treeitem.h
changeset 776 25e634a7e1dc
parent 773 340bc29da9a0
child 777 8acac4fade1b
     1.1 --- a/treeitem.h	Wed Jun 03 20:37:17 2009 +0000
     1.2 +++ b/treeitem.h	Mon Jun 08 11:36:56 2009 +0000
     1.3 @@ -6,21 +6,23 @@
     1.4  #include <QVariant>
     1.5  
     1.6  #include "flagrow.h"
     1.7 -#include "mapitem.h"
     1.8  #include "noteobj.h"
     1.9  #include "xmlobj.h"
    1.10  
    1.11  class LinkableMapObj;
    1.12  class BranchObj;
    1.13  class BranchItem;
    1.14 +class FloatImageObj;
    1.15 +class ImageItem;
    1.16  class VymModel;
    1.17  
    1.18 -class TreeItem:public MapItem
    1.19 +class TreeItem
    1.20  {
    1.21  public:
    1.22  	enum Type {Undefined,MapCenter,Branch,Image};
    1.23  	enum HideTmpMode {HideNone, HideExport};
    1.24  
    1.25 +    TreeItem();
    1.26      TreeItem(const QList<QVariant> &data, TreeItem *parent = 0);
    1.27      ~TreeItem();
    1.28  	void init();
    1.29 @@ -29,6 +31,11 @@
    1.30  	virtual void setModel (VymModel *m);
    1.31  	virtual VymModel* getModel();
    1.32  
    1.33 +
    1.34 +	/*! Return number of item, as it would be after it would have been appended.
    1.35 +	    This is used to notify view about layout changes before model is modified. */
    1.36 +	virtual int getRowNumAppend (TreeItem *child);
    1.37 +
    1.38      virtual void appendChild (TreeItem *child);
    1.39  	virtual void removeChild (int row);
    1.40  	virtual void removeChildBranches ();
    1.41 @@ -95,7 +102,8 @@
    1.42  	virtual void clearNote();
    1.43  	virtual QString getNote();
    1.44  	virtual bool hasEmptyNote();
    1.45 -	virtual void setNoteObj(const NoteObj &, bool updateNoteEditor=true);
    1.46 +	virtual void setNoteObj(const NoteObj &, bool updateNoteEditor=true); //FIXME-1 setNoteObj is called for every select or so???
    1.47 +
    1.48  	virtual NoteObj getNoteObj();			
    1.49  	virtual QString getNoteASCII(const QString &indent, const int &width); // returns note	(ASCII)
    1.50      virtual QString getNoteASCII();			// returns note	(ASCII)
    1.51 @@ -146,6 +154,8 @@
    1.52  	virtual void setLastSelectedBranch(int i);	//! Set last selected branch directly
    1.53  	virtual TreeItem* getLastSelectedBranch();
    1.54  
    1.55 +	virtual ImageItem* getImageNum(const int &n);
    1.56 +	virtual FloatImageObj* getImageObjNum(const int &n);
    1.57  protected:
    1.58  	bool hideExport;							//! Hide this item in export
    1.59  public: