flagrowobj.h
author insilmaril
Wed Oct 24 12:21:24 2007 +0000 (2007-10-24)
changeset 613 8fb5b3956b3e
parent 425 7014be3ac7d0
child 766 7a71a914afdb
permissions -rw-r--r--
Improved ascii export
     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