1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/branchobj.h Sun Jan 30 12:59:07 2005 +0000
1.3 @@ -0,0 +1,113 @@
1.4 +#ifndef BRANCHOBJ_H
1.5 +#define BRANCHOBJ_H
1.6 +
1.7 +#include "floatimageobj.h"
1.8 +#include "linkablemapobj.h"
1.9 +#include "ornamentedobj.h"
1.10 +
1.11 +class BranchObjPtrList : public QPtrList<BranchObj>
1.12 +{
1.13 + virtual int compareItems (QPtrCollection::Item i, QPtrCollection::Item j);
1.14 +};
1.15 +
1.16 +/////////////////////////////////////////////////////////////////////////////
1.17 +class BranchObj:public OrnamentedObj {
1.18 +public:
1.19 + BranchObj ();
1.20 + BranchObj (QCanvas*);
1.21 + BranchObj (QCanvas*, LinkableMapObj* parent);
1.22 + ~BranchObj ();
1.23 + bool operator< ( const BranchObj & );
1.24 + bool operator== ( const BranchObj & );
1.25 + virtual void init ();
1.26 + virtual void copy (BranchObj*);
1.27 + void clear();
1.28 + virtual int getNum(); // return number of this in parent
1.29 + virtual int getNum(BranchObj*); // return number of this in parent
1.30 + virtual int getFloatImageNum(FloatImageObj*);
1.31 + virtual int countBranches();
1.32 + virtual int countFloatImages();
1.33 + virtual void setParObjTmp (LinkableMapObj*,QPoint,int);// Only for moving Obj around
1.34 + virtual void unsetParObjTmp(); // reuse original ParObj
1.35 +
1.36 + virtual void unScroll();
1.37 + virtual void toggleScroll(); // scroll or unscroll
1.38 + virtual bool isScrolled(); // returns scroll state
1.39 + virtual bool hasScrolledParent(BranchObj*); // true, if any of the parents is scrolled
1.40 + virtual void tmpUnscroll(); // unscroll scrolled parents temporary e.g. during "find" process
1.41 + virtual void resetTmpUnscroll(); // scroll all tmp scrolled parents again e.g. when unselecting
1.42 +
1.43 + virtual void setVisibility(bool,int); // set visibility
1.44 + virtual void setVisibility(bool); // set vis. for w
1.45 + virtual void setLinkColor(); // set the color of link
1.46 + virtual void setColor(QColor,bool); // set the color of heading
1.47 +
1.48 +
1.49 + BranchObj* first (); // set Iterator to first LMO
1.50 + BranchObj* next (); // find next LMO after given one
1.51 + BranchObj* getLastIterator(); // to interrupt and resume next iteration
1.52 + void setLastIterator (BranchObj*); // needed by next()
1.53 +
1.54 + virtual void move (double x,double y);
1.55 + virtual void move (QPoint);
1.56 + virtual void moveBy (double x,double y);
1.57 + virtual void moveBy (QPoint);
1.58 + virtual void positionBBox();
1.59 + virtual void calcBBoxSize();
1.60 + virtual LinkableMapObj* findMapObj(QPoint,LinkableMapObj*); // find MapObj
1.61 + virtual void setHeading (QString);
1.62 + virtual void setURL (QString);
1.63 + virtual QString getURL ();
1.64 + virtual void setVymLink (QString);
1.65 + virtual QString getVymLink ();
1.66 + virtual QString saveToDir (const QString&,const QString&, const QPoint&);// Save data recursivly to tempdir
1.67 + virtual LinkableMapObj* addFloatImage();
1.68 + virtual LinkableMapObj* addFloatImage(FloatImageObj*);
1.69 + virtual void removeFloatImage(FloatImageObj*);
1.70 + virtual FloatImageObj* getFirstFloatImage();
1.71 + virtual FloatImageObj* getLastFloatImage();
1.72 + virtual FloatImageObj* getFloatImageNum(const uint &);
1.73 +protected:
1.74 + virtual void savePosInAngle(); // write pos in angle for resorting
1.75 +public:
1.76 + virtual BranchObj* addBranch();
1.77 + virtual BranchObj* addBranch(BranchObj*); // makes deep copy of BranchObj
1.78 + virtual BranchObj* insertBranch(int);
1.79 + virtual BranchObj* insertBranch(BranchObj*,int);
1.80 + virtual void removeBranch(BranchObj*);
1.81 + virtual void setLastSelectedBranch(BranchObj*);
1.82 + virtual BranchObj* getLastSelectedBranch();
1.83 + virtual BranchObj* getFirstBranch();
1.84 + virtual BranchObj* getLastBranch();
1.85 + virtual BranchObj* getBranchNum(const uint &);
1.86 + virtual BranchObj* moveBranchUp(BranchObj*);
1.87 + virtual BranchObj* moveBranchDown(BranchObj*);
1.88 +
1.89 + virtual void alignRelativeTo(const QPoint );
1.90 + virtual void reposition();
1.91 +
1.92 + virtual QRect getTotalBBox(); // return BBox including childs
1.93 + virtual QRect getBBoxSizeWithChilds(); // return size of BBox including childs
1.94 + virtual void calcBBoxSizeWithChilds(); // calc size of BBox including childs recursivly
1.95 +
1.96 + virtual void select();
1.97 + virtual void unselect();
1.98 + virtual QString getSelectString();
1.99 +
1.100 +protected:
1.101 + static BranchObj* itLast; // iterator for first(), next()
1.102 + BranchObjPtrList branch; // all child branches
1.103 + QPtrList<FloatImageObj> floatimage; // child images
1.104 +public:
1.105 + float angle; // used in mainbranch to reorder mainbranches
1.106 +protected:
1.107 + int lastSelectedBranch; // for going deeper into tree
1.108 + bool scrolled; // true if all childs are scrolled and thus invisible
1.109 + bool tmpUnscrolled; // can only be true (temporary) for a scrolled subtree
1.110 + QString url; // url to external doc
1.111 + QString vymLink; // path to another map
1.112 +};
1.113 +
1.114 +
1.115 +#endif
1.116 +