OpenASIP 2.2
Loading...
Searching...
No Matches
ProDeOptions.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 ProDeOptions.cc
26 *
27 * Implementation of class ProDeOptions.
28 *
29 * @author Veli-Pekka Jääskeläinen 2005 (vjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#include <cassert>
34
35#include "ProDeOptions.hh"
36#include "Conversion.hh"
37#include "SequenceTools.hh"
38#include "ObjectState.hh"
39
40using std::string;
41
42// initialization of static data members
43const string ProDeOptions::CONFIGURATION_NAME = "prode-configuration";
44const string ProDeOptions::OSKEY_UNDO_STACK_SIZE = "undosize";
45
46
47/**
48 * Constructor.
49 */
51 GUIOptions(CONFIGURATION_NAME),
52 undoStackSize_(10) {
53}
54
55
56/**
57 * Constructor.
58 *
59 * Loads the state from the given ObjectState tree.
60 *
61 * @param state The ObjectState tree.
62 * @exception ObjectStateLoadingException If the given ObjectState tree is
63 * invalid.
64 */
66 : GUIOptions(CONFIGURATION_NAME) {
67 loadState(state);
68}
69
70/**
71 * Copy constructor.
72 *
73 * This constructor creates identical options with the given options class.
74 */
80
81
82/**
83 * Destructor.
84 */
87
88
89/**
90 * Returns the size of the undo stack.
91 *
92 * @return The size of the undo stack.
93 */
94int
98
99
100/**
101 * Sets the size of the undo stack.
102 *
103 * @param size The new size.
104 */
105void
109
110
111/**
112 * Loads the state of the object from the given ObjectState object.
113 *
114 * @param state ObjectState from which the state is loaded.
115 * @exception ObjectStateLoadingException If the given ObjectState instance
116 * is invalid.
117 */
118void
122
123 const string procName = "ProDeOptions::loadState";
124
126
127 try {
129 } catch (...) {
132 throw ObjectStateLoadingException(__FILE__, __LINE__, procName);
133 }
134}
135
136/**
137 * Creates an ObjectState object and saves the state of the object into it.
138 *
139 * @return The created ObjectState object.
140 */
virtual void loadState(const ObjectState *state)
void deleteAllKeyboardShortcuts()
virtual ObjectState * saveState() const
void deleteAllToolbarButtons()
void setAttribute(const std::string &name, const std::string &value)
int intAttribute(const std::string &name) const
ObjectState * saveState() const
int undoStackSize_
Undo stack size.
static const std::string CONFIGURATION_NAME
ObjectState name for ProDeOptions.
static const std::string OSKEY_UNDO_STACK_SIZE
ObjectState attribute key for the size of the undo stack.
void loadState(const ObjectState *state)
virtual ~ProDeOptions()
int undoStackSize() const
void setUndoStackSize(int size)