1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/mapitem.h Wed Apr 29 18:46:31 2009 +0000
1.3 @@ -0,0 +1,45 @@
1.4 +#ifndef MAPITEM_H
1.5 +#define MAPITEM_H
1.6 +
1.7 +#include <QPointF>
1.8 +
1.9 +class LinkableMapObj;
1.10 +
1.11 +/*! /brief MapItem is used to store information of MapObj and inherited
1.12 + classes.
1.13 +
1.14 + This is done even while no QGraphicsView is availabe, e.g. on a
1.15 + mobile device.
1.16 +*/
1.17 +
1.18 +class MapItem
1.19 +{
1.20 +protected:
1.21 + enum PositionMode {Unused,Absolute,Relative};
1.22 + QPointF pos;
1.23 + PositionMode posMode;
1.24 +
1.25 +public:
1.26 + MapItem();
1.27 +
1.28 + /*! Used to save relative position while map is not in QGraphicsView */
1.29 + virtual void setRelPos(const QPointF&);
1.30 +
1.31 + /*! Used to save absolute position while map is not in QGraphicsView */
1.32 + virtual void setAbsPos(const QPointF&);
1.33 +
1.34 +protected:
1.35 + LinkableMapObj *lmo;
1.36 +public:
1.37 + /*! Returns pointer to related LinkableMapObj in QGraphicsView */
1.38 + virtual LinkableMapObj* getLMO();
1.39 +
1.40 + /*! Set pointer to related LinkableMapObj in QGraphicsView */
1.41 + virtual void setLMO (LinkableMapObj*);
1.42 +
1.43 + /*! Initialize LinkableMapObj with data in MapItem */
1.44 + virtual void initLMO();
1.45 +};
1.46 +
1.47 +
1.48 +#endif