]> Shamusworld >> Repos - architektonas/blob - src/base/variabledict.h
Fixed problem with MDI activation.
[architektonas] / src / base / variabledict.h
1 #ifndef __VARIABLEDICT_H__
2 #define __VARIABLEDICT_H__
3
4 #include <QtCore>
5 #include "variable.h"
6 #include "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 VariableDict
15 {
16         public:
17                 VariableDict();
18                 virtual ~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<Variable> & getVariableDict();
35                 QMultiHash<QString, Variable *> & getVariableDict();
36
37                 //void addVariableDictListener(VariableDictListener* listener);
38
39                 friend std::ostream & operator<<(std::ostream & os, VariableDict & v);
40
41         private:
42                 //! Variables for the graphic
43 //              Q3Dict<Variable> variables;
44                 QMultiHash<QString, Variable *> variables;
45 };
46
47 #endif