branchobj.h
branchqt4-port
changeset 15 699f28529079
parent 0 7a96bd401351
child 17 557239819c45
     1.1 --- a/branchobj.h	Sun Jan 30 12:58:47 2005 +0000
     1.2 +++ b/branchobj.h	Tue Aug 15 12:01:14 2006 +0000
     1.3 @@ -4,18 +4,24 @@
     1.4  #include "floatimageobj.h"
     1.5  #include "linkablemapobj.h"
     1.6  #include "ornamentedobj.h"
     1.7 +#include "xlinkobj.h"
     1.8 +//Added by qt3to4:
     1.9 +#include <Q3PtrList>
    1.10  
    1.11 -class BranchObjPtrList : public QPtrList<BranchObj>
    1.12 +class BranchObjPtrList : public Q3PtrList<BranchObj>
    1.13  {
    1.14 -	virtual int compareItems (QPtrCollection::Item i, QPtrCollection::Item j);
    1.15 +	virtual int compareItems (Q3PtrCollection::Item i, Q3PtrCollection::Item j);
    1.16  };
    1.17  
    1.18 +enum BranchModification {NewBranch, MovedBranch};
    1.19 +enum HideTmpMode {HideNone, HideExport};
    1.20 +
    1.21  /////////////////////////////////////////////////////////////////////////////
    1.22  class BranchObj:public OrnamentedObj {
    1.23  public:
    1.24      BranchObj ();
    1.25 -    BranchObj (QCanvas*);
    1.26 -    BranchObj (QCanvas*, LinkableMapObj* parent);
    1.27 +    BranchObj (Q3Canvas*);
    1.28 +    BranchObj (Q3Canvas*, LinkableMapObj* parent);
    1.29      ~BranchObj ();
    1.30  	bool operator< ( const BranchObj & );
    1.31  	bool operator== ( const BranchObj & );
    1.32 @@ -27,6 +33,7 @@
    1.33  	virtual int getFloatImageNum(FloatImageObj*);		
    1.34  	virtual int countBranches();		
    1.35  	virtual int countFloatImages();		
    1.36 +	virtual int countXLinks();		
    1.37      virtual void setParObjTmp (LinkableMapObj*,QPoint,int);// Only for moving Obj around
    1.38  	virtual void unsetParObjTmp();			// reuse original ParObj
    1.39  
    1.40 @@ -40,27 +47,40 @@
    1.41  	virtual void setVisibility(bool,int);	// set visibility
    1.42      virtual void setVisibility(bool);	    // set vis. for w
    1.43  	virtual void setLinkColor();			// set the color of link
    1.44 -	virtual void setColor(QColor,bool);		// set the color of heading
    1.45 -
    1.46 +	virtual void setColorChilds(QColor);			// set the color of heading
    1.47  
    1.48  	BranchObj* first ();				// set Iterator to first LMO
    1.49  	BranchObj* next ();					// find next LMO after given one
    1.50  	BranchObj* getLastIterator();		// to interrupt and resume next iteration
    1.51  	void setLastIterator (BranchObj*);	// needed by next() 
    1.52  
    1.53 +	virtual void positionContents();
    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 void setDockPos();
    1.61      virtual LinkableMapObj* findMapObj(QPoint,LinkableMapObj*);	// find MapObj 
    1.62      virtual void setHeading (QString);
    1.63 -    virtual void setURL (QString);
    1.64 -    virtual QString getURL ();
    1.65 -    virtual void setVymLink (QString);
    1.66 -    virtual QString getVymLink ();
    1.67 +
    1.68 +	virtual void setHideTmp (HideTmpMode);
    1.69 +	virtual bool hasHiddenExportParent (BranchObj*);
    1.70 +
    1.71  	virtual QString saveToDir (const QString&,const QString&, const QPoint&);// Save data recursivly to tempdir
    1.72 +	virtual void addXLink (XLinkObj*);
    1.73 +	virtual void removeXLinkRef (XLinkObj*);// Remove ref in list
    1.74 +	virtual void deleteXLink (XLinkObj*);	// remove references and delete XLinkObj 
    1.75 +	virtual void deleteXLinkAt (int);		// remove references and delete XLinkObj 
    1.76 +	virtual XLinkObj* XLinkAt (int);		// return reference of XLinkObj 
    1.77 +	virtual int countXLink ();
    1.78 +	virtual BranchObj* XLinkTargetAt (int);
    1.79 +	void setIncludeImagesVer(bool);
    1.80 +	bool getIncludeImagesVer();
    1.81 +	void setIncludeImagesHor(bool);
    1.82 +	bool getIncludeImagesHor();
    1.83 +	QString getIncludeImageAttr();
    1.84  	virtual LinkableMapObj* addFloatImage();
    1.85  	virtual LinkableMapObj* addFloatImage(FloatImageObj*);
    1.86  	virtual void removeFloatImage(FloatImageObj*);
    1.87 @@ -68,21 +88,29 @@
    1.88      virtual FloatImageObj* getLastFloatImage();
    1.89  	virtual FloatImageObj* getFloatImageNum(const uint &);
    1.90  protected:	
    1.91 -	virtual void savePosInAngle();			// write pos in angle for resorting			
    1.92 +	virtual void savePosInAngle();					// write pos in angle for resorting			
    1.93 +	virtual void setDefAttr (BranchModification);	// set default attributes (font, size, ...)
    1.94  public:	
    1.95      virtual BranchObj* addBranch();
    1.96      virtual BranchObj* addBranch(BranchObj*);		// makes deep copy of BranchObj
    1.97 +    virtual BranchObj* addBranchPtr(BranchObj*);	// just adds pointer
    1.98      virtual BranchObj* insertBranch(int);
    1.99      virtual BranchObj* insertBranch(BranchObj*,int);
   1.100 +    virtual BranchObj* insertBranchPtr (BranchObj*,int);
   1.101 +    virtual void removeBranchHere(BranchObj*);  
   1.102 +    virtual void removeChilds();  
   1.103      virtual void removeBranch(BranchObj*);  
   1.104 +    virtual void removeBranchPtr (BranchObj*);  
   1.105      virtual void setLastSelectedBranch(BranchObj*);
   1.106      virtual BranchObj* getLastSelectedBranch();
   1.107      virtual BranchObj* getFirstBranch();
   1.108      virtual BranchObj* getLastBranch();
   1.109  	virtual BranchObj* getBranchNum(const uint &);
   1.110 +    virtual bool canMoveBranchUp();
   1.111      virtual BranchObj* moveBranchUp(BranchObj*);
   1.112 +    virtual bool canMoveBranchDown();
   1.113      virtual BranchObj* moveBranchDown(BranchObj*);
   1.114 -
   1.115 +    virtual BranchObj* moveBranchTo (BranchObj*, int);
   1.116      virtual void alignRelativeTo(const QPoint );
   1.117  	virtual void reposition();
   1.118  
   1.119 @@ -97,15 +125,17 @@
   1.120  protected:
   1.121  	static BranchObj* itLast;		// iterator for first(), next()
   1.122      BranchObjPtrList branch;		// all child branches
   1.123 -	QPtrList<FloatImageObj> floatimage;	// child images
   1.124 +	Q3PtrList<FloatImageObj> floatimage;	// child images
   1.125 +	Q3PtrList<XLinkObj> xlink;		// xlinks to other branches
   1.126  public:	
   1.127  	float angle;					// used in mainbranch to reorder mainbranches
   1.128  protected:	
   1.129      int lastSelectedBranch;			// for going deeper into tree
   1.130  	bool scrolled;					// true if all childs are scrolled and thus invisible
   1.131  	bool tmpUnscrolled;				// can only be true (temporary) for a scrolled subtree
   1.132 -	QString url;					// url to external doc
   1.133 -	QString vymLink;				// path to another map
   1.134 +	bool includeImagesVer;			// include floatimages in bbox vertically
   1.135 +	bool includeImagesHor;			// include floatimages in bbox horizontally
   1.136 +
   1.137  };
   1.138  
   1.139