mapeditor.h
author insilmaril
Wed, 20 Jun 2007 11:05:39 +0000
changeset 520 0ccc00c05a22
parent 517 b525fdd445c4
child 526 eacf1b165d2d
permissions -rw-r--r--
scripted exports (continued)
insilmaril@0
     1
#ifndef MAPEDITOR_H
insilmaril@0
     2
#define MAPEDITOR_H
insilmaril@0
     3
insilmaril@408
     4
#include <QGraphicsView>
insilmaril@0
     5
insilmaril@0
     6
#include "mapcenterobj.h"
insilmaril@175
     7
#include "file.h"
insilmaril@0
     8
#include "misc.h"
insilmaril@432
     9
#include "parser.h"
insilmaril@473
    10
#include "ornamentedobj.h"
insilmaril@366
    11
#include "selection.h"
insilmaril@366
    12
#include "settings.h"
insilmaril@0
    13
insilmaril@119
    14
insilmaril@486
    15
/*! \brief Main widget in vym to display and edit a map */
insilmaril@473
    16
insilmaril@408
    17
class MapEditor : public QGraphicsView, public xmlObj {
insilmaril@0
    18
    Q_OBJECT
insilmaril@0
    19
insilmaril@0
    20
public:
insilmaril@491
    21
    /*! \brief State of the mapeditor 
insilmaril@491
    22
		
insilmaril@491
    23
		While a heading is edited, the state has to change, so
insilmaril@491
    24
		that e.g. no other object might get selected. This is done
insilmaril@491
    25
		in Main by calling setStateEditHeading
insilmaril@491
    26
	*/
insilmaril@491
    27
	enum State {
insilmaril@491
    28
		Idle,			//!< Idle, waiting for user event
insilmaril@491
    29
		EditHeading		//!< Editing heading (dont't select another branch now)
insilmaril@491
    30
	};
insilmaril@408
    31
    MapEditor(QWidget* parent=0);
insilmaril@0
    32
	~MapEditor();
insilmaril@491
    33
    MapCenterObj* getMapCenter();		//!< Return center of map
insilmaril@408
    34
	QGraphicsScene * getScene();
insilmaril@491
    35
	State getState();					//!< Return State of MapEditor
insilmaril@491
    36
	void setStateEditHeading (bool);	//!< If set to true, State will change to EditHeading
insilmaril@491
    37
	bool isRepositionBlocked(); //!< While load or undo there is no need to update graphicsview
insilmaril@491
    38
	bool isSaveStateBlocked();			//!< block while undo/redo or while running scripts
insilmaril@491
    39
	void setSaveStateBlocked(bool);		//!< block saving the undo/redo state
insilmaril@491
    40
	bool isSelectBlocked();		//!< true, if no change of selection is possible, e.g. while editing the heading of abranch
insilmaril@0
    41
	
insilmaril@486
    42
protected:
insilmaril@491
    43
	/*! \brief Get name of object
insilmaril@491
    44
	  
insilmaril@491
    45
	  Returns heading of a branch or name of an object for use in comment
insilmaril@491
    46
	  of undo/redo history
insilmaril@491
    47
	*/ 
insilmaril@420
    48
	QString getName(const LinkableMapObj*);	// Get e.g. heading or filename
insilmaril@0
    49
	void makeTmpDirs();		// create temporary directories
insilmaril@486
    50
insilmaril@486
    51
	/*! This function saves all information of the map to disc.
insilmaril@486
    52
	    saveToDir also calls the functions for all BranchObj and other objects in the map.
insilmaril@486
    53
		The structure of the map itself is returned as QString and passed back to Main, 
insilmaril@486
    54
		where saveToDir is called initially
insilmaril@486
    55
	*/	
insilmaril@486
    56
    QString saveToDir (const QString &tmpdir, const QString &prefix, bool writeflags, const QPointF &offset, LinkableMapObj *saveSel);
insilmaril@486
    57
insilmaril@505
    58
	/*! \brief Get directory, where current step in history is save
insilmaril@505
    59
insilmaril@505
    60
		saveState creates a directory for each step in history. This function returns the
insilmaril@505
    61
		path of the current directory
insilmaril@505
    62
	*/
insilmaril@505
    63
	QString getHistoryDir();
insilmaril@486
    64
insilmaril@486
    65
	/*! \brief Save the current changes in map 
insilmaril@486
    66
insilmaril@486
    67
		Two commands and selections are saved:
insilmaril@486
    68
insilmaril@486
    69
			- undocommand and undoselection to undo the change
insilmaril@486
    70
			- redocommand and redoselection to redo the action after an undo
insilmaril@486
    71
insilmaril@486
    72
		Additionally a comment is logged. 
insilmaril@486
    73
insilmaril@486
    74
	*/	
insilmaril@486
    75
    void saveState(const SaveMode& savemode, const QString &undoSelection, const QString &undoCommand, const QString &redoSelection, const QString &redoCommand, const QString &comment, LinkableMapObj *saveSelection);
insilmaril@486
    76
	/*! Overloaded for convenience */
insilmaril@502
    77
    void saveStateChangingPart(LinkableMapObj *undoSelection, LinkableMapObj* redoSelection, const QString &redoCommand, const QString &comment);
insilmaril@486
    78
	/*! Overloaded for convenience */
insilmaril@486
    79
    void saveStateRemovingPart(LinkableMapObj *redoSelection, const QString &comment);
insilmaril@486
    80
	/*! Overloaded for convenience */
insilmaril@502
    81
    void saveState(LinkableMapObj *undoSelection, const QString &undoCommand, LinkableMapObj *redoSelection, const QString &redoCommand, const QString &comment); 
insilmaril@486
    82
	/*! Overloaded for convenience */
insilmaril@502
    83
    void saveState(const QString &undoSelection, const QString &undoCommand, const QString &redoSelection, const QString &redoCommand, const QString &comment) ;
insilmaril@486
    84
insilmaril@393
    85
public:	
insilmaril@486
    86
insilmaril@486
    87
	/* \brief Process one command and its parameters */
insilmaril@486
    88
    void parseAtom (const QString &atom);	
insilmaril@486
    89
insilmaril@486
    90
	/* \brief Runs the script */
insilmaril@486
    91
	void runScript (QString script);
insilmaril@393
    92
private:
insilmaril@395
    93
    void addFloatImageInt(const QPixmap &img);
insilmaril@119
    94
insilmaril@0
    95
public:
insilmaril@486
    96
	bool isDefault();		//!< true, if map is still the empty default map
insilmaril@486
    97
    bool hasChanged();		//!< true, if something has changed and is not saved yet
insilmaril@486
    98
	void setChanged();		//!< called from TextEditor via LinkableMapObj
insilmaril@486
    99
	void closeMap();		//!< Closes the map
insilmaril@486
   100
insilmaril@486
   101
	/*! \brief Sets filepath, filename and mapname
insilmaril@486
   102
insilmaril@486
   103
	     If the filepath is "/home/tux/map.xml", then the filename will be set
insilmaril@486
   104
		 to map.xml. The destname is needed for vymLinks, pointing to another map. 
insilmaril@486
   105
		 The destname holds the real name of the file, after it has been compressed, e.g. "map.vym"
insilmaril@486
   106
	*/	 
insilmaril@491
   107
insilmaril@491
   108
	/*! \brief Set File path
insilmaril@491
   109
insilmaril@491
   110
	     The destname is needed to construct the references between maps
insilmaril@491
   111
	*/	 
insilmaril@486
   112
	void setFilePath (QString filepath,QString destname);	
insilmaril@486
   113
	void setFilePath (QString);	//!< Overloaded for convenience
insilmaril@486
   114
	QString getFilePath ();	//!< Full path e.g. "/home/tux/map.xml"
insilmaril@486
   115
	QString getFileName ();	//!< e.g. "map.xml"
insilmaril@486
   116
	QString getMapName ();	//!< e.g. "map"
insilmaril@486
   117
	QString getDestPath (); //!< e.g. "/home/tux/map.vym"
insilmaril@491
   118
insilmaril@491
   119
	/*! \brief Load map
insilmaril@491
   120
insilmaril@491
   121
		The data is read from file. Depending on LoadMode the current
insilmaril@491
   122
		selection gets replaced by data or the data is appended.
insilmaril@491
   123
	*/	
insilmaril@205
   124
    ErrorCode load (QString, LoadMode );	// newmap, import/replace selection
insilmaril@163
   125
public:
insilmaril@491
   126
	/*! \brief Save the map to file */
insilmaril@491
   127
    int save(const SaveMode &);	
insilmaril@491
   128
	void setZipped(bool);		//!< Set or unset compression of map with zip save map zipped
insilmaril@491
   129
	bool saveZipped();			//!< True, if file will be saved zipped
insilmaril@491
   130
    void print();				//!< Print the map
insilmaril@491
   131
	void setAntiAlias (bool);	//!< Set or unset antialiasing
insilmaril@491
   132
	void setSmoothPixmap(bool); //!< Set or unset smoothing of pixmaps
insilmaril@0
   133
private:
insilmaril@0
   134
    QPixmap getPixmap();
insilmaril@473
   135
	void setHideTmpMode (BranchObj::HideTmpMode);	// temporary hide stuff
insilmaril@473
   136
	BranchObj::HideTmpMode getHideTmpMode();		// temporary hide stuff
insilmaril@0
   137
public:
insilmaril@520
   138
	/*! Set or unset temporary hiding of objects during export  */
insilmaril@520
   139
	void setExportMode (bool);
insilmaril@520
   140
insilmaril@520
   141
	/*! Export as ASCII text to file */
insilmaril@520
   142
	void exportASCII (QString fname="",bool askForName=true);  
insilmaril@514
   143
insilmaril@514
   144
	/*! Save as image */
insilmaril@514
   145
    void exportImage (QString fname="",bool askForName=true,QString format="PNG");
insilmaril@520
   146
insilmaril@520
   147
    /*! Export as OpenOfficeOrg presentation */
insilmaril@520
   148
    void exportOOPresentation(const QString &,const QString &);	
insilmaril@520
   149
insilmaril@520
   150
	/*! Export as XHTML to directory */
insilmaril@520
   151
    void exportXHTML(const QString& dir="", bool askForName=true);	
insilmaril@520
   152
insilmaril@520
   153
	/*! Export as XTML to directory */
insilmaril@520
   154
    void exportXML(const QString& dir="");
insilmaril@520
   155
insilmaril@491
   156
    void clear();						//!< Clear map
insilmaril@491
   157
    void copy();						//!< Copy to clipboard
insilmaril@491
   158
    void redo();						//!< Redo last action
insilmaril@491
   159
	bool isRedoAvailable();				//!< True, if redo is available
insilmaril@491
   160
    void undo();						//!< Undo last action
insilmaril@491
   161
	bool isUndoAvailable();				//!< True, if undo is available
insilmaril@491
   162
	void gotoHistoryStep (int);			//!< Goto a specifig step in history
insilmaril@0
   163
private:	
insilmaril@394
   164
    void addMapReplaceInt(const QString & undoSel, const QString & path);
insilmaril@394
   165
    void addMapInsertInt (const QString & path, int pos);
insilmaril@502
   166
    void pasteNoSave(const int &n);		//!< paste clipboard to branch
insilmaril@0
   167
public:	
insilmaril@491
   168
    void paste();		//!< Paste clipboard to branch and backup
insilmaril@491
   169
    void cut();			//!< Cut to clipboard (and copy)
insilmaril@491
   170
	/*! \brief Move absolutly
insilmaril@491
   171
insilmaril@491
   172
		Move absolutly to (x,y).
insilmaril@491
   173
	*/	
insilmaril@393
   174
    void move    (const int &x, const int &y);
insilmaril@491
   175
	/*! \brief Move relativly
insilmaril@491
   176
insilmaril@491
   177
		Move relativly to (x,y).
insilmaril@491
   178
	*/	
insilmaril@393
   179
    void moveRel (const int &x, const int &y);
insilmaril@491
   180
    void moveBranchUp();	//!< Move branch up
insilmaril@491
   181
    void moveBranchDown();	//!< Move branch down
insilmaril@420
   182
private:	
insilmaril@420
   183
	void linkTo(const QString &);
insilmaril@420
   184
public:	
insilmaril@491
   185
	QString getHeading (bool &ok,QPoint &p); //!< Get heading, ok if selection is branch
insilmaril@491
   186
	void setHeading(const QString &);		//!< Set heading of branch	
insilmaril@106
   187
private:
insilmaril@366
   188
	void setHeadingInt(const QString &);
insilmaril@366
   189
	void setVymLinkInt(const QString &);	// Set vymLink for selection
insilmaril@491
   190
	/*! \brief Add new branch
insilmaril@491
   191
insilmaril@491
   192
		Depending on num the new branch is created
insilmaril@491
   193
insilmaril@491
   194
		-3 above selection as child of selections parent
insilmaril@491
   195
		-2 as child of selection
insilmaril@491
   196
		-1 below selection as child of selections parent
insilmaril@491
   197
		0..n	insert at a specific position in selections parent
insilmaril@491
   198
		(needed for free relinking)
insilmaril@491
   199
	*/	
insilmaril@366
   200
    BranchObj* addNewBranchInt(int);		// pos allows to add above/below selection
insilmaril@106
   201
public:	
insilmaril@491
   202
	/*! \Add new branch
insilmaril@491
   203
		
insilmaril@491
   204
		Depending on num the new branch is created
insilmaril@491
   205
		-1 above selection
insilmaril@491
   206
		 0 as child of selection
insilmaril@491
   207
		 1 below selection
insilmaril@491
   208
	*/
insilmaril@491
   209
    BranchObj* addNewBranch(int pos);		
insilmaril@491
   210
    BranchObj* addNewBranchBefore();		//!< Insert branch between selection and its parent
insilmaril@491
   211
    void deleteSelection();					//!< Delete selection
insilmaril@491
   212
	LinkableMapObj* getSelection();			//!< Returns selection
insilmaril@442
   213
	BranchObj* getSelectedBranch();			// returns selected branch or NULL
insilmaril@442
   214
	FloatImageObj* getSelectedFloatImage();	// returns selected branch or NULL
insilmaril@442
   215
	void unselect();						// before changing current noteedit
insilmaril@442
   216
	void reselect();						// after  changing current noteedit
insilmaril@442
   217
	bool select(const QString &);			// Select by string
insilmaril@366
   218
	QString getSelectString();
insilmaril@0
   219
private:	
insilmaril@366
   220
	void selectInt(LinkableMapObj*);	
insilmaril@366
   221
	void selectNextBranchInt();		// Increment number of branch
insilmaril@366
   222
	void selectPrevBranchInt();		// Decrement number of branch
insilmaril@0
   223
public:	
insilmaril@0
   224
    void selectUpperBranch();
insilmaril@0
   225
    void selectLowerBranch();
insilmaril@0
   226
    void selectLeftBranch();
insilmaril@0
   227
    void selectRightBranch();
insilmaril@0
   228
    void selectFirstBranch();
insilmaril@0
   229
    void selectLastBranch();
insilmaril@408
   230
    void selectMapBackgroundImage();
insilmaril@408
   231
    void setMapBackgroundImage(const QString &);
insilmaril@398
   232
    void selectMapBackgroundColor();
insilmaril@398
   233
    void setMapBackgroundColor(QColor);
insilmaril@398
   234
    QColor getMapBackgroundColor();
insilmaril@395
   235
    QColor getCurrentHeadingColor();
insilmaril@395
   236
    void colorBranch(QColor);
insilmaril@417
   237
    void colorSubtree(QColor);
insilmaril@0
   238
	void toggleStandardFlag(QString);
insilmaril@0
   239
    BranchObj* findText(QString,bool);		// Find object
insilmaril@0
   240
    void findReset();						// Reset Find 
insilmaril@395
   241
	void setURL(const QString &);			// set the URL
insilmaril@0
   242
	void editURL();							// edit the URL
insilmaril@266
   243
	QString getURL();						// returns URL of selection or ""
insilmaril@366
   244
	QStringList getURLs();					// returns URLs of subtree
insilmaril@0
   245
	void editHeading2URL();					// copy heading to URL
insilmaril@0
   246
	void editBugzilla2URL();				// create URL to Bugzilla
insilmaril@175
   247
	void editFATE2URL();					// create URL to FATE
insilmaril@0
   248
	void editVymLink();						// edit link to another map
insilmaril@0
   249
	void deleteVymLink();					// delete link to another map
insilmaril@0
   250
	QString getVymLink();					// return path to map
insilmaril@366
   251
	QStringList getVymLinks();				// return paths in subtree
insilmaril@395
   252
	void setHideExport(bool);				// toggle the export flag
insilmaril@243
   253
	void toggleHideExport();				// toggle the export flag
insilmaril@395
   254
	void deleteKeepChilds();				// remove but keep childs
insilmaril@395
   255
	void deleteChilds();					// remove childs
insilmaril@0
   256
	void editMapInfo();						// dialog to enter author, ...
insilmaril@442
   257
	void ensureSelectionVisible();		
insilmaril@442
   258
	void updateSelection();					// update geometry of selection
insilmaril@0
   259
	void updateActions();					// update e.g. format buttons
insilmaril@160
   260
	void updateNoteFlag();					// when TextEditor changes
insilmaril@398
   261
	void setMapAuthor (const QString &);
insilmaril@398
   262
	void setMapComment(const QString &);
insilmaril@398
   263
	void setMapLinkStyle (const QString &);	// Set style of link
insilmaril@473
   264
	LinkableMapObj::Style getMapLinkStyle ();	// requested in LMO
insilmaril@398
   265
	void setMapDefLinkColor(QColor);		// default color of links
insilmaril@398
   266
	void setMapLinkColorHintInt();			// color of links
insilmaril@473
   267
	void setMapLinkColorHint(LinkableMapObj::ColorHint);// color of links
insilmaril@473
   268
	LinkableMapObj::ColorHint getMapLinkColorHint();
insilmaril@398
   269
	QColor getMapDefLinkColor();
insilmaril@398
   270
	void setMapDefXLinkColor(QColor);
insilmaril@398
   271
	QColor getMapDefXLinkColor();
insilmaril@398
   272
	void setMapDefXLinkWidth (int);
insilmaril@398
   273
	int getMapDefXLinkWidth();
insilmaril@398
   274
	void toggleMapLinkColorHint();			// after changing linkStyles
insilmaril@398
   275
    void selectMapLinkColor();
insilmaril@442
   276
    void selectMapSelectionColor();
insilmaril@442
   277
private:	
insilmaril@442
   278
    void setSelectionColorInt(QColor);
insilmaril@442
   279
public:	
insilmaril@442
   280
    void setSelectionColor(QColor);
insilmaril@442
   281
    QColor getSelectionColor();
insilmaril@473
   282
	bool scrollBranch(BranchObj*);
insilmaril@473
   283
	bool unscrollBranch(BranchObj*);
insilmaril@0
   284
    void toggleScroll();
insilmaril@428
   285
    void unscrollChilds();
insilmaril@432
   286
private:	
insilmaril@432
   287
	FloatImageObj* loadFloatImageInt (QString);
insilmaril@432
   288
public:	
insilmaril@0
   289
	void loadFloatImage ();
insilmaril@434
   290
private:	
insilmaril@434
   291
	void saveFloatImageInt (FloatImageObj*, const QString &, const QString &);
insilmaril@434
   292
public:	
insilmaril@366
   293
	void saveFloatImage ();
insilmaril@473
   294
	void setFrameType(const FrameObj::FrameType &);
insilmaril@445
   295
	void setFrameType(const QString &);
insilmaril@442
   296
	void setFramePenColor (const QColor &);
insilmaril@442
   297
	void setFrameBrushColor (const QColor &);
insilmaril@473
   298
	void setFramePadding (const int &);
insilmaril@473
   299
	void setFrameBorderWidth (const int &);
insilmaril@175
   300
	void setIncludeImagesVer(bool);
insilmaril@175
   301
	void setIncludeImagesHor(bool);
insilmaril@160
   302
	void setHideLinkUnselected (bool);
insilmaril@160
   303
	bool getHideLinkUnselected ();
insilmaril@0
   304
private:	
insilmaril@366
   305
    void importDirInt(BranchObj *,QDir);
insilmaril@491
   306
    void importDirInt(const QString&);
insilmaril@0
   307
public:	
insilmaril@0
   308
    void importDir();
insilmaril@95
   309
	void followXLink (int);
insilmaril@95
   310
	void editXLink (int);
insilmaril@366
   311
    void testFunction();					// just testing new stuff
insilmaril@366
   312
											// set /mainwindo/showTestMenu=true...
insilmaril@0
   313
insilmaril@0
   314
protected:
insilmaril@408
   315
	virtual void contextMenuEvent ( QContextMenuEvent *e );
insilmaril@398
   316
    virtual void keyPressEvent(QKeyEvent*);
insilmaril@398
   317
    virtual void keyReleaseEvent(QKeyEvent*);
insilmaril@408
   318
    virtual void mousePressEvent(QMouseEvent*);
insilmaril@473
   319
    virtual void mouseMoveEvent(QMouseEvent*);
insilmaril@408
   320
    virtual void mouseReleaseEvent(QMouseEvent*);
insilmaril@408
   321
    virtual void mouseDoubleClickEvent(QMouseEvent*);
insilmaril@473
   322
    virtual void resizeEvent( QResizeEvent * );
insilmaril@0
   323
insilmaril@417
   324
	void dragEnterEvent (QDragEnterEvent *);
insilmaril@417
   325
	void dragMoveEvent (QDragMoveEvent *);
insilmaril@417
   326
	void dragLeaveEvent (QDragLeaveEvent *);
insilmaril@417
   327
	void dropEvent (QDropEvent *);
insilmaril@412
   328
insilmaril@473
   329
	void timerEvent(QTimerEvent *event);
insilmaril@473
   330
insilmaril@473
   331
private slots:	
insilmaril@473
   332
	void autosave ();
insilmaril@473
   333
insilmaril@0
   334
private:
insilmaril@491
   335
	State state;				// State of MapEditor
insilmaril@408
   336
	QGraphicsScene *mapScene;
insilmaril@0
   337
    MapCenterObj* mapCenter;
insilmaril@473
   338
	QTimer *autosaveTimer;
insilmaril@0
   339
insilmaril@0
   340
	bool adjustCanvasRequested;	// collect requests until end of user event
insilmaril@0
   341
	BranchObj *editingBO;		// entering Text into BO
insilmaril@0
   342
insilmaril@97
   343
	QColor defLinkColor;		// default color for links
insilmaril@97
   344
	QColor defXLinkColor;		// default color for xlinks
insilmaril@97
   345
	int defXLinkWidth;			// default width for xlinks
insilmaril@473
   346
	LinkableMapObj::ColorHint linkcolorhint;// use heading color or own color
insilmaril@473
   347
	LinkableMapObj::Style linkstyle;		// default style for links
insilmaril@0
   348
insilmaril@398
   349
    QCursor HandOpenCursor;		// cursor while moving canvas view
insilmaril@398
   350
	QCursor PickColorCursor;	// cursor while picking color 
insilmaril@398
   351
	QCursor CopyCursor;			// cursor while picking color 
insilmaril@398
   352
	QCursor XLinkCursor;		// cursor while picking color 
insilmaril@83
   353
	bool pickingColor;
insilmaril@83
   354
	bool drawingLink;			// true while creating a link
insilmaril@93
   355
	bool copyingObj;			// true while creating a link
insilmaril@95
   356
	XLinkObj* tmpXLink;
insilmaril@366
   357
insilmaril@424
   358
	Selection xelection;	
insilmaril@0
   359
    MapObj* movingObj;				// moving a MapObj
insilmaril@83
   360
	MapObj* linkingObj_src;			// part of a link
insilmaril@408
   361
    QPointF movingObj_orgPos;		// org. pos of mouse before move
insilmaril@408
   362
    QPointF movingObj_orgRelPos;	// org. relative pos of mouse before move
insilmaril@408
   363
    QPointF movingObj_start;		// rel. pos of mouse to absPos 
insilmaril@408
   364
    QPointF movingCont_start;		// inital pos of moving Content or
insilmaril@408
   365
    QPointF movingVec;				// how far has Content moved
insilmaril@0
   366
    QPrinter* printer;				// Printing
insilmaril@0
   367
insilmaril@0
   368
    bool mapDefault;				// Flag if map is untouched
insilmaril@0
   369
    bool mapChanged;				// Flag if undo is possible
insilmaril@0
   370
	bool mapUnsaved;				// Flag if map should be saved
insilmaril@0
   371
insilmaril@432
   372
	Parser parser;				// Parser stuff for scripting
insilmaril@432
   373
insilmaril@0
   374
	bool printFrame;			// Print frame around map
insilmaril@0
   375
	bool printFooter;			// Print footer below map
insilmaril@0
   376
insilmaril@0
   377
	bool zipped;				// should map be zipped
insilmaril@393
   378
	static	int mapNum;			// unique number for Editor
insilmaril@0
   379
	QString fileName;			// short name of file (for tab)
insilmaril@0
   380
	QString filePath;			// path to file which will be saved
insilmaril@0
   381
	QString fileDir;			// dir where file is saved
insilmaril@0
   382
	QString destPath;			// path to .vym file (needed for vymlinks)
insilmaril@0
   383
	QString mapName;			// fileName without ".vym"
insilmaril@0
   384
insilmaril@377
   385
	QString tmpMapDir;			// tmp directory with undo history
insilmaril@366
   386
	QString histPath;			// Path to history file
insilmaril@502
   387
	SimpleSettings undoSet;		// undo/redo commands, saved in histPath
insilmaril@381
   388
	int stepsTotal;				// total number of steps (undos+redos) 
insilmaril@502
   389
	int curStep;				// Current step in history (ring buffer)
insilmaril@502
   390
	int curClipboard;			// number of history step, which is the current clipboard
insilmaril@502
   391
	int redosAvail;				// Available number of redo steps
insilmaril@502
   392
	int undosAvail;				// Available number of undo steps
insilmaril@139
   393
	bool blockReposition;		// block while load or undo
insilmaril@139
   394
	bool blockSaveState;		// block while load or undo
insilmaril@0
   395
insilmaril@0
   396
	BranchObj* itFind;			// next object in find process
insilmaril@0
   397
	bool EOFind;				// true, if search failed
insilmaril@0
   398
insilmaril@0
   399
	QPoint exportOffset;		// set before export, used in save
insilmaril@473
   400
	BranchObj::HideTmpMode hidemode;	// true while exporting to hide some stuff
insilmaril@473
   401
insilmaril@473
   402
	int timerId;				// animation timer
insilmaril@473
   403
	QList <MapObj*> animObjList;// list with animated objects
insilmaril@0
   404
};
insilmaril@0
   405
#endif
insilmaril@0
   406