flagobj.h
author insilmaril
Wed Apr 25 16:02:54 2007 +0000 (2007-04-25)
changeset 473 8b9cfc26638c
parent 408 c2a05fa925a1
child 581 eaa3798cc33a
permissions -rw-r--r--
started doxygen documentation
     1 #ifndef FLAGOBJ_H
     2 #define FLAGOBJ_H
     3 
     4 
     5 #include <QAction>
     6 #include <QPixmap>
     7 
     8 #include "mapobj.h"
     9 #include "imageobj.h"
    10 
    11 /*! \brief One flag which is visible in the map. 
    12 
    13     Flags are aligned in a row. 
    14 */
    15 
    16 
    17 /////////////////////////////////////////////////////////////////////////////
    18 class FlagObj:public MapObj {
    19 public:
    20     FlagObj ();
    21     FlagObj (QGraphicsScene*);
    22     FlagObj (FlagObj*);
    23     ~FlagObj ();
    24     virtual void init ();
    25     virtual void copy (FlagObj*);
    26     virtual void move (double x,double y);      // move to absolute Position
    27     virtual void moveBy (double x,double y);    // move to relative Position
    28     virtual void setVisibility(bool);
    29 	void load (const QString&);
    30 	void load (const QPixmap&);
    31 	void setName (const QString&);
    32 	const QString getName ();
    33 	void setGroup (const QString&);
    34 	const QString getGroup();
    35 	void setToolTip(const QString&);
    36 	const QString getToolTip();
    37 	QPixmap getPixmap();
    38 	void setAction(QAction*);
    39 	void updateAction ();
    40 	bool isActive();
    41 	void toggle();
    42 	void activate();
    43 	void deactivate();
    44 	void setUsed (bool);
    45 	bool isUsed();
    46 	void saveToDir (const QString&, const QString&);
    47 	
    48 protected:	
    49 	QString name;
    50 	QString group;
    51 	QString tooltip;
    52 	bool state;
    53 	bool used;
    54     virtual void positionBBox();
    55     virtual void calcBBoxSize();
    56 private:
    57 	ImageObj* icon;
    58 	QAction* action;
    59 };
    60 
    61 #endif