vymmodel.h
author insilmaril
Tue, 09 Mar 2010 08:29:09 +0000
changeset 831 25a950c2eb98
parent 829 832e96c9abb6
child 835 31841b366d5e
permissions -rw-r--r--
Introduce loadNote and saveNote commands
     1 #ifndef VYMMODEL_H
     2 #define VYMMODEL_H
     3 
     4 #include <QGraphicsScene>
     5 #include <QtNetwork>
     6 
     7 #include <QtDBus/QDBusAbstractAdaptor>
     8 #include <QtDBus/QDBusVariant>
     9 
    10 #include <QTextCursor>
    11 
    12 #include "adaptormodel.h"
    13 #include "file.h"
    14 #include "imageitem.h"
    15 #include "mapeditor.h"
    16 #include "parser.h"
    17 #include "treeitem.h"
    18 #include "treemodel.h"
    19 
    20 class AttributeItem;
    21 class BranchItem;
    22 class FindResultModel;
    23 class MapEditor;
    24 class XLinkItem;
    25 
    26 class VymModel :  public TreeModel {		
    27 	Q_OBJECT
    28 	Q_CLASSINFO("D-Bus Interface", "org.insilmaril.vym.VymModel-h")
    29 
    30 
    31 ////////////////////////////////////////////
    32 // General housekeeping
    33 ////////////////////////////////////////////
    34 private:
    35 	QString version;	//!< version string saved in vym file
    36 	QString author;
    37 	QString comment;
    38 	QDate date;
    39 
    40 	static uint idLast;		//! the last used unique ID
    41 	uint mapID;
    42 
    43 public:
    44 	VymModel();
    45 	~VymModel ();
    46     void clear();
    47     void init();
    48 	void makeTmpDirectories();		//!< create temporary directories e.g. for history
    49 
    50 	MapEditor* getMapEditor();			// FIXME-2 still necessary?
    51 	uint getID();						//! Return unique ID of model
    52 
    53 	bool isRepositionBlocked();		//!< While load or undo there is no need to update graphicsview
    54 
    55 	void updateActions();			//!< Update buttons in mainwindow
    56 
    57 
    58 ////////////////////////////////////////////
    59 // Load/save 
    60 ////////////////////////////////////////////
    61 private:
    62 
    63 	bool zipped;				// should map be zipped
    64 	static	int mapNum;			// unique number for model used in save/undo
    65 	FileType fileType;			// type of file, e.g. vym, freemind...
    66 	QString fileName;			// short name of file (for tab)
    67 	QString filePath;			// path to file which will be saved
    68 	QString fileDir;			// dir where file is saved
    69 	QString destPath;			// path to .vym file (needed for vymlinks)
    70 	QString mapName;			// fileName without ".vym"
    71 
    72 	QString tmpMapDir;			// tmp directory with undo history
    73 
    74 	QTimer *autosaveTimer;
    75 	QTimer *fileChangedTimer;
    76 	QDateTime fileChangedTime;
    77 
    78 public:
    79 	/*! This function saves all information of the map to disc.
    80 	    saveToDir also calls the functions for all BranchObj and other objects in the map.
    81 		The structure of the map itself is returned as QString and passed back to Main, 
    82 		where saveToDir is called initially
    83 	*/	
    84     QString saveToDir (const QString &tmpdir, const QString &prefix, bool writeflags, const QPointF &offset, TreeItem *saveSel);
    85 
    86 	/*! Save all data in tree*/
    87 	QString saveTreeToDir (const QString&,const QString&,const QPointF&);// Save data recursivly to tempdir
    88 
    89 
    90 	/*! \brief Sets filepath, filename and mapname
    91 
    92 	     If the filepath is "/home/tux/map.xml", then the filename will be set
    93 		 to map.xml. The destname is needed for vymLinks, pointing to another map. 
    94 		 The destname holds the real name of the file, after it has been compressed, e.g. "map.vym"
    95 	*/	 
    96 
    97 
    98 	/*! \brief Set File path
    99 
   100 	     The destname is needed to construct the references between maps
   101 	*/	 
   102 	void setFilePath (QString filepath,QString destname);	
   103 	void setFilePath (QString);	//!< Overloaded for convenience
   104 	QString getFilePath ();	//!< Full path e.g. "/home/tux/map.xml"
   105 	QString getFileName ();	//!< e.g. "map.xml"
   106 	QString getMapName ();	//!< e.g. "map"
   107 	QString getDestPath (); //!< e.g. "/home/tux/map.vym"
   108 
   109 	/*! \brief Load map
   110 
   111 		The data is read from file. Depending on LoadMode the current
   112 		selection gets replaced by data or the data is appended.
   113 	*/	
   114     ErrorCode load (QString, const LoadMode &, const FileType& );	// newmap, import/replace selection
   115 
   116 public:
   117 	/*! \brief Save the map to file */
   118     ErrorCode save(const SaveMode &);	
   119 
   120 private:
   121     void addMapReplaceInt(const QString & undoSel, const QString & path);
   122     bool addMapInsertInt (const QString & path);
   123     bool addMapInsertInt (const QString & path, int pos);
   124 
   125 	ImageItem* loadFloatImageInt (BranchItem *dst,QString);
   126 	void saveFloatImageInt (ImageItem*, const QString &, const QString &);
   127 public:	
   128 	void loadFloatImage ();
   129 	void saveFloatImage ();
   130 
   131 private:	
   132     void importDirInt(BranchItem *,QDir);
   133     void importDirInt(const QString&);
   134 public:	
   135     void importDir();
   136 
   137 private slots:
   138 	void autosave ();
   139 	void fileChanged();
   140 
   141 ////////////////////////////////////////////
   142 // history (undo/redo)
   143 ////////////////////////////////////////////
   144 private:
   145     bool mapDefault;			//!< Flag if map is untouched
   146     bool mapChanged;			//!< Flag if undo is possible
   147 	bool mapUnsaved;			//!< Flag if map should be saved
   148 
   149 	QString histPath;			//!< Path to history file
   150 	SimpleSettings undoSet;		//!< undo/redo commands, saved in histPath
   151 	int stepsTotal;				//!< total number of steps (undos+redos) 
   152 	int curStep;				//!< Current step in history (ring buffer)
   153 	int curClipboard;			//!< number of history step, which is the current clipboard
   154 	int redosAvail;				//!< Available number of redo steps
   155 	int undosAvail;				//!< Available number of undo steps
   156 	bool blockReposition;		//!< block while load or undo
   157 	bool blockSaveState;		//!< block while load or undo
   158 public:
   159 	bool isDefault();			//!< true, if map is still the empty default map
   160 	void makeDefault();			//!< Reset changelog, declare this as default map
   161     bool hasChanged()	;		//!< true, if something has changed and is not saved yet
   162 	void setChanged();			//!< called from TextEditor via LinkableMapObj
   163 
   164 	/*! \brief Get name of object
   165 	  
   166 	  Returns heading of a branch or name of an object for use in comment
   167 	  of undo/redo history
   168 	*/ 
   169 	QString getObjectName(LinkableMapObj*);	
   170 	QString getObjectName(TreeItem*);	
   171 
   172     void redo();						//!< Redo last action
   173 	bool isRedoAvailable();				//!< True, if redo is available
   174     void undo();						//!< Undo last action
   175 	bool isUndoAvailable();				//!< True, if undo is available
   176 	void gotoHistoryStep (int);			//!< Goto a specifig step in history
   177 
   178 
   179 	QString getHistoryPath();			//!< Path to directory containing the history
   180 
   181 	/*! \brief Save the current changes in map 
   182 
   183 		Two commands and selections are saved:
   184 
   185 			- undocommand and undoselection to undo the change
   186 			- redocommand and redoselection to redo the action after an undo
   187 
   188 		Additionally a comment is logged. 
   189 
   190 	*/	
   191     void saveState(
   192 		const SaveMode& savemode, 
   193 		const QString &undoSelection, 
   194 		const QString &undoCommand, 
   195 		const QString &redoSelection, 
   196 		const QString &redoCommand, 
   197 		const QString &comment, 
   198 		TreeItem *saveSelection);
   199 	/*! Overloaded for convenience */
   200     void saveStateChangingPart(
   201 		TreeItem *undoSelection, 
   202 		TreeItem* redoSelection, 
   203 		const QString &redoCommand, 
   204 		const QString &comment);
   205 	/*! Overloaded for convenience */
   206     void saveStateRemovingPart(
   207 		TreeItem *redoSelection, 
   208 		const QString &comment);
   209 	/*! Overloaded for convenience */
   210     void saveState(
   211 		TreeItem *undoSelection, 
   212 		const QString &undoCommand, 
   213 		TreeItem *redoSelection, 
   214 		const QString &redoCommand, 
   215 		const QString &comment); 
   216 	/*! Overloaded for convenience */
   217     void saveState(
   218 		const QString &undoSelection, 
   219 		const QString &undoCommand, 
   220 		const QString &redoSelection, 
   221 		const QString &redoCommand, 
   222 		const QString &comment) ;
   223     void saveState(
   224 		const QString &undoCommand, 
   225 		const QString &redoCommand, 
   226 		const QString &comment) ;
   227 
   228 
   229 ////////////////////////////////////////////
   230 // unsorted so far
   231 ////////////////////////////////////////////
   232 private:
   233 	QGraphicsScene *mapScene;
   234 public:
   235 	void setScene(QGraphicsScene *s);
   236 	QGraphicsScene *getScene();
   237 
   238     TreeItem* findBySelectString (QString s);		
   239     TreeItem* findID (const uint &i);		// find MapObj by unique ID
   240 
   241 
   242 ////////////////////////////////////////////
   243 // Interface 
   244 ////////////////////////////////////////////
   245 public:
   246 	void setVersion(const  QString &);
   247 	QString getVersion();
   248 	void setAuthor  (const QString &);
   249 	QString getAuthor ();
   250 	void setComment (const QString &);
   251 	QString getComment ();
   252 	QString getDate();
   253 	int branchCount();
   254 
   255 	void setSortFilter (const QString &);
   256 	QString getSortFilter ();
   257 protected:	
   258 	QString sortFilter;
   259 signals:
   260 	void sortFilterChanged (QString );		//!< Notify editors of new filter
   261 
   262 public:
   263 	void setHeading(const QString &);		//!< Set heading of item	
   264 	QString getHeading ();					//!< Get heading of item
   265 	void setNote(const QString &s);			//!< Set note text
   266 	QString getNote();						//!< Get note text
   267 	void loadNote (const QString &fn);		//!< Load note from file
   268 	void saveNote (const QString &fn);		//!< Save note to file
   269 
   270 private:
   271 	BranchItem* findCurrent;				// next object in find process
   272 	BranchItem* findPrevious;				// next object in find process
   273 	bool EOFind;							// true, if search failed
   274 
   275 public:
   276 	void findDuplicateURLs();				// find duplicate URLs, testing only so far
   277     void findAll (FindResultModel*, QString s, Qt::CaseSensitivity cs);	// Search all objects at once, also notes
   278     BranchItem* findText(QString s,Qt::CaseSensitivity cs,QTextCursor &cursor);	// Find object, also in note
   279     void findReset();						// Reset Search
   280 private:	
   281 	QString findString;
   282 
   283 public:
   284 	void setURL(const QString &url);
   285 	QString getURL();						// returns URL of selection or ""
   286 	QStringList getURLs(bool ignoreScrolled=true);	// returns URLs of subtree
   287 
   288 
   289 	void setFrameType(const FrameObj::FrameType &);
   290 	void setFrameType(const QString &);
   291 	void setFramePenColor (const QColor &);
   292 	void setFrameBrushColor (const QColor &);
   293 	void setFramePadding (const int &);
   294 	void setFrameBorderWidth (const int &);
   295 	void setIncludeImagesVer(bool);
   296 	void setIncludeImagesHor(bool);
   297 	void setHideLinkUnselected (bool);
   298 
   299 	/*! Should object be hidden in exports (clouded)? */
   300 	void setHideExport(bool);			
   301 
   302 	/*! Should object be hidden in exports (clouded)? */
   303 	void toggleHideExport();		
   304 
   305 	void addTimestamp();		
   306 
   307     void copy();						//!< Copy to clipboard
   308 private:	
   309     void pasteNoSave(const int &n);		//!< paste clipboard to branch
   310 public:	
   311     void paste();			//!< Paste clipboard to branch and backup
   312     void cut();				//!< Cut to clipboard (and copy)
   313 
   314     bool moveUp(BranchItem *bi);	//!< Move branch up without saving state
   315     void moveUp();					//!< Move branch up with saving state
   316     bool moveDown(BranchItem *bi);	//!< Move branch down without saving state
   317     void moveDown();		//!< Move branch down
   318 	void detach();					//!< Detach branch and use as new mapcenter
   319 	void sortChildren(bool inverse=false);	//!< Sort children lexically
   320 
   321 	// The create methods are used to quickly parse a XML file
   322 	BranchItem* createMapCenter();				//!< Create MapCenter 
   323 	BranchItem* createBranch(BranchItem *dst);	//!< Create Branch
   324 	ImageItem* createImage(BranchItem *dst);	//!< Create image
   325 	XLinkItem* createXLink(BranchItem *dst,bool createMO=false);	//!< Create XLink starting at dst
   326 
   327 	AttributeItem* addAttribute();
   328 	AttributeItem* addAttribute(AttributeItem* );
   329 
   330 	/*! \brief Add new mapcenter
   331 
   332 	    Disclaimer: Still experimental, not fully supported yet.
   333 	*/	
   334 	BranchItem* addMapCenter();
   335 private:	
   336 	BranchItem* addMapCenter(QPointF absPos);
   337 
   338 	/*! \brief Add new branch
   339 
   340 		Depending on num the new branch is created
   341 
   342 		-3 above selection as child of selections parent
   343 		-2 as child of selection
   344 		-1 below selection as child of selections parent
   345 		0..n	insert at a specific position in selections parent
   346 		(needed for free relinking)
   347 	*/	
   348 
   349 private:	
   350     BranchItem* addNewBranchInt(BranchItem *dst, int pos);	// pos allows to add above/below selection
   351 public:	
   352 	/*! \Add new branch
   353 		
   354 		Depending on num the new branch is created
   355 		-1 above selection
   356 		 0 as child of selection
   357 		 1 below selection
   358 	*/
   359     BranchItem* addNewBranch(int pos=0);		
   360     BranchItem* addNewBranchBefore();		//!< Insert branch between selection and its parent
   361 	/*! \brief Relink a branch to a new destination dst 
   362 	    Relinks branch to dst at branch position pos. There is no saveState
   363 		here, as for example moveUp or moving in MapEditor have
   364 		different needs to call saveState
   365 		Returns true if relinking was successful.
   366 	*/	
   367 	bool relinkBranch (BranchItem* branch, BranchItem* dst, int pos =-1);	
   368 	bool relinkImage  (ImageItem* image, BranchItem* dst);	
   369 
   370     void deleteSelection();				//!< Delete selection
   371 	void deleteKeepChildren();			//!< remove branch, but keep children
   372 	void deleteChildren();				//!< keep branch, but remove children
   373 
   374 	TreeItem* deleteItem(TreeItem*);	//!< Delete item and return parent (if parent!= rootItem)
   375 	void clearItem (TreeItem* ti);		//!< Remove all children of TreeItem ti
   376 	bool scrollBranch(BranchItem *);
   377 	bool unscrollBranch(BranchItem *);
   378 public:	
   379     void toggleScroll();
   380     void unscrollChildren();
   381 	void emitExpandAll();
   382 	void emitExpandOneLevel();
   383 	void emitCollapseOneLevel();
   384 signals:	
   385 	void expandAll();
   386 	void expandOneLevel();
   387 	void collapseOneLevel();
   388 
   389 public:	
   390 	void toggleStandardFlag (const QString &name, FlagRow *master=NULL);
   391     void addFloatImage(const QPixmap &img);
   392 
   393     void colorBranch(QColor);
   394     void colorSubtree(QColor);
   395 	QColor getCurrentHeadingColor();
   396 
   397 
   398 	void editURL();							// edit URL
   399 	void editLocalURL();					// edit URL to local file
   400 	void editHeading2URL();					// copy heading to URL
   401 	void editBugzilla2URL();				// create URL to Bugzilla
   402 	void getBugzillaData();					// get data from Novell Bugzilla
   403 	void editFATE2URL();					// create URL to FATE
   404 	void editVymLink();						// edit link to another map
   405 	void setVymLink (const QString &);	// Set vymLink for selection
   406 	void deleteVymLink();					// delete link to another map
   407 	QString getVymLink();					// return path to map
   408 	QStringList getVymLinks();				// return paths in subtree
   409 	void followXLink (int);
   410 	void editXLink (int);
   411 
   412 
   413 
   414 
   415 ////////////////////////////////////////////
   416 // Scripting
   417 ////////////////////////////////////////////
   418 public:	
   419 
   420 	/* \brief Process one command and its parameters */
   421     QVariant parseAtom (const QString &atom, bool &noError, QString &errorMsg);	
   422 
   423 	/* \brief Runs the script */
   424 	QVariant runScript (const QString &script);
   425 
   426 private:
   427 	Parser parser;
   428 
   429 ////////////////////////////////////////////
   430 // Exports
   431 ////////////////////////////////////////////
   432 private:
   433 	TreeItem::HideTmpMode hidemode;	// true while exporting to hide some stuff
   434 
   435 public:
   436 	/*! Set or unset temporary hiding of objects during export  */
   437 	void setExportMode (bool);
   438 
   439 	/*! Save as image */
   440     void exportImage (QString fname="",bool askForName=true,QString format="PNG");
   441 
   442 
   443 	/*! Export as XTML to directory */
   444     void exportXML(QString dir="", bool askForName=true);
   445 
   446 	/*! Export as A&O report text to file */
   447 	void exportAO (QString fname="",bool askForName=true);  
   448 
   449 	/*! Export as ASCII text to file */
   450 	void exportASCII (QString fname="",bool askForName=true);  
   451 
   452 	/*! Export as HTML to directory */
   453     void exportHTML(const QString& dir="", bool useDialog=true);	
   454     void exportXHTML(const QString& dir="", bool askForName=true);	
   455 
   456     /*! Export as OpenOfficeOrg presentation */
   457     void exportOOPresentation(const QString &,const QString &);	
   458 
   459 
   460 ////////////////////////////////////////////
   461 // View related
   462 ////////////////////////////////////////////
   463 public:
   464 	void registerEditor (QWidget *);
   465 	void unregisterEditor (QWidget *);
   466 
   467 private: 
   468 	QPointF contextPos;					//!< local position during context menu
   469 public:
   470 	void setContextPos (QPointF);		//!< local position during context menu
   471 	void unsetContextPos ();			//!< forget local position after context menu
   472 
   473 	void updateNoteFlag();				//!< Signal origination in TextEditor
   474 	void reposition();					//!< Call reposition for all MCOs
   475 	void setHideTmpMode (TreeItem::HideTmpMode mode);	
   476 
   477 	void emitNoteHasChanged (TreeItem *ti);
   478 	void emitDataHasChanged (TreeItem *ti);
   479 
   480 signals:
   481 	void noteHasChanged (QModelIndex ix);
   482 	void newChildObject(QModelIndex ix);
   483 
   484 private:
   485 	MapEditor *mapEditor;
   486 
   487 	QColor defLinkColor;		// default color for links
   488 	QColor defXLinkColor;		// default color for xlinks
   489 	int defXLinkWidth;			// default width for xlinks
   490 	LinkableMapObj::ColorHint linkcolorhint;// use heading color or own color
   491 	LinkableMapObj::Style linkstyle;		// default style for links
   492 
   493 public:
   494 	void setMapLinkStyle (const QString &);	// Set style of link
   495 	LinkableMapObj::Style getMapLinkStyle ();	// requested in LMO
   496 	void setMapDefLinkColor(QColor);		// default color of links
   497 	void setMapLinkColorHintInt();			// color of links
   498 	void setMapLinkColorHint(LinkableMapObj::ColorHint);// color of links
   499 	void toggleMapLinkColorHint();			// after changing linkStyles
   500     void selectMapBackgroundImage();
   501     void setMapBackgroundImage(const QString &);
   502     void selectMapBackgroundColor();
   503     void setMapBackgroundColor(QColor);
   504     QColor getMapBackgroundColor();
   505 
   506 
   507 	LinkableMapObj::ColorHint getMapLinkColorHint();
   508 	QColor getMapDefLinkColor();
   509 	void setMapDefXLinkColor(QColor);
   510 	QColor getMapDefXLinkColor();
   511 	void setMapDefXLinkWidth (int);
   512 	int getMapDefXLinkWidth();
   513 
   514 	/*!  Move absolutly to (x,y).  */	
   515     void move    (const double &x, const double &y);
   516 
   517 	/*!  Move relativly to (x,y).  */	
   518     void moveRel (const double &x, const double &y);
   519 
   520 ////////////////////////////////////////////
   521 // Animation  **experimental**
   522 ////////////////////////////////////////////
   523 private:	
   524 	QTimer *animationTimer;
   525 	bool animationUse;
   526 	uint animationTicks;
   527 	uint animationInterval;
   528 	int timerId;				// animation timer
   529 	QList <MapObj*> animObjList;// list with animated objects //FIXME-2 should go to MapEditor
   530 
   531 private slots:
   532 	void animate();						//!< Called by timer to animate stuff
   533 public:
   534 	void startAnimation(BranchObj *bo, const QPointF &start, const QPointF &dest);
   535 	void stopAnimation(MapObj *mo);
   536 
   537 ////////////////////////////////////////////
   538 // Network related 
   539 ////////////////////////////////////////////
   540 public:
   541     /*! \brief Networking states
   542 		
   543 		In Network modus we want to switch of saveState, autosave, ...
   544 	*/
   545 	enum NetState {
   546 		Offline,			//!< Offline
   547 		Client,				//!< I am the client and connected to server
   548 		Server				//!< I am the server
   549 	};
   550 
   551 private:
   552 	// Network connections **Experimental**
   553 	NetState netstate;			// offline, client, server
   554 	QTcpServer *tcpServer;		// Act as server in conference mode (experimental)
   555 	QList <QTcpSocket*> clientList;		// List of connected clients
   556 	quint16 sendCounter;		// Increased with every sent command
   557 
   558 	QTcpSocket	*clientSocket;	// socket of this client
   559 	QString server;				// server address of this client
   560 	int port;					// server port of this client
   561 
   562 
   563 
   564 protected:
   565 	void sendSelection();
   566 
   567 public:
   568 	void newServer();
   569 	void connectToServer();
   570 
   571 private slots:	
   572 	void newClient();
   573 	void sendData(const QString &s);
   574 	void readData();
   575 	void displayNetworkError (QAbstractSocket::SocketError);
   576 
   577 ////////////////////////////////////////////
   578 // DBUS related 
   579 ////////////////////////////////////////////
   580 
   581 private:
   582 AdaptorModel *adaptorModel; //FIXME-3
   583 
   584 public slots:
   585 	void testslot();
   586 
   587 ////////////////////////////////////////////
   588 // Selection related 
   589 ////////////////////////////////////////////
   590 private:
   591 	TreeItem *latestAddedItem;				// latest added object, reset on setChanged()
   592 
   593 public:
   594 	void setSelectionModel(QItemSelectionModel *);		// Set common selectionModel
   595 	QItemSelectionModel* getSelectionModel();
   596 
   597 	void setSelectionBlocked(bool);
   598 	bool isSelectionBlocked();
   599 
   600 	bool select ();							//! select by using common QItemSelectionModel
   601 	bool select (const QString &);			//! Select by string
   602 	bool select (LinkableMapObj *lmo);		//! Select by pointer to LMO
   603 	bool select (TreeItem *ti );			//! Select by pointer to TreeItem
   604 	bool select (const QModelIndex &index);	//! Select by ModelIndex
   605 	void unselect();
   606 	bool reselect();
   607 
   608 	void emitShowSelection();				//!< Show selection in all views
   609 signals:
   610 	void showSelection();
   611 
   612 public:	
   613     bool selectFirstBranch();
   614     bool selectLastBranch();
   615 	bool selectLastSelectedBranch();
   616 	bool selectParent();
   617 
   618 public:
   619 	TreeItem::Type selectionType();
   620 	LinkableMapObj* getSelectedLMO();
   621 	BranchObj* getSelectedBranchObj();	// FIXME-3 replace by item...
   622 	BranchItem* getSelectedBranch();
   623 	ImageItem* getSelectedImage();
   624 	AttributeItem* getSelectedAttribute();
   625 	TreeItem* getSelectedItem();
   626 	QModelIndex getSelectedIndex();
   627 	QString getSelectString ();
   628 	QString getSelectString (LinkableMapObj *lmo);
   629 	QString getSelectString (TreeItem *item);
   630 	
   631 	
   632 signals:
   633 	void selectionChanged(const QItemSelection &newsel, const QItemSelection &oldsel);
   634 
   635 public:
   636 	void emitSelectionChanged(const QItemSelection &oldsel);
   637 	void emitSelectionChanged();
   638 	void selectMapLinkColor();
   639     void selectMapSelectionColor();
   640 private:	
   641     void setSelectionColorInt(QColor);
   642 	QItemSelectionModel *selModel;
   643 	QString lastSelectString;
   644 	bool selectionBlocked;		//! Used to block changes of selection while editing a heading
   645 
   646 public:	
   647     void setSelectionColor(QColor);
   648     QColor getSelectionColor();
   649 };
   650 
   651 #endif