flagobj.h
author insilmaril
Wed Jan 16 15:45:19 2008 +0000 (2008-01-16)
changeset 655 d4b49c6c6069
parent 467 b54deedfcfdd
child 767 6d2b32f305f9
permissions -rw-r--r--
Fixed missing MapCenter
     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 unsetGroup ();
    36 	void setToolTip(const QString&);
    37 	const QString getToolTip();
    38 	QPixmap getPixmap();
    39 	void setAction(QAction*);
    40 	void updateAction ();
    41 	void setAlwaysVisible (bool b);
    42 	bool isAlwaysVisible ();
    43 	bool isActive();
    44 	void toggle();
    45 	void activate();
    46 	void deactivate();
    47 	void setUsed (bool);
    48 	bool isUsed();
    49 	void saveToDir (const QString&, const QString&);
    50 	
    51 protected:	
    52 	QString name;
    53 	QString group;
    54 	QString tooltip;
    55 	bool state;
    56 	bool avis;
    57 	bool used;
    58     virtual void positionBBox();
    59     virtual void calcBBoxSize();
    60 private:
    61 	ImageObj* icon;
    62 	QAction* action;
    63 };
    64 
    65 #endif