4 #include "floatimageobj.h"
5 #include "linkablemapobj.h"
6 #include "ornamentedobj.h"
10 bool isAbove(BranchObj*,BranchObj*);
12 /*! \brief A branch visible in the map */
14 /////////////////////////////////////////////////////////////////////////////
15 class BranchObj:public OrnamentedObj {
17 /*! New branches will get use same color for heading as parent */
18 enum BranchModification {NewBranch, MovedBranch};
22 BranchObj (QGraphicsScene*);
23 BranchObj (QGraphicsScene*, LinkableMapObj* parent);
25 bool operator< ( const BranchObj & );
26 bool operator== ( const BranchObj & );
28 virtual void copy (BranchObj*);
31 virtual void setParObjTmp (LinkableMapObj*,QPointF,int);// Only for moving Obj around
32 virtual void unsetParObjTmp(); // reuse original ParObj
34 virtual void setVisibility(bool,int); // set visibility
35 virtual void setVisibility(bool); // set vis. for w
36 virtual void setLinkColor(); // set the color of link
37 virtual void setColorSubtree(QColor); // set the color of heading
39 virtual void updateContentSize();
40 virtual void positionContents();
41 virtual void move (double x,double y);
42 virtual void move (QPointF);
43 virtual void moveBy (double x,double y);
44 virtual void moveBy (QPointF);
45 virtual void positionBBox();
46 virtual void calcBBoxSize();
47 virtual void setDockPos();
49 virtual void updateData(); //! Update represantatio of heading, flags, etc.
51 virtual void addXLink (XLinkObj*);
52 virtual void removeXLinkRef (XLinkObj*);// Remove ref in list
53 virtual void deleteXLink (XLinkObj*); // remove references and delete XLinkObj
54 virtual void deleteXLinkAt (int); // remove references and delete XLinkObj
55 virtual XLinkObj* XLinkAt (int); // return reference of XLinkObj
56 virtual BranchObj* XLinkTargetAt (int);
58 void setIncludeImagesVer(bool);
59 bool getIncludeImagesVer();
60 void setIncludeImagesHor(bool);
61 bool getIncludeImagesHor();
62 QString getIncludeImageAttr();
64 virtual FloatImageObj* addFloatImage();
65 virtual FloatImageObj* 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 void setDefAttr (BranchModification); // set default attributes (font, size, ...)
75 virtual void removeBranchHere(BranchObj*); //FIXME-3
76 virtual void removeChildren();
77 virtual void removeBranch(BranchObj*);
78 virtual void removeBranchPtr (BranchObj*);
80 virtual void sortChildren();
81 virtual void alignRelativeTo(const QPointF, bool alignSelf=false );
82 virtual void reposition();
83 virtual void unsetAllRepositionRequests();
85 virtual QPolygonF shape(); //!< Returns arbitrary bounding polygon
86 virtual QRectF getTotalBBox(); // return BBox including children
87 virtual QRectF getBBoxSizeWithChildren(); // return size of BBox including children
88 virtual void calcBBoxSizeWithChildren(); // calc size of BBox including children recursivly
90 virtual QString getSelectString();
91 virtual void setAnimation(const AnimPoint &ap);
92 virtual bool animate();
95 QList<FloatImageObj*> floatimage;// child images
96 QList<XLinkObj*> xlink; // xlinks to other branches
101 float angle; // used in mainbranch to reorder mainbranches
103 bool includeImagesVer; // include floatimages in bbox vertically
104 bool includeImagesHor; // include floatimages in bbox horizontally