mapobj.h
author insilmaril
Mon Apr 10 11:21:35 2006 +0000 (2006-04-10)
changeset 288 24a51ea91118
parent 175 728f51b71e71
child 315 866f79dfa6d7
permissions -rw-r--r--
switching to KDE icons
     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_ICON    80
    17 #define Z_TEXT   100
    18 
    19 class MapObj:public xmlObj {
    20 public:
    21     MapObj ();
    22     MapObj (QCanvas*);
    23     MapObj (MapObj*);
    24     virtual ~MapObj ();
    25     virtual void init ();
    26     virtual void copy (MapObj*);
    27 	virtual QCanvas* getCanvas();
    28     virtual int x();
    29     virtual int y();
    30 	virtual int width();
    31 	virtual int height();
    32 	virtual QPoint getAbsPos();
    33 	virtual QString getPos();					// Return position as string (x,y)
    34     virtual void move (double x,double y);      // move to absolute Position
    35     virtual void moveBy (double x,double y);    // move to relative Position
    36     virtual bool inBox(const QPoint&);			// Check if Point is within clickbox
    37     virtual QRect getBBox();					// returns bounding box
    38     virtual QRect addBBox(QRect,QRect);			// returns bbox which includes both boxes
    39     virtual QSize getSize();					// returns size of bounding box
    40     virtual bool isVisibleObj();
    41     virtual void setVisibility(bool);
    42     virtual void positionBBox()=0;       
    43 	virtual void calcBBoxSize()=0;
    44 protected:  
    45     QCanvas* canvas;
    46     QRect bbox;									// bounding box of MO itself
    47 	QRect clickBox;								// area where mouseclicks are found
    48     QPoint absPos;							    // Position on canvas
    49     bool visible;
    50 };
    51 
    52 #endif