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