flagrowobj.h
author insilmaril
Thu, 07 May 2009 08:48:53 +0000
changeset 766 7a71a914afdb
parent 468 82bd254b58da
child 767 6d2b32f305f9
permissions -rw-r--r--
Started to reanimate flags
     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 {	// FIXME-0 move pixmaps to mainwindow or model in the end...
    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 &name);
    32 	void activate(const QString&);
    33 	void deactivate(const QString&);
    34 	void deactivateAll();
    35 	void deactivateGroup(FlagObj *);	//FIXME-0
    36 	void setToolBar (QToolBar *);		//FIXME-0
    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 FIXME-0
    43 	void updateToolbar();					// Update Toolbar buttons	FIXME-0
    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