branchitem.h
author insilmaril
Thu, 03 Sep 2009 08:52:00 +0000
changeset 790 133e2ed6b9c5
parent 787 c6bb4fdcc55f
child 795 6b0a5f4923d3
permissions -rw-r--r--
More work on xLinks
     1 #ifndef BRANCHITEM_H
     2 #define BRANCHITEM_H
     3 
     4 #include "mapitem.h"
     5 
     6 
     7 class QString;
     8 class QGraphicsScene;
     9 class BranchObj;
    10 class XLinkItem;
    11 
    12 class BranchItem:public MapItem
    13 {
    14 public:
    15     BranchItem(const QList<QVariant> &data, TreeItem *parent = 0);
    16     virtual ~BranchItem();
    17 	virtual void copy (BranchItem *item);
    18 
    19 	virtual void insertBranch (int pos,BranchItem *branch);
    20 
    21 	virtual QString saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset);
    22 
    23 	virtual void updateVisibility();
    24 
    25 	virtual void setHeadingColor (QColor color); //!Overloaded from TreeItem to update QGraphicsView
    26 
    27 protected:	
    28 	bool scrolled;			// true if all children are scrolled and thus invisible
    29 	bool tmpUnscrolled;		// can only be true (temporary) for a scrolled subtree
    30 public:
    31 	virtual void unScroll();				
    32 	virtual bool toggleScroll();			// scroll or unscroll
    33 	virtual bool isScrolled();				// returns scroll state
    34 	virtual bool hasScrolledParent(BranchItem*);	// true, if any of the parents is scrolled
    35 	virtual void tmpUnscroll();				// unscroll scrolled parents temporary e.g. during "find" process
    36 	virtual void resetTmpUnscroll();		// scroll all tmp scrolled parents again e.g. when unselecting
    37 
    38 
    39 protected:
    40 	bool includeImagesVer;			//! include floatimages in bbox vertically
    41 	bool includeImagesHor;			//! include floatimages in bbox horizontally
    42 public:
    43 	void setIncludeImagesVer(bool);
    44 	bool getIncludeImagesVer();
    45 	void setIncludeImagesHor(bool);
    46 	bool getIncludeImagesHor();
    47 	QString getIncludeImageAttr();
    48 
    49 protected:
    50 	int lastSelectedBranchNum;
    51 	int lastSelectedBranchNumAlt;
    52 public:
    53 	virtual void setLastSelectedBranch();			//! Set myself as last selected in parent
    54 	virtual void setLastSelectedBranch(int i);		//! Set last selected branch directly
    55 	virtual BranchItem* getLastSelectedBranch();	//! Returns last selected branch usually
    56 	virtual BranchItem* getLastSelectedBranchAlt(); //! Used to return last selected branch left of a mapcenter
    57 
    58 public:
    59 	TreeItem* findMapItem (QPointF p,TreeItem* excludeTI);	//! search map for branches or images. Ignore excludeTI, where search is started 
    60 	virtual TreeItem* findID (QString sid);	//! search map for object with ID string
    61 
    62 	virtual void updateStyles ();			//! update related fonts, parObjects, links, ...
    63 	virtual BranchObj* getBranchObj();	
    64 	virtual BranchObj* createMapObj(QGraphicsScene *scene);		//! Create classic object in GraphicsView
    65 };
    66 
    67 #endif