1.1 --- a/vymmodel.h Thu Apr 02 09:46:29 2009 +0000
1.2 +++ b/vymmodel.h Tue Apr 07 16:15:53 2009 +0000
1.3 @@ -13,6 +13,7 @@
1.4 #include "treemodel.h"
1.5
1.6 class BranchItem;
1.7 +class MapCenterItem;
1.8
1.9 class VymModel : public TreeModel {
1.10 Q_OBJECT
1.11 @@ -68,7 +69,7 @@
1.12 The structure of the map itself is returned as QString and passed back to Main,
1.13 where saveToDir is called initially
1.14 */
1.15 - QString saveToDir (const QString &tmpdir, const QString &prefix, bool writeflags, const QPointF &offset, LinkableMapObj *saveSel);
1.16 + QString saveToDir (const QString &tmpdir, const QString &prefix, bool writeflags, const QPointF &offset, TreeItem *saveSel);
1.17
1.18 /*! Save all data in tree*/
1.19 QString saveTreeToDir (const QString&,const QString&,int, const QPointF&);// Save data recursivly to tempdir
1.20 @@ -153,6 +154,7 @@
1.21 of undo/redo history
1.22 */
1.23 QString getObjectName(const LinkableMapObj*);
1.24 + QString getObjectName(const TreeItem*);
1.25
1.26 void redo(); //!< Redo last action
1.27 bool isRedoAvailable(); //!< True, if redo is available
1.28 @@ -180,22 +182,22 @@
1.29 const QString &redoSelection,
1.30 const QString &redoCommand,
1.31 const QString &comment,
1.32 - LinkableMapObj *saveSelection);
1.33 + TreeItem *saveSelection);
1.34 /*! Overloaded for convenience */
1.35 void saveStateChangingPart(
1.36 - LinkableMapObj *undoSelection,
1.37 - LinkableMapObj* redoSelection,
1.38 + TreeItem *undoSelection,
1.39 + TreeItem* redoSelection,
1.40 const QString &redoCommand,
1.41 const QString &comment);
1.42 /*! Overloaded for convenience */
1.43 void saveStateRemovingPart(
1.44 - LinkableMapObj *redoSelection,
1.45 + TreeItem *redoSelection,
1.46 const QString &comment);
1.47 /*! Overloaded for convenience */
1.48 void saveState(
1.49 - LinkableMapObj *undoSelection,
1.50 + TreeItem *undoSelection,
1.51 const QString &undoCommand,
1.52 - LinkableMapObj *redoSelection,
1.53 + TreeItem *redoSelection,
1.54 const QString &redoCommand,
1.55 const QString &comment);
1.56 /*! Overloaded for convenience */
1.57 @@ -244,7 +246,7 @@
1.58 BranchItem* findPrevious; // next object in find process
1.59 bool EOFind; // true, if search failed
1.60 public:
1.61 - BranchObj* findText(QString,bool); // Find object
1.62 + BranchItem* findText(QString,bool); // Find object
1.63 void findReset(); // Reset Search
1.64
1.65 void setURL(const QString &url);
1.66 @@ -281,19 +283,19 @@
1.67 void sortChildren(); //!< Sort children lexically
1.68
1.69 // The create methods are used to quickly parse a XML file
1.70 - void createMapCenter(); //!< Create and select MapCenter
1.71 - BranchItem* createBranch(); //!< Create and select Branch
1.72 - TreeItem* createImage(); //!< Create and select image
1.73 + MapCenterItem* createMapCenter(); //!< Create and select MapCenter
1.74 + BranchItem* createBranch(); //!< Create and select Branch
1.75 + TreeItem* createImage(); //!< Create and select image
1.76
1.77 /*! \brief Add new mapcenter
1.78
1.79 Disclaimer: Still experimental, not fully supported yet.
1.80 */
1.81 - MapCenterObj* addMapCenter();
1.82 + MapCenterItem* addMapCenter();
1.83 private:
1.84 - MapCenterObj* addMapCenter(QPointF absPos);
1.85 + MapCenterItem* addMapCenter(QPointF absPos);
1.86 public:
1.87 - MapCenterObj* removeMapCenter(MapCenterObj *mco);
1.88 + MapCenterItem* removeMapCenter(MapCenterItem *mci);
1.89
1.90 /*! \brief Add new branch
1.91
1.92 @@ -371,7 +373,7 @@
1.93 // Exports
1.94 ////////////////////////////////////////////
1.95 private:
1.96 - HideTmpMode hidemode; // true while exporting to hide some stuff
1.97 + TreeItem::HideTmpMode hidemode; // true while exporting to hide some stuff
1.98
1.99 public:
1.100 /*! Set or unset temporary hiding of objects during export */
1.101 @@ -412,17 +414,19 @@
1.102
1.103 QRectF getTotalBBox();
1.104 void reposition(); //!< Call reposition for all MCOs
1.105 - void setHideTmpMode (HideTmpMode mode);
1.106 + void setHideTmpMode (TreeItem::HideTmpMode mode);
1.107
1.108 QPolygonF shape(BranchObj *bo); //!< Returns arbitrary shape of subtree
1.109 void moveAway (LinkableMapObj *lmo);//!< Autolayout: Move all out of the way
1.110
1.111 //void ensureSelectionVisible(); //!< Show selection in all views
1.112
1.113 - void emitContentHasChanged (TreeItem *ti);
1.114 + void emitNoteHasChanged (TreeItem *ti);
1.115 + void emitDataHasChanged (TreeItem *ti);
1.116
1.117 signals:
1.118 - void contentHasChanged (QModelIndex ix);
1.119 + void noteHasChanged (QModelIndex ix);
1.120 + void dataHasChanged (QModelIndex ix); //FIXME-3 necessary? There is dataChanged in AbstractModel
1.121 void newChildObject(QModelIndex ix);
1.122
1.123 private:
1.124 @@ -569,8 +573,9 @@
1.125 public:
1.126 TreeItem::Type selectionType();
1.127 LinkableMapObj* getSelectedLMO();
1.128 - BranchObj* getSelectedBranch();
1.129 + BranchObj* getSelectedBranchObj(); // FIXME-2 replace by item...
1.130 BranchItem* getSelectedBranchItem();
1.131 + MapCenterItem* getSelectedMapCenterItem();
1.132 TreeItem* getSelectedItem();
1.133 QModelIndex getSelectedIndex();
1.134 FloatImageObj* getSelectedFloatImage();