diff -r 83a3be747ad9 -r 8b9cfc26638c linkablemapobj.h --- a/linkablemapobj.h Wed Apr 25 16:02:54 2007 +0000 +++ b/linkablemapobj.h Wed Apr 25 16:02:54 2007 +0000 @@ -1,6 +1,7 @@ #ifndef LINKABLEMAPOBJ_H #define LINKABLEMAPOBJ_H +#include "animpoint.h" #include "noteobj.h" #include "headingobj.h" #include "flagrowobj.h" @@ -8,20 +9,43 @@ #define MAX_DEPTH 999 -enum LinkOrient {OrientUndef,OrientLeftOfCenter, OrientRightOfCenter}; -enum LinkStyle { - StyleUndef, - StyleLine, - StyleParabel, - StylePolyLine, - StylePolyParabel -}; -enum LinkPos {LinkMiddle,LinkBottom}; -enum LinkColorHint {DefaultColor,HeadingColor}; + +/*! \brief This class adds links to MapObj + +The links are connecting the branches (BranchObj) and images (FloatImageObj) in the map. +*/ class LinkableMapObj:public QObject, public MapObj { Q_OBJECT public: + /*! Orientation of an object dependd on the position relative to the parent */ + enum Orientation { + UndefinedOrientation, //!< Undefined + LeftOfCenter, //!< Object is left of center + RightOfCenter //!< Object is right of center + }; + + /*! Various drawing styles for links */ + enum Style { + UndefinedStyle, //!< Undefined + Line, //!< Straight line + Parabel, //!< Parabel + PolyLine, //!< Polygon (thick line) + PolyParabel //!< Thick parabel + }; + + /*! Vertical position of link in object */ + enum Position { + Middle, //!< Link is drawn in the middle of object + Bottom //!< Link is drawn at bottom of object + }; + + /*! Hint if link should use the default link color or the color of heading */ + enum ColorHint { + DefaultColor, //!< Link uses the default color + HeadingColor //!< Link uses the color of heading + }; + LinkableMapObj (); LinkableMapObj (QGraphicsScene*); LinkableMapObj (LinkableMapObj*); @@ -45,13 +69,13 @@ virtual qreal getTopPad(); virtual qreal getLeftPad(); virtual qreal getRightPad(); - LinkStyle getDefLinkStyle(); - void setLinkStyle(LinkStyle); - LinkStyle getLinkStyle(); + Style getDefLinkStyle(); + void setLinkStyle(Style); + Style getLinkStyle(); void setHideLinkUnselected(bool); bool getHideLinkUnselected(); - void setLinkPos (LinkPos); - LinkPos getLinkPos (); + void setLinkPos (Position); + Position getLinkPos (); virtual void setLinkColor(); // sets color according to colorhint, overloaded virtual void setLinkColor(QColor); @@ -67,7 +91,7 @@ virtual void setDockPos()=0; // sets childPos and parPos QPointF getChildPos(); // returns pos where childs dock QPointF getParPos(); // returns pos where parents dock - LinkOrient getOrientation(); // get orientation + Orientation getOrientation(); // get orientation virtual int getDepth(); // return depth virtual void setMapEditor(MapEditor*); // set MapEditor (needed in LMO::updateNoteFlag) virtual MapEditor* getMapEditor(); // get MapEditor (usually from parent); @@ -99,7 +123,7 @@ MapEditor* mapEditor; // for and toggleScroll(), get default styles // and mapEditor->updateActions() // and mapEditor->updateSelection() - LinkOrient orientation; + Orientation orientation; qreal linkwidth; // width of a link int depth; // depth: undef=-1 mapCenter=0 branch=1..n QRectF bboxTotal; // bounding box including childs @@ -110,8 +134,8 @@ qreal bottomlineY; // vertical offset of dockpos to pos int thickness_start; // for StylePoly* - LinkStyle style; // Current style - LinkPos linkpos; // Link at bottom of object or middle of height + Style style; // Current style + Position linkpos; // Link at bottom of object or middle of height QColor linkcolor; // Link color QPen pen; QGraphicsLineItem* l; // line style @@ -129,7 +153,8 @@ qreal topPad, botPad, leftPad, rightPad; // padding within bbox - QPointF relPos; // position relative to childPos of parent + QPointF relPos; // position relative to childPos of parent + //AnimPoint relPos; // position relative to childPos of parent bool useRelPos; bool useOrientation; };