]> git.sven.stormbind.net Git - sven/vym.git/blob - flagrow.h
f94c171ee4d76577c61e9f3315d33e9d63068966
[sven/vym.git] / flagrow.h
1 #ifndef FLAGROW_H
2 #define FLAGROW_H
3
4 #include <QStringList>
5 #include <QToolBar>
6
7 #include "flag.h"
8 #include "xmlobj.h"
9
10 /*! \brief A set of flags (Flag). 
11
12    A toolbar can be created from the flags in this row.
13    The data needed for represention in a vym map 
14    is stored in FlagRowObj.
15  */
16
17 class FlagRow:public XMLObj {
18 public:
19     FlagRow ();
20     ~FlagRow ();
21     void addFlag (Flag *flag);
22     Flag *getFlag (const QString &name);
23     QStringList  activeFlagNames();
24     bool isActive(const QString &name);
25
26     /*! \brief Toggle a Flag 
27         
28         To activate a flag it will be copied from masterRow to current row.
29     */  
30     bool toggle (const QString&, FlagRow *masterRow=NULL);
31     bool activate(const QString&);
32     bool deactivate(const QString&);
33     bool deactivateGroup(const QString&);
34     void deactivateAll();
35     void setEnabled (bool);
36     void resetUsedCounter();
37     QString saveToDir (const QString &,const QString &,bool);
38     void setName (const QString&);          // prefix for exporting flags to dir
39     void setToolBar   (QToolBar *tb);
40     void setMasterRow (FlagRow *row);
41     void updateToolBar(const QStringList &activeNames);
42
43 private:    
44     QToolBar *toolBar;
45     FlagRow *masterRow;
46     QList <Flag*> flags; 
47     QStringList activeNames;    //! Lists all names of currently active flags
48     QString rowName;            //! Name of this collection of flags
49 };
50 #endif
51