4 #include "floatimageobj.h"
5 #include "linkablemapobj.h"
6 #include "ornamentedobj.h"
9 class BranchObjPtrList : public QPtrList<BranchObj>
11 virtual int compareItems (QPtrCollection::Item i, QPtrCollection::Item j);
14 /////////////////////////////////////////////////////////////////////////////
15 class BranchObj:public OrnamentedObj {
19 BranchObj (QCanvas*, LinkableMapObj* parent);
21 bool operator< ( const BranchObj & );
22 bool operator== ( const BranchObj & );
24 virtual void copy (BranchObj*);
26 virtual int getNum(); // return number of this in parent
27 virtual int getNum(BranchObj*); // return number of this in parent
28 virtual int getFloatImageNum(FloatImageObj*);
29 virtual int countBranches();
30 virtual int countFloatImages();
31 virtual int countXLinks();
32 virtual void setParObjTmp (LinkableMapObj*,QPoint,int);// Only for moving Obj around
33 virtual void unsetParObjTmp(); // reuse original ParObj
35 virtual void unScroll();
36 virtual void toggleScroll(); // scroll or unscroll
37 virtual bool isScrolled(); // returns scroll state
38 virtual bool hasScrolledParent(BranchObj*); // true, if any of the parents is scrolled
39 virtual void tmpUnscroll(); // unscroll scrolled parents temporary e.g. during "find" process
40 virtual void resetTmpUnscroll(); // scroll all tmp scrolled parents again e.g. when unselecting
42 virtual void setVisibility(bool,int); // set visibility
43 virtual void setVisibility(bool); // set vis. for w
44 virtual void setLinkColor(); // set the color of link
45 virtual void setColor(QColor,bool); // set the color of heading
46 virtual QColor getColor(); // get color of heading
49 BranchObj* first (); // set Iterator to first LMO
50 BranchObj* next (); // find next LMO after given one
51 BranchObj* getLastIterator(); // to interrupt and resume next iteration
52 void setLastIterator (BranchObj*); // needed by next()
54 virtual void move (double x,double y);
55 virtual void move (QPoint);
56 virtual void moveBy (double x,double y);
57 virtual void moveBy (QPoint);
58 virtual void positionBBox();
59 virtual void calcBBoxSize();
60 virtual LinkableMapObj* findMapObj(QPoint,LinkableMapObj*); // find MapObj
61 virtual int getDefHeadingSize();
62 virtual void setHeading (QString);
63 virtual void setURL (QString);
64 virtual QString getURL ();
65 virtual void setVymLink (QString);
66 virtual QString getVymLink ();
67 virtual QString saveToDir (const QString&,const QString&, const QPoint&);// Save data recursivly to tempdir
68 virtual void addXLink (XLinkObj*);
69 virtual void removeXLinkRef (XLinkObj*); // Remove ref in list
70 virtual void deleteXLink (XLinkObj*); // remove references and delete XLinkObj
71 virtual void deleteXLinkAt (int); // remove references and delete XLinkObj
72 virtual XLinkObj* XLinkAt (int); // return reference of XLinkObj
73 virtual int countXLink ();
74 virtual BranchObj* XLinkTargetAt (int);
75 virtual LinkableMapObj* addFloatImage();
76 virtual LinkableMapObj* addFloatImage(FloatImageObj*);
77 virtual void removeFloatImage(FloatImageObj*);
78 virtual FloatImageObj* getFirstFloatImage();
79 virtual FloatImageObj* getLastFloatImage();
80 virtual FloatImageObj* getFloatImageNum(const uint &);
82 virtual void savePosInAngle(); // write pos in angle for resorting
84 virtual BranchObj* addBranch();
85 virtual BranchObj* addBranch(BranchObj*); // makes deep copy of BranchObj
86 virtual BranchObj* addBranchPtr(BranchObj*); // just adds pointer
87 virtual BranchObj* insertBranch(int);
88 virtual BranchObj* insertBranch(BranchObj*,int);
89 virtual BranchObj* insertBranchPtr (BranchObj*,int);
90 virtual void removeBranchHere(BranchObj*);
91 virtual void removeChilds();
92 virtual void removeBranch(BranchObj*);
93 virtual void removeBranchPtr (BranchObj*);
94 virtual void setLastSelectedBranch(BranchObj*);
95 virtual BranchObj* getLastSelectedBranch();
96 virtual BranchObj* getFirstBranch();
97 virtual BranchObj* getLastBranch();
98 virtual BranchObj* getBranchNum(const uint &);
99 virtual BranchObj* moveBranchUp(BranchObj*);
100 virtual BranchObj* moveBranchDown(BranchObj*);
101 virtual BranchObj* moveBranchTo (BranchObj*, int);
102 virtual void alignRelativeTo(const QPoint );
103 virtual void reposition();
105 virtual QRect getTotalBBox(); // return BBox including childs
106 virtual QRect getBBoxSizeWithChilds(); // return size of BBox including childs
107 virtual void calcBBoxSizeWithChilds(); // calc size of BBox including childs recursivly
109 virtual void select();
110 virtual void unselect();
111 virtual QString getSelectString();
114 static BranchObj* itLast; // iterator for first(), next()
115 BranchObjPtrList branch; // all child branches
116 QPtrList<FloatImageObj> floatimage; // child images
117 QPtrList<XLinkObj> xlink; // xlinks to other branches
119 float angle; // used in mainbranch to reorder mainbranches
121 int lastSelectedBranch; // for going deeper into tree
122 bool scrolled; // true if all childs are scrolled and thus invisible
123 bool tmpUnscrolled; // can only be true (temporary) for a scrolled subtree
124 QString url; // url to external doc
125 QString vymLink; // path to another map