-
Notifications
You must be signed in to change notification settings - Fork 1
/
rsectionmodel.h
executable file
·79 lines (65 loc) · 2.44 KB
/
rsectionmodel.h
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef RSECTIONMODEL_H
#define RSECTIONMODEL_H
#include "rmapobjectmodel.h"
#include <QColor>
class RImageDescriptor;
class RFontDescriptor;
class RRefsDescriptor;
class RSectionModel : public RMapObjectModel {
Q_OBJECT
public:
explicit RSectionModel(QObject *parent = 0);
virtual ~RSectionModel();
virtual RSectionModel *clone() const;
virtual bool isValid() const;
virtual int rowCount(const QModelIndex &parent) const;
virtual QVariant data(const QModelIndex &index, int role) const;
virtual bool setData(const QModelIndex &index, const QVariant &value, int role);
virtual const QString &caption() const;
enum SECTIONS {
EN_NAME = RMapObjectModel::EN_SECTIONS_COUNT,
EN_PICTURE,
EN_FONT,
EN_FONT_COLOR,
EN_CHILD_FONT,
EN_CHILD_FONT_COLOR,
EN_FRAME_COLOR,
EN_ACTIVE_CHILD_PICTURE,
EN_SECTIONS_COUNT
};
void setSectionName(const RRefsDescriptor *refs);
void setSectionPicture(const RImageDescriptor *image);
void setSectionFont(const RFontDescriptor *font);
void setSectionFontColor(const QColor &color);
void setChildFont(const RFontDescriptor *font);
void setChildFontColor(const QColor &color);
void setSectionFrameColor(const QColor &color);
void setActiveChildPicture(const RImageDescriptor *image);
const QString §ionName() const;
const QImage §ionPicture() const;
const QFont §ionFont() const;
const QColor §ionFontColor() const;
const QFont &childFont() const;
const QColor &childFontColor() const;
const QColor §ionFrameColor() const;
const QImage &activeChildPicture() const;
const RRefsDescriptor *sectionNameDescriptor() const;
const RFontDescriptor *sectionFontDescriptor() const;
const RFontDescriptor *childFontDescriptor() const;
const RImageDescriptor *sectionPictureDescriptor() const;
const RImageDescriptor *activeChildPictureDescriptor() const;
protected:
void initModel(RSectionModel *m) const;
private:
struct SectionInfo {
const RRefsDescriptor *sectionName;
const RImageDescriptor *sectionPicture;
const RFontDescriptor *sectionFont;
QColor sectionFontColor;
const RFontDescriptor *childFont;
QColor childFontColor;
QColor sectionFrameColor;
const RImageDescriptor *activeChildPicture;
} Data;
};
#endif // RSECTIONMODEL_H