Changeset 7470 in orxonox.OLD for branches/qt_gui/src/lib/gui/gui_saveable.h
- Timestamp:
- May 2, 2006, 8:21:00 AM (18 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/qt_gui/src/lib/gui/gui_saveable.h
r7469 r7470 12 12 13 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(); 14 23 15 namespace OrxGui 16 { 17 //! A class for ... 18 class GuiSaveable 19 { 20 public: 21 protected: 22 GuiSaveable(const std::string& optionName); 23 virtual ~GuiSaveable(); 24 void makeSaveable(); 24 25 25 void makeSaveable(); 26 virtual void load(const MultiType& value) = 0; 27 virtual const MultiType& save() = 0; 26 28 27 virtual void load(const MultiType& value) = 0; 28 virtual const MultiType& save() = 0; 29 MultiType& getValue() { return this->value; }; 30 const MultiType& getValue() const { return this->value; }; 31 bool isSaveable() const { return this->bSaveable; }; 29 32 30 MultiType& getValue() { return this->value; }; 31 const MultiType& getValue() const { return this->value; }; 32 bool isSaveable() const { return this->bSaveable; }; 33 protected: 34 virtual void makingElementSaveable() {}; 33 35 34 protected: 35 virtual void makingElementSaveable() {}; 36 37 private: 38 MultiType value; 39 bool bSaveable; 40 }; 36 private: 37 MultiType value; 38 bool bSaveable; 39 }; 41 40 42 41 43 42 44 class GuiSaveableGroup : virtual public GuiSaveable45 {46 public:47 GuiSaveableGroup(const std::string& name);48 ~GuiSaveableGroup();43 class GuiSaveableGroup : virtual public GuiSaveable 44 { 45 public: 46 GuiSaveableGroup(const std::string& name); 47 ~GuiSaveableGroup(); 49 48 50 void addSaveable(GuiSaveable* saveable);51 void removeSaveable(GuiSaveable* saveable);49 void addSaveable(GuiSaveable* saveable); 50 void removeSaveable(GuiSaveable* saveable); 52 51 53 protected:54 virtual void makingElementSaveable();55 private:56 std::vector<GuiSaveable*> saveables;57 static std::vector<GuiSaveableGroup*> saveableGroups;58 };52 protected: 53 virtual void makingElementSaveable(); 54 private: 55 std::vector<GuiSaveable*> saveables; 56 static std::vector<GuiSaveableGroup*> saveableGroups; 57 }; 59 58 60 } 61 59 } 62 60 #endif /* _GUI_SAVEABLE_H */
Note: See TracChangeset
for help on using the changeset viewer.