forked from sialan-labs/kaqaz
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathpapermanager.h
100 lines (77 loc) · 2.69 KB
/
papermanager.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
/*
Copyright (C) 2014 Aseman
http://aseman.co
Papyrus is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Papyrus is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAPERMANAGER_H
#define PAPERMANAGER_H
#include <QQuickItem>
#include <QStringList>
#include <QGeoCoordinate>
class Papyrus;
class PaperManagerPrivate;
class PaperManager : public QQuickItem
{
Q_PROPERTY(int root READ root WRITE setRoot NOTIFY rootChanged)
Q_PROPERTY(int type READ type WRITE setType NOTIFY typeChanged)
Q_PROPERTY(QString keyword READ keyword WRITE setKeyword NOTIFY keywordChanged)
Q_PROPERTY(QQuickItem *currentPaper READ currentPaper NOTIFY currentPaperChanged)
Q_PROPERTY(QList<int> papers READ papers NOTIFY papersChanged)
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
Q_ENUMS(Type)
Q_OBJECT
public:
enum Type {
Group,
Date,
Search,
AdvanceSearch,
Clean,
All
};
PaperManager(QQuickItem *parent = 0);
~PaperManager();
void setRoot( int id );
int root() const;
void setType( int t );
int type() const;
void setKeyword( const QString & kw );
QString keyword() const;
QQuickItem *currentPaper() const;
QList<int> papers() const;
void setCurrentIndex( int idx );
int currentIndex();
public slots:
void setAdvanceSearch( const QString & keyword, const QDate & startDate, const QDate & endDate, const QTime & startTime, const QTime & endTime, int group, int domain, const QRectF & geo, const QString & weather );
signals:
void rootChanged();
void typeChanged();
void keywordChanged();
void currentPaperChanged();
void papersChanged();
void currentIndexChanged();
private slots:
QQuickItem *createPaper();
Papyrus *getPapyrus();
void init_buffer();
void reindexBuffer();
void load_buffers();
void paperClosed(const QVariant &var);
void paperEntered(const QVariant &var);
void paperSaved(int id);
void deletePaper(const QVariant &var );
void outMove(QVariant size );
void outMoveFinished();
private:
PaperManagerPrivate *p;
};
#endif // PAPERMANAGER_H