mapitem.h
author insilmaril
Mon, 29 Jun 2009 10:27:42 +0000
changeset 777 8acac4fade1b
parent 776 25e634a7e1dc
child 779 1fb50e79661c
permissions -rw-r--r--
more fixes
     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 public:
    21 	enum PositionMode {Unused,Absolute,Relative};
    22 protected:
    23 	QPointF pos;
    24 	PositionMode posMode;
    25 
    26 public:
    27 	MapItem();
    28 	void init();
    29 
    30 	/*! Used to save relative position while map is not in QGraphicsView */
    31 	virtual void setRelPos(const QPointF&);	
    32 
    33 	/*! Used to save absolute position while map is not in QGraphicsView */
    34 	virtual void setAbsPos(const QPointF&);	
    35 
    36 	/*! Tell object to use e.g. absolute positioning for mapcenter. 
    37 	    Defaulst is MapItem::Unused */
    38 	void setPositionMode (PositionMode mode);
    39 
    40 protected:
    41 	LinkableMapObj *lmo;
    42 public:
    43 	/*! Returns pointer to related LinkableMapObj in QGraphicsView */
    44 	virtual LinkableMapObj* getLMO();
    45 
    46 	/*! Set pointer to related LinkableMapObj in QGraphicsView */
    47 	virtual void setLMO (LinkableMapObj*);
    48 
    49 	/*! Initialize LinkableMapObj with data in MapItem */
    50 	virtual void initLMO();
    51 
    52 };
    53 
    54 
    55 #endif