]> Shamusworld >> Repos - architektonas/blob - src/base/rs_variabledict.h
Refactoring: Moved RS_GraphicView to GraphicView.
[architektonas] / src / base / rs_variabledict.h
1 #ifndef RS_VARIABLEDICT_H
2 #define RS_VARIABLEDICT_H
3
4 #include <QtCore>
5 #include "rs_variable.h"
6 #include "rs_debug.h"
7
8 /**
9  * Dictionary of variables. The variables are stored as key / value
10  * pairs (string / string).
11  *
12  * @author Andrew Mustun
13  */
14 class RS_VariableDict
15 {
16         public:
17                 RS_VariableDict();
18                 virtual ~RS_VariableDict();
19
20                 void clear();
21                 int count();
22
23                 void add(const QString & key, const Vector & value, int code);
24                 void add(const QString & key, const QString & value, int code);
25                 void add(const QString & key, int value, int code);
26                 void add(const QString & key, double value, int code);
27
28                 Vector getVector(const QString & key, const Vector & def);
29                 QString getString(const QString & key, const QString & def);
30                 int getInt(const QString & key, int def);
31                 double getDouble(const QString & key, double def);
32
33                 virtual void remove(const QString & key);
34 //              Q3Dict<RS_Variable> & getVariableDict();
35                 QMultiHash<QString, RS_Variable *> & getVariableDict();
36
37                 //void addVariableDictListener(RS_VariableDictListener* listener);
38
39                 friend std::ostream & operator<<(std::ostream & os, RS_VariableDict & v);
40
41         private:
42                 //! Variables for the graphic
43 //              Q3Dict<RS_Variable> variables;
44                 QMultiHash<QString, RS_Variable *> variables;
45 };
46
47 #endif