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);
27 QString saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset);
30 // General housekeeping
31 void setModel (VymModel *m);
34 void appendChild (TreeItem *child);
35 void removeChild (int row);
37 TreeItem *child(int row);
38 int childCount() const;
39 int childNumber() const;
40 int columnCount() const;
41 int branchCount() const;
42 int imageCount() const;
43 int xlinkCount() const;
50 /*! Return number of item in parent by type,
51 e.g. first branch has number 0 */
52 int childNum(); //! Return number of item in list of all children
53 int num(); //! Return number of item by type
54 int num (TreeItem *item); //! Return number of item by type
57 QVariant data(int column) const;
58 void setHeading (const QString s);
59 QString getHeading() const;
60 std::string getHeadingStd() const; //! convenience function used for debugging
65 void setNote(const QString s);
67 virtual void setNoteObj(const NoteObj &, bool updateNoteEditor=true);
68 virtual NoteObj getNoteObj();
69 virtual QString getNoteASCII(const QString &indent, const int &width); // returns note (ASCII)
70 virtual QString getNoteASCII(); // returns note (ASCII)
71 virtual QString getNoteOpenDoc(); // returns note (OpenDoc)
77 void setType (const Type t);
79 bool isBranchLikeType() const;
80 QString getTypeName ();
83 QString objID; //! id set during load/save currently used for xLinks
85 virtual void setID (const QString &s);
86 virtual QString getID ();
88 // Navigation and selection
89 TreeItem* getChildNum(const int &n);
90 BranchItem* getFirstBranch();
91 BranchItem* getLastBranch();
92 BranchItem* getBranchNum(const int &n);
93 BranchObj* getBranchObjNum(const int &n);
94 void setLastSelectedBranch(); //! Set myself as last selected in parent
95 void setLastSelectedBranch(int i); //! Set last selected branch directly
96 TreeItem* getLastSelectedBranch();
97 TreeItem* findBySelectString (const QString &);
99 virtual void setHideTmp (HideTmpMode);
100 virtual bool hasHiddenExportParent ();
101 virtual void setHideInExport(bool); // set export of object (and children)
102 virtual bool hideInExport();
103 virtual bool isHidden ();
106 // Relation to map objects in graphicsscene // FIXME-3 should be obsolete
107 LinkableMapObj* getLMO();
108 void setLMO (LinkableMapObj*);
113 QList<TreeItem*> childItems;
114 QList<QVariant> itemData;
115 TreeItem *parentItem;
121 int lastSelectedBranchNum;
123 bool hideExport;//! Hide this item in export
124 bool hidden; //! Hidden in export if true