mapitem.h
author insilmaril
Wed, 29 Apr 2009 21:40:37 +0000
changeset 761 0301e6109702
parent 760 59614eaf5fbb
child 762 ffb95cd03156
permissions -rw-r--r--
speedup
     1 #ifndef MAPITEM_H
     2 #define MAPITEM_H
     3 
     4 #include <QPointF>
     5 
     6 class LinkableMapObj;
     7 
     8 /*! /brief MapItem is used to store information of MapObj and inherited
     9    classes.
    10  
    11 	This is done even while no QGraphicsView is availabe, e.g. on a
    12 	mobile device.
    13 */
    14 
    15 class MapItem
    16 {
    17 protected:
    18 	enum PositionMode {Unused,Absolute,Relative};
    19 	QPointF pos;
    20 	PositionMode posMode;
    21 
    22 public:
    23 	MapItem();
    24 
    25 	/*! Used to save relative position while map is not in QGraphicsView */
    26 	virtual void setRelPos(const QPointF&);	
    27 
    28 	/*! Used to save absolute position while map is not in QGraphicsView */
    29 	virtual void setAbsPos(const QPointF&);	
    30 
    31 protected:
    32 	LinkableMapObj *lmo;
    33 public:
    34 	/*! Returns pointer to related LinkableMapObj in QGraphicsView */
    35 	virtual LinkableMapObj* getLMO();
    36 
    37 	/*! Set pointer to related LinkableMapObj in QGraphicsView */
    38 	virtual void setLMO (LinkableMapObj*);
    39 
    40 	/*! Initialize LinkableMapObj with data in MapItem */
    41 	virtual void initLMO();
    42 };
    43 
    44 
    45 #endif