diff -r c6908bc17d78 -r 04039e47ac74 treeitem.h --- a/treeitem.h Mon Apr 27 12:42:06 2009 +0000 +++ b/treeitem.h Tue Apr 28 09:51:48 2009 +0000 @@ -1,6 +1,7 @@ #ifndef TREEITEM_H #define TREEITEM_H +#include #include #include @@ -49,21 +50,27 @@ /*! Return number of item in parent by type, e.g. first branch has number 0 */ - int childNum(); //! Return number of item in list of all children - int num(); //! Return number of item by type - int num (TreeItem *item); //! Return number of item by type + virtual int childNum(); //! Return number of item in list of all children + virtual int num(); //! Return number of item by type + virtual int num (TreeItem *item); //! Return number of item by type // Accessing data - QVariant data(int column) const; - void setHeading (const QString s); - QString getHeading() const; - std::string getHeadingStd() const; //! convenience function used for debugging + virtual QVariant data(int column) const; + +protected: + QColor headingColor; +public: + virtual void setHeading (const QString s); + virtual QString getHeading() const; + virtual std::string getHeadingStd() const; //! convenience function used for debugging + virtual void setHeadingColor(QColor color); //! Set color of heading. In BranchItem overloaded to update QGraphicsView + virtual QColor getHeadingColor(); //! Returns color of heading protected: NoteObj note; public: - void setNote(const QString s); - QString getNote(); + virtual void setNote(const QString s); + virtual QString getNote(); virtual void setNoteObj(const NoteObj &, bool updateNoteEditor=true); virtual NoteObj getNoteObj(); virtual QString getNoteASCII(const QString &indent, const int &width); // returns note (ASCII) @@ -74,10 +81,10 @@ protected: Type type; public: - void setType (const Type t); - Type getType (); - bool isBranchLikeType() const; - QString getTypeName (); + virtual void setType (const Type t); + virtual Type getType (); + virtual bool isBranchLikeType() const; + virtual QString getTypeName (); protected: QString objID; //! id set during load/save currently used for xLinks @@ -86,15 +93,15 @@ virtual QString getID (); // Navigation and selection - TreeItem* getChildNum(const int &n); - BranchItem* getFirstBranch(); - BranchItem* getLastBranch(); - BranchItem* getBranchNum(const int &n); - BranchObj* getBranchObjNum(const int &n); - void setLastSelectedBranch(); //! Set myself as last selected in parent - void setLastSelectedBranch(int i); //! Set last selected branch directly - TreeItem* getLastSelectedBranch(); - TreeItem* findBySelectString (const QString &); + virtual TreeItem* getChildNum(const int &n); + virtual BranchItem* getFirstBranch(); + virtual BranchItem* getLastBranch(); + virtual BranchItem* getBranchNum(const int &n); + virtual BranchObj* getBranchObjNum(const int &n); + virtual void setLastSelectedBranch(); //! Set myself as last selected in parent + virtual void setLastSelectedBranch(int i); //! Set last selected branch directly + virtual TreeItem* getLastSelectedBranch(); + virtual TreeItem* findBySelectString (const QString &); virtual void setHideTmp (HideTmpMode); virtual bool hasHiddenExportParent (); @@ -103,9 +110,9 @@ virtual bool isHidden (); - // Relation to map objects in graphicsscene // FIXME-3 should be obsolete - LinkableMapObj* getLMO(); - void setLMO (LinkableMapObj*); + // Relation to map objects in graphicsscene // FIXME-4 should be obsolete + virtual LinkableMapObj* getLMO(); + virtual void setLMO (LinkableMapObj*); protected: VymModel *model;