4 #include "floatimageobj.h"
5 #include "linkablemapobj.h"
6 #include "ornamentedobj.h"
8 class BranchObjPtrList : public QPtrList<BranchObj>
10 virtual int compareItems (QPtrCollection::Item i, QPtrCollection::Item j);
13 /////////////////////////////////////////////////////////////////////////////
14 class BranchObj:public OrnamentedObj {
18 BranchObj (QCanvas*, LinkableMapObj* parent);
20 bool operator< ( const BranchObj & );
21 bool operator== ( const BranchObj & );
23 virtual void copy (BranchObj*);
25 virtual int getNum(); // return number of this in parent
26 virtual int getNum(BranchObj*); // return number of this in parent
27 virtual int getFloatImageNum(FloatImageObj*);
28 virtual int countBranches();
29 virtual int countFloatImages();
30 virtual void setParObjTmp (LinkableMapObj*,QPoint,int);// Only for moving Obj around
31 virtual void unsetParObjTmp(); // reuse original ParObj
33 virtual void unScroll();
34 virtual void toggleScroll(); // scroll or unscroll
35 virtual bool isScrolled(); // returns scroll state
36 virtual bool hasScrolledParent(BranchObj*); // true, if any of the parents is scrolled
37 virtual void tmpUnscroll(); // unscroll scrolled parents temporary e.g. during "find" process
38 virtual void resetTmpUnscroll(); // scroll all tmp scrolled parents again e.g. when unselecting
40 virtual void setVisibility(bool,int); // set visibility
41 virtual void setVisibility(bool); // set vis. for w
42 virtual void setLinkColor(); // set the color of link
43 virtual void setColor(QColor,bool); // set the color of heading
46 BranchObj* first (); // set Iterator to first LMO
47 BranchObj* next (); // find next LMO after given one
48 BranchObj* getLastIterator(); // to interrupt and resume next iteration
49 void setLastIterator (BranchObj*); // needed by next()
51 virtual void move (double x,double y);
52 virtual void move (QPoint);
53 virtual void moveBy (double x,double y);
54 virtual void moveBy (QPoint);
55 virtual void positionBBox();
56 virtual void calcBBoxSize();
57 virtual LinkableMapObj* findMapObj(QPoint,LinkableMapObj*); // find MapObj
58 virtual void setHeading (QString);
59 virtual void setURL (QString);
60 virtual QString getURL ();
61 virtual void setVymLink (QString);
62 virtual QString getVymLink ();
63 virtual QString saveToDir (const QString&,const QString&, const QPoint&);// Save data recursivly to tempdir
64 virtual LinkableMapObj* addFloatImage();
65 virtual LinkableMapObj* addFloatImage(FloatImageObj*);
66 virtual void removeFloatImage(FloatImageObj*);
67 virtual FloatImageObj* getFirstFloatImage();
68 virtual FloatImageObj* getLastFloatImage();
69 virtual FloatImageObj* getFloatImageNum(const uint &);
71 virtual void savePosInAngle(); // write pos in angle for resorting
73 virtual BranchObj* addBranch();
74 virtual BranchObj* addBranch(BranchObj*); // makes deep copy of BranchObj
75 virtual BranchObj* insertBranch(int);
76 virtual BranchObj* insertBranch(BranchObj*,int);
77 virtual void removeBranch(BranchObj*);
78 virtual void setLastSelectedBranch(BranchObj*);
79 virtual BranchObj* getLastSelectedBranch();
80 virtual BranchObj* getFirstBranch();
81 virtual BranchObj* getLastBranch();
82 virtual BranchObj* getBranchNum(const uint &);
83 virtual BranchObj* moveBranchUp(BranchObj*);
84 virtual BranchObj* moveBranchDown(BranchObj*);
86 virtual void alignRelativeTo(const QPoint );
87 virtual void reposition();
89 virtual QRect getTotalBBox(); // return BBox including childs
90 virtual QRect getBBoxSizeWithChilds(); // return size of BBox including childs
91 virtual void calcBBoxSizeWithChilds(); // calc size of BBox including childs recursivly
93 virtual void select();
94 virtual void unselect();
95 virtual QString getSelectString();
98 static BranchObj* itLast; // iterator for first(), next()
99 BranchObjPtrList branch; // all child branches
100 QPtrList<FloatImageObj> floatimage; // child images
102 float angle; // used in mainbranch to reorder mainbranches
104 int lastSelectedBranch; // for going deeper into tree
105 bool scrolled; // true if all childs are scrolled and thus invisible
106 bool tmpUnscrolled; // can only be true (temporary) for a scrolled subtree
107 QString url; // url to external doc
108 QString vymLink; // path to another map