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