Line | |
---|
1 | /*! |
---|
2 | * @file gui_saveable.h |
---|
3 | * @brief Definition of ... |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _GUI_SAVEABLE_H |
---|
7 | #define _GUI_SAVEABLE_H |
---|
8 | |
---|
9 | #include "base_object.h" |
---|
10 | #include "multi_type.h" |
---|
11 | #include <vector> |
---|
12 | |
---|
13 | // FORWARD DECLARATION |
---|
14 | namespace OrxGui |
---|
15 | { |
---|
16 | //! A class for ... |
---|
17 | class GuiSaveable |
---|
18 | { |
---|
19 | public: |
---|
20 | protected: |
---|
21 | GuiSaveable(const std::string& optionName); |
---|
22 | virtual ~GuiSaveable(); |
---|
23 | |
---|
24 | void makeSaveable(); |
---|
25 | |
---|
26 | virtual void load(const MultiType& value) = 0; |
---|
27 | virtual const MultiType& save() = 0; |
---|
28 | |
---|
29 | MultiType& getValue() { return this->value; }; |
---|
30 | const MultiType& getValue() const { return this->value; }; |
---|
31 | bool isSaveable() const { return this->bSaveable; }; |
---|
32 | |
---|
33 | protected: |
---|
34 | virtual void makingElementSaveable() {}; |
---|
35 | |
---|
36 | private: |
---|
37 | MultiType value; |
---|
38 | bool bSaveable; |
---|
39 | }; |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | class GuiSaveableGroup : virtual public GuiSaveable |
---|
44 | { |
---|
45 | public: |
---|
46 | GuiSaveableGroup(const std::string& name); |
---|
47 | ~GuiSaveableGroup(); |
---|
48 | |
---|
49 | void addSaveable(GuiSaveable* saveable); |
---|
50 | void removeSaveable(GuiSaveable* saveable); |
---|
51 | |
---|
52 | protected: |
---|
53 | virtual void makingElementSaveable(); |
---|
54 | private: |
---|
55 | std::vector<GuiSaveable*> saveables; |
---|
56 | static std::vector<GuiSaveableGroup*> saveableGroups; |
---|
57 | }; |
---|
58 | |
---|
59 | } |
---|
60 | #endif /* _GUI_SAVEABLE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.