linkobj.h
author insilmaril
Sat, 19 Feb 2005 17:14:33 +0000
changeset 90 10f3d35dcbad
parent 89 9db3eaa21237
child 94 6783e13bb05d
permissions -rw-r--r--
moved translation files to lang, basic link functionality
     1 #ifndef LINKOBJ_H
     2 #define LINKOBJ_H
     3 
     4 #include "linkablemapobj.h"
     5 
     6 enum LinkState {undefinedLink,initLink,activeLink,deleteLink};
     7 
     8 /////////////////////////////////////////////////////////////////////////////
     9 class LinkObj:public MapObj {
    10 public:
    11     LinkObj ();
    12     LinkObj (QCanvas*);
    13     ~LinkObj ();
    14     virtual void init ();
    15     virtual void copy (LinkObj*);
    16 	void setBegin (BranchObj*);
    17 	void setEnd   (BranchObj*);
    18 	void setEnd   (QPoint);
    19 	bool activate ();			// Sets pointers in branchObjects
    20 	void deactivate();			// removes those pointers
    21 	bool isUsed();				// true, if at least on branch uses it
    22 	void updateLink();
    23 	BranchObj* otherBranch (BranchObj*);
    24 	void positionBBox();
    25 	void calcBBoxSize();
    26 	void setVisibility (bool);
    27 
    28 private:
    29 	QCanvasLine *line;
    30 	BranchObj *beginBranch;
    31 	BranchObj *endBranch;
    32 	LinkState linkState;	// init during drawing or active
    33 	QPoint beginPos;
    34 	QPoint   endPos;
    35 };
    36 
    37 #endif