mapobj.h
author insilmaril
Mon May 08 13:26:08 2006 +0000 (2006-05-08)
changeset 323 31c3d5f142c1
parent 227 38ad83f1d4ce
child 366 e95081c21da2
permissions -rw-r--r--
1.7.16 Small bugfixes
     1 #ifndef MAPOBJ_H
     2 #define MAPOBJ_H
     3 
     4 #include <qcanvas.h>
     5 #include <iostream>
     6 
     7 #include "misc.h"
     8 
     9 using namespace std;
    10 
    11 #define Z_BBOX      0
    12 #define Z_XLINK    10
    13 #define Z_LINK     20
    14 #define Z_FRAME    50
    15 #define Z_SELBOX   60
    16 #define Z_FLOATIMG 65
    17 #define Z_ICON     80
    18 #define Z_TEXT    100
    19 
    20 class MapObj:public xmlObj {
    21 public:
    22     MapObj ();
    23     MapObj (QCanvas*);
    24     MapObj (MapObj*);
    25     virtual ~MapObj ();
    26     virtual void init ();
    27     virtual void copy (MapObj*);
    28 	virtual QCanvas* getCanvas();
    29     virtual int x();
    30     virtual int y();
    31 	virtual int width();
    32 	virtual int height();
    33 	virtual QPoint getAbsPos();
    34 	virtual QString getPos();					// Return position as string (x,y)
    35     virtual void move (double x,double y);      // move to absolute Position
    36     virtual void moveBy (double x,double y);    // move to relative Position
    37     virtual bool inBox(const QPoint&);			// Check if Point is within clickbox
    38     virtual QRect getBBox();					// returns bounding box
    39     virtual QRect addBBox(QRect,QRect);			// returns bbox which includes both boxes
    40     virtual QSize getSize();					// returns size of bounding box
    41     virtual bool isVisibleObj();
    42     virtual void setVisibility(bool);
    43     virtual void positionBBox()=0;       
    44 	virtual void calcBBoxSize()=0;
    45 protected:  
    46     QCanvas* canvas;
    47     QRect bbox;									// bounding box of MO itself
    48 	QRect clickBox;								// area where mouseclicks are found
    49     QPoint absPos;							    // Position on canvas
    50     bool visible;
    51 };
    52 
    53 #endif