1.1 --- a/branchobj.h Sun Jan 30 12:58:47 2005 +0000
1.2 +++ b/branchobj.h Wed Feb 25 12:44:10 2009 +0000
1.3 @@ -4,18 +4,27 @@
1.4 #include "floatimageobj.h"
1.5 #include "linkablemapobj.h"
1.6 #include "ornamentedobj.h"
1.7 +#include "xlinkobj.h"
1.8
1.9 -class BranchObjPtrList : public QPtrList<BranchObj>
1.10 -{
1.11 - virtual int compareItems (QPtrCollection::Item i, QPtrCollection::Item j);
1.12 -};
1.13 +
1.14 +bool isAbove(BranchObj*,BranchObj*);
1.15 +
1.16 +/*! \brief A branch visible in the map */
1.17 +
1.18 +/*! If HideExport is used, this branch and its childs will be hidden in export */
1.19 +enum HideTmpMode {HideNone, HideExport};
1.20 +
1.21
1.22 /////////////////////////////////////////////////////////////////////////////
1.23 class BranchObj:public OrnamentedObj {
1.24 public:
1.25 + /*! New branches will get use same color for heading as parent */
1.26 + enum BranchModification {NewBranch, MovedBranch};
1.27 +
1.28 +
1.29 BranchObj ();
1.30 - BranchObj (QCanvas*);
1.31 - BranchObj (QCanvas*, LinkableMapObj* parent);
1.32 + BranchObj (QGraphicsScene*);
1.33 + BranchObj (QGraphicsScene*, LinkableMapObj* parent);
1.34 ~BranchObj ();
1.35 bool operator< ( const BranchObj & );
1.36 bool operator== ( const BranchObj & );
1.37 @@ -27,7 +36,8 @@
1.38 virtual int getFloatImageNum(FloatImageObj*);
1.39 virtual int countBranches();
1.40 virtual int countFloatImages();
1.41 - virtual void setParObjTmp (LinkableMapObj*,QPoint,int);// Only for moving Obj around
1.42 + virtual int countXLinks();
1.43 + virtual void setParObjTmp (LinkableMapObj*,QPointF,int);// Only for moving Obj around
1.44 virtual void unsetParObjTmp(); // reuse original ParObj
1.45
1.46 virtual void unScroll();
1.47 @@ -40,72 +50,105 @@
1.48 virtual void setVisibility(bool,int); // set visibility
1.49 virtual void setVisibility(bool); // set vis. for w
1.50 virtual void setLinkColor(); // set the color of link
1.51 - virtual void setColor(QColor,bool); // set the color of heading
1.52 -
1.53 + virtual void setColorSubtree(QColor); // set the color of heading
1.54
1.55 BranchObj* first (); // set Iterator to first LMO
1.56 BranchObj* next (); // find next LMO after given one
1.57 BranchObj* getLastIterator(); // to interrupt and resume next iteration
1.58 void setLastIterator (BranchObj*); // needed by next()
1.59
1.60 + virtual void positionContents();
1.61 virtual void move (double x,double y);
1.62 - virtual void move (QPoint);
1.63 + virtual void move (QPointF);
1.64 virtual void moveBy (double x,double y);
1.65 - virtual void moveBy (QPoint);
1.66 + virtual void moveBy (QPointF);
1.67 virtual void positionBBox();
1.68 virtual void calcBBoxSize();
1.69 - virtual LinkableMapObj* findMapObj(QPoint,LinkableMapObj*); // find MapObj
1.70 + virtual void setDockPos();
1.71 + virtual LinkableMapObj* findMapObj(QPointF,LinkableMapObj*); // find MapObj
1.72 + virtual LinkableMapObj* findID (QString sid); // find Obj by ID string
1.73 virtual void setHeading (QString);
1.74 - virtual void setURL (QString);
1.75 - virtual QString getURL ();
1.76 - virtual void setVymLink (QString);
1.77 - virtual QString getVymLink ();
1.78 - virtual QString saveToDir (const QString&,const QString&, const QPoint&);// Save data recursivly to tempdir
1.79 - virtual LinkableMapObj* addFloatImage();
1.80 - virtual LinkableMapObj* addFloatImage(FloatImageObj*);
1.81 +
1.82 + virtual void setHideTmp (HideTmpMode);
1.83 + virtual bool hasHiddenExportParent ();
1.84 +
1.85 + virtual QString saveToDir (const QString&,const QString&, const QPointF&);// Save data recursivly to tempdir
1.86 + virtual void addXLink (XLinkObj*);
1.87 + virtual void removeXLinkRef (XLinkObj*);// Remove ref in list
1.88 + virtual void deleteXLink (XLinkObj*); // remove references and delete XLinkObj
1.89 + virtual void deleteXLinkAt (int); // remove references and delete XLinkObj
1.90 + virtual XLinkObj* XLinkAt (int); // return reference of XLinkObj
1.91 + virtual int countXLink ();
1.92 + virtual BranchObj* XLinkTargetAt (int);
1.93 + void setIncludeImagesVer(bool);
1.94 + bool getIncludeImagesVer();
1.95 + void setIncludeImagesHor(bool);
1.96 + bool getIncludeImagesHor();
1.97 + QString getIncludeImageAttr();
1.98 + virtual FloatImageObj* addFloatImage();
1.99 + virtual FloatImageObj* addFloatImage(FloatImageObj*);
1.100 virtual void removeFloatImage(FloatImageObj*);
1.101 virtual FloatImageObj* getFirstFloatImage();
1.102 virtual FloatImageObj* getLastFloatImage();
1.103 virtual FloatImageObj* getFloatImageNum(const uint &);
1.104 protected:
1.105 - virtual void savePosInAngle(); // write pos in angle for resorting
1.106 + virtual void savePosInAngle(); // write pos in angle for resorting
1.107 + virtual void setDefAttr (BranchModification); // set default attributes (font, size, ...)
1.108 public:
1.109 virtual BranchObj* addBranch();
1.110 virtual BranchObj* addBranch(BranchObj*); // makes deep copy of BranchObj
1.111 + virtual BranchObj* addBranchPtr(BranchObj*); // just adds pointer
1.112 virtual BranchObj* insertBranch(int);
1.113 virtual BranchObj* insertBranch(BranchObj*,int);
1.114 + virtual BranchObj* insertBranchPtr (BranchObj*,int);
1.115 + virtual void removeBranchHere(BranchObj*);
1.116 + virtual void removeChilds();
1.117 virtual void removeBranch(BranchObj*);
1.118 + virtual void removeBranchPtr (BranchObj*);
1.119 virtual void setLastSelectedBranch(BranchObj*);
1.120 virtual BranchObj* getLastSelectedBranch();
1.121 virtual BranchObj* getFirstBranch();
1.122 virtual BranchObj* getLastBranch();
1.123 - virtual BranchObj* getBranchNum(const uint &);
1.124 + virtual BranchObj* getBranchNum(int);
1.125 + virtual bool canMoveBranchUp();
1.126 virtual BranchObj* moveBranchUp(BranchObj*);
1.127 + virtual bool canMoveBranchDown();
1.128 virtual BranchObj* moveBranchDown(BranchObj*);
1.129 + virtual void sortChildren();
1.130 + virtual BranchObj* linkTo (BranchObj*, int);
1.131 + virtual void alignRelativeTo(const QPointF ref, bool alignSelf=false );
1.132 + virtual void reposition();
1.133 + virtual void unsetAllRepositionRequests();
1.134
1.135 - virtual void alignRelativeTo(const QPoint );
1.136 - virtual void reposition();
1.137 -
1.138 - virtual QRect getTotalBBox(); // return BBox including childs
1.139 - virtual QRect getBBoxSizeWithChilds(); // return size of BBox including childs
1.140 + virtual QPolygonF shape(); //!< Returns arbitrary bounding polygon
1.141 + virtual QRectF getTotalBBox(); // return BBox including childs
1.142 + virtual QRectF getBBoxSizeWithChilds(); // return size of BBox including childs
1.143 virtual void calcBBoxSizeWithChilds(); // calc size of BBox including childs recursivly
1.144
1.145 virtual void select();
1.146 virtual void unselect();
1.147 virtual QString getSelectString();
1.148 + virtual void setAnimation(const AnimPoint &ap);
1.149 + virtual bool animate();
1.150
1.151 protected:
1.152 static BranchObj* itLast; // iterator for first(), next()
1.153 - BranchObjPtrList branch; // all child branches
1.154 - QPtrList<FloatImageObj> floatimage; // child images
1.155 + static BranchObj* itFirst; // first iterator for first(), next()
1.156 + QList<BranchObj*> branch; // all child branches
1.157 + QList<FloatImageObj*> floatimage;// child images
1.158 + QList<XLinkObj*> xlink; // xlinks to other branches
1.159 +
1.160 + AnimPoint anim;
1.161 +
1.162 public:
1.163 float angle; // used in mainbranch to reorder mainbranches
1.164 protected:
1.165 int lastSelectedBranch; // for going deeper into tree
1.166 bool scrolled; // true if all childs are scrolled and thus invisible
1.167 bool tmpUnscrolled; // can only be true (temporary) for a scrolled subtree
1.168 - QString url; // url to external doc
1.169 - QString vymLink; // path to another map
1.170 + bool includeImagesVer; // include floatimages in bbox vertically
1.171 + bool includeImagesHor; // include floatimages in bbox horizontally
1.172 +
1.173 };
1.174
1.175