vymmodel.h
author insilmaril
Fri, 09 Apr 2010 14:24:04 +0000
changeset 846 f0fe7c36ec5c
parent 845 b98c1793bb8b
child 847 43268373032d
permissions -rw-r--r--
Version 1.13.3 and added treeeditor.png
     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 
   454     /*! Export as OpenOfficeOrg presentation */
   455     void exportOOPresentation(const QString &,const QString &);	
   456 
   457 
   458 ////////////////////////////////////////////
   459 // View related
   460 ////////////////////////////////////////////
   461 public:
   462 	void registerEditor (QWidget *);
   463 	void unregisterEditor (QWidget *);
   464 
   465 	void setMapZoomFactor (const double &); 
   466 private: 
   467 	double zoomFactor;
   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 	void emitUpdateLayout ();
   480 
   481 signals:
   482 	void updateLayout();
   483 	void noteHasChanged (QModelIndex ix);
   484 	void newChildObject(QModelIndex ix);
   485 
   486 private:
   487 	MapEditor *mapEditor;
   488 
   489 	QColor defLinkColor;		// default color for links
   490 	QColor defXLinkColor;		// default color for xlinks
   491 	int defXLinkWidth;			// default width for xlinks
   492 	LinkableMapObj::ColorHint linkcolorhint;// use heading color or own color
   493 	LinkableMapObj::Style linkstyle;		// default style for links
   494 
   495 public:
   496 	void setMapLinkStyle (const QString &);	// Set style of link
   497 	LinkableMapObj::Style getMapLinkStyle ();	// requested in LMO
   498 	void setMapDefLinkColor(QColor);		// default color of links
   499 	void setMapLinkColorHintInt();			// color of links
   500 	void setMapLinkColorHint(LinkableMapObj::ColorHint);// color of links
   501 	void toggleMapLinkColorHint();			// after changing linkStyles
   502     void selectMapBackgroundImage();
   503     void setMapBackgroundImage(const QString &);
   504     void selectMapBackgroundColor();
   505     void setMapBackgroundColor(QColor);
   506     QColor getMapBackgroundColor();
   507 
   508 
   509 	LinkableMapObj::ColorHint getMapLinkColorHint();
   510 	QColor getMapDefLinkColor();
   511 	void setMapDefXLinkColor(QColor);
   512 	QColor getMapDefXLinkColor();
   513 	void setMapDefXLinkWidth (int);
   514 	int getMapDefXLinkWidth();
   515 
   516 	/*!  Move absolutly to (x,y).  */	
   517     void move    (const double &x, const double &y);
   518 
   519 	/*!  Move relativly to (x,y).  */	
   520     void moveRel (const double &x, const double &y);
   521 
   522 ////////////////////////////////////////////
   523 // Animation  **experimental**
   524 ////////////////////////////////////////////
   525 private:	
   526 	QTimer *animationTimer;
   527 	bool animationUse;
   528 	uint animationTicks;
   529 	uint animationInterval;
   530 	int timerId;				// animation timer
   531 	QList <MapObj*> animObjList;// list with animated objects //FIXME-2 should go to MapEditor
   532 
   533 private slots:
   534 	void animate();						//!< Called by timer to animate stuff
   535 public:
   536 	void startAnimation(BranchObj *bo, const QPointF &v);
   537 	void startAnimation(BranchObj *bo, const QPointF &start, const QPointF &dest);
   538 	void stopAnimation(MapObj *mo);
   539 
   540 ////////////////////////////////////////////
   541 // Network related 
   542 ////////////////////////////////////////////
   543 public:
   544     /*! \brief Networking states
   545 		
   546 		In Network modus we want to switch of saveState, autosave, ...
   547 	*/
   548 	enum NetState {
   549 		Offline,			//!< Offline
   550 		Client,				//!< I am the client and connected to server
   551 		Server				//!< I am the server
   552 	};
   553 
   554 private:
   555 	// Network connections **Experimental**
   556 	NetState netstate;			// offline, client, server
   557 	QTcpServer *tcpServer;		// Act as server in conference mode (experimental)
   558 	QList <QTcpSocket*> clientList;		// List of connected clients
   559 	quint16 sendCounter;		// Increased with every sent command
   560 
   561 	QTcpSocket	*clientSocket;	// socket of this client
   562 	QString server;				// server address of this client
   563 	int port;					// server port of this client
   564 
   565 
   566 
   567 protected:
   568 	void sendSelection();
   569 
   570 public:
   571 	void newServer();
   572 	void connectToServer();
   573 
   574 private slots:	
   575 	void newClient();
   576 	void sendData(const QString &s);
   577 	void readData();
   578 	void displayNetworkError (QAbstractSocket::SocketError);
   579 
   580 ////////////////////////////////////////////
   581 // DBUS related 
   582 ////////////////////////////////////////////
   583 
   584 private:
   585 AdaptorModel *adaptorModel; //FIXME-3
   586 
   587 public slots:
   588 	void testslot();
   589 
   590 ////////////////////////////////////////////
   591 // Selection related 
   592 ////////////////////////////////////////////
   593 private:
   594 	TreeItem *latestAddedItem;				// latest added object, reset on setChanged()
   595 
   596 public:
   597 	void setSelectionModel(QItemSelectionModel *);		// Set common selectionModel
   598 	QItemSelectionModel* getSelectionModel();
   599 
   600 	void setSelectionBlocked(bool);
   601 	bool isSelectionBlocked();
   602 
   603 	bool select ();							//! select by using common QItemSelectionModel
   604 	bool select (const QString &);			//! Select by string
   605 	bool select (LinkableMapObj *lmo);		//! Select by pointer to LMO
   606 	bool select (TreeItem *ti );			//! Select by pointer to TreeItem
   607 	bool select (TreeItem *ti,int i );		//! Select by pointer to TreeItem and index in note
   608 	bool select (const QModelIndex &index);	//! Select by ModelIndex
   609 	void unselect();
   610 	bool reselect();
   611 
   612 	void emitShowSelection();				//!< Show selection in all views
   613 signals:
   614 	void showSelection();
   615 
   616 public:	
   617     bool selectFirstBranch();
   618     bool selectLastBranch();
   619 	bool selectLastSelectedBranch();
   620 	bool selectParent();
   621 
   622 public:
   623 	TreeItem::Type selectionType();
   624 	LinkableMapObj* getSelectedLMO();
   625 	BranchObj* getSelectedBranchObj();	// FIXME-3 replace by item...
   626 	BranchItem* getSelectedBranch();
   627 	ImageItem* getSelectedImage();
   628 	AttributeItem* getSelectedAttribute();
   629 	TreeItem* getSelectedItem();
   630 	QModelIndex getSelectedIndex();
   631 	QString getSelectString ();
   632 	QString getSelectString (LinkableMapObj *lmo);
   633 	QString getSelectString (TreeItem *item);
   634 	
   635 	
   636 signals:
   637 	void selectionChanged(const QItemSelection &newsel, const QItemSelection &oldsel);
   638 
   639 public:
   640 	void emitSelectionChanged(const QItemSelection &oldsel);
   641 	void emitSelectionChanged();
   642 	void selectMapLinkColor();
   643     void selectMapSelectionColor();
   644 private:	
   645     void setSelectionColorInt(QColor);
   646 	QItemSelectionModel *selModel;
   647 	QString lastSelectString;
   648 	bool selectionBlocked;		//! Used to block changes of selection while editing a heading
   649 
   650 public:	
   651     void setSelectionColor(QColor);
   652     QColor getSelectionColor();
   653 };
   654 
   655 #endif