flagobj.h
author insilmaril
Mon May 18 11:22:41 2009 +0000 (2009-05-18)
changeset 771 01f2f6d6789d
parent 581 eaa3798cc33a
permissions -rw-r--r--
Fixed addBranchBefore
     1 #ifndef FLAGOBJ_H
     2 #define FLAGOBJ_H
     3 
     4 
     5 #include <QAction>
     6 #include <QPixmap>
     7 
     8 #include "flag.h"
     9 #include "mapobj.h"
    10 #include "imageobj.h"
    11 
    12 /*! \brief One flag which is visible in the map. 
    13 
    14     Flags are aligned in a row. 
    15 */
    16 
    17 
    18 /////////////////////////////////////////////////////////////////////////////
    19 class FlagObj:public MapObj {
    20 public:
    21     FlagObj ();
    22     FlagObj (QGraphicsScene*);
    23     FlagObj (FlagObj*);
    24     FlagObj (Flag*);
    25     ~FlagObj ();
    26     virtual void init ();
    27     virtual void copy (FlagObj*);
    28     virtual void move (double x,double y);      // move to absolute Position
    29     virtual void moveBy (double x,double y);    // move to relative Position
    30     virtual void setVisibility(bool);
    31 	void load (const QString&);
    32 	void load (const QPixmap&);
    33 	void setName (const QString&);
    34 	const QString getName ();
    35 	QPixmap getPixmap();
    36 	void setAction(QAction*);
    37 	void setAlwaysVisible (bool b);
    38 	bool isAlwaysVisible ();
    39 	bool isActive();
    40 	void toggle();
    41 	void activate();
    42 	void deactivate();
    43 	void saveToDir (const QString&, const QString&);
    44 	
    45 protected:	
    46 	QString name;
    47 	bool state;
    48 	bool avis;
    49     virtual void positionBBox();
    50     virtual void calcBBoxSize();
    51 private:
    52 	ImageObj* icon;
    53 };
    54 
    55 #endif