mapeditor.h
author insilmaril
Mon Jul 14 11:25:09 2008 +0000 (2008-07-14)
changeset 719 3f90aab4794d
parent 684 5f9a2771680d
child 720 192e1392ba6a
permissions -rw-r--r--
Added french manual
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@684
   233
	/*! \brief Add new mapcenter
insilmaril@684
   234
insilmaril@684
   235
	    Disclaimer: Still experimental, not fully supported.
insilmaril@684
   236
	*/	
insilmaril@684
   237
public:	
insilmaril@684
   238
    BranchObj* addMapCenter();		
insilmaril@684
   239
insilmaril@491
   240
	/*! \brief Add new branch
insilmaril@491
   241
insilmaril@491
   242
		Depending on num the new branch is created
insilmaril@491
   243
insilmaril@491
   244
		-3 above selection as child of selections parent
insilmaril@491
   245
		-2 as child of selection
insilmaril@491
   246
		-1 below selection as child of selections parent
insilmaril@491
   247
		0..n	insert at a specific position in selections parent
insilmaril@491
   248
		(needed for free relinking)
insilmaril@491
   249
	*/	
insilmaril@684
   250
private:	
insilmaril@366
   251
    BranchObj* addNewBranchInt(int);		// pos allows to add above/below selection
insilmaril@106
   252
public:	
insilmaril@491
   253
	/*! \Add new branch
insilmaril@491
   254
		
insilmaril@491
   255
		Depending on num the new branch is created
insilmaril@491
   256
		-1 above selection
insilmaril@491
   257
		 0 as child of selection
insilmaril@491
   258
		 1 below selection
insilmaril@491
   259
	*/
insilmaril@491
   260
    BranchObj* addNewBranch(int pos);		
insilmaril@491
   261
    BranchObj* addNewBranchBefore();		//!< Insert branch between selection and its parent
insilmaril@491
   262
    void deleteSelection();					//!< Delete selection
insilmaril@491
   263
	LinkableMapObj* getSelection();			//!< Returns selection
insilmaril@442
   264
	BranchObj* getSelectedBranch();			// returns selected branch or NULL
insilmaril@442
   265
	FloatImageObj* getSelectedFloatImage();	// returns selected branch or NULL
insilmaril@442
   266
	void unselect();						// before changing current noteedit
insilmaril@442
   267
	void reselect();						// after  changing current noteedit
insilmaril@442
   268
	bool select(const QString &);			// Select by string
insilmaril@684
   269
	bool select(LinkableMapObj *lmo);		// Select by pointer
insilmaril@366
   270
	QString getSelectString();
insilmaril@0
   271
private:	
insilmaril@366
   272
	void selectInt(LinkableMapObj*);	
insilmaril@366
   273
	void selectNextBranchInt();		// Increment number of branch
insilmaril@366
   274
	void selectPrevBranchInt();		// Decrement number of branch
insilmaril@0
   275
public:	
insilmaril@0
   276
    void selectUpperBranch();
insilmaril@0
   277
    void selectLowerBranch();
insilmaril@0
   278
    void selectLeftBranch();
insilmaril@0
   279
    void selectRightBranch();
insilmaril@0
   280
    void selectFirstBranch();
insilmaril@0
   281
    void selectLastBranch();
insilmaril@408
   282
    void selectMapBackgroundImage();
insilmaril@408
   283
    void setMapBackgroundImage(const QString &);
insilmaril@398
   284
    void selectMapBackgroundColor();
insilmaril@398
   285
    void setMapBackgroundColor(QColor);
insilmaril@398
   286
    QColor getMapBackgroundColor();
insilmaril@395
   287
    QColor getCurrentHeadingColor();
insilmaril@395
   288
    void colorBranch(QColor);
insilmaril@417
   289
    void colorSubtree(QColor);
insilmaril@0
   290
	void toggleStandardFlag(QString);
insilmaril@0
   291
    BranchObj* findText(QString,bool);		// Find object
insilmaril@0
   292
    void findReset();						// Reset Find 
insilmaril@528
   293
	void setURL(const QString &);			// set  URL
insilmaril@528
   294
	void editURL();							// edit URL
insilmaril@528
   295
	void editLocalURL();					// edit URL to local file
insilmaril@266
   296
	QString getURL();						// returns URL of selection or ""
insilmaril@366
   297
	QStringList getURLs();					// returns URLs of subtree
insilmaril@0
   298
	void editHeading2URL();					// copy heading to URL
insilmaril@0
   299
	void editBugzilla2URL();				// create URL to Bugzilla
insilmaril@175
   300
	void editFATE2URL();					// create URL to FATE
insilmaril@0
   301
	void editVymLink();						// edit link to another map
insilmaril@0
   302
	void deleteVymLink();					// delete link to another map
insilmaril@0
   303
	QString getVymLink();					// return path to map
insilmaril@366
   304
	QStringList getVymLinks();				// return paths in subtree
insilmaril@395
   305
	void setHideExport(bool);				// toggle the export flag
insilmaril@243
   306
	void toggleHideExport();				// toggle the export flag
insilmaril@395
   307
	void deleteKeepChilds();				// remove but keep childs
insilmaril@395
   308
	void deleteChilds();					// remove childs
insilmaril@0
   309
	void editMapInfo();						// dialog to enter author, ...
insilmaril@442
   310
	void ensureSelectionVisible();		
insilmaril@442
   311
	void updateSelection();					// update geometry of selection
insilmaril@0
   312
	void updateActions();					// update e.g. format buttons
insilmaril@160
   313
	void updateNoteFlag();					// when TextEditor changes
insilmaril@398
   314
	void setMapAuthor (const QString &);
insilmaril@398
   315
	void setMapComment(const QString &);
insilmaril@398
   316
	void setMapLinkStyle (const QString &);	// Set style of link
insilmaril@473
   317
	LinkableMapObj::Style getMapLinkStyle ();	// requested in LMO
insilmaril@398
   318
	void setMapDefLinkColor(QColor);		// default color of links
insilmaril@398
   319
	void setMapLinkColorHintInt();			// color of links
insilmaril@473
   320
	void setMapLinkColorHint(LinkableMapObj::ColorHint);// color of links
insilmaril@473
   321
	LinkableMapObj::ColorHint getMapLinkColorHint();
insilmaril@398
   322
	QColor getMapDefLinkColor();
insilmaril@398
   323
	void setMapDefXLinkColor(QColor);
insilmaril@398
   324
	QColor getMapDefXLinkColor();
insilmaril@398
   325
	void setMapDefXLinkWidth (int);
insilmaril@398
   326
	int getMapDefXLinkWidth();
insilmaril@398
   327
	void toggleMapLinkColorHint();			// after changing linkStyles
insilmaril@398
   328
    void selectMapLinkColor();
insilmaril@442
   329
    void selectMapSelectionColor();
insilmaril@442
   330
private:	
insilmaril@442
   331
    void setSelectionColorInt(QColor);
insilmaril@442
   332
public:	
insilmaril@442
   333
    void setSelectionColor(QColor);
insilmaril@442
   334
    QColor getSelectionColor();
insilmaril@473
   335
	bool scrollBranch(BranchObj*);
insilmaril@473
   336
	bool unscrollBranch(BranchObj*);
insilmaril@0
   337
    void toggleScroll();
insilmaril@428
   338
    void unscrollChilds();
insilmaril@432
   339
private:	
insilmaril@432
   340
	FloatImageObj* loadFloatImageInt (QString);
insilmaril@432
   341
public:	
insilmaril@0
   342
	void loadFloatImage ();
insilmaril@434
   343
private:	
insilmaril@434
   344
	void saveFloatImageInt (FloatImageObj*, const QString &, const QString &);
insilmaril@434
   345
public:	
insilmaril@366
   346
	void saveFloatImage ();
insilmaril@473
   347
	void setFrameType(const FrameObj::FrameType &);
insilmaril@445
   348
	void setFrameType(const QString &);
insilmaril@442
   349
	void setFramePenColor (const QColor &);
insilmaril@442
   350
	void setFrameBrushColor (const QColor &);
insilmaril@473
   351
	void setFramePadding (const int &);
insilmaril@473
   352
	void setFrameBorderWidth (const int &);
insilmaril@175
   353
	void setIncludeImagesVer(bool);
insilmaril@175
   354
	void setIncludeImagesHor(bool);
insilmaril@160
   355
	void setHideLinkUnselected (bool);
insilmaril@160
   356
	bool getHideLinkUnselected ();
insilmaril@0
   357
private:	
insilmaril@366
   358
    void importDirInt(BranchObj *,QDir);
insilmaril@491
   359
    void importDirInt(const QString&);
insilmaril@0
   360
public:	
insilmaril@0
   361
    void importDir();
insilmaril@95
   362
	void followXLink (int);
insilmaril@95
   363
	void editXLink (int);
insilmaril@628
   364
	AttributeTable* attributeTable();
insilmaril@527
   365
    void testFunction1();					// just testing new stuff
insilmaril@527
   366
    void testFunction2();					// just testing new stuff
insilmaril@366
   367
											// set /mainwindo/showTestMenu=true...
insilmaril@0
   368
insilmaril@0
   369
protected:
insilmaril@408
   370
	virtual void contextMenuEvent ( QContextMenuEvent *e );
insilmaril@398
   371
    virtual void keyPressEvent(QKeyEvent*);
insilmaril@398
   372
    virtual void keyReleaseEvent(QKeyEvent*);
insilmaril@408
   373
    virtual void mousePressEvent(QMouseEvent*);
insilmaril@473
   374
    virtual void mouseMoveEvent(QMouseEvent*);
insilmaril@408
   375
    virtual void mouseReleaseEvent(QMouseEvent*);
insilmaril@408
   376
    virtual void mouseDoubleClickEvent(QMouseEvent*);
insilmaril@473
   377
    virtual void resizeEvent( QResizeEvent * );
insilmaril@0
   378
insilmaril@417
   379
	void dragEnterEvent (QDragEnterEvent *);
insilmaril@417
   380
	void dragMoveEvent (QDragMoveEvent *);
insilmaril@417
   381
	void dragLeaveEvent (QDragLeaveEvent *);
insilmaril@417
   382
	void dropEvent (QDropEvent *);
insilmaril@412
   383
insilmaril@473
   384
insilmaril@528
   385
protected:
insilmaril@528
   386
	void sendSelection();
insilmaril@528
   387
insilmaril@528
   388
public:
insilmaril@528
   389
	void newServer();
insilmaril@531
   390
	void connectToServer();
insilmaril@528
   391
insilmaril@473
   392
private slots:	
insilmaril@528
   393
	void newClient();
insilmaril@528
   394
	void sendData(const QString &s);
insilmaril@531
   395
	void readData();
insilmaril@531
   396
	void displayNetworkError (QAbstractSocket::SocketError);
insilmaril@531
   397
insilmaril@473
   398
	void autosave ();
insilmaril@676
   399
	void fileChanged();
insilmaril@473
   400
insilmaril@0
   401
private:
insilmaril@491
   402
	State state;				// State of MapEditor
insilmaril@408
   403
	QGraphicsScene *mapScene;
insilmaril@645
   404
	VymModel *model;					// Vym Map, includding several mapCenters
insilmaril@473
   405
	QTimer *autosaveTimer;
insilmaril@676
   406
	QTimer *fileChangedTimer;
insilmaril@676
   407
	QDateTime fileChangedTime;
insilmaril@0
   408
insilmaril@0
   409
	bool adjustCanvasRequested;	// collect requests until end of user event
insilmaril@0
   410
	BranchObj *editingBO;		// entering Text into BO
insilmaril@0
   411
insilmaril@97
   412
	QColor defLinkColor;		// default color for links
insilmaril@97
   413
	QColor defXLinkColor;		// default color for xlinks
insilmaril@97
   414
	int defXLinkWidth;			// default width for xlinks
insilmaril@473
   415
	LinkableMapObj::ColorHint linkcolorhint;// use heading color or own color
insilmaril@473
   416
	LinkableMapObj::Style linkstyle;		// default style for links
insilmaril@0
   417
insilmaril@398
   418
    QCursor HandOpenCursor;		// cursor while moving canvas view
insilmaril@398
   419
	QCursor PickColorCursor;	// cursor while picking color 
insilmaril@398
   420
	QCursor CopyCursor;			// cursor while picking color 
insilmaril@398
   421
	QCursor XLinkCursor;		// cursor while picking color 
insilmaril@83
   422
	bool pickingColor;
insilmaril@83
   423
	bool drawingLink;			// true while creating a link
insilmaril@93
   424
	bool copyingObj;			// true while creating a link
insilmaril@95
   425
	XLinkObj* tmpXLink;
insilmaril@366
   426
insilmaril@424
   427
	Selection xelection;	
insilmaril@537
   428
insilmaril@537
   429
	QString latestSelection;		// select string of latest added object
insilmaril@537
   430
insilmaril@0
   431
    MapObj* movingObj;				// moving a MapObj
insilmaril@83
   432
	MapObj* linkingObj_src;			// part of a link
insilmaril@408
   433
    QPointF movingObj_orgPos;		// org. pos of mouse before move
insilmaril@408
   434
    QPointF movingObj_orgRelPos;	// org. relative pos of mouse before move
insilmaril@408
   435
    QPointF movingObj_start;		// rel. pos of mouse to absPos 
insilmaril@408
   436
    QPointF movingCont_start;		// inital pos of moving Content or
insilmaril@408
   437
    QPointF movingVec;				// how far has Content moved
insilmaril@684
   438
insilmaril@684
   439
	QPointF contextMenuPos;					// position where context event was triggered
insilmaril@684
   440
insilmaril@0
   441
    QPrinter* printer;				// Printing
insilmaril@0
   442
insilmaril@0
   443
    bool mapDefault;				// Flag if map is untouched
insilmaril@0
   444
    bool mapChanged;				// Flag if undo is possible
insilmaril@0
   445
	bool mapUnsaved;				// Flag if map should be saved
insilmaril@0
   446
insilmaril@432
   447
	Parser parser;				// Parser stuff for scripting
insilmaril@432
   448
insilmaril@628
   449
	AttributeTable *attrTable;
insilmaril@628
   450
insilmaril@0
   451
	bool printFrame;			// Print frame around map
insilmaril@0
   452
	bool printFooter;			// Print footer below map
insilmaril@0
   453
insilmaril@0
   454
	bool zipped;				// should map be zipped
insilmaril@393
   455
	static	int mapNum;			// unique number for Editor
insilmaril@676
   456
	FileType fileType;			// type of file, e.g. vym, freemind...
insilmaril@0
   457
	QString fileName;			// short name of file (for tab)
insilmaril@0
   458
	QString filePath;			// path to file which will be saved
insilmaril@0
   459
	QString fileDir;			// dir where file is saved
insilmaril@0
   460
	QString destPath;			// path to .vym file (needed for vymlinks)
insilmaril@0
   461
	QString mapName;			// fileName without ".vym"
insilmaril@0
   462
insilmaril@377
   463
	QString tmpMapDir;			// tmp directory with undo history
insilmaril@366
   464
	QString histPath;			// Path to history file
insilmaril@502
   465
	SimpleSettings undoSet;		// undo/redo commands, saved in histPath
insilmaril@381
   466
	int stepsTotal;				// total number of steps (undos+redos) 
insilmaril@502
   467
	int curStep;				// Current step in history (ring buffer)
insilmaril@502
   468
	int curClipboard;			// number of history step, which is the current clipboard
insilmaril@502
   469
	int redosAvail;				// Available number of redo steps
insilmaril@502
   470
	int undosAvail;				// Available number of undo steps
insilmaril@139
   471
	bool blockReposition;		// block while load or undo
insilmaril@139
   472
	bool blockSaveState;		// block while load or undo
insilmaril@0
   473
insilmaril@0
   474
	BranchObj* itFind;			// next object in find process
insilmaril@0
   475
	bool EOFind;				// true, if search failed
insilmaril@0
   476
insilmaril@0
   477
	QPoint exportOffset;		// set before export, used in save
insilmaril@628
   478
	HideTmpMode hidemode;	// true while exporting to hide some stuff
insilmaril@616
   479
insilmaril@616
   480
	// Network connections **Experimental**
insilmaril@531
   481
	NetState netstate;			// offline, client, server
insilmaril@527
   482
	QTcpServer *tcpServer;		// Act as server in conference mode (experimental)
insilmaril@531
   483
	QList <QTcpSocket*> clientList;		// List of connected clients
insilmaril@531
   484
	quint16 sendCounter;		// Increased with every sent command
insilmaril@531
   485
insilmaril@531
   486
	QTcpSocket	*clientSocket;	// socket of this client
insilmaril@531
   487
	QString server;				// server address of this client
insilmaril@531
   488
	int port;					// server port of this client
insilmaril@531
   489
	void displayClientError(QAbstractSocket::SocketError socketError);
insilmaril@531
   490
insilmaril@0
   491
};
insilmaril@0
   492
#endif
insilmaril@0
   493