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