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