/*! * @file gui_saveable.h * @brief Definition of ... */ #ifndef _GUI_SAVEABLE_H #define _GUI_SAVEABLE_H #include "base_object.h" #include "lib/util/multi_type.h" #include // FORWARD DECLARATION namespace OrxGui { //! A class for ... class Saveable : public BaseObject { public: virtual ~Saveable(); void makeSaveable(); virtual void load(const MultiType& value) {}; virtual const MultiType& save() {}; MultiType& value() { return this->_value; }; const MultiType& value() const { return this->_value; }; bool isSaveable() const { return this->bSaveable; }; protected: Saveable(const std::string& optionName); virtual void makingElementSaveable() {}; private: MultiType _value; bool bSaveable; }; class SaveableGroup : public Saveable { public: virtual ~SaveableGroup(); void addSaveable(Saveable* saveable); void removeSaveable(Saveable* saveable); virtual void load(const MultiType& value); virtual const MultiType& save(); protected: SaveableGroup(const std::string& name); virtual void makingElementSaveable(); private: std::vector saveables; static std::vector saveableGroups; }; } #endif /* _GUI_SAVEABLE_H */