13 class TreeItem:public XMLObj
16 enum Type {Undefined,MapCenter,Branch,Image};
17 TreeItem(const QList<QVariant> &data, TreeItem *parent = 0);
19 QString saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset);
22 // General housekeeping
23 void setModel (VymModel *m);
26 void appendChild (TreeItem *child);
27 void removeChild (int row);
29 TreeItem *child(int row);
30 int childCount() const;
31 int childNumber() const;
32 int columnCount() const;
33 int branchCount() const;
34 int imageCount() const;
35 int xlinkCount() const;
42 /*! Return number of item in parent by type,
43 e.g. first branch has number 0 */
45 int num (TreeItem *item); //! Return number of item by type
48 QVariant data(int column) const;
49 void setHeading (const QString s);
55 void setNote(const QString s);
57 virtual void setNoteObj(const NoteObj &, bool updateNoteEditor=true);
58 virtual NoteObj getNoteObj();
59 virtual QString getNoteASCII(const QString &indent, const int &width); // returns note (ASCII)
60 virtual QString getNoteASCII(); // returns note (ASCII)
61 virtual QString getNoteOpenDoc(); // returns note (OpenDoc)
67 void setType (const Type t);
69 QString getTypeName ();
71 // Navigation and selection
72 TreeItem* getChildNum(const int &n);
73 TreeItem* getFirstBranch();
74 TreeItem* getLastBranch();
75 TreeItem* getBranchNum(const int &n);
76 void setLastSelectedBranch();
77 TreeItem* getLastSelectedBranch();
80 // Relation to map objects in graphicsscene
81 LinkableMapObj* getLMO();
82 void setLMO (LinkableMapObj*);
87 QList<TreeItem*> childItems;
88 QList<QVariant> itemData;
95 int lastSelectedBranchNum;
97 bool hidden; //! Hidden in export if true