xlinkobj.h
author insilmaril
Thu Sep 14 11:38:17 2006 +0000 (2006-09-14)
changeset 384 73bfe41502d9
parent 299 7ca34d0e299d
child 408 c2a05fa925a1
permissions -rw-r--r--
1.8.57 - more changes in history window, Note Editor is QT4 now
insilmaril@95
     1
#ifndef XLINKOBJ_H
insilmaril@95
     2
#define XLINKOBJ_H
insilmaril@95
     3
insilmaril@95
     4
#include "linkablemapobj.h"
insilmaril@95
     5
insilmaril@95
     6
enum XLinkState {undefinedXLink,initXLink,activeXLink,deleteXLink};
insilmaril@95
     7
insilmaril@95
     8
/////////////////////////////////////////////////////////////////////////////
insilmaril@95
     9
class XLinkObj:public MapObj {
insilmaril@95
    10
public:
insilmaril@95
    11
    XLinkObj ();
insilmaril@366
    12
    XLinkObj (Q3Canvas*);
insilmaril@95
    13
    ~XLinkObj ();
insilmaril@95
    14
    virtual void init ();
insilmaril@95
    15
    virtual void copy (XLinkObj*);
insilmaril@95
    16
	void setBegin (BranchObj*);
insilmaril@299
    17
	BranchObj* getBegin();
insilmaril@95
    18
	void setEnd   (BranchObj*);
insilmaril@95
    19
	void setEnd   (QPoint);
insilmaril@299
    20
	BranchObj* getEnd();
insilmaril@95
    21
	void setColor(QColor);
insilmaril@97
    22
	QColor getColor();
insilmaril@97
    23
	void setWidth (int);
insilmaril@97
    24
	int getWidth ();
insilmaril@95
    25
	bool activate ();			// Sets pointers in branchObjects
insilmaril@95
    26
	void deactivate();			// removes those pointers
insilmaril@95
    27
	bool isUsed();				// true, if at least on branch uses it
insilmaril@95
    28
	void updateXLink();
insilmaril@95
    29
	BranchObj* otherBranch (BranchObj*);
insilmaril@95
    30
	void positionBBox();
insilmaril@95
    31
	void calcBBoxSize();
insilmaril@95
    32
	void setVisibility (bool);
insilmaril@95
    33
	void setVisibility ();
insilmaril@95
    34
	QString saveToDir ();
insilmaril@95
    35
insilmaril@95
    36
private:
insilmaril@95
    37
	static int arrowSize;
insilmaril@97
    38
	QColor color;
insilmaril@97
    39
	int width;
insilmaril@366
    40
	Q3CanvasLine *line;
insilmaril@366
    41
	Q3CanvasPolygon *poly;
insilmaril@95
    42
	BranchObj *beginBranch;
insilmaril@95
    43
	BranchObj *endBranch;
insilmaril@95
    44
	BranchObj *visBranch;	// the "visible" part of a partially scrolled link
insilmaril@95
    45
	XLinkState xLinkState;	// init during drawing or active
insilmaril@95
    46
	QPoint beginPos;
insilmaril@95
    47
	QPoint   endPos;
insilmaril@95
    48
};
insilmaril@95
    49
insilmaril@95
    50
#endif