diff -r bf3ea1f1520b -r 59614eaf5fbb mapitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mapitem.h Wed Apr 29 18:46:31 2009 +0000 @@ -0,0 +1,45 @@ +#ifndef MAPITEM_H +#define MAPITEM_H + +#include + +class LinkableMapObj; + +/*! /brief MapItem is used to store information of MapObj and inherited + classes. + + This is done even while no QGraphicsView is availabe, e.g. on a + mobile device. +*/ + +class MapItem +{ +protected: + enum PositionMode {Unused,Absolute,Relative}; + QPointF pos; + PositionMode posMode; + +public: + MapItem(); + + /*! Used to save relative position while map is not in QGraphicsView */ + virtual void setRelPos(const QPointF&); + + /*! Used to save absolute position while map is not in QGraphicsView */ + virtual void setAbsPos(const QPointF&); + +protected: + LinkableMapObj *lmo; +public: + /*! Returns pointer to related LinkableMapObj in QGraphicsView */ + virtual LinkableMapObj* getLMO(); + + /*! Set pointer to related LinkableMapObj in QGraphicsView */ + virtual void setLMO (LinkableMapObj*); + + /*! Initialize LinkableMapObj with data in MapItem */ + virtual void initLMO(); +}; + + +#endif