15 class TreeItem:public XMLObj
18 enum Type {Undefined,MapCenter,Branch,Image};
19 TreeItem(const QList<QVariant> &data, TreeItem *parent = 0);
21 QString saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset);
24 // General housekeeping
25 void setModel (VymModel *m);
28 void appendChild (TreeItem *child);
29 void removeChild (int row);
31 TreeItem *child(int row);
32 int childCount() const;
33 int childNumber() const;
34 int columnCount() const;
35 int branchCount() const;
36 int imageCount() const;
37 int xlinkCount() const;
44 /*! Return number of item in parent by type,
45 e.g. first branch has number 0 */
47 int num (TreeItem *item); //! Return number of item by type
50 QVariant data(int column) const;
51 void setHeading (const QString s);
57 void setNote(const QString s);
59 virtual void setNoteObj(const NoteObj &, bool updateNoteEditor=true);
60 virtual NoteObj getNoteObj();
61 virtual QString getNoteASCII(const QString &indent, const int &width); // returns note (ASCII)
62 virtual QString getNoteASCII(); // returns note (ASCII)
63 virtual QString getNoteOpenDoc(); // returns note (OpenDoc)
69 void setType (const Type t);
71 QString getTypeName ();
73 // Navigation and selection
74 TreeItem* getChildNum(const int &n);
75 BranchItem* getFirstBranch();
76 BranchItem* getLastBranch();
77 BranchItem* getBranchNum(const int &n);
78 BranchObj* getBranchObjNum(const int &n);
79 void setLastSelectedBranch();
80 TreeItem* getLastSelectedBranch();
83 // Relation to map objects in graphicsscene
84 LinkableMapObj* getLMO();
85 void setLMO (LinkableMapObj*);
90 QList<TreeItem*> childItems;
91 QList<QVariant> itemData;
98 int lastSelectedBranchNum;
100 bool hidden; //! Hidden in export if true