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