diff -r 0796c5592f00 -r 4e2c9394c7da mapeditor.h --- a/mapeditor.h Mon Apr 09 15:42:21 2007 +0000 +++ b/mapeditor.h Wed May 02 15:31:17 2007 +0000 @@ -8,10 +8,13 @@ #include "file.h" #include "misc.h" #include "parser.h" +#include "ornamentedobj.h" #include "selection.h" #include "settings.h" +/*! \brief Main widget in vym to display and edit the map */ + class MapEditor : public QGraphicsView, public xmlObj { Q_OBJECT @@ -21,6 +24,8 @@ MapCenterObj* getMapCenter(); QGraphicsScene * getScene(); bool isRepositionBlocked(); // block while load or undo + bool isSaveStateBlocked(); // block while undo/redo or while running scripts + void setSaveStateBlocked(bool); private: QString getName(const LinkableMapObj*); // Get e.g. heading or filename @@ -59,8 +64,8 @@ void setSmoothPixmap(bool); private: QPixmap getPixmap(); - void setHideTmpMode (HideTmpMode); // temporary hide stuff - HideTmpMode getHideTmpMode(); // temporary hide stuff + void setHideTmpMode (BranchObj::HideTmpMode); // temporary hide stuff + BranchObj::HideTmpMode getHideTmpMode(); // temporary hide stuff public: void setExportMode (bool); // temporary hide stuff during export void exportImage (QString fn); // export as PNG @@ -152,11 +157,11 @@ void setMapAuthor (const QString &); void setMapComment(const QString &); void setMapLinkStyle (const QString &); // Set style of link - LinkStyle getMapLinkStyle (); // requested in LMO + LinkableMapObj::Style getMapLinkStyle (); // requested in LMO void setMapDefLinkColor(QColor); // default color of links void setMapLinkColorHintInt(); // color of links - void setMapLinkColorHint(LinkColorHint);// color of links - LinkColorHint getMapLinkColorHint(); + void setMapLinkColorHint(LinkableMapObj::ColorHint);// color of links + LinkableMapObj::ColorHint getMapLinkColorHint(); QColor getMapDefLinkColor(); void setMapDefXLinkColor(QColor); QColor getMapDefXLinkColor(); @@ -170,8 +175,8 @@ public: void setSelectionColor(QColor); QColor getSelectionColor(); - bool scrollBranch(); - bool unscrollBranch(); + bool scrollBranch(BranchObj*); + bool unscrollBranch(BranchObj*); void toggleScroll(); void unscrollChilds(); private: @@ -182,10 +187,12 @@ void saveFloatImageInt (FloatImageObj*, const QString &, const QString &); public: void saveFloatImage (); - void setFrameType(const FrameType &); + void setFrameType(const FrameObj::FrameType &); void setFrameType(const QString &); void setFramePenColor (const QColor &); void setFrameBrushColor (const QColor &); + void setFramePadding (const int &); + void setFrameBorderWidth (const int &); void setIncludeImagesVer(bool); void setIncludeImagesHor(bool); void setHideLinkUnselected (bool); @@ -204,18 +211,25 @@ virtual void keyPressEvent(QKeyEvent*); virtual void keyReleaseEvent(QKeyEvent*); virtual void mousePressEvent(QMouseEvent*); + virtual void mouseMoveEvent(QMouseEvent*); virtual void mouseReleaseEvent(QMouseEvent*); virtual void mouseDoubleClickEvent(QMouseEvent*); - virtual void mouseMoveEvent(QMouseEvent*); + virtual void resizeEvent( QResizeEvent * ); void dragEnterEvent (QDragEnterEvent *); void dragMoveEvent (QDragMoveEvent *); void dragLeaveEvent (QDragLeaveEvent *); void dropEvent (QDropEvent *); + void timerEvent(QTimerEvent *event); + +private slots: + void autosave (); + private: QGraphicsScene *mapScene; MapCenterObj* mapCenter; + QTimer *autosaveTimer; bool adjustCanvasRequested; // collect requests until end of user event BranchObj *editingBO; // entering Text into BO @@ -223,8 +237,8 @@ QColor defLinkColor; // default color for links QColor defXLinkColor; // default color for xlinks int defXLinkWidth; // default width for xlinks - LinkColorHint linkcolorhint;// use heading color or own color - LinkStyle linkstyle; // default style for links + LinkableMapObj::ColorHint linkcolorhint;// use heading color or own color + LinkableMapObj::Style linkstyle; // default style for links QCursor HandOpenCursor; // cursor while moving canvas view QCursor PickColorCursor; // cursor while picking color @@ -273,9 +287,10 @@ bool EOFind; // true, if search failed QPoint exportOffset; // set before export, used in save - HideTmpMode hidemode; // true while exporting to hide some stuff - - void resizeEvent( QResizeEvent * ); + BranchObj::HideTmpMode hidemode; // true while exporting to hide some stuff + + int timerId; // animation timer + QList animObjList;// list with animated objects }; #endif