Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/qt_gui: elements defined

File size: 1.3 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 "lib/util/multi_type.h"
11#include <vector>
12
13// FORWARD DECLARATION
14namespace OrxGui
15{
16  //! A class for ...
17  class Saveable : public BaseObject
18  {
19  public:
20    virtual ~Saveable();
21
22    void makeSaveable();
23
24    virtual void load(const MultiType& value) {};
25    virtual const MultiType& save() {};
26
27    MultiType&       value() { return this->_value; };
28    const MultiType& value() const { return this->_value; };
29    bool             isSaveable() const { return this->bSaveable; };
30
31  protected:
32    Saveable(const std::string& optionName);
33    virtual void makingElementSaveable() {};
34
35  private:
36    MultiType       _value;
37    bool            bSaveable;
38  };
39
40
41
42  class SaveableGroup : public Saveable
43  {
44  public:
45    virtual ~SaveableGroup();
46
47    void addSaveable(Saveable* saveable);
48    void removeSaveable(Saveable* saveable);
49
50    virtual void load(const MultiType& value);
51    virtual const MultiType& save();
52
53  protected:
54    SaveableGroup(const std::string& name);
55    virtual void makingElementSaveable();
56
57  private:
58    std::vector<Saveable*>              saveables;
59    static std::vector<SaveableGroup*>  saveableGroups;
60  };
61
62}
63#endif /* _GUI_SAVEABLE_H */
Note: See TracBrowser for help on using the repository browser.