mapobj.h
author insilmaril
Thu, 06 Jul 2006 15:39:54 +0000
branchqt4-port
changeset 10 e2a80d9b5858
parent 2 608f976aa7bb
permissions -rw-r--r--
disabled join lines/paragraphs in TextEditor
     1 #ifndef MAPOBJ_H
     2 #define MAPOBJ_H
     3 
     4 #include <q3canvas.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 (Q3Canvas*);
    24     MapObj (MapObj*);
    25     virtual ~MapObj ();
    26     virtual void init ();
    27     virtual void copy (MapObj*);
    28 	virtual Q3Canvas* 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     Q3Canvas* 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