OpenASIP 2.2
Loading...
Searching...
No Matches
GUIOptions.cc
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file GUIOptions.cc
26 *
27 * Implementation of class GUIOptions.
28 *
29 * @author Lasse Laasonen 2003 (lasse.laasonen-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#include <wx/wx.h>
34#include "Application.hh"
35#include "GUIOptions.hh"
36#include "Conversion.hh"
37#include "SequenceTools.hh"
38#include "WxConversion.hh"
39#include "CommandRegistry.hh"
40#include "GUICommand.hh"
41#include "FileSystem.hh"
42#include "ObjectState.hh"
43
44using std::string;
45
46// initialization of static data members
47const string GUIOptions::OSNAME_OPTIONS = "options";
48const string GUIOptions::OSKEY_FULL_SCREEN = "fscreen";
49const string GUIOptions::OSKEY_WINDOW_WIDTH = "wwidth";
50const string GUIOptions::OSKEY_WINDOW_HEIGHT = "wheight";
51const string GUIOptions::OSKEY_X_POS = "xpos";
52const string GUIOptions::OSKEY_Y_POS = "ypos";
53const string GUIOptions::OSKEY_TOOLBAR_VISIBILITY = "tbvisib";
54const string GUIOptions::OSKEY_TOOLBAR_LAYOUT = "tblayout";
55const string GUIOptions::OSVALUE_TEXT = "text";
56const string GUIOptions::OSVALUE_ICON = "icon";
57const string GUIOptions::OSVALUE_BOTH = "both";
58const string GUIOptions::OSNAME_SEPARATOR = "separator";
59const string GUIOptions::OSKEY_POSITION = "pos";
60
61const string GUIOptions::TOOLBAR_SEPARATOR = "-- separator --";
62
63#include <iostream>
64
65/**
66 * Constructor.
67 */
68GUIOptions::GUIOptions(std::string name) :
69 fullScreen_(false), windowWidth_(400), windowHeight_(400), xPosition_(0),
70 yPosition_(0), toolbarVisibility_(false), toolbarLayout_(BOTH),
71 modified_(false), name_(name) {
72}
73
74
75/**
76 * Constructor.
77 *
78 * Loads the state from the given ObjectState tree.
79 *
80 * @param state The ObjectState tree.
81 * @exception ObjectStateLoadingException If the given ObjectState tree is
82 * invalid.
83 */
84GUIOptions::GUIOptions(const ObjectState* state) : modified_(false) {
85 loadState(state);
86}
87
88/**
89 * Copy constructor.
90 *
91 * This constructor creates identical options with the given options class.
92 */
94
103 modified_ = old.modified_;
104
105#ifdef KB_SC_EDITING
106 // deep copy keyboard shortcuts
107 for (KSTable::const_iterator iter = old.keyboardShortcuts_.begin();
108 iter != old.keyboardShortcuts_.end(); iter++) {
109
110 keyboardShortcuts_.push_back(new KeyboardShortcut(**iter));
111 }
112#endif
113
114 // deep copy toolbar buttons
115 for (TBTable::const_iterator iter = old.toolbarButtons_.begin();
116 iter != old.toolbarButtons_.end(); iter++) {
117 toolbarButtons_.push_back(new ToolbarButton(**iter));
118 }
119}
120
121
122/**
123 * Destructor.
124 */
129
130
131/**
132 * Returns true, if the application window opens in full screen mode as
133 * default, otherwise false.
134 *
135 * @return True, if the application window opens in full screen mode as
136 * default, otherwise false.
137 */
138bool
140 return fullScreen_;
141}
142
143
144/**
145 * Returns the default width of the application window.
146 *
147 * @return The default width of the application window.
148 */
149int
151 return windowWidth_;
152}
153
154
155/**
156 * Returns the default height of the application window.
157 *
158 * @return The default height of the application window.
159 */
160int
162 return windowHeight_;
163}
164
165
166/**
167 * Returns the default x position of left side of the application window.
168 *
169 * @return The default x position of left side of the application window.
170 */
171int
173 return xPosition_;
174}
175
176
177/**
178 * Returns the default y position of upper side of the application window.
179 *
180 * @return The default y position of upper side of the application window.
181 */
182int
184 return yPosition_;
185}
186
187
188/**
189 * Returns true if the toolbar is visible by default, otherwise false.
190 *
191 * @return True if the toolbar is visible by default, otherwise false.
192 */
193bool
197
198
199/**
200 * Returns the layout mode of the toolbar.
201 *
202 * @return Layout mode of the toolbar.
203 */
206 return toolbarLayout_;
207}
208
209
210/**
211 * Sets or unsets the default full screen mode of the application window.
212 *
213 * @param fullScreen If true, the full screen mode is set, otherwise unset.
214 */
215void
218 modified_ = true;
219}
220
221
222/**
223 * Sets the default application window size.
224 *
225 * @param width Pixel width of the window.
226 * @param height Pixel height of the window.
227 */
228void
229GUIOptions::setWindowSize(int width, int height) {
230 windowWidth_ = width;
231 windowHeight_ = height;
232 modified_ = true;
233}
234
235
236/**
237 * Sets the default position of the window.
238 *
239 * @param x X-coordinate of left side of the application window.
240 * @param y Y-coordinate of upper side of the application window.
241 */
242void
244 xPosition_ = x;
245 yPosition_ = y;
246 modified_ = true;
247}
248
249
250/**
251 * Sets the visibility mode of the toolbar.
252 *
253 * @param visible If true, the toolbar is visible, otherwise it is hidden.
254 */
255void
257 toolbarVisibility_ = visible;
258 modified_ = true;
259}
260
261
262/**
263 * Sets the layout of the toolbar buttons.
264 *
265 * @param layout Layout of the toolbar buttons.
266 */
267void
272
273
274/**
275 * Adds a keyboard shortcut.
276 *
277 * @param shortcut Keyboard shortcut to be added.
278 */
279void
281 keyboardShortcuts_.push_back(shortcut);
282 modified_ = true;
283}
284
285
286/**
287 * Adds the given button to the toolbar.
288 *
289 * @param button Button to be added.
290 */
291void
293 toolbarButtons_.push_back(button);
294 modified_ = true;
295}
296
297
298/**
299 * Adds a separator to the toolbar to the given position.
300 *
301 * @param position Number of the slot left side of which the separator is
302 * drawn.
303 */
304void
306 toolbarSeparators_.push_back(position);
307 modified_ = true;
308}
309
310
311/**
312 * Deletes the given keyboard shortcut.
313 *
314 * @param shortcut The keyboard shortcut to be deleted.
315 */
316void
318 KSTable::iterator iter = keyboardShortcuts_.begin();
319 while (iter != keyboardShortcuts_.end()) {
320 if (*iter == shortcut) {
321 keyboardShortcuts_.erase(iter);
322 delete shortcut;
323 modified_ = true;
324 return;
325 }
326 iter++;
327 }
328}
329
330
331/**
332 * Deletes the given toolbar button.
333 *
334 * @param button The toolbar button to be deleted.
335 */
336void
338 TBTable::iterator iter = toolbarButtons_.begin();
339 while (iter != toolbarButtons_.end()) {
340 if (*iter == button) {
341 toolbarButtons_.erase(iter);
342 delete button;
343 modified_ = true;
344 return;
345 }
346 iter++;
347 }
348}
349
350
351/**
352 * Deletes a separator from the given position.
353 *
354 * @param position The slot position left side of which the separator is
355 * deleted.
356 */
357void
359 SeparatorTable::iterator iter = toolbarSeparators_.begin();
360 while (iter != toolbarSeparators_.end()) {
361 if (*iter == position) {
362 toolbarSeparators_.erase(iter);
363 modified_ = true;
364 return;
365 }
366 iter++;
367 }
368}
369
370/**
371 * Returns keyboard shortcut for the command with given name.
372 *
373 * @param commandName Name of the command to search shortcut for.
374 * @return NULL if a shortcut doesn't exist for the command.
375 */
377GUIOptions::keyboardShortcut(const std::string commandName) const {
378
379 KSTable::const_iterator iter = keyboardShortcuts_.begin();
380
381 for (; iter != keyboardShortcuts_.end(); iter++) {
382 if ((*iter)->action() == commandName) {
383 return *iter;
384 }
385 }
386
387 return NULL;
388}
389
390/**
391 * Returns the first keyboard shortcut. If there are no keyboard shortcuts,
392 * returns null pointer.
393 *
394 * @return The first keyboard shortcut.
395 */
398 ksIter_ = keyboardShortcuts_.begin();
399 if (ksIter_ != keyboardShortcuts_.end()) {
400 return *ksIter_;
401 } else {
402 return NULL;
403 }
404}
405
406
407/**
408 * Returns the always the next keyboard shortcut after firstShortcut has been
409 * called. Returns null pointer after the last keyboard shortcut.
410 *
411 * @return The next keyboard shortcut.
412 */
416 ksIter_++;
417 if (ksIter_ != keyboardShortcuts_.end()) {
418 return *ksIter_;
419 } else {
420 return NULL;
421 }
422}
423
424
425/**
426 * Returns the first toolbar button. Returns null pointer if there are no
427 * toolbar buttons.
428 *
429 * @return The first toolbar button.
430 */
433 tbIter_ = toolbarButtons_.begin();
434 if (tbIter_ != toolbarButtons_.end()) {
435 return *tbIter_;
436 } else {
437 return NULL;
438 }
439}
440
441
442/**
443 * Returns always the next toolbar button after the firstToolbarButton has
444 * been called.
445 *
446 * @return The next toolbar button.
447 */
451 tbIter_++;
452 if (tbIter_ != toolbarButtons_.end()) {
453 return *tbIter_;
454 } else {
455 return NULL;
456 }
457}
458
459
460/**
461 * Returns position of the first toolbar separator. Position is the position
462 * of the slot left side of which the separator is. If there are no
463 * separators, returns -1.
464 *
465 * @return Position of the first toolbar separator.
466 */
467int
470 if (separatorIter_ != toolbarSeparators_.end()) {
471 return *separatorIter_;
472 } else {
473 return -1;
474 }
475}
476
477
478/**
479 * Returns always position of the next toolbar separator. If there are no
480 * more separators, returns -1.
481 *
482 * @return Position of the next toolbar separator.
483 */
484int
488 if (separatorIter_ != toolbarSeparators_.end()) {
489 return *separatorIter_;
490 } else {
491 return -1;
492 }
493}
494
495
496/**
497 * Clears the modified flag.
498 *
499 * The isModified method returns false after calling this method.
500 */
501void
505
506
507/**
508 * Returns true if the options are modified.
509 *
510 * @return True if the options are modified.
511 */
512bool
514 return modified_;
515}
516
517
518/**
519 * Validates the state of the options.
520 *
521 * Checks that there is no gaps in toolbar item positions and no two items
522 * at the same position. Additionally checks that there is no same keyboard
523 * shortcuts for several actions and no two keyboard shortcuts for the same
524 * action.
525 *
526 * @exception InvalidData If the options are in invalid state.
527 */
528void
530 const string procName = "GUIOptions::validate";
531 int buttons = toolbarButtons_.size();
532 int separators = toolbarSeparators_.size();
533
534 // check that there is no gaps in toolbar item positions
535 for (int i = 0; i < buttons + separators; i++) {
536 bool buttonfound = false;
537 bool separatorfound = false;
539 while (button != NULL) {
540 if (button->slot() == i) {
541 if (buttonfound) {
542 string errorMsg = "There is at least two toolbar items ";
543 errorMsg += "at position \'" + Conversion::toString(i) +
544 "\'.";
545 throw InvalidData(__FILE__, __LINE__, procName,
546 errorMsg);
547 }
548 buttonfound = true;
549 }
550 button = nextToolbarButton();
551 }
552
553 for (int sepIndex = 0; sepIndex < separators; sepIndex++) {
554 if (toolbarSeparators_[sepIndex] == i) {
555 if (separatorfound || buttonfound) {
556 string errorMsg = "There is at least two toolbar items ";
557 errorMsg += "at position \'" + Conversion::toString(i) +
558 "\'.";
559 throw InvalidData(__FILE__, __LINE__, procName,
560 errorMsg);
561 }
562 separatorfound = true;
563 }
564 }
565
566 if (!buttonfound && !separatorfound) {
567 string errorMsg = "There is no separator or button at slot "
568 "position \'" + Conversion::toString(i) + "\'.";
569 throw InvalidData(__FILE__, __LINE__, procName, errorMsg);
570 }
571
572 }
573
574 // check that there is no same keyboard shortcuts for several actions and
575 // no two keyboard shortcuts for same action
576 KSTable::const_iterator ksIter = keyboardShortcuts_.begin();
577 while (ksIter != keyboardShortcuts_.end()) {
578 KeyboardShortcut* observable = *ksIter;
579 string action = observable->action();
580 KSTable::const_iterator seekerIter = keyboardShortcuts_.begin();
581
582 while (seekerIter != keyboardShortcuts_.end()) {
583 KeyboardShortcut* sc = *seekerIter;
584 if (action == sc->action() && sc != observable) {
585 string errorMsg = "Action \'" + action + "\' is assigned for"
586 + " two or more keyboard shortcuts.";
587 throw InvalidData(__FILE__, __LINE__, procName, errorMsg);
588 }
589 if (observable->equals(*sc) && observable != sc) {
590 string errorMsg = "Same keyboard shortcut is used for \'" +
591 observable->action() + "\' and \'" + sc->action() +
592 "\' actions.";
593 throw InvalidData(__FILE__, __LINE__, procName, errorMsg);
594 }
595 seekerIter++;
596 }
597 ksIter++;
598 }
599}
600
601/**
602 * Checks whether these options has file name assigned.
603 *
604 * @return True if these options has file name assigned, otherwise false.
605 */
606bool
608 if (fileName_ == "") {
609 return false;
610 }
611 return true;
612}
613
614
615/**
616 * Returns the file name assigned to these options.
617 *
618 * @return The file name assigned to these options.
619 */
620string
622 return fileName_;
623}
624
625
626/**
627 * Sets the file name assigned into these options.
628 *
629 * @param fileName The file name assigned into these options.
630 */
631void
632GUIOptions::setFileName(const std::string& fileName) {
634}
635
636
637/**
638 * Loads the state of the object from the given ObjectState object.
639 *
640 * @param state ObjectState from which the state is loaded.
641 * @exception ObjectStateLoadingException If the given ObjectState instance
642 * is invalid.
643 */
644void
646 const string procName = "GUIOptions::loadState";
647
648 if (state->name() != OSNAME_OPTIONS) {
649 throw ObjectStateLoadingException(__FILE__, __LINE__, procName);
650 }
651
652 try {
659
660 string layout = state->stringAttribute(OSKEY_TOOLBAR_LAYOUT);
661 if (layout == OSVALUE_TEXT) {
663 } else if (layout == OSVALUE_ICON) {
665 } else if (layout == OSVALUE_BOTH) {
667 } else {
668 throw ObjectStateLoadingException(__FILE__, __LINE__, procName);
669 }
670
671 // get toolbar separators, keyboard shortcuts and toolbar buttons
672 for (int i = 0; i < state->childCount(); i++) {
673 ObjectState* child = state->child(i);
674 if (child->name() == OSNAME_SEPARATOR) {
676
677 } else if (child->name() ==
680 } else if (child->name() == ToolbarButton::OSNAME_TOOLBAR_BUTTON) {
682 } else {
683 throw ObjectStateLoadingException(__FILE__, __LINE__,
684 procName);
685 }
686 }
687 } catch (...) {
690 throw ObjectStateLoadingException(__FILE__, __LINE__, procName);
691 }
692}
693
694/**
695 * Creates an ObjectState object and saves the state of the object into it.
696 *
697 * @return The created ObjectState object.
698 */
701
703
710
711 if (toolbarLayout_ == TEXT) {
713 } else if (toolbarLayout_ == ICON) {
715 } else {
717 }
718
719 // add toolbar separators
720 for (int i = 0; i < (int)toolbarSeparators_.size(); i++) {
721 ObjectState* separator = new ObjectState(OSNAME_SEPARATOR);
722 state->addChild(separator);
724 }
725
726 // add keyboard shortcuts
727 for (int i = 0; i < (int)keyboardShortcuts_.size(); i++) {
729 state->addChild(sc->saveState());
730 }
731
732 // add toolbar buttons
733 for (int i = 0; i < (int)toolbarButtons_.size(); i++) {
734 ToolbarButton* button = toolbarButtons_[i];
735 state->addChild(button->saveState());
736 }
737
738 return state;
739}
740
741/**
742 * Deletes all the keyboard shortcuts.
743 */
744void
748
749
750/**
751 * Deletes all the toolbar buttons.
752 */
753void
757
758
759/**
760 * Creates a toolbar defined in the options.
761 *
762 * @param parent Parent window of the created toolbar.
763 * @param registry Command registry containing the toolbar commands.
764 * @param iconPath Path of the toolbar icon files.
765 * @return A new toolbar corresponding to the one defined in the options.
766 */
767wxToolBar*
769 wxWindow* parent, CommandRegistry& registry,
770 const wxString& iconsPath) {
771
772 int layout = toolbarLayout();
773 long style = 0;
774
775 // check toolbar layout from options
776 if (layout == GUIOptions::BOTH) {
777 style = wxTB_HORIZONTAL | wxNO_BORDER | wxTB_TEXT;
778 } else if (layout == GUIOptions::ICON) {
779 style = wxTB_HORIZONTAL | wxNO_BORDER;
780 } else if (layout == GUIOptions::TEXT) {
781 style = wxTB_HORIZONTAL | wxNO_BORDER | wxTB_TEXT | wxTB_NOICONS;
782 } else {
783 assert(false);
784 }
785
786 // create a new toolbar
787 wxToolBar* toolbar = new wxToolBar(
788 parent, -1, wxDefaultPosition, wxDefaultSize, style);
789
790 bool found = true;
791 int slot = 0;
792 wxBitmap icon;
793
794 // Add buttons and separators for each slot, until a slot without
795 // button or separator is found.
796 while (found) {
797
798 found = false;
799
800 // check if a toolbar button exists for the slot
802 while (tool != NULL) {
803 if (tool->slot() == slot) {
804 // button found for the slot, add it
805 found = true;
806
807 wxString iconPath = iconsPath;
808 iconPath.Append(WxConversion::toWxString(
810 iconPath.Append(
812 registry.commandIcon(tool->action())));
813
814 if (!icon.LoadFile(iconPath, wxBITMAP_TYPE_PNG)) {
815 std::cerr << "Toolbar icon file "
816 << WxConversion::toString(iconPath)
817 << " not found!"
818 << std::endl;
819
820 icon.Create(32, 32);
821 }
822
823 toolbar->AddTool(registry.commandId(tool->action()),
825 registry.commandShortName(tool->action())),
826 icon, wxNullBitmap, wxITEM_NORMAL,
828 tool->action()),
830 tool->action()));
831 found = true;
832 // disable button if command is not executable at the moment
833 if (!registry.isEnabled(tool->action())) {
834 toolbar->EnableTool(registry.commandId(tool->action()),
835 false);
836 }
837 }
838 tool = nextToolbarButton();
839 }
840
841
842 // check if a separator exists for the slot
843 int separator = firstSeparator();
844 while (separator != -1) {
845 if (separator == slot) {
846 // separator found for the slot, add it
847 toolbar->AddSeparator();
848 found = true;
849 }
850 separator = nextSeparator();
851 }
852 slot++;
853 }
854
855 toolbar->Realize();
856 return toolbar;
857}
#define assert(condition)
find Finds info of the inner loops in the false
bool isEnabled(const std::string command)
int commandId(const std::string name) const
std::string commandIcon(const std::string name) const
std::string commandShortName(const std::string name) const
static std::string toString(const T &source)
static const std::string DIRECTORY_SEPARATOR
virtual ~GUIOptions()
int xPosition_
Default x position of left side of the application window.
KSTable keyboardShortcuts_
Keyboard shortcuts.
static const std::string OSKEY_X_POS
ObjectState attribute key for window x position.
int windowHeight_
Default height of the window.
bool toolbarVisibility_
If true, the toolbar is visible.
int windowWidth() const
void addKeyboardShortcut(KeyboardShortcut *shortcut)
void setToolbarVisibility(bool visible)
void deleteSeparator(int position)
virtual void loadState(const ObjectState *state)
TBTable::const_iterator tbIter_
Iterator used in firstToolbarButton and nextToolbarButton functions.
void addToolbarButton(ToolbarButton *button)
void setFullScreen(bool fullScreen)
void deleteAllKeyboardShortcuts()
virtual ObjectState * saveState() const
void setWindowPosition(int x, int y)
ToolbarButton * nextToolbarButton() const
int firstSeparator() const
wxToolBar * createToolbar(wxWindow *parent, CommandRegistry &registry, const wxString &iconsPath)
static const std::string OSKEY_POSITION
ObjectState attribute key for separator position.
KeyboardShortcut * firstShortcut() const
KeyboardShortcut * nextShortcut() const
int windowWidth_
Default width of the window.
int yPosition() const
void addSeparator(int position)
ToolbarLayout toolbarLayout_
Layout of the toolbar.
SeparatorTable::const_iterator separatorIter_
Iterator used in firstSeparator and nextSeparator functions.
bool hasFileName() const
static const std::string OSVALUE_BOTH
ObjectState attribute value for text & icon layout.
bool fullScreen() const
bool modified_
Indicates whether the options are modified or not.
int yPosition_
Default y position of the upper side of the application window.
ToolbarLayout toolbarLayout() const
static const std::string OSKEY_WINDOW_WIDTH
ObjectState attribute key for window width.
static const std::string TOOLBAR_SEPARATOR
Toolbar separator name.
void deleteKeyboardShortcut(KeyboardShortcut *shortcut)
void deleteAllToolbarButtons()
int xPosition() const
static const std::string OSVALUE_TEXT
ObjectState attribute value for text layout.
KSTable::const_iterator ksIter_
Iterator used in firstShortcut and nextShortcut functions.
virtual void validate() const
int windowHeight() const
void clearModified()
static const std::string OSKEY_TOOLBAR_VISIBILITY
ObjectState attribute key for toolbar visibility.
@ TEXT
Buttons contains only text.
Definition GUIOptions.hh:65
@ BOTH
Buttons contains text and icon.
Definition GUIOptions.hh:67
@ ICON
Buttons contains only icon.
Definition GUIOptions.hh:66
bool toolbarVisibility() const
static const std::string OSNAME_OPTIONS
ObjectState name for the options.
static const std::string OSKEY_FULL_SCREEN
ObjectState attribute key for full screen feature.
bool fullScreen_
If true, the application window will open in full screen mode.
int nextSeparator() const
void deleteToolbarButton(ToolbarButton *button)
SeparatorTable toolbarSeparators_
Toolbar separators.
std::string fileName() const
std::string fileName_
File name assigned to these options.
void setFileName(const std::string &fileName)
static const std::string OSKEY_TOOLBAR_LAYOUT
ObjectState attribute key for toolbar layout.
void setToolbarLayout(ToolbarLayout layout)
TBTable toolbarButtons_
Toolbar buttons.
KeyboardShortcut * keyboardShortcut(const std::string commandName) const
static const std::string OSKEY_WINDOW_HEIGHT
ObjectState attribute key for window height.
static const std::string OSNAME_SEPARATOR
ObjectState name for separator.
GUIOptions(std::string name)
Definition GUIOptions.cc:68
bool isModified() const
void setWindowSize(int width, int height)
static const std::string OSKEY_Y_POS
ObjectState attribute key for window y position.
static const std::string OSVALUE_ICON
ObjectState attribute value for icon layout.
ToolbarButton * firstToolbarButton() const
bool equals(const KeyboardShortcut &sc) const
std::string action() const
ObjectState * saveState() const
static const std::string OSNAME_KEYBOARD_SHORTCUT
ObjectState name for keyboard shortcut.
void setAttribute(const std::string &name, const std::string &value)
ObjectState * child(int index) const
void addChild(ObjectState *child)
std::string stringAttribute(const std::string &name) const
int intAttribute(const std::string &name) const
std::string name() const
int childCount() const
static void deleteAllItems(SequenceType &aSequence)
static const std::string OSNAME_TOOLBAR_BUTTON
ObjectState name for ToolbarButton.
int slot() const
std::string action() const
ObjectState * saveState() const
static wxString toWxString(const std::string &source)
static std::string toString(const wxString &source)