diff -r 4004e795b1ad -r 65c5a0c28d20 vymmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vymmodel.h Tue Jan 15 10:54:41 2008 +0000 @@ -0,0 +1,67 @@ +#ifndef VYMMODEL_H +#define VYMMODEL_H + +#include + +#include "mapcenterobj.h" +#include "mapeditor.h" + + +/*! \brief This will later be divided into Model/View +*/ + +class VymModel{ +public: + VymModel(); + ~VymModel (); + void clear(); + void init(); + void setMapEditor(MapEditor *me); // FIXME should not be necessary in Model/View + MapEditor* getMapEditor(); + void setVersion(const QString &); + void setAuthor (const QString &); + QString getAuthor (); + void setComment (const QString &); + QString getComment (); + QString getDate(); + void setScene(QGraphicsScene *s); + QGraphicsScene *getScene(); + MapCenterObj* addMapCenter(); + MapCenterObj* removeMapCenter(MapCenterObj *mco); + LinkableMapObj* getSelection(); + BranchObj* getSelectedBranch(); + bool select (const QString &s); + QString getSelectString (LinkableMapObj *lmo); + /* + void move (double,double); // FIXME needed at all? + void moveBy (double,double); // FIXME needed at all? + void moveAll (double,double); // FIXME needed at all? + void moveAllBy (double,double); // FIXME needed at all? + */ + BranchObj* first(); // FIXME replaced by ModelIndex later + BranchObj* next(BranchObj *bo); // FIXME replaced by ModelIndex later + +/* + void updateLink(); +*/ + void updateRelPositions(); + + QRectF getTotalBBox(); + void reposition(); //!< Call reposition for all MCOs + void setHideTmp (HideTmpMode mode); + LinkableMapObj* findMapObj(QPointF,LinkableMapObj*); // find MapObj + LinkableMapObj* findObjBySelect (const QString &s); // find MapObj by select string + LinkableMapObj* findID (const QString &s); // find MapObj by previously set ID + QString saveToDir (const QString&,const QString&,int, const QPointF&);// Save data recursivly to tempdir +private: + QGraphicsScene *mapScene; + MapEditor *mapEditor; + QList mapCenters; + QString version; //!< version string saved in vym file + QString author; + QString comment; + QDate date; +}; + + +#endif