branchitem.h
author insilmaril
Wed, 10 Feb 2010 13:48:42 +0000
changeset 822 c2ce9944148c
parent 796 cf634bbf9e04
child 847 43268373032d
permissions -rw-r--r--
More fixes and sorting lexically backwards
     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 	virtual BranchItem* parentBranch();
    19 
    20 	virtual void insertBranch (int pos,BranchItem *branch);
    21 
    22 	virtual QString saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset);
    23 
    24 	virtual void updateVisibility();
    25 
    26 	virtual void setHeadingColor (QColor color); //!Overloaded from TreeItem to update QGraphicsView
    27 
    28 protected:	
    29 	bool scrolled;			// true if all children are scrolled and thus invisible
    30 	bool tmpUnscrolled;		// can only be true (temporary) for a scrolled subtree
    31 public:
    32 	virtual void unScroll();				
    33 	virtual bool toggleScroll();			// scroll or unscroll
    34 	virtual bool isScrolled();				// returns scroll state
    35 	virtual bool hasScrolledParent(BranchItem*);	// true, if any of the parents is scrolled
    36 	virtual bool tmpUnscroll();				// unscroll scrolled parents temporary e.g. during "find" process
    37 	virtual bool resetTmpUnscroll();		// scroll all tmp scrolled parents again e.g. when unselecting
    38 	virtual void sortChildren(bool inverse=false);		//! Sort children 
    39 
    40 protected:
    41 	bool includeImagesVer;			//! include floatimages in bbox vertically
    42 	bool includeImagesHor;			//! include floatimages in bbox horizontally
    43 public:
    44 	void setIncludeImagesVer(bool);
    45 	bool getIncludeImagesVer();
    46 	void setIncludeImagesHor(bool);
    47 	bool getIncludeImagesHor();
    48 	QString getIncludeImageAttr();
    49 
    50 protected:
    51 	int lastSelectedBranchNum;
    52 	int lastSelectedBranchNumAlt;
    53 public:
    54 	virtual void setLastSelectedBranch();			//! Set myself as last selected in parent
    55 	virtual void setLastSelectedBranch(int i);		//! Set last selected branch directly
    56 	virtual BranchItem* getLastSelectedBranch();	//! Returns last selected branch usually
    57 	virtual BranchItem* getLastSelectedBranchAlt(); //! Used to return last selected branch left of a mapcenter
    58 
    59 public:
    60 	TreeItem* findMapItem (QPointF p,TreeItem* excludeTI);	//! search map for branches or images. Ignore excludeTI, where search is started 
    61 
    62 	virtual void updateStyles (const bool &keepFrame=false);		//! update related fonts, parObjects, links, ...
    63 	virtual BranchObj* getBranchObj();	
    64 	virtual BranchObj* createMapObj(QGraphicsScene *scene);	//! Create classic object in GraphicsView
    65 };
    66 
    67 #endif