author | insilmaril |
Mon Feb 11 12:44:00 2008 +0000 (2008-02-11) | |
changeset 669 | a418fad921a8 |
parent 652 | 700553af9ca5 |
child 684 | 5f9a2771680d |
permissions | -rw-r--r-- |
insilmaril@650 | 1 |
#ifndef VYMMODEL_H |
insilmaril@650 | 2 |
#define VYMMODEL_H |
insilmaril@650 | 3 |
|
insilmaril@650 | 4 |
#include <QGraphicsScene> |
insilmaril@650 | 5 |
|
insilmaril@650 | 6 |
#include "mapcenterobj.h" |
insilmaril@650 | 7 |
#include "mapeditor.h" |
insilmaril@650 | 8 |
|
insilmaril@650 | 9 |
|
insilmaril@650 | 10 |
/*! \brief This will later be divided into Model/View |
insilmaril@650 | 11 |
*/ |
insilmaril@650 | 12 |
|
insilmaril@650 | 13 |
class VymModel{ |
insilmaril@650 | 14 |
public: |
insilmaril@650 | 15 |
VymModel(); |
insilmaril@650 | 16 |
~VymModel (); |
insilmaril@650 | 17 |
void clear(); |
insilmaril@650 | 18 |
void init(); |
insilmaril@650 | 19 |
void setMapEditor(MapEditor *me); // FIXME should not be necessary in Model/View |
insilmaril@650 | 20 |
MapEditor* getMapEditor(); |
insilmaril@650 | 21 |
void setVersion(const QString &); |
insilmaril@650 | 22 |
void setAuthor (const QString &); |
insilmaril@650 | 23 |
QString getAuthor (); |
insilmaril@650 | 24 |
void setComment (const QString &); |
insilmaril@650 | 25 |
QString getComment (); |
insilmaril@650 | 26 |
QString getDate(); |
insilmaril@650 | 27 |
void setScene(QGraphicsScene *s); |
insilmaril@650 | 28 |
QGraphicsScene *getScene(); |
insilmaril@650 | 29 |
MapCenterObj* addMapCenter(); |
insilmaril@650 | 30 |
MapCenterObj* removeMapCenter(MapCenterObj *mco); |
insilmaril@652 | 31 |
|
insilmaril@650 | 32 |
BranchObj* first(); // FIXME replaced by ModelIndex later |
insilmaril@650 | 33 |
BranchObj* next(BranchObj *bo); // FIXME replaced by ModelIndex later |
insilmaril@650 | 34 |
|
insilmaril@652 | 35 |
LinkableMapObj* findMapObj(QPointF,LinkableMapObj*); // find MapObj |
insilmaril@652 | 36 |
LinkableMapObj* findObjBySelect (const QString &s); // find MapObj by select string |
insilmaril@652 | 37 |
LinkableMapObj* findID (const QString &s); // find MapObj by previously set ID |
insilmaril@652 | 38 |
QString saveToDir (const QString&,const QString&,int, const QPointF&);// Save data recursivly to tempdir |
insilmaril@652 | 39 |
|
insilmaril@652 | 40 |
|
insilmaril@652 | 41 |
////////////////////////////////////////// View related |
insilmaril@652 | 42 |
// void updateLink(); FIXME needed? |
insilmaril@650 | 43 |
void updateRelPositions(); |
insilmaril@650 | 44 |
|
insilmaril@650 | 45 |
QRectF getTotalBBox(); |
insilmaril@650 | 46 |
void reposition(); //!< Call reposition for all MCOs |
insilmaril@650 | 47 |
void setHideTmp (HideTmpMode mode); |
insilmaril@665 | 48 |
QPolygonF shape(BranchObj *bo); //!< Returns arbitrary shape of subtree |
insilmaril@665 | 49 |
void moveAway (LinkableMapObj *lmo);//!< Autolayout: Move all out of the way |
insilmaril@652 | 50 |
|
insilmaril@652 | 51 |
////////////////////////////////////////// Selection related |
insilmaril@652 | 52 |
LinkableMapObj* getSelection(); |
insilmaril@652 | 53 |
BranchObj* getSelectedBranch(); |
insilmaril@652 | 54 |
bool select (const QString &s); |
insilmaril@652 | 55 |
QString getSelectString (LinkableMapObj *lmo); |
insilmaril@652 | 56 |
|
insilmaril@650 | 57 |
private: |
insilmaril@650 | 58 |
QGraphicsScene *mapScene; |
insilmaril@650 | 59 |
MapEditor *mapEditor; |
insilmaril@650 | 60 |
QList <MapCenterObj*> mapCenters; |
insilmaril@650 | 61 |
QString version; //!< version string saved in vym file |
insilmaril@650 | 62 |
QString author; |
insilmaril@650 | 63 |
QString comment; |
insilmaril@650 | 64 |
QDate date; |
insilmaril@650 | 65 |
}; |
insilmaril@650 | 66 |
|
insilmaril@650 | 67 |
|
insilmaril@650 | 68 |
#endif |