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