flagrowobj.h
author insilmaril
Tue, 06 Nov 2007 13:54:41 +0000
changeset 615 497f19b3c1fe
parent 468 82bd254b58da
child 766 7a71a914afdb
permissions -rw-r--r--
1.11.1 fixed undo/redo sorting of branches
     1 #ifndef FLAGROWOBJ_H
     2 #define FLAGROWOBJ_H
     3 
     4 #include <QMainWindow>
     5 
     6 #include "mapobj.h"
     7 #include "flagobj.h"
     8 
     9 /*! \brief A collection of flags (FlagObj). 
    10 
    11    The flags are aligned horizontally  in a row on the map. 
    12    A toolbar can be created from the flags in this row.
    13  */
    14 
    15 class FlagRowObj:public MapObj {
    16 public:
    17     FlagRowObj ();
    18     FlagRowObj (QGraphicsScene *);
    19     ~FlagRowObj ();
    20     virtual void init ();
    21     virtual void copy (FlagRowObj*);
    22     virtual void clone(FlagRowObj*);
    23     virtual void move   (double,double);
    24     virtual void moveBy (double,double);
    25     virtual void setVisibility(bool);
    26     virtual FlagObj* addFlag (FlagObj *fo);			// make deep copy of FlagObj
    27     virtual void positionBBox();
    28     virtual void calcBBoxSize();
    29 	virtual QString getFlagName (const QPointF &p);	// Find flag by position
    30 	bool isActive(const QString&);
    31 	void toggle (const QString&,bool);
    32 	void activate(const QString&);
    33 	void deactivate(const QString&);
    34 	void deactivateAll();
    35 	void deactivateGroup(FlagObj *);
    36 	void setToolBar (QToolBar *);
    37 	void setEnabled (bool);
    38 	void setShowFlags (bool);
    39 	void resetUsedCounter();
    40 	QString saveToDir (const QString &,const QString &,bool);
    41 	void setName (const QString&);			// prefix for exporting flags to dir
    42 	void makeToolbar (QMainWindow*, const QString &);	// Create Toolbar buttons
    43 	void updateToolbar();					// Update Toolbar buttons	
    44 private:	
    45 	FlagRowObj* parentRow;					// look for flags in this row
    46 	FlagObj* findFlag (const QString&);
    47     QList <FlagObj*> flag; 
    48 	QToolBar *toolbar;
    49 	QString name;
    50 	bool showFlags;							// FloatObjects want to hide their flags
    51 };
    52 #endif