xlinkobj.h
author insilmaril
Tue, 15 Aug 2006 11:42:10 +0000
branchqt4-port
changeset 13 9aadd0f58300
parent 2 608f976aa7bb
permissions -rw-r--r--
1.8.52 Toolbar layout is saved now.
     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 (Q3Canvas*);
    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 	Q3CanvasLine *line;
    41 	Q3CanvasPolygon *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