treeitem.h
changeset 746 ee6b0f3a4c2f
parent 745 2d4cc445a86a
child 749 9ff332964015
     1.1 --- a/treeitem.h	Mon Mar 23 09:06:51 2009 +0000
     1.2 +++ b/treeitem.h	Thu Mar 26 07:49:17 2009 +0000
     1.3 @@ -4,16 +4,25 @@
     1.4  #include <QList>
     1.5  #include <QVariant>
     1.6  
     1.7 +#include "noteobj.h"
     1.8 +#include "xmlobj.h"
     1.9 +
    1.10  class LinkableMapObj;
    1.11 +class VymModel;
    1.12  
    1.13 -class TreeItem
    1.14 +class TreeItem:public XMLObj
    1.15  {
    1.16  public:
    1.17  	enum Type {Undefined,MapCenter,Branch,Image};
    1.18      TreeItem(const QList<QVariant> &data, TreeItem *parent = 0);
    1.19      ~TreeItem();
    1.20 +	QString saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset);
    1.21 +
    1.22  
    1.23  	// General housekeeping
    1.24 +	void setModel (VymModel *m);
    1.25 +	VymModel* getModel();
    1.26 +
    1.27      void appendChild (TreeItem *child);
    1.28  	void removeChild (int row);
    1.29  
    1.30 @@ -33,8 +42,22 @@
    1.31      QVariant data(int column) const;
    1.32  	void setHeading (const QString s);
    1.33  	QString getHeading();
    1.34 +
    1.35 +protected:
    1.36 +	NoteObj note;
    1.37 +public:	
    1.38  	void setNote(const QString s);
    1.39  	QString getNote();
    1.40 +	virtual void setNoteObj(const NoteObj &, bool updateNoteEditor=true);
    1.41 +	virtual NoteObj getNoteObj();			
    1.42 +	virtual QString getNoteASCII(const QString &indent, const int &width); // returns note	(ASCII)
    1.43 +    virtual QString getNoteASCII();			// returns note	(ASCII)
    1.44 +    virtual QString getNoteOpenDoc();		// returns note	(OpenDoc)
    1.45 +
    1.46 +
    1.47 +protected:
    1.48 +	Type type;
    1.49 +public:	
    1.50  	void setType (const Type t);
    1.51  	Type getType ();
    1.52  	QString getTypeName ();
    1.53 @@ -53,16 +76,19 @@
    1.54  	void setLMO (LinkableMapObj*);
    1.55  
    1.56  protected:
    1.57 +	VymModel *model;
    1.58 +
    1.59      QList<TreeItem*> childItems;
    1.60      QList<QVariant> itemData;
    1.61      TreeItem *parentItem;
    1.62   
    1.63 -	Type type;
    1.64  	LinkableMapObj *lmo;
    1.65  
    1.66  	int branchOffset;
    1.67  	int branchCounter;
    1.68  	int lastSelectedBranchNum;
    1.69 +
    1.70 +	bool hidden;	//! Hidden in export if true
    1.71  };
    1.72  
    1.73  #endif