Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7478 in orxonox.OLD for branches/qt_gui/src/lib/gui/gui_saveable.h


Ignore:
Timestamp:
May 2, 2006, 9:34:48 PM (18 years ago)
Author:
bensch
Message:

qt_gui: gui-element

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/qt_gui/src/lib/gui/gui_saveable.h

    r7470 r7478  
    1212
    1313// FORWARD DECLARATION
    14   namespace OrxGui
     14namespace OrxGui
     15{
     16  //! A class for ...
     17  class GuiSaveable
    1518  {
    16     //! A class for ...
    17     class GuiSaveable
    18     {
    19     public:
    20     protected:
    21       GuiSaveable(const std::string& optionName);
    22       virtual ~GuiSaveable();
     19  public:
     20    virtual ~GuiSaveable();
    2321
    24       void makeSaveable();
     22    void makeSaveable();
    2523
    26       virtual void load(const MultiType& value) = 0;
    27       virtual const MultiType& save() = 0;
     24    virtual void load(const MultiType& value) = 0;
     25    virtual const MultiType& save() = 0;
    2826
    29       MultiType&       getValue() { return this->value; };
    30       const MultiType& getValue() const { return this->value; };
    31       bool             isSaveable() const { return this->bSaveable; };
     27    MultiType&       getValue() { return this->value; };
     28    const MultiType& getValue() const { return this->value; };
     29    bool             isSaveable() const { return this->bSaveable; };
    3230
    33     protected:
    34       virtual void makingElementSaveable() {};
     31  protected:
     32    GuiSaveable(const std::string& optionName);
     33    virtual void makingElementSaveable() {};
    3534
    36     private:
    37       MultiType       value;
    38       bool            bSaveable;
    39     };
     35  private:
     36    MultiType       value;
     37    bool            bSaveable;
     38  };
    4039
    4140
    4241
    43     class GuiSaveableGroup : virtual public GuiSaveable
    44     {
    45     public:
    46       GuiSaveableGroup(const std::string& name);
    47       ~GuiSaveableGroup();
     42  class GuiSaveableGroup : public GuiSaveable
     43  {
     44  public:
     45    virtual ~GuiSaveableGroup();
    4846
    49       void addSaveable(GuiSaveable* saveable);
    50       void removeSaveable(GuiSaveable* saveable);
     47    void addSaveable(GuiSaveable* saveable);
     48    void removeSaveable(GuiSaveable* saveable);
    5149
    52     protected:
    53       virtual void makingElementSaveable();
    54     private:
    55       std::vector<GuiSaveable*>              saveables;
    56       static std::vector<GuiSaveableGroup*>  saveableGroups;
    57     };
     50  protected:
     51    GuiSaveableGroup(const std::string& name);
     52    virtual void makingElementSaveable();
    5853
    59   }
     54  private:
     55    std::vector<GuiSaveable*>              saveables;
     56    static std::vector<GuiSaveableGroup*>  saveableGroups;
     57  };
     58
     59}
    6060#endif /* _GUI_SAVEABLE_H */
Note: See TracChangeset for help on using the changeset viewer.