mapeditor.h
changeset 473 8b9cfc26638c
parent 445 0796c5592f00
child 486 9c86935835a4
     1.1 --- a/mapeditor.h	Wed Apr 25 16:02:54 2007 +0000
     1.2 +++ b/mapeditor.h	Wed Apr 25 16:02:54 2007 +0000
     1.3 @@ -8,10 +8,13 @@
     1.4  #include "file.h"
     1.5  #include "misc.h"
     1.6  #include "parser.h"
     1.7 +#include "ornamentedobj.h"
     1.8  #include "selection.h"
     1.9  #include "settings.h"
    1.10  
    1.11  
    1.12 +/*! \brief Main widget in vym to display and edit the map */
    1.13 +
    1.14  class MapEditor : public QGraphicsView, public xmlObj {
    1.15      Q_OBJECT
    1.16  
    1.17 @@ -21,6 +24,8 @@
    1.18      MapCenterObj* getMapCenter();
    1.19  	QGraphicsScene * getScene();
    1.20  	bool isRepositionBlocked(); // block while load or undo
    1.21 +	bool isSaveStateBlocked();	// block while undo/redo or while running scripts
    1.22 +	void setSaveStateBlocked(bool);
    1.23  	
    1.24  private:
    1.25  	QString getName(const LinkableMapObj*);	// Get e.g. heading or filename
    1.26 @@ -59,8 +64,8 @@
    1.27  	void setSmoothPixmap(bool);
    1.28  private:
    1.29      QPixmap getPixmap();
    1.30 -	void setHideTmpMode (HideTmpMode);	// temporary hide stuff
    1.31 -	HideTmpMode getHideTmpMode();		// temporary hide stuff
    1.32 +	void setHideTmpMode (BranchObj::HideTmpMode);	// temporary hide stuff
    1.33 +	BranchObj::HideTmpMode getHideTmpMode();		// temporary hide stuff
    1.34  public:
    1.35  	void setExportMode (bool);			// temporary hide stuff during export
    1.36      void exportImage (QString fn);			// export as PNG	
    1.37 @@ -152,11 +157,11 @@
    1.38  	void setMapAuthor (const QString &);
    1.39  	void setMapComment(const QString &);
    1.40  	void setMapLinkStyle (const QString &);	// Set style of link
    1.41 -	LinkStyle getMapLinkStyle ();			// requested in LMO
    1.42 +	LinkableMapObj::Style getMapLinkStyle ();	// requested in LMO
    1.43  	void setMapDefLinkColor(QColor);		// default color of links
    1.44  	void setMapLinkColorHintInt();			// color of links
    1.45 -	void setMapLinkColorHint(LinkColorHint);// color of links
    1.46 -	LinkColorHint getMapLinkColorHint();
    1.47 +	void setMapLinkColorHint(LinkableMapObj::ColorHint);// color of links
    1.48 +	LinkableMapObj::ColorHint getMapLinkColorHint();
    1.49  	QColor getMapDefLinkColor();
    1.50  	void setMapDefXLinkColor(QColor);
    1.51  	QColor getMapDefXLinkColor();
    1.52 @@ -170,8 +175,8 @@
    1.53  public:	
    1.54      void setSelectionColor(QColor);
    1.55      QColor getSelectionColor();
    1.56 -	bool scrollBranch();
    1.57 -	bool unscrollBranch();
    1.58 +	bool scrollBranch(BranchObj*);
    1.59 +	bool unscrollBranch(BranchObj*);
    1.60      void toggleScroll();
    1.61      void unscrollChilds();
    1.62  private:	
    1.63 @@ -182,10 +187,12 @@
    1.64  	void saveFloatImageInt (FloatImageObj*, const QString &, const QString &);
    1.65  public:	
    1.66  	void saveFloatImage ();
    1.67 -	void setFrameType(const FrameType &);
    1.68 +	void setFrameType(const FrameObj::FrameType &);
    1.69  	void setFrameType(const QString &);
    1.70  	void setFramePenColor (const QColor &);
    1.71  	void setFrameBrushColor (const QColor &);
    1.72 +	void setFramePadding (const int &);
    1.73 +	void setFrameBorderWidth (const int &);
    1.74  	void setIncludeImagesVer(bool);
    1.75  	void setIncludeImagesHor(bool);
    1.76  	void setHideLinkUnselected (bool);
    1.77 @@ -204,18 +211,25 @@
    1.78      virtual void keyPressEvent(QKeyEvent*);
    1.79      virtual void keyReleaseEvent(QKeyEvent*);
    1.80      virtual void mousePressEvent(QMouseEvent*);
    1.81 +    virtual void mouseMoveEvent(QMouseEvent*);
    1.82      virtual void mouseReleaseEvent(QMouseEvent*);
    1.83      virtual void mouseDoubleClickEvent(QMouseEvent*);
    1.84 -    virtual void mouseMoveEvent(QMouseEvent*);
    1.85 +    virtual void resizeEvent( QResizeEvent * );
    1.86  
    1.87  	void dragEnterEvent (QDragEnterEvent *);
    1.88  	void dragMoveEvent (QDragMoveEvent *);
    1.89  	void dragLeaveEvent (QDragLeaveEvent *);
    1.90  	void dropEvent (QDropEvent *);
    1.91  
    1.92 +	void timerEvent(QTimerEvent *event);
    1.93 +
    1.94 +private slots:	
    1.95 +	void autosave ();
    1.96 +
    1.97  private:
    1.98  	QGraphicsScene *mapScene;
    1.99      MapCenterObj* mapCenter;
   1.100 +	QTimer *autosaveTimer;
   1.101  
   1.102  	bool adjustCanvasRequested;	// collect requests until end of user event
   1.103  	BranchObj *editingBO;		// entering Text into BO
   1.104 @@ -223,8 +237,8 @@
   1.105  	QColor defLinkColor;		// default color for links
   1.106  	QColor defXLinkColor;		// default color for xlinks
   1.107  	int defXLinkWidth;			// default width for xlinks
   1.108 -	LinkColorHint linkcolorhint;// use heading color or own color
   1.109 -	LinkStyle linkstyle;		// default style for links
   1.110 +	LinkableMapObj::ColorHint linkcolorhint;// use heading color or own color
   1.111 +	LinkableMapObj::Style linkstyle;		// default style for links
   1.112  
   1.113      QCursor HandOpenCursor;		// cursor while moving canvas view
   1.114  	QCursor PickColorCursor;	// cursor while picking color 
   1.115 @@ -273,9 +287,10 @@
   1.116  	bool EOFind;				// true, if search failed
   1.117  
   1.118  	QPoint exportOffset;		// set before export, used in save
   1.119 -	HideTmpMode hidemode;			// true while exporting to hide some stuff
   1.120 -	
   1.121 -    void resizeEvent( QResizeEvent * );
   1.122 +	BranchObj::HideTmpMode hidemode;	// true while exporting to hide some stuff
   1.123 +
   1.124 +	int timerId;				// animation timer
   1.125 +	QList <MapObj*> animObjList;// list with animated objects
   1.126  };
   1.127  #endif
   1.128