vymmodel.h
changeset 784 9db215a4ad53
parent 781 6cbf3c9cbd21
child 785 5987f9f15bac
     1.1 --- a/vymmodel.h	Mon Jul 27 12:53:17 2009 +0000
     1.2 +++ b/vymmodel.h	Mon Jul 27 12:53:17 2009 +0000
     1.3 @@ -3,8 +3,11 @@
     1.4  
     1.5  #include <QGraphicsScene>
     1.6  #include <QtNetwork>
     1.7 -#include <QtDBus/QDBusConnection>
     1.8  
     1.9 +#include <QtDBus/QDBusAbstractAdaptor>
    1.10 +#include <QtDBus/QDBusVariant>
    1.11 +
    1.12 +#include "adaptormodel.h"
    1.13  #include "file.h"
    1.14  #include "imageitem.h"
    1.15  #include "mapeditor.h"
    1.16 @@ -15,14 +18,15 @@
    1.17  class BranchItem;
    1.18  class MapEditor;
    1.19  
    1.20 -class VymModel : public TreeModel {		
    1.21 +class VymModel :  public TreeModel {		
    1.22  	Q_OBJECT
    1.23 +	Q_CLASSINFO("D-Bus Interface", "org.insilmaril.vym.VymModel-h")
    1.24 +
    1.25  
    1.26  ////////////////////////////////////////////
    1.27  // General housekeeping
    1.28  ////////////////////////////////////////////
    1.29  private:
    1.30 -	QGraphicsScene *mapScene;
    1.31  	QString version;	//!< version string saved in vym file
    1.32  	QString author;
    1.33  	QString comment;
    1.34 @@ -215,6 +219,8 @@
    1.35  ////////////////////////////////////////////
    1.36  // unsorted so far
    1.37  ////////////////////////////////////////////
    1.38 +private:
    1.39 +	QGraphicsScene *mapScene;
    1.40  public:
    1.41  	void setScene(QGraphicsScene *s);
    1.42  	QGraphicsScene *getScene();
    1.43 @@ -236,13 +242,13 @@
    1.44  	int branchCount();
    1.45  
    1.46  public:	
    1.47 -	void setHeading(const QString &);		//!< Set heading of branch	
    1.48 -//	QString getHeading (bool &ok,QPoint &p); //!< Get heading, ok if selection is branch
    1.49 +	void setHeading(const QString &);		//!< Set heading of item	
    1.50 +	QString getHeading ();					//!< Get heading of item
    1.51  
    1.52  private:
    1.53 -	BranchItem* findCurrent;		// next object in find process
    1.54 -	BranchItem* findPrevious;		// next object in find process
    1.55 -	bool EOFind;				// true, if search failed
    1.56 +	BranchItem* findCurrent;				// next object in find process
    1.57 +	BranchItem* findPrevious;				// next object in find process
    1.58 +	bool EOFind;							// true, if search failed
    1.59  public:
    1.60      BranchItem* findText(QString,bool);		// Find object
    1.61      void findReset();						// Reset Search
    1.62 @@ -272,17 +278,17 @@
    1.63  private:	
    1.64      void pasteNoSave(const int &n);		//!< paste clipboard to branch
    1.65  public:	
    1.66 -    void paste();		//!< Paste clipboard to branch and backup
    1.67 -    void cut();			//!< Cut to clipboard (and copy)
    1.68 +    void paste();			//!< Paste clipboard to branch and backup
    1.69 +    void cut();				//!< Cut to clipboard (and copy)
    1.70  
    1.71 -    void moveUp();	//!< Move branch up
    1.72 -    void moveDown();	//!< Move branch down
    1.73 +    void moveUp();			//!< Move branch up
    1.74 +    void moveDown();		//!< Move branch down
    1.75  	void sortChildren();	//!< Sort children lexically
    1.76  
    1.77  	// The create methods are used to quickly parse a XML file
    1.78  	BranchItem* createMapCenter();				//!< Create MapCenter 
    1.79  	BranchItem* createBranch(BranchItem *dst);	//!< Create Branch
    1.80 -	ImageItem* createImage(BranchItem *dst);		//!< Create image
    1.81 +	ImageItem* createImage(BranchItem *dst);	//!< Create image
    1.82  
    1.83  	/*! \brief Add new mapcenter
    1.84  
    1.85 @@ -421,7 +427,6 @@
    1.86  	void updateNoteFlag();				//!< Signal origination in TextEditor
    1.87      void updateRelPositions();
    1.88  
    1.89 -	QRectF getTotalBBox();
    1.90  	void reposition();					//!< Call reposition for all MCOs
    1.91  	void setHideTmpMode (TreeItem::HideTmpMode mode);	
    1.92  
    1.93 @@ -444,9 +449,6 @@
    1.94  	LinkableMapObj::ColorHint linkcolorhint;// use heading color or own color
    1.95  	LinkableMapObj::Style linkstyle;		// default style for links
    1.96  
    1.97 -private:
    1.98 -    QPixmap getPixmap();
    1.99 -
   1.100  public:
   1.101  	void setMapLinkStyle (const QString &);	// Set style of link
   1.102  	LinkableMapObj::Style getMapLinkStyle ();	// requested in LMO
   1.103 @@ -531,9 +533,12 @@
   1.104  	void readData();
   1.105  	void displayNetworkError (QAbstractSocket::SocketError);
   1.106  
   1.107 -private:	
   1.108 -	void displayClientError(QAbstractSocket::SocketError socketError);
   1.109 +////////////////////////////////////////////
   1.110 +// DBUS related 
   1.111 +////////////////////////////////////////////
   1.112  
   1.113 +private:
   1.114 +AdaptorModel *adaptorModel; //FIXME-3
   1.115  
   1.116  ////////////////////////////////////////////
   1.117  // Selection related