]> git.sven.stormbind.net Git - sven/vym.git/blob - src/flag.h
New upstream version 2.9.22
[sven/vym.git] / src / flag.h
1 #ifndef FLAG_H
2 #define FLAG_H
3
4 #include <QAction>
5 #include <QUuid>
6
7 #include "imageobj.h"
8 #include "xmlobj.h"
9
10 /*! \brief One flag belonging to a FlagRow.
11
12     Each TreeItem in a VymModel has a set of standard flags and system
13     flags.
14 */
15
16 /////////////////////////////////////////////////////////////////////////////
17 class Flag : public XMLObj {
18   public:
19     enum FlagType {
20         SystemFlag,
21         StandardFlag,
22         UserFlag,
23         FreemindFlag,
24         UndefinedFlag
25     };
26
27     Flag();
28     Flag(const QString &fname);
29     ~Flag();
30     virtual void init();
31     bool load(const QString &);
32     void setName(const QString &);
33     const QString getName();
34     const QString getPath();
35     void setVisible(bool b);
36     bool isVisible();
37     void setGroup(const QString &);
38     const QString getGroup();
39     void unsetGroup();
40     void setToolTip(const QString &);
41     const QString getToolTip();
42     ImageObj *getImageObj();
43     void setAction(QAction *a);
44     QAction *getAction();
45     void setUsed(bool);
46     bool isUsed();
47     FlagType getType();
48     void setType(FlagType t);
49     void setUuid(const QUuid &id);
50     QUuid getUuid();
51     QString getDefinition(const QString &prefix);
52     void saveDataToDir(const QString &);
53     QString saveState();
54
55   protected:
56     QString name;
57     bool visible;
58     QString group;
59     QString tooltip;
60     QAction *action;
61     bool state;
62     bool used;
63     FlagType type;
64     QUuid uuid;
65
66   private:
67     ImageObj *image;
68     QString path;
69 };
70
71 #endif