mapeditor.h
author insilmaril
Fri, 01 Feb 2008 15:28:35 +0000
changeset 661 6a5e2c27f8a4
parent 645 2abfdb7e85f4
child 676 3dabc6424d73
permissions -rw-r--r--
Added brasilian translation by Amadeu Júnior
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@491
   167
    int save(const SaveMode &);	
insilmaril@491
   168
	void setZipped(bool);		//!< Set or unset compression of map with zip save map zipped
insilmaril@491
   169
	bool saveZipped();			//!< True, if file will be saved zipped
insilmaril@491
   170
    void print();				//!< Print the map
insilmaril@491
   171
	void setAntiAlias (bool);	//!< Set or unset antialiasing
insilmaril@491
   172
	void setSmoothPixmap(bool); //!< Set or unset smoothing of pixmaps
insilmaril@0
   173
private:
insilmaril@0
   174
    QPixmap getPixmap();
insilmaril@628
   175
	void setHideTmpMode (HideTmpMode);	// temporary hide stuff
insilmaril@628
   176
	HideTmpMode getHideTmpMode();		// temporary hide stuff
insilmaril@0
   177
public:
insilmaril@520
   178
	/*! Set or unset temporary hiding of objects during export  */
insilmaril@520
   179
	void setExportMode (bool);
insilmaril@520
   180
insilmaril@520
   181
	/*! Export as ASCII text to file */
insilmaril@520
   182
	void exportASCII (QString fname="",bool askForName=true);  
insilmaril@514
   183
insilmaril@514
   184
	/*! Save as image */
insilmaril@514
   185
    void exportImage (QString fname="",bool askForName=true,QString format="PNG");
insilmaril@520
   186
insilmaril@520
   187
    /*! Export as OpenOfficeOrg presentation */
insilmaril@520
   188
    void exportOOPresentation(const QString &,const QString &);	
insilmaril@520
   189
insilmaril@520
   190
	/*! Export as XHTML to directory */
insilmaril@520
   191
    void exportXHTML(const QString& dir="", bool askForName=true);	
insilmaril@520
   192
insilmaril@520
   193
	/*! Export as XTML to directory */
insilmaril@526
   194
    void exportXML(QString dir="", bool askForName=true);
insilmaril@520
   195
insilmaril@491
   196
    void clear();						//!< Clear map
insilmaril@491
   197
    void copy();						//!< Copy to clipboard
insilmaril@491
   198
    void redo();						//!< Redo last action
insilmaril@491
   199
	bool isRedoAvailable();				//!< True, if redo is available
insilmaril@491
   200
    void undo();						//!< Undo last action
insilmaril@491
   201
	bool isUndoAvailable();				//!< True, if undo is available
insilmaril@491
   202
	void gotoHistoryStep (int);			//!< Goto a specifig step in history
insilmaril@0
   203
private:	
insilmaril@394
   204
    void addMapReplaceInt(const QString & undoSel, const QString & path);
insilmaril@394
   205
    void addMapInsertInt (const QString & path, int pos);
insilmaril@502
   206
    void pasteNoSave(const int &n);		//!< paste clipboard to branch
insilmaril@0
   207
public:	
insilmaril@491
   208
    void paste();		//!< Paste clipboard to branch and backup
insilmaril@491
   209
    void cut();			//!< Cut to clipboard (and copy)
insilmaril@491
   210
	/*! \brief Move absolutly
insilmaril@491
   211
insilmaril@491
   212
		Move absolutly to (x,y).
insilmaril@491
   213
	*/	
insilmaril@537
   214
    void move    (const double &x, const double &y);
insilmaril@491
   215
	/*! \brief Move relativly
insilmaril@491
   216
insilmaril@491
   217
		Move relativly to (x,y).
insilmaril@491
   218
	*/	
insilmaril@537
   219
    void moveRel (const double &x, const double &y);
insilmaril@491
   220
    void moveBranchUp();	//!< Move branch up
insilmaril@491
   221
    void moveBranchDown();	//!< Move branch down
insilmaril@608
   222
	void sortChildren();	//!< Sort children lexically
insilmaril@420
   223
private:	
insilmaril@420
   224
	void linkTo(const QString &);
insilmaril@420
   225
public:	
insilmaril@491
   226
	QString getHeading (bool &ok,QPoint &p); //!< Get heading, ok if selection is branch
insilmaril@491
   227
	void setHeading(const QString &);		//!< Set heading of branch	
insilmaril@106
   228
private:
insilmaril@366
   229
	void setHeadingInt(const QString &);
insilmaril@366
   230
	void setVymLinkInt(const QString &);	// Set vymLink for selection
insilmaril@491
   231
	/*! \brief Add new branch
insilmaril@491
   232
insilmaril@491
   233
		Depending on num the new branch is created
insilmaril@491
   234
insilmaril@491
   235
		-3 above selection as child of selections parent
insilmaril@491
   236
		-2 as child of selection
insilmaril@491
   237
		-1 below selection as child of selections parent
insilmaril@491
   238
		0..n	insert at a specific position in selections parent
insilmaril@491
   239
		(needed for free relinking)
insilmaril@491
   240
	*/	
insilmaril@366
   241
    BranchObj* addNewBranchInt(int);		// pos allows to add above/below selection
insilmaril@106
   242
public:	
insilmaril@491
   243
	/*! \Add new branch
insilmaril@491
   244
		
insilmaril@491
   245
		Depending on num the new branch is created
insilmaril@491
   246
		-1 above selection
insilmaril@491
   247
		 0 as child of selection
insilmaril@491
   248
		 1 below selection
insilmaril@491
   249
	*/
insilmaril@491
   250
    BranchObj* addNewBranch(int pos);		
insilmaril@491
   251
    BranchObj* addNewBranchBefore();		//!< Insert branch between selection and its parent
insilmaril@491
   252
    void deleteSelection();					//!< Delete selection
insilmaril@491
   253
	LinkableMapObj* getSelection();			//!< Returns selection
insilmaril@442
   254
	BranchObj* getSelectedBranch();			// returns selected branch or NULL
insilmaril@442
   255
	FloatImageObj* getSelectedFloatImage();	// returns selected branch or NULL
insilmaril@442
   256
	void unselect();						// before changing current noteedit
insilmaril@442
   257
	void reselect();						// after  changing current noteedit
insilmaril@442
   258
	bool select(const QString &);			// Select by string
insilmaril@366
   259
	QString getSelectString();
insilmaril@0
   260
private:	
insilmaril@366
   261
	void selectInt(LinkableMapObj*);	
insilmaril@366
   262
	void selectNextBranchInt();		// Increment number of branch
insilmaril@366
   263
	void selectPrevBranchInt();		// Decrement number of branch
insilmaril@0
   264
public:	
insilmaril@0
   265
    void selectUpperBranch();
insilmaril@0
   266
    void selectLowerBranch();
insilmaril@0
   267
    void selectLeftBranch();
insilmaril@0
   268
    void selectRightBranch();
insilmaril@0
   269
    void selectFirstBranch();
insilmaril@0
   270
    void selectLastBranch();
insilmaril@408
   271
    void selectMapBackgroundImage();
insilmaril@408
   272
    void setMapBackgroundImage(const QString &);
insilmaril@398
   273
    void selectMapBackgroundColor();
insilmaril@398
   274
    void setMapBackgroundColor(QColor);
insilmaril@398
   275
    QColor getMapBackgroundColor();
insilmaril@395
   276
    QColor getCurrentHeadingColor();
insilmaril@395
   277
    void colorBranch(QColor);
insilmaril@417
   278
    void colorSubtree(QColor);
insilmaril@0
   279
	void toggleStandardFlag(QString);
insilmaril@0
   280
    BranchObj* findText(QString,bool);		// Find object
insilmaril@0
   281
    void findReset();						// Reset Find 
insilmaril@528
   282
	void setURL(const QString &);			// set  URL
insilmaril@528
   283
	void editURL();							// edit URL
insilmaril@528
   284
	void editLocalURL();					// edit URL to local file
insilmaril@266
   285
	QString getURL();						// returns URL of selection or ""
insilmaril@366
   286
	QStringList getURLs();					// returns URLs of subtree
insilmaril@0
   287
	void editHeading2URL();					// copy heading to URL
insilmaril@0
   288
	void editBugzilla2URL();				// create URL to Bugzilla
insilmaril@175
   289
	void editFATE2URL();					// create URL to FATE
insilmaril@0
   290
	void editVymLink();						// edit link to another map
insilmaril@0
   291
	void deleteVymLink();					// delete link to another map
insilmaril@0
   292
	QString getVymLink();					// return path to map
insilmaril@366
   293
	QStringList getVymLinks();				// return paths in subtree
insilmaril@395
   294
	void setHideExport(bool);				// toggle the export flag
insilmaril@243
   295
	void toggleHideExport();				// toggle the export flag
insilmaril@395
   296
	void deleteKeepChilds();				// remove but keep childs
insilmaril@395
   297
	void deleteChilds();					// remove childs
insilmaril@0
   298
	void editMapInfo();						// dialog to enter author, ...
insilmaril@442
   299
	void ensureSelectionVisible();		
insilmaril@442
   300
	void updateSelection();					// update geometry of selection
insilmaril@0
   301
	void updateActions();					// update e.g. format buttons
insilmaril@160
   302
	void updateNoteFlag();					// when TextEditor changes
insilmaril@398
   303
	void setMapAuthor (const QString &);
insilmaril@398
   304
	void setMapComment(const QString &);
insilmaril@398
   305
	void setMapLinkStyle (const QString &);	// Set style of link
insilmaril@473
   306
	LinkableMapObj::Style getMapLinkStyle ();	// requested in LMO
insilmaril@398
   307
	void setMapDefLinkColor(QColor);		// default color of links
insilmaril@398
   308
	void setMapLinkColorHintInt();			// color of links
insilmaril@473
   309
	void setMapLinkColorHint(LinkableMapObj::ColorHint);// color of links
insilmaril@473
   310
	LinkableMapObj::ColorHint getMapLinkColorHint();
insilmaril@398
   311
	QColor getMapDefLinkColor();
insilmaril@398
   312
	void setMapDefXLinkColor(QColor);
insilmaril@398
   313
	QColor getMapDefXLinkColor();
insilmaril@398
   314
	void setMapDefXLinkWidth (int);
insilmaril@398
   315
	int getMapDefXLinkWidth();
insilmaril@398
   316
	void toggleMapLinkColorHint();			// after changing linkStyles
insilmaril@398
   317
    void selectMapLinkColor();
insilmaril@442
   318
    void selectMapSelectionColor();
insilmaril@442
   319
private:	
insilmaril@442
   320
    void setSelectionColorInt(QColor);
insilmaril@442
   321
public:	
insilmaril@442
   322
    void setSelectionColor(QColor);
insilmaril@442
   323
    QColor getSelectionColor();
insilmaril@473
   324
	bool scrollBranch(BranchObj*);
insilmaril@473
   325
	bool unscrollBranch(BranchObj*);
insilmaril@0
   326
    void toggleScroll();
insilmaril@428
   327
    void unscrollChilds();
insilmaril@432
   328
private:	
insilmaril@432
   329
	FloatImageObj* loadFloatImageInt (QString);
insilmaril@432
   330
public:	
insilmaril@0
   331
	void loadFloatImage ();
insilmaril@434
   332
private:	
insilmaril@434
   333
	void saveFloatImageInt (FloatImageObj*, const QString &, const QString &);
insilmaril@434
   334
public:	
insilmaril@366
   335
	void saveFloatImage ();
insilmaril@473
   336
	void setFrameType(const FrameObj::FrameType &);
insilmaril@445
   337
	void setFrameType(const QString &);
insilmaril@442
   338
	void setFramePenColor (const QColor &);
insilmaril@442
   339
	void setFrameBrushColor (const QColor &);
insilmaril@473
   340
	void setFramePadding (const int &);
insilmaril@473
   341
	void setFrameBorderWidth (const int &);
insilmaril@175
   342
	void setIncludeImagesVer(bool);
insilmaril@175
   343
	void setIncludeImagesHor(bool);
insilmaril@160
   344
	void setHideLinkUnselected (bool);
insilmaril@160
   345
	bool getHideLinkUnselected ();
insilmaril@0
   346
private:	
insilmaril@366
   347
    void importDirInt(BranchObj *,QDir);
insilmaril@491
   348
    void importDirInt(const QString&);
insilmaril@0
   349
public:	
insilmaril@0
   350
    void importDir();
insilmaril@95
   351
	void followXLink (int);
insilmaril@95
   352
	void editXLink (int);
insilmaril@628
   353
	AttributeTable* attributeTable();
insilmaril@527
   354
    void testFunction1();					// just testing new stuff
insilmaril@527
   355
    void testFunction2();					// just testing new stuff
insilmaril@366
   356
											// set /mainwindo/showTestMenu=true...
insilmaril@0
   357
insilmaril@0
   358
protected:
insilmaril@408
   359
	virtual void contextMenuEvent ( QContextMenuEvent *e );
insilmaril@398
   360
    virtual void keyPressEvent(QKeyEvent*);
insilmaril@398
   361
    virtual void keyReleaseEvent(QKeyEvent*);
insilmaril@408
   362
    virtual void mousePressEvent(QMouseEvent*);
insilmaril@473
   363
    virtual void mouseMoveEvent(QMouseEvent*);
insilmaril@408
   364
    virtual void mouseReleaseEvent(QMouseEvent*);
insilmaril@408
   365
    virtual void mouseDoubleClickEvent(QMouseEvent*);
insilmaril@473
   366
    virtual void resizeEvent( QResizeEvent * );
insilmaril@0
   367
insilmaril@417
   368
	void dragEnterEvent (QDragEnterEvent *);
insilmaril@417
   369
	void dragMoveEvent (QDragMoveEvent *);
insilmaril@417
   370
	void dragLeaveEvent (QDragLeaveEvent *);
insilmaril@417
   371
	void dropEvent (QDropEvent *);
insilmaril@412
   372
insilmaril@473
   373
	void timerEvent(QTimerEvent *event);
insilmaril@473
   374
insilmaril@528
   375
protected:
insilmaril@528
   376
	void sendSelection();
insilmaril@528
   377
insilmaril@528
   378
public:
insilmaril@528
   379
	void newServer();
insilmaril@531
   380
	void connectToServer();
insilmaril@528
   381
insilmaril@473
   382
private slots:	
insilmaril@528
   383
	void newClient();
insilmaril@528
   384
	void sendData(const QString &s);
insilmaril@531
   385
	void readData();
insilmaril@531
   386
	void displayNetworkError (QAbstractSocket::SocketError);
insilmaril@531
   387
insilmaril@473
   388
	void autosave ();
insilmaril@473
   389
insilmaril@0
   390
private:
insilmaril@491
   391
	State state;				// State of MapEditor
insilmaril@408
   392
	QGraphicsScene *mapScene;
insilmaril@645
   393
	VymModel *model;					// Vym Map, includding several mapCenters
insilmaril@473
   394
	QTimer *autosaveTimer;
insilmaril@0
   395
insilmaril@0
   396
	bool adjustCanvasRequested;	// collect requests until end of user event
insilmaril@0
   397
	BranchObj *editingBO;		// entering Text into BO
insilmaril@0
   398
insilmaril@97
   399
	QColor defLinkColor;		// default color for links
insilmaril@97
   400
	QColor defXLinkColor;		// default color for xlinks
insilmaril@97
   401
	int defXLinkWidth;			// default width for xlinks
insilmaril@473
   402
	LinkableMapObj::ColorHint linkcolorhint;// use heading color or own color
insilmaril@473
   403
	LinkableMapObj::Style linkstyle;		// default style for links
insilmaril@0
   404
insilmaril@398
   405
    QCursor HandOpenCursor;		// cursor while moving canvas view
insilmaril@398
   406
	QCursor PickColorCursor;	// cursor while picking color 
insilmaril@398
   407
	QCursor CopyCursor;			// cursor while picking color 
insilmaril@398
   408
	QCursor XLinkCursor;		// cursor while picking color 
insilmaril@83
   409
	bool pickingColor;
insilmaril@83
   410
	bool drawingLink;			// true while creating a link
insilmaril@93
   411
	bool copyingObj;			// true while creating a link
insilmaril@95
   412
	XLinkObj* tmpXLink;
insilmaril@366
   413
insilmaril@424
   414
	Selection xelection;	
insilmaril@537
   415
insilmaril@537
   416
	QString latestSelection;		// select string of latest added object
insilmaril@537
   417
insilmaril@0
   418
    MapObj* movingObj;				// moving a MapObj
insilmaril@83
   419
	MapObj* linkingObj_src;			// part of a link
insilmaril@408
   420
    QPointF movingObj_orgPos;		// org. pos of mouse before move
insilmaril@408
   421
    QPointF movingObj_orgRelPos;	// org. relative pos of mouse before move
insilmaril@408
   422
    QPointF movingObj_start;		// rel. pos of mouse to absPos 
insilmaril@408
   423
    QPointF movingCont_start;		// inital pos of moving Content or
insilmaril@408
   424
    QPointF movingVec;				// how far has Content moved
insilmaril@0
   425
    QPrinter* printer;				// Printing
insilmaril@0
   426
insilmaril@0
   427
    bool mapDefault;				// Flag if map is untouched
insilmaril@0
   428
    bool mapChanged;				// Flag if undo is possible
insilmaril@0
   429
	bool mapUnsaved;				// Flag if map should be saved
insilmaril@0
   430
insilmaril@432
   431
	Parser parser;				// Parser stuff for scripting
insilmaril@432
   432
insilmaril@628
   433
	AttributeTable *attrTable;
insilmaril@628
   434
insilmaril@0
   435
	bool printFrame;			// Print frame around map
insilmaril@0
   436
	bool printFooter;			// Print footer below map
insilmaril@0
   437
insilmaril@0
   438
	bool zipped;				// should map be zipped
insilmaril@393
   439
	static	int mapNum;			// unique number for Editor
insilmaril@0
   440
	QString fileName;			// short name of file (for tab)
insilmaril@0
   441
	QString filePath;			// path to file which will be saved
insilmaril@0
   442
	QString fileDir;			// dir where file is saved
insilmaril@0
   443
	QString destPath;			// path to .vym file (needed for vymlinks)
insilmaril@0
   444
	QString mapName;			// fileName without ".vym"
insilmaril@0
   445
insilmaril@377
   446
	QString tmpMapDir;			// tmp directory with undo history
insilmaril@366
   447
	QString histPath;			// Path to history file
insilmaril@502
   448
	SimpleSettings undoSet;		// undo/redo commands, saved in histPath
insilmaril@381
   449
	int stepsTotal;				// total number of steps (undos+redos) 
insilmaril@502
   450
	int curStep;				// Current step in history (ring buffer)
insilmaril@502
   451
	int curClipboard;			// number of history step, which is the current clipboard
insilmaril@502
   452
	int redosAvail;				// Available number of redo steps
insilmaril@502
   453
	int undosAvail;				// Available number of undo steps
insilmaril@139
   454
	bool blockReposition;		// block while load or undo
insilmaril@139
   455
	bool blockSaveState;		// block while load or undo
insilmaril@0
   456
insilmaril@0
   457
	BranchObj* itFind;			// next object in find process
insilmaril@0
   458
	bool EOFind;				// true, if search failed
insilmaril@0
   459
insilmaril@0
   460
	QPoint exportOffset;		// set before export, used in save
insilmaril@628
   461
	HideTmpMode hidemode;	// true while exporting to hide some stuff
insilmaril@616
   462
insilmaril@616
   463
	// Network connections **Experimental**
insilmaril@531
   464
	NetState netstate;			// offline, client, server
insilmaril@527
   465
	QTcpServer *tcpServer;		// Act as server in conference mode (experimental)
insilmaril@531
   466
	QList <QTcpSocket*> clientList;		// List of connected clients
insilmaril@531
   467
	quint16 sendCounter;		// Increased with every sent command
insilmaril@531
   468
insilmaril@531
   469
	QTcpSocket	*clientSocket;	// socket of this client
insilmaril@531
   470
	QString server;				// server address of this client
insilmaril@531
   471
	int port;					// server port of this client
insilmaril@531
   472
	void displayClientError(QAbstractSocket::SocketError socketError);
insilmaril@531
   473
insilmaril@527
   474
insilmaril@616
   475
	// Animation data **experimental**
insilmaril@473
   476
	int timerId;				// animation timer
insilmaril@473
   477
	QList <MapObj*> animObjList;// list with animated objects
insilmaril@0
   478
};
insilmaril@0
   479
#endif
insilmaril@0
   480