Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/qt_gui/src/lib/gui/gui_saveable.h @ 7478

Last change on this file since 7478 was 7478, checked in by bensch, 18 years ago

qt_gui: gui-element

File size: 1.2 KB
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
14namespace OrxGui
15{
16  //! A class for ...
17  class GuiSaveable
18  {
19  public:
20    virtual ~GuiSaveable();
21
22    void makeSaveable();
23
24    virtual void load(const MultiType& value) = 0;
25    virtual const MultiType& save() = 0;
26
27    MultiType&       getValue() { return this->value; };
28    const MultiType& getValue() const { return this->value; };
29    bool             isSaveable() const { return this->bSaveable; };
30
31  protected:
32    GuiSaveable(const std::string& optionName);
33    virtual void makingElementSaveable() {};
34
35  private:
36    MultiType       value;
37    bool            bSaveable;
38  };
39
40
41
42  class GuiSaveableGroup : public GuiSaveable
43  {
44  public:
45    virtual ~GuiSaveableGroup();
46
47    void addSaveable(GuiSaveable* saveable);
48    void removeSaveable(GuiSaveable* saveable);
49
50  protected:
51    GuiSaveableGroup(const std::string& name);
52    virtual void makingElementSaveable();
53
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.