-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcomponentinfo.h
More file actions
62 lines (56 loc) · 1.43 KB
/
Copy pathcomponentinfo.h
File metadata and controls
62 lines (56 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef COMPONENTINFO_H
#define COMPONENTINFO_H
#include <QMap>
#include <QString>
#include <QGraphicsSvgItem>
#include <QVariant>
using namespace std;
enum ComponentType{
BlockSchemeComponent = 1,
PrincipalSchemeComponent = 2,
BoardSchemeComponent = 4
};
//! Holds information about component
/**
* Holds information about component. Used by component classes to
* hold default values of properties.
*/
class ComponentInfo
{
/**
* Map with properties and their default values
*/
QMap<QString, QVariant> properties;
/**
* Type of the component
*/
ComponentType type;
/**
* String with type name of the component
*/
QString typeId;
public:
/**
* Default constructor
*/
ComponentInfo();
/**
* Creates ComponentInfo with specified parameters
* @param typeId string with type name
* @param type component type
* @param properties properties of component
*/
ComponentInfo(QString typeId, ComponentType type,
const QMap<QString,QVariant> &properties);
/**
* Returns properties of the component
* @return Map with properties
*/
QMap<QString, QVariant> &getProperties();
/**
* Returns string with type name
* @return string with type name
*/
QString getTypeId() const;
};
#endif // COMPONENTINFO_H