1.1 --- a/treeitem.h Mon Apr 27 12:42:06 2009 +0000
1.2 +++ b/treeitem.h Tue Apr 28 09:51:48 2009 +0000
1.3 @@ -1,6 +1,7 @@
1.4 #ifndef TREEITEM_H
1.5 #define TREEITEM_H
1.6
1.7 +#include <QColor>
1.8 #include <QList>
1.9 #include <QVariant>
1.10
1.11 @@ -49,21 +50,27 @@
1.12
1.13 /*! Return number of item in parent by type,
1.14 e.g. first branch has number 0 */
1.15 - int childNum(); //! Return number of item in list of all children
1.16 - int num(); //! Return number of item by type
1.17 - int num (TreeItem *item); //! Return number of item by type
1.18 + virtual int childNum(); //! Return number of item in list of all children
1.19 + virtual int num(); //! Return number of item by type
1.20 + virtual int num (TreeItem *item); //! Return number of item by type
1.21
1.22 // Accessing data
1.23 - QVariant data(int column) const;
1.24 - void setHeading (const QString s);
1.25 - QString getHeading() const;
1.26 - std::string getHeadingStd() const; //! convenience function used for debugging
1.27 + virtual QVariant data(int column) const;
1.28 +
1.29 +protected:
1.30 + QColor headingColor;
1.31 +public:
1.32 + virtual void setHeading (const QString s);
1.33 + virtual QString getHeading() const;
1.34 + virtual std::string getHeadingStd() const; //! convenience function used for debugging
1.35 + virtual void setHeadingColor(QColor color); //! Set color of heading. In BranchItem overloaded to update QGraphicsView
1.36 + virtual QColor getHeadingColor(); //! Returns color of heading
1.37
1.38 protected:
1.39 NoteObj note;
1.40 public:
1.41 - void setNote(const QString s);
1.42 - QString getNote();
1.43 + virtual void setNote(const QString s);
1.44 + virtual QString getNote();
1.45 virtual void setNoteObj(const NoteObj &, bool updateNoteEditor=true);
1.46 virtual NoteObj getNoteObj();
1.47 virtual QString getNoteASCII(const QString &indent, const int &width); // returns note (ASCII)
1.48 @@ -74,10 +81,10 @@
1.49 protected:
1.50 Type type;
1.51 public:
1.52 - void setType (const Type t);
1.53 - Type getType ();
1.54 - bool isBranchLikeType() const;
1.55 - QString getTypeName ();
1.56 + virtual void setType (const Type t);
1.57 + virtual Type getType ();
1.58 + virtual bool isBranchLikeType() const;
1.59 + virtual QString getTypeName ();
1.60
1.61 protected:
1.62 QString objID; //! id set during load/save currently used for xLinks
1.63 @@ -86,15 +93,15 @@
1.64 virtual QString getID ();
1.65
1.66 // Navigation and selection
1.67 - TreeItem* getChildNum(const int &n);
1.68 - BranchItem* getFirstBranch();
1.69 - BranchItem* getLastBranch();
1.70 - BranchItem* getBranchNum(const int &n);
1.71 - BranchObj* getBranchObjNum(const int &n);
1.72 - void setLastSelectedBranch(); //! Set myself as last selected in parent
1.73 - void setLastSelectedBranch(int i); //! Set last selected branch directly
1.74 - TreeItem* getLastSelectedBranch();
1.75 - TreeItem* findBySelectString (const QString &);
1.76 + virtual TreeItem* getChildNum(const int &n);
1.77 + virtual BranchItem* getFirstBranch();
1.78 + virtual BranchItem* getLastBranch();
1.79 + virtual BranchItem* getBranchNum(const int &n);
1.80 + virtual BranchObj* getBranchObjNum(const int &n);
1.81 + virtual void setLastSelectedBranch(); //! Set myself as last selected in parent
1.82 + virtual void setLastSelectedBranch(int i); //! Set last selected branch directly
1.83 + virtual TreeItem* getLastSelectedBranch();
1.84 + virtual TreeItem* findBySelectString (const QString &);
1.85
1.86 virtual void setHideTmp (HideTmpMode);
1.87 virtual bool hasHiddenExportParent ();
1.88 @@ -103,9 +110,9 @@
1.89 virtual bool isHidden ();
1.90
1.91
1.92 - // Relation to map objects in graphicsscene // FIXME-3 should be obsolete
1.93 - LinkableMapObj* getLMO();
1.94 - void setLMO (LinkableMapObj*);
1.95 + // Relation to map objects in graphicsscene // FIXME-4 should be obsolete
1.96 + virtual LinkableMapObj* getLMO();
1.97 + virtual void setLMO (LinkableMapObj*);
1.98
1.99 protected:
1.100 VymModel *model;