17 class TreeItem:public XMLObj
20 enum Type {Undefined,MapCenter,Branch,Image};
21 enum HideTmpMode {HideNone, HideExport};
23 TreeItem(const QList<QVariant> &data, TreeItem *parent = 0);
25 QString saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset);
28 // General housekeeping
29 void setModel (VymModel *m);
32 void appendChild (TreeItem *child);
33 void removeChild (int row);
35 TreeItem *child(int row);
36 int childCount() const;
37 int childNumber() const;
38 int columnCount() const;
39 int branchCount() const;
40 int imageCount() const;
41 int xlinkCount() const;
48 /*! Return number of item in parent by type,
49 e.g. first branch has number 0 */
51 int num (TreeItem *item); //! Return number of item by type
54 QVariant data(int column) const;
55 void setHeading (const QString s);
56 QString getHeading() const;
57 std::string headingStd() const; //! convenience function used for debugging
62 void setNote(const QString s);
64 virtual void setNoteObj(const NoteObj &, bool updateNoteEditor=true);
65 virtual NoteObj getNoteObj();
66 virtual QString getNoteASCII(const QString &indent, const int &width); // returns note (ASCII)
67 virtual QString getNoteASCII(); // returns note (ASCII)
68 virtual QString getNoteOpenDoc(); // returns note (OpenDoc)
74 void setType (const Type t);
76 bool isBranchLikeType() const;
77 QString getTypeName ();
80 QString objID; //! id set during load/save currently used for xLinks
82 virtual void setID (const QString &s);
83 virtual QString getID ();
85 // Navigation and selection
86 TreeItem* getChildNum(const int &n);
87 BranchItem* getFirstBranch();
88 BranchItem* getLastBranch();
89 BranchItem* getBranchNum(const int &n);
90 BranchObj* getBranchObjNum(const int &n);
91 void setLastSelectedBranch(); //! Set myself as last selected in parent
92 void setLastSelectedBranch(int i); //! Set last selected branch directly
93 TreeItem* getLastSelectedBranch();
94 TreeItem* findBySelectString (const QString &);
96 virtual void setHideTmp (HideTmpMode);
97 virtual bool hasHiddenExportParent ();
98 virtual void setHideInExport(bool); // set export of object (and children)
99 virtual bool hideInExport();
100 virtual bool isHidden ();
103 // Relation to map objects in graphicsscene // FIXME-3 should be obsolete
104 LinkableMapObj* getLMO();
105 void setLMO (LinkableMapObj*);
110 QList<TreeItem*> childItems;
111 QList<QVariant> itemData;
112 TreeItem *parentItem;
118 int lastSelectedBranchNum;
120 bool hideExport;//! Hide this item in export
121 bool hidden; //! Hidden in export if true