mapeditor.h
branchqt4-port
changeset 16 41c3d7f9f532
parent 11 b8c547f0fc58
child 17 557239819c45
     1.1 --- a/mapeditor.h	Tue Aug 15 12:01:14 2006 +0000
     1.2 +++ b/mapeditor.h	Tue Aug 29 08:31:42 2006 +0000
     1.3 @@ -2,23 +2,24 @@
     1.4  #define MAPEDITOR_H
     1.5  
     1.6  #include <q3canvas.h>
     1.7 -#include <qlineedit.h>
     1.8 -#include <qcursor.h>
     1.9 -#include <q3filedialog.h>
    1.10 -#include <qevent.h>
    1.11 -#include <q3process.h>
    1.12 +#include <QCursor>
    1.13 +//#include <q3filedialog.h>
    1.14 +#include <QEvent>
    1.15 +//#include <q3process.h>
    1.16  #include <qbuffer.h>
    1.17 -//Added by qt3to4:
    1.18 +#include <QDragEnterEvent>
    1.19  #include <QContextMenuEvent>
    1.20  #include <QDropEvent>
    1.21 +#include <QLineEdit>
    1.22 +#include <QMouseEvent>
    1.23 +#include <QPixmap>
    1.24  #include <QResizeEvent>
    1.25 -#include <QPixmap>
    1.26 -#include <QMouseEvent>
    1.27 -#include <QDragEnterEvent>
    1.28  
    1.29  #include "mapcenterobj.h"
    1.30  #include "file.h"
    1.31  #include "misc.h"
    1.32 +#include "selection.h"
    1.33 +#include "settings.h"
    1.34  #include "showtextdialog.h"
    1.35  
    1.36  class Q3NetworkOperation;
    1.37 @@ -41,17 +42,16 @@
    1.38  	QString getName(LinkableMapObj*);	// Get e.g. heading or filename
    1.39  	void makeTmpDirs();		// create temporary directories
    1.40      QString saveToDir(const QString&,const QString &,bool, const QPoint &,LinkableMapObj*);
    1.41 -    void saveState(const QString &);	// save actual state to backup
    1.42 -    void saveState(LinkableMapObj *, const QString &);
    1.43 -    void saveState(const QString &, const QString &, const QString &);
    1.44 -    void saveState(const QString &, LinkableMapObj *, const QString &);
    1.45 +    void saveStateComplete       (const QString &);					
    1.46 +    void saveStatePart           (LinkableMapObj *, const QString &);
    1.47 +    void saveStateConstSelection (const QString &, const QString &, const QString &);
    1.48 +    void saveStateX				 (LinkableMapObj *, const QString &, const QString &);
    1.49      void saveState(const SaveMode&, const QString &, LinkableMapObj *, const QString &, LinkableMapObj *, const QString &);
    1.50      void parseAtom(const QString &);	
    1.51  
    1.52      void addFloatImage(const QPixmap &img);
    1.53  
    1.54    private slots:
    1.55 -    void finishedLineEdit();
    1.56      void fetchImage(const QString &img);
    1.57      void imageDataFetched(const QByteArray &, Q3NetworkOperation *);
    1.58      void imageDataFinished(Q3NetworkOperation *);
    1.59 @@ -99,11 +99,13 @@
    1.60      void move(const int &,const int&);
    1.61      void moveBranchUp();
    1.62      void moveBranchDown();
    1.63 -    void editHeading();					// Start editing heading 
    1.64 +    void editHeading();						// Start editing heading 
    1.65 +	QString getHeading (bool &,QPoint &);	// Get heading, ok if selection is branch
    1.66 +	void setHeading(const QString &);
    1.67  private:
    1.68 -	void setHeading(const QString &);	// Just set the heading for selection
    1.69 -	void setURL(const QString &);		// Just set the URL for selection
    1.70 -	void setVymLink(const QString &);	// Set vymLink for selection
    1.71 +	void setHeadingInt(const QString &);
    1.72 +	void setURLInt(const QString &);		// Just set the URL for selection
    1.73 +	void setVymLinkInt(const QString &);	// Set vymLink for selection
    1.74  public:	
    1.75      void addNewBranch(int);			// pos allows to add above/below selection
    1.76      void addNewBranchHere();		// insert and make selection its
    1.77 @@ -113,9 +115,9 @@
    1.78  	void reselect();				// after  changing current noteedit
    1.79  	bool select(const QString &);	// Select 
    1.80  private:	
    1.81 -	void select(LinkableMapObj*);	
    1.82 -	void selectNextBranch();		// Increment number of branch
    1.83 -	void selectPrevBranch();		// Decrement number of branch
    1.84 +	void selectInt(LinkableMapObj*);	
    1.85 +	void selectNextBranchInt();		// Increment number of branch
    1.86 +	void selectPrevBranchInt();		// Decrement number of branch
    1.87  public:	
    1.88      void selectUpperBranch();
    1.89      void selectLowerBranch();
    1.90 @@ -170,7 +172,7 @@
    1.91  	void setHideLinkUnselected (bool);
    1.92  	bool getHideLinkUnselected ();
    1.93  private:	
    1.94 -    void importDir(BranchObj *,QDir);
    1.95 +    void importDirInt(BranchObj *,QDir);
    1.96  public:	
    1.97      void importDir();
    1.98  	void followXLink (int);
    1.99 @@ -194,7 +196,6 @@
   1.100  
   1.101  	bool adjustCanvasRequested;	// collect requests until end of user event
   1.102  	BranchObj *editingBO;		// entering Text into BO
   1.103 -    QLineEdit* lineedit;
   1.104  
   1.105      QColor actColor;			// actual color
   1.106  	QColor defLinkColor;		// default color for links
   1.107 @@ -209,7 +210,8 @@
   1.108  	bool drawingLink;			// true while creating a link
   1.109  	bool copyingObj;			// true while creating a link
   1.110  	XLinkObj* tmpXLink;
   1.111 -	
   1.112 +
   1.113 +	Selection xelection;
   1.114      LinkableMapObj* selection;		// select a LinkableMapObj
   1.115      LinkableMapObj* selectionLast;	// last selection 
   1.116      MapObj* movingObj;				// moving a MapObj
   1.117 @@ -238,9 +240,9 @@
   1.118  
   1.119  	bool isInteractive;			// non interactive don't need tmpdirs
   1.120  	QString tmpMapDir;			// tmp directory with data for undo/redo
   1.121 +	QString histPath;			// Path to history file
   1.122  	int undosTotal;				// total number of undos 
   1.123 -	int undoNum;				// current number of bakMapDir to be used 
   1.124 -	int undosAvail;				// how many actions can currently be undone
   1.125 +	SimpleSettings undoSet;		// undo/redo commands
   1.126  	bool blockReposition;		// block while load or undo
   1.127  	bool blockSaveState;		// block while load or undo
   1.128