mapobj.h
author insilmaril
Tue Jan 24 15:09:48 2006 +0000 (2006-01-24)
changeset 180 60e2297bab39
parent 129 9b9c7e8b9147
child 227 38ad83f1d4ce
permissions -rw-r--r--
Introduced basic export to Open Document format
     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 QString getPos();					// Return position as string (x,y)
    33     virtual void move (double x,double y);      // move to absolute Position
    34     virtual void moveBy (double x,double y);    // move to relative Position
    35     virtual bool inBox(const QPoint&);			// Check if Point is within clickbox
    36     virtual QRect getBBox();					// returns bounding box
    37     virtual QRect addBBox(QRect,QRect);			// returns bbox which includes both boxes
    38     virtual QSize getSize();					// returns size of bounding box
    39     virtual bool isVisibleObj();
    40     virtual void setVisibility(bool);
    41     virtual void positionBBox()=0;       
    42 	virtual void calcBBoxSize()=0;
    43 protected:  
    44     QCanvas* canvas;
    45     QRect bbox;									// bounding box of MO itself
    46 	QRect clickBox;								// area where mouseclicks are found
    47     QPoint absPos;							    // Position on canvas
    48     bool visible;
    49 };
    50 
    51 #endif