vymmodel.h
author insilmaril
Mon, 22 Mar 2010 15:37:23 +0000
changeset 841 46553c106c52
parent 837 5ecd0462f76b
child 842 bec082472471
permissions -rw-r--r--
Fixes for QLineEdit and moving vym.changelog up one level
     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 	void setMapZoomFactor (const double &); 
   468 private: 
   469 	double zoomFactor;
   470 	QPointF contextPos;					//!< local position during context menu
   471 public:
   472 	void setContextPos (QPointF);		//!< local position during context menu
   473 	void unsetContextPos ();			//!< forget local position after context menu
   474 
   475 	void updateNoteFlag();				//!< Signal origination in TextEditor
   476 	void reposition();					//!< Call reposition for all MCOs
   477 	void setHideTmpMode (TreeItem::HideTmpMode mode);	
   478 
   479 	void emitNoteHasChanged (TreeItem *ti);
   480 	void emitDataHasChanged (TreeItem *ti);
   481 	void emitUpdateLayout ();
   482 
   483 signals:
   484 	void updateLayout();
   485 	void noteHasChanged (QModelIndex ix);
   486 	void newChildObject(QModelIndex ix);
   487 
   488 private:
   489 	MapEditor *mapEditor;
   490 
   491 	QColor defLinkColor;		// default color for links
   492 	QColor defXLinkColor;		// default color for xlinks
   493 	int defXLinkWidth;			// default width for xlinks
   494 	LinkableMapObj::ColorHint linkcolorhint;// use heading color or own color
   495 	LinkableMapObj::Style linkstyle;		// default style for links
   496 
   497 public:
   498 	void setMapLinkStyle (const QString &);	// Set style of link
   499 	LinkableMapObj::Style getMapLinkStyle ();	// requested in LMO
   500 	void setMapDefLinkColor(QColor);		// default color of links
   501 	void setMapLinkColorHintInt();			// color of links
   502 	void setMapLinkColorHint(LinkableMapObj::ColorHint);// color of links
   503 	void toggleMapLinkColorHint();			// after changing linkStyles
   504     void selectMapBackgroundImage();
   505     void setMapBackgroundImage(const QString &);
   506     void selectMapBackgroundColor();
   507     void setMapBackgroundColor(QColor);
   508     QColor getMapBackgroundColor();
   509 
   510 
   511 	LinkableMapObj::ColorHint getMapLinkColorHint();
   512 	QColor getMapDefLinkColor();
   513 	void setMapDefXLinkColor(QColor);
   514 	QColor getMapDefXLinkColor();
   515 	void setMapDefXLinkWidth (int);
   516 	int getMapDefXLinkWidth();
   517 
   518 	/*!  Move absolutly to (x,y).  */	
   519     void move    (const double &x, const double &y);
   520 
   521 	/*!  Move relativly to (x,y).  */	
   522     void moveRel (const double &x, const double &y);
   523 
   524 ////////////////////////////////////////////
   525 // Animation  **experimental**
   526 ////////////////////////////////////////////
   527 private:	
   528 	QTimer *animationTimer;
   529 	bool animationUse;
   530 	uint animationTicks;
   531 	uint animationInterval;
   532 	int timerId;				// animation timer
   533 	QList <MapObj*> animObjList;// list with animated objects //FIXME-2 should go to MapEditor
   534 
   535 private slots:
   536 	void animate();						//!< Called by timer to animate stuff
   537 public:
   538 	void startAnimation(BranchObj *bo, const QPointF &v);
   539 	void startAnimation(BranchObj *bo, const QPointF &start, const QPointF &dest);
   540 	void stopAnimation(MapObj *mo);
   541 
   542 ////////////////////////////////////////////
   543 // Network related 
   544 ////////////////////////////////////////////
   545 public:
   546     /*! \brief Networking states
   547 		
   548 		In Network modus we want to switch of saveState, autosave, ...
   549 	*/
   550 	enum NetState {
   551 		Offline,			//!< Offline
   552 		Client,				//!< I am the client and connected to server
   553 		Server				//!< I am the server
   554 	};
   555 
   556 private:
   557 	// Network connections **Experimental**
   558 	NetState netstate;			// offline, client, server
   559 	QTcpServer *tcpServer;		// Act as server in conference mode (experimental)
   560 	QList <QTcpSocket*> clientList;		// List of connected clients
   561 	quint16 sendCounter;		// Increased with every sent command
   562 
   563 	QTcpSocket	*clientSocket;	// socket of this client
   564 	QString server;				// server address of this client
   565 	int port;					// server port of this client
   566 
   567 
   568 
   569 protected:
   570 	void sendSelection();
   571 
   572 public:
   573 	void newServer();
   574 	void connectToServer();
   575 
   576 private slots:	
   577 	void newClient();
   578 	void sendData(const QString &s);
   579 	void readData();
   580 	void displayNetworkError (QAbstractSocket::SocketError);
   581 
   582 ////////////////////////////////////////////
   583 // DBUS related 
   584 ////////////////////////////////////////////
   585 
   586 private:
   587 AdaptorModel *adaptorModel; //FIXME-3
   588 
   589 public slots:
   590 	void testslot();
   591 
   592 ////////////////////////////////////////////
   593 // Selection related 
   594 ////////////////////////////////////////////
   595 private:
   596 	TreeItem *latestAddedItem;				// latest added object, reset on setChanged()
   597 
   598 public:
   599 	void setSelectionModel(QItemSelectionModel *);		// Set common selectionModel
   600 	QItemSelectionModel* getSelectionModel();
   601 
   602 	void setSelectionBlocked(bool);
   603 	bool isSelectionBlocked();
   604 
   605 	bool select ();							//! select by using common QItemSelectionModel
   606 	bool select (const QString &);			//! Select by string
   607 	bool select (LinkableMapObj *lmo);		//! Select by pointer to LMO
   608 	bool select (TreeItem *ti );			//! Select by pointer to TreeItem
   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