mapitem.h
author insilmaril
Thu May 07 08:48:53 2009 +0000 (2009-05-07)
changeset 766 7a71a914afdb
parent 760 59614eaf5fbb
child 775 6e4b586aa88a
permissions -rw-r--r--
Started to reanimate flags
     1 #ifndef MAPITEM_H
     2 #define MAPITEM_H
     3 
     4 #include <QPointF>
     5 
     6 #include "xmlobj.h"
     7 
     8 class LinkableMapObj;
     9 
    10 /*! /brief MapItem is used to store information of MapObj and inherited
    11    classes.
    12  
    13 	This is done even while no QGraphicsView is availabe. This is useful
    14 	if e.g. on a small device like a cellphone te full map is not used,
    15 	but just a treeview instead.
    16 */
    17 
    18 class MapItem: public XMLObj
    19 {
    20 protected:
    21 	enum PositionMode {Unused,Absolute,Relative};
    22 	QPointF pos;
    23 	PositionMode posMode;
    24 
    25 public:
    26 	MapItem();
    27 
    28 	/*! Used to save relative position while map is not in QGraphicsView */
    29 	virtual void setRelPos(const QPointF&);	
    30 
    31 	/*! Used to save absolute position while map is not in QGraphicsView */
    32 	virtual void setAbsPos(const QPointF&);	
    33 
    34 protected:
    35 	LinkableMapObj *lmo;
    36 public:
    37 	/*! Returns pointer to related LinkableMapObj in QGraphicsView */
    38 	virtual LinkableMapObj* getLMO();
    39 
    40 	/*! Set pointer to related LinkableMapObj in QGraphicsView */
    41 	virtual void setLMO (LinkableMapObj*);
    42 
    43 	/*! Initialize LinkableMapObj with data in MapItem */
    44 	virtual void initLMO();
    45 
    46 	/*! Return data as attributes for saving in XML */
    47 	virtual QString getAttr();
    48 };
    49 
    50 
    51 #endif