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