diff -r d922fb6ea482 -r 6b0a5f4923d3 xlinkitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xlinkitem.h Thu Sep 17 09:41:09 2009 +0000 @@ -0,0 +1,48 @@ +#ifndef XLINKITEM_H +#define XLINKITEM_H + +class BranchItem; +class XLinkObj; +class QGraphicsScene; + +#include "mapitem.h" + +/*! \brief xlinks are used to draw arbitrary connections between branches (BranchObj) in the map. */ + +///////////////////////////////////////////////////////////////////////////// +class XLinkItem:public MapItem { +public: + enum XLinkState {undefinedXLink,initXLink,activeXLink,deleteXLink}; + + XLinkItem (const QList &data, TreeItem *parent=NULL); + virtual ~XLinkItem (); + virtual void init (); + void setBegin (BranchItem*); + BranchItem* getBegin(); + void setEnd (BranchItem*); + void setEnd (QPointF); + BranchItem* getEnd(); + void setColor(QColor); + QColor getColor(); + void setWidth (int); + int getWidth (); + bool activate (); //! Creates a 2nd XLink (without a XLinkObj attached) + bool isBegin(); //! true, if this is master xLink, which may have an XLinkObj attached + void updateXLink(); + virtual void updateVisibility(); // FIXME-3 not really needed atm... + BranchItem* getPartnerBranch (); + XLinkItem *getPartnerXLink(); //! Partner XLink + QString saveToDir (); + virtual XLinkObj* createMapObj(QGraphicsScene *scene); + +private: + XLinkState xLinkState; // init during drawing or active + QColor color; + int width; + BranchItem *beginBranch; + BranchItem *endBranch; + XLinkItem *partnerXLink; + bool isBeginXLink; +}; + +#endif