OpenASIP  2.0
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
ProDeOptions Class Reference

#include <ProDeOptions.hh>

Inheritance diagram for ProDeOptions:
Inheritance graph
Collaboration diagram for ProDeOptions:
Collaboration graph

Public Member Functions

 ProDeOptions ()
 
 ProDeOptions (const ObjectState *state)
 
 ProDeOptions (const ProDeOptions &old)
 
virtual ~ProDeOptions ()
 
int undoStackSize () const
 
void setUndoStackSize (int size)
 
void loadState (const ObjectState *state)
 
ObjectStatesaveState () const
 
- Public Member Functions inherited from GUIOptions
 GUIOptions (std::string name)
 
 GUIOptions (const GUIOptions &old)
 
 GUIOptions (const ObjectState *state)
 
virtual ~GUIOptions ()
 
bool hasFileName () const
 
std::string fileName () const
 
void setFileName (const std::string &fileName)
 
virtual void validate () const
 
bool fullScreen () const
 
int windowWidth () const
 
int windowHeight () const
 
int xPosition () const
 
int yPosition () const
 
bool toolbarVisibility () const
 
ToolbarLayout toolbarLayout () const
 
void setFullScreen (bool fullScreen)
 
void setWindowSize (int width, int height)
 
void setWindowPosition (int x, int y)
 
void setToolbarVisibility (bool visible)
 
void setToolbarLayout (ToolbarLayout layout)
 
void addKeyboardShortcut (KeyboardShortcut *shortcut)
 
void addToolbarButton (ToolbarButton *button)
 
void addSeparator (int position)
 
void deleteKeyboardShortcut (KeyboardShortcut *shortcut)
 
void deleteToolbarButton (ToolbarButton *button)
 
void deleteSeparator (int position)
 
KeyboardShortcutkeyboardShortcut (const std::string commandName) const
 
KeyboardShortcutfirstShortcut () const
 
KeyboardShortcutnextShortcut () const
 
ToolbarButtonfirstToolbarButton () const
 
ToolbarButtonnextToolbarButton () const
 
int firstSeparator () const
 
int nextSeparator () const
 
void clearModified ()
 
bool isModified () const
 
wxToolBar * createToolbar (wxWindow *parent, CommandRegistry &registry, const wxString &iconsPath)
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Static Public Attributes

static const std::string CONFIGURATION_NAME = "prode-configuration"
 ObjectState name for ProDeOptions. More...
 
static const std::string OSKEY_UNDO_STACK_SIZE = "undosize"
 ObjectState attribute key for the size of the undo stack. More...
 
- Static Public Attributes inherited from GUIOptions
static const std::string TOOLBAR_SEPARATOR = "-- separator --"
 Toolbar separator name. More...
 
static const std::string OSNAME_OPTIONS = "options"
 ObjectState name for the options. More...
 
static const std::string OSKEY_FULL_SCREEN = "fscreen"
 ObjectState attribute key for full screen feature. More...
 
static const std::string OSKEY_WINDOW_WIDTH = "wwidth"
 ObjectState attribute key for window width. More...
 
static const std::string OSKEY_WINDOW_HEIGHT = "wheight"
 ObjectState attribute key for window height. More...
 
static const std::string OSKEY_X_POS = "xpos"
 ObjectState attribute key for window x position. More...
 
static const std::string OSKEY_Y_POS = "ypos"
 ObjectState attribute key for window y position. More...
 
static const std::string OSKEY_TOOLBAR_VISIBILITY = "tbvisib"
 ObjectState attribute key for toolbar visibility. More...
 
static const std::string OSKEY_TOOLBAR_LAYOUT = "tblayout"
 ObjectState attribute key for toolbar layout. More...
 
static const std::string OSVALUE_TEXT = "text"
 ObjectState attribute value for text layout. More...
 
static const std::string OSVALUE_ICON = "icon"
 ObjectState attribute value for icon layout. More...
 
static const std::string OSVALUE_BOTH = "both"
 ObjectState attribute value for text & icon layout. More...
 
static const std::string OSNAME_SEPARATOR = "separator"
 ObjectState name for separator. More...
 
static const std::string OSKEY_POSITION = "pos"
 ObjectState attribute key for separator position. More...
 

Private Attributes

int undoStackSize_
 Undo stack size. More...
 

Additional Inherited Members

- Public Types inherited from GUIOptions
enum  ToolbarLayout { TEXT, ICON, BOTH }
 
- Protected Member Functions inherited from GUIOptions
void deleteAllKeyboardShortcuts ()
 
void deleteAllToolbarButtons ()
 

Detailed Description

Represents the options of the editor.

Definition at line 44 of file ProDeOptions.hh.

Constructor & Destructor Documentation

◆ ProDeOptions() [1/3]

ProDeOptions::ProDeOptions ( )

Constructor.

Definition at line 50 of file ProDeOptions.cc.

50  :
52  undoStackSize_(10) {
53 }

◆ ProDeOptions() [2/3]

ProDeOptions::ProDeOptions ( const ObjectState state)

Constructor.

Loads the state from the given ObjectState tree.

Parameters
stateThe ObjectState tree.
Exceptions
ObjectStateLoadingExceptionIf the given ObjectState tree is invalid.

Definition at line 65 of file ProDeOptions.cc.

67  loadState(state);
68 }

References loadState().

Here is the call graph for this function:

◆ ProDeOptions() [3/3]

ProDeOptions::ProDeOptions ( const ProDeOptions old)

Copy constructor.

This constructor creates identical options with the given options class.

Definition at line 75 of file ProDeOptions.cc.

75  :
76  GUIOptions(old) {
77 
79 }

References undoStackSize_.

◆ ~ProDeOptions()

ProDeOptions::~ProDeOptions ( )
virtual

Destructor.

Definition at line 85 of file ProDeOptions.cc.

85  {
86 }

Member Function Documentation

◆ loadState()

void ProDeOptions::loadState ( const ObjectState state)
virtual

Loads the state of the object from the given ObjectState object.

Parameters
stateObjectState from which the state is loaded.
Exceptions
ObjectStateLoadingExceptionIf the given ObjectState instance is invalid.

Reimplemented from GUIOptions.

Definition at line 119 of file ProDeOptions.cc.

119  {
122 
123  const string procName = "ProDeOptions::loadState";
124 
125  GUIOptions::loadState(state);
126 
127  try {
129  } catch (...) {
132  throw ObjectStateLoadingException(__FILE__, __LINE__, procName);
133  }
134 }

References GUIOptions::deleteAllKeyboardShortcuts(), GUIOptions::deleteAllToolbarButtons(), ObjectState::intAttribute(), GUIOptions::loadState(), OSKEY_UNDO_STACK_SIZE, and undoStackSize_.

Referenced by ProDeOptions().

Here is the call graph for this function:

◆ saveState()

ObjectState * ProDeOptions::saveState ( ) const
virtual

Creates an ObjectState object and saves the state of the object into it.

Returns
The created ObjectState object.

Reimplemented from GUIOptions.

Definition at line 142 of file ProDeOptions.cc.

142  {
145  return state;
146 }

References OSKEY_UNDO_STACK_SIZE, GUIOptions::saveState(), ObjectState::setAttribute(), and undoStackSize_.

Here is the call graph for this function:

◆ setUndoStackSize()

void ProDeOptions::setUndoStackSize ( int  size)

Sets the size of the undo stack.

Parameters
sizeThe new size.

Definition at line 106 of file ProDeOptions.cc.

106  {
107  undoStackSize_ = size;
108 }

References undoStackSize_.

Referenced by ProDe::createDefaultOptions(), and ProDeOptionsDialog::writeProDeOptions().

◆ undoStackSize()

int ProDeOptions::undoStackSize ( ) const

Returns the size of the undo stack.

Returns
The size of the undo stack.

Definition at line 95 of file ProDeOptions.cc.

95  {
96  return undoStackSize_;
97 }

References undoStackSize_.

Referenced by ProDeOptionsDialog::readProDeOptions().

Member Data Documentation

◆ CONFIGURATION_NAME

const string ProDeOptions::CONFIGURATION_NAME = "prode-configuration"
static

ObjectState name for ProDeOptions.

Definition at line 59 of file ProDeOptions.hh.

◆ OSKEY_UNDO_STACK_SIZE

const string ProDeOptions::OSKEY_UNDO_STACK_SIZE = "undosize"
static

ObjectState attribute key for the size of the undo stack.

Definition at line 61 of file ProDeOptions.hh.

Referenced by ProDeOptionsSerializer::convertToConfigFileFormat(), ProDeOptionsSerializer::convertToOptionsObjectFormat(), loadState(), and saveState().

◆ undoStackSize_

int ProDeOptions::undoStackSize_
private

Undo stack size.

Definition at line 65 of file ProDeOptions.hh.

Referenced by loadState(), ProDeOptions(), saveState(), setUndoStackSize(), and undoStackSize().


The documentation for this class was generated from the following files:
GUIOptions::deleteAllKeyboardShortcuts
void deleteAllKeyboardShortcuts()
Definition: GUIOptions.cc:745
ObjectStateLoadingException
Definition: Exception.hh:551
GUIOptions::saveState
virtual ObjectState * saveState() const
Definition: GUIOptions.cc:700
ObjectState
Definition: ObjectState.hh:59
GUIOptions::deleteAllToolbarButtons
void deleteAllToolbarButtons()
Definition: GUIOptions.cc:754
ProDeOptions::undoStackSize_
int undoStackSize_
Undo stack size.
Definition: ProDeOptions.hh:65
ProDeOptions::loadState
void loadState(const ObjectState *state)
Definition: ProDeOptions.cc:119
GUIOptions::loadState
virtual void loadState(const ObjectState *state)
Definition: GUIOptions.cc:645
ProDeOptions::OSKEY_UNDO_STACK_SIZE
static const std::string OSKEY_UNDO_STACK_SIZE
ObjectState attribute key for the size of the undo stack.
Definition: ProDeOptions.hh:61
ObjectState::intAttribute
int intAttribute(const std::string &name) const
Definition: ObjectState.cc:276
GUIOptions::GUIOptions
GUIOptions(std::string name)
Definition: GUIOptions.cc:68
ObjectState::setAttribute
void setAttribute(const std::string &name, const std::string &value)
Definition: ObjectState.cc:100
ProDeOptions::CONFIGURATION_NAME
static const std::string CONFIGURATION_NAME
ObjectState name for ProDeOptions.
Definition: ProDeOptions.hh:59