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