1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/flagrow.h Tue Jul 07 09:34:24 2009 +0000
1.3 @@ -0,0 +1,52 @@
1.4 +#ifndef FLAGROW_H
1.5 +#define FLAGROW_H
1.6 +
1.7 +#include <QStringList>
1.8 +#include <QToolBar>
1.9 +
1.10 +#include "flag.h"
1.11 +#include "xmlobj.h"
1.12 +
1.13 +/*! \brief A set of flags (Flag).
1.14 +
1.15 + A toolbar can be created from the flags in this row.
1.16 + The data needed for represention in a vym map
1.17 + is stored in FlagRowObj.
1.18 + */
1.19 +
1.20 +class FlagRow:public XMLObj {
1.21 +public:
1.22 + FlagRow ();
1.23 + ~FlagRow ();
1.24 + void addFlag (Flag *flag);
1.25 + Flag *getFlag (const QString &name);
1.26 + QStringList activeFlagNames();
1.27 + bool isActive(const QString &name);
1.28 +
1.29 + /*! \brief Toggle a Flag
1.30 +
1.31 + To activate a flag it will be copied from masterRow to current row.
1.32 + */
1.33 + void toggle (const QString&, FlagRow *masterRow=NULL);
1.34 + void activate(const QString&);
1.35 + void deactivate(const QString&);
1.36 + void deactivateAll();
1.37 + void setEnabled (bool);
1.38 + void setShowFlags (bool);
1.39 + void resetUsedCounter();
1.40 + QString saveToDir (const QString &,const QString &,bool);
1.41 + void setName (const QString&); // prefix for exporting flags to dir
1.42 + void setToolBar (QToolBar *tb);
1.43 + void setMasterRow (FlagRow *row);
1.44 + void updateToolBar(const QStringList &activeNames);
1.45 +
1.46 +private:
1.47 + QToolBar *toolBar;
1.48 + FlagRow *masterRow;
1.49 + QList <Flag*> flags;
1.50 + QStringList activeNames; //! Lists all names of currently active flags
1.51 + QString rowName; //! Name of this collection of flags
1.52 +// bool showFlags; // FloatObjects want to hide their flags
1.53 +};
1.54 +#endif
1.55 +