15 class BranchItem : public MapItem {
17 enum LayoutHint { AutoPositioning, FreePositioning };
19 BranchItem(TreeItem *parent = nullptr);
20 virtual ~BranchItem();
22 virtual void copy(BranchItem *item);
23 virtual BranchItem *parentBranch();
25 virtual void insertBranch(int pos, BranchItem *branch);
27 virtual QString saveToDir(const QString &tmpdir, const QString &prefix,
28 const QPointF &offset, QList<Link *> &tmpLinks);
30 virtual void updateVisibility();
32 virtual void setHeadingColor(
33 QColor color); //! Overloaded from TreeItem to update QGraphicsView
36 bool scrolled; // true if all children are scrolled and thus invisible
37 bool tmpUnscrolled; // can only be true (temporary) for a scrolled subtree
40 void updateTaskFlag();
41 void setTask(Task *t);
48 virtual void scroll();
49 virtual void unScroll();
50 virtual bool toggleScroll(); // scroll or unscroll
51 virtual bool isScrolled(); // returns scroll state
52 virtual bool hasScrolledParent(
53 BranchItem *start = NULL); // true, if any of the parents is scrolled
54 virtual bool tmpUnscroll(
55 BranchItem *start = NULL); // unscroll scrolled parents temporary e.g.
56 // during "find" process
57 virtual bool resetTmpUnscroll(); // scroll all tmp scrolled parents again
58 // e.g. when unselecting
59 virtual void sortChildren(bool inverse = false); //! Sort children
60 virtual void setChildrenLayout(BranchItem::LayoutHint layoutHint);
61 virtual BranchItem::LayoutHint getChildrenLayout();
64 bool includeImagesVer; //! include floatimages in bbox vertically
65 bool includeImagesHor; //! include floatimages in bbox horizontally
66 bool includeChildren; //! include children in frame
67 LayoutHint childrenLayout; //! should children be positioned freely?
70 void setIncludeImagesVer(bool);
71 bool getIncludeImagesVer();
72 void setIncludeImagesHor(bool);
73 bool getIncludeImagesHor();
74 QString getIncludeImageAttr();
75 BranchItem *getFramedParentBranch(BranchItem *start);
76 void setFrameIncludeChildren(bool);
77 bool getFrameIncludeChildren();
79 QColor getBackgroundColor(BranchItem *start, bool checkInnerFrame = true);
82 int lastSelectedBranchNum;
83 int lastSelectedBranchNumAlt;
87 setLastSelectedBranch(); //! Set myself as last selected in parent
89 setLastSelectedBranch(int i); //! Set last selected branch directly
91 getLastSelectedBranch(); //! Returns last selected branch usually
93 getLastSelectedBranchAlt(); //! Used to return last selected branch left of
97 TreeItem *findMapItem(
99 TreeItem *excludeTI); //! search map for branches or images. Ignore
100 //! excludeTI, where search is started
103 updateStyles(const bool &keepFrame =
104 false); //! update related fonts, parObjects, links, ...
105 virtual BranchObj *getBranchObj();
106 virtual BranchObj *createMapObj(
107 QGraphicsScene *scene); //! Create classic object in GraphicsView