linkablemapobj.h
branchqt4-port
changeset 13 9aadd0f58300
parent 0 7a96bd401351
child 20 9ad3d0391be1
     1.1 --- a/linkablemapobj.h	Sun Jan 30 12:58:47 2005 +0000
     1.2 +++ b/linkablemapobj.h	Tue Aug 15 11:42:10 2006 +0000
     1.3 @@ -5,6 +5,9 @@
     1.4  #include "noteobj.h"
     1.5  #include "headingobj.h"
     1.6  #include "flagrowobj.h"
     1.7 +//Added by qt3to4:
     1.8 +#include <Q3PointArray>
     1.9 +#include <Q3PtrList>
    1.10  
    1.11  #define MAX_DEPTH 999
    1.12  
    1.13 @@ -23,7 +26,7 @@
    1.14  	Q_OBJECT
    1.15  public:
    1.16      LinkableMapObj ();
    1.17 -    LinkableMapObj (QCanvas*);
    1.18 +    LinkableMapObj (Q3Canvas*);
    1.19      LinkableMapObj (LinkableMapObj*);
    1.20      ~LinkableMapObj ();
    1.21  	virtual void delLink();
    1.22 @@ -33,9 +36,22 @@
    1.23      virtual void setParObj (LinkableMapObj*);
    1.24      virtual void setParObjTmp (LinkableMapObj*,QPoint,int);	// Only for moving Obj around
    1.25  	virtual void unsetParObjTmp();						// reuse original ParObj
    1.26 +	virtual bool hasParObjTmp();
    1.27 +
    1.28 +	virtual void setUseRelPos (const bool&);
    1.29 +	virtual void setRelPos();				// set relPos to current parentPos
    1.30 +	virtual void setRelPos(const QPoint&);	
    1.31 +	virtual void setUseOrientation (const bool &);
    1.32 +
    1.33 +
    1.34 +	virtual int getTopPad();
    1.35 +	virtual int getLeftPad();
    1.36 +	virtual int getRightPad();
    1.37  	LinkStyle getDefLinkStyle();
    1.38      void setLinkStyle(LinkStyle);            
    1.39  	LinkStyle getLinkStyle();
    1.40 +	void setHideLinkUnselected(bool);
    1.41 +	bool getHideLinkUnselected();
    1.42  	void setLinkPos (LinkPos);
    1.43  	LinkPos getLinkPos ();
    1.44  
    1.45 @@ -51,6 +67,8 @@
    1.46  											// redraw link with given style
    1.47      LinkableMapObj* getChildObj();			// returns pointer to fromObj
    1.48      LinkableMapObj* getParObj();			// returns pointer to toObj
    1.49 +    virtual LinkableMapObj* findObjBySelect(QString s);	// find obj by selectstring
    1.50 +	virtual void setDockPos();				// sets childPos and parPos
    1.51      QPoint getChildPos();					// returns pos where childs dock
    1.52      QPoint getParPos();						// returns pos where parents dock
    1.53      QPoint getRelPos();						// get position relative to parent (or (0,0))
    1.54 @@ -75,9 +93,12 @@
    1.55      virtual void select();
    1.56      virtual void unselect();
    1.57  	virtual	QString getSelectString()=0;
    1.58 +	virtual QString saveToDir (const QString&,const QString&, const QPoint&)=0;// Save data to tempdir
    1.59  
    1.60  protected:
    1.61 -	void parabel(QPointArray &,double,double,double,double);	// Create Parabel connecting two points
    1.62 +	void parabel(Q3PointArray &,double,double,double,double);	// Create Parabel connecting two points
    1.63 +	QString getLinkAttr();
    1.64 +
    1.65      QPoint childPos;
    1.66      QPoint parPos;
    1.67  	bool link2ParPos;				// While moving around, sometimes link to parent
    1.68 @@ -90,24 +111,31 @@
    1.69      LinkableMapObj* childObj;
    1.70      LinkableMapObj* parObj;
    1.71      LinkableMapObj* parObjTmpBuf;	// temporary buffer the original parent
    1.72 -    int offset;                     // vertical offset of dockpos to pos
    1.73 +    int bottomlineY;                // vertical offset of dockpos to pos
    1.74  
    1.75  	int thickness_start;			// for StylePoly*	
    1.76 -    LinkStyle style;
    1.77 -	LinkPos linkpos;
    1.78 +    LinkStyle style;				// Current style
    1.79 +	LinkPos linkpos;				// Link at bottom of object or middle of height
    1.80      QColor linkcolor;               // Link color
    1.81 -    QCanvasLine* l;                 // line style
    1.82 -	QCanvasPolygon* p;				// poly styles
    1.83 +    Q3CanvasLine* l;                 // line style
    1.84 +	Q3CanvasPolygon* p;				// poly styles
    1.85      int arcsegs;                    // arc: number of segments
    1.86 -    QPtrList <QCanvasLine> segment; // a part of e.g. the parabel
    1.87 -	QPointArray pa0;				// For drawing of PolyParabel and PolyLine
    1.88 -	QPointArray pa1;				// For drawing of PolyParabel 
    1.89 -	QPointArray pa2;				// For drawing of PolyParabel	
    1.90 -    QCanvasLine* bottomline;        // on bottom of BBox
    1.91 +    Q3PtrList <Q3CanvasLine> segment; // a part of e.g. the parabel
    1.92 +	Q3PointArray pa0;				// For drawing of PolyParabel and PolyLine
    1.93 +	Q3PointArray pa1;				// For drawing of PolyParabel 
    1.94 +	Q3PointArray pa2;				// For drawing of PolyParabel	
    1.95 +    Q3CanvasLine* bottomline;        // on bottom of BBox
    1.96  	bool repositionRequest;			// 
    1.97  
    1.98  	bool selected;					// Used for marking the selection
    1.99 -	QCanvasRectangle* selbox;
   1.100 +	bool hideLinkUnselected;		// to hide links if unselected
   1.101 +	Q3CanvasRectangle* selbox;
   1.102  	FrameObj *frame;				// frame around object
   1.103 +	int topPad, botPad,
   1.104 +		leftPad, rightPad;          // padding within bbox
   1.105 +
   1.106 +	QPoint relPos;					// position relative to childPos of parent
   1.107 +	bool useRelPos;
   1.108 +	bool useOrientation;
   1.109  };
   1.110  #endif