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