forked from sialan-labs/kaqaz
-
Notifications
You must be signed in to change notification settings - Fork 12
/
papercoreobject.h
115 lines (91 loc) · 3.24 KB
/
papercoreobject.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#ifndef PAPERCOREOBJECT_H
#define PAPERCOREOBJECT_H
#include <QObject>
#include <QGeoCoordinate>
#include <QStringList>
#include <QDateTime>
class PaperCoreObjectPrivate;
class PaperCoreObject : public QObject
{
Q_OBJECT
Q_PROPERTY(int paperId READ paperId WRITE setPaper NOTIFY paperIdChanged)
Q_PROPERTY(QString uuid READ uuid NOTIFY uuidChanged)
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
Q_PROPERTY(QDateTime create READ create WRITE setCreate NOTIFY createChanged)
Q_PROPERTY(QDateTime modified READ modified WRITE setModified NOTIFY modifiedChanged)
Q_PROPERTY(QGeoCoordinate location READ location WRITE setLocation NOTIFY locationChanged)
Q_PROPERTY(int group READ group WRITE setGroup NOTIFY groupChanged)
Q_PROPERTY(int activity READ activity WRITE setActivity NOTIFY activityChanged)
Q_PROPERTY(QString weather READ weather WRITE setWeather NOTIFY weatherChanged)
Q_PROPERTY(int temperature READ temperature WRITE setTemperature NOTIFY temperatureChanged)
Q_PROPERTY(QStringList files READ files NOTIFY filesChanged)
Q_PROPERTY(int type READ type WRITE setType NOTIFY typeChanged)
public:
PaperCoreObject(QObject *parent = 0);
~PaperCoreObject();
int paperId() const;
void setPaper(int id);
QString uuid() const;
void setTitle(const QString &title);
QString title() const;
void setText(const QString &txt);
QString text() const;
void setCreate(const QDateTime &create);
QDateTime create() const;
void setModified(const QDateTime &modified);
QDateTime modified() const;
void setLocation(const QGeoCoordinate &location);
QGeoCoordinate location() const;
void setGroup(int group);
int group() const;
void setActivity(int activity);
int activity() const;
void setWeather(const QString &weather);
QString weather() const;
void setTemperature(int temperature);
int temperature() const;
QStringList files() const;
void setType(int type);
int type() const;
public slots:
void addFile(const QString &file);
void removeFile(const QString &file);
void replaceFile(const QString &oldFile, const QString &newFile);
void reset();
void refresh();
void save(bool force = true);
signals:
void paperIdChanged();
void textChanged();
void uuidChanged();
void titleChanged();
void createChanged();
void modifiedChanged();
void locationChanged();
void groupChanged();
void activityChanged();
void weatherChanged();
void temperatureChanged();
void filesChanged();
void typeChanged();
private slots:
void paperUuidChanged(int id);
void paperTitleChanged(int id);
void paperTextChanged(int id);
void paperCreateChanged(int id);
void paperModifiedChanged(int id);
void paperLocationChanged(int id);
void paperGroupChanged(int id);
void paperActivityChanged(int id);
void paperWeatherChanged(int id);
void paperTemperatureChanged(int id);
void paperFilesChanged(int id);
void paperTypeChanged(int id);
private:
void reset_prv();
void emit_all();
private:
PaperCoreObjectPrivate *p;
};
#endif // PAPERCOREOBJECT_H