diff -r 1cc73bd7ee1f -r e95081c21da2 mapeditor.h --- a/mapeditor.h Tue Sep 05 09:47:13 2006 +0000 +++ b/mapeditor.h Tue Sep 05 09:47:14 2006 +0000 @@ -1,32 +1,40 @@ #ifndef MAPEDITOR_H #define MAPEDITOR_H -#include -#include -#include -#include -#include -#include -#include +#include +//#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "mapcenterobj.h" #include "file.h" #include "misc.h" +#include "selection.h" +#include "settings.h" #include "showtextdialog.h" -class QNetworkOperation; -class QUrlOperator; +class Q3NetworkOperation; +class Q3UrlOperator; -class MapEditor : public QCanvasView , public xmlObj { +class MapEditor : public Q3CanvasView , public xmlObj { Q_OBJECT public: - MapEditor(QWidget* parent=0, bool interactive=false, const char* name=0, WFlags f=0); + MapEditor(QWidget* parent=0, bool interactive=false, const char* name=0, Qt::WFlags f=0); ~MapEditor(); QColor color(); QColor backgroundColor(); MapCenterObj* getMapCenter(); - QCanvas* getCanvas(); + Q3Canvas* getCanvas(); void adjustCanvasSize();// adjust canvas size to map and scrollview bool isRepositionBlocked(); // block while load or undo @@ -34,20 +42,21 @@ QString getName(LinkableMapObj*); // Get e.g. heading or filename void makeTmpDirs(); // create temporary directories QString saveToDir(const QString&,const QString &,bool, const QPoint &,LinkableMapObj*); - void saveState(const QString &); // save actual state to backup - void saveState(LinkableMapObj *, const QString &); - void saveState(const QString &, const QString &, const QString &); - void saveState(const QString &, LinkableMapObj *, const QString &); - void saveState(const SaveMode&, const QString &, LinkableMapObj *, const QString &, LinkableMapObj *, const QString &); + void saveStateComplete (const QString &); + void saveStatePart (LinkableMapObj *, const QString &); + void saveStateConstSelection (const QString &, const QString &, const QString &); + void saveStateComData (LinkableMapObj *, const QString &, LinkableMapObj *, const QString &, const QString &, LinkableMapObj *); + void saveState(LinkableMapObj *, const QString &, LinkableMapObj *, const QString &, const QString &); + void saveState(const QString &, const QString &, const QString &, const QString &, const QString &); + void saveState(const SaveMode&, const QString &, const QString &, const QString &, const QString &, const QString &, LinkableMapObj *); void parseAtom(const QString &); void addFloatImage(const QPixmap &img); private slots: - void finishedLineEdit(); void fetchImage(const QString &img); - void imageDataFetched(const QByteArray &, QNetworkOperation *); - void imageDataFinished(QNetworkOperation *); + void imageDataFetched(const QByteArray &, Q3NetworkOperation *); + void imageDataFinished(Q3NetworkOperation *); public: void toggleHistoryWindow(); @@ -74,8 +83,8 @@ HideTmpMode getHideTmpMode(); // temporary hide stuff public: void setExportMode (bool); // temporary hide stuff during export - void exportImage (QString fn); // export as PNG - void exportImage (QString fn, int); // export in given format + void exportImage (QString fn); // export as PNG + void exportImage (QString fn, QString); // export in given format void exportOOPresentation(const QString &,const QString &); void exportXML(const QString&); // export to directory void clear(); // clear map @@ -89,14 +98,17 @@ public: void paste(); // paste clipboard to branch and backup void cut(); // cut to clipboard and backup - void move(const int &,const int&); + void move (const int &,const int&); + void moveRel (const int &,const int&); void moveBranchUp(); void moveBranchDown(); - void editHeading(); // Start editing heading + QString getHeading (bool &,QPoint &); // Get heading, ok if selection is branch + void setHeading(const QString &); private: - void setHeading(const QString &); // Just set the heading for selection - void setURL(const QString &); // Just set the URL for selection - void setVymLink(const QString &); // Set vymLink for selection + void setHeadingInt(const QString &); + void setURLInt(const QString &); // Just set the URL for selection + void setVymLinkInt(const QString &); // Set vymLink for selection + BranchObj* addNewBranchInt(int); // pos allows to add above/below selection public: void addNewBranch(int); // pos allows to add above/below selection void addNewBranchHere(); // insert and make selection its @@ -104,11 +116,12 @@ LinkableMapObj* getSelection(); // returns selection void unselect(); // before changing current noteedit void reselect(); // after changing current noteedit - bool select(const QString &); // Select + bool select(const QString &); // Select by string + QString getSelectString(); private: - void select(LinkableMapObj*); - void selectNextBranch(); // Increment number of branch - void selectPrevBranch(); // Decrement number of branch + void selectInt(LinkableMapObj*); + void selectNextBranchInt(); // Increment number of branch + void selectPrevBranchInt(); // Decrement number of branch public: void selectUpperBranch(); void selectLowerBranch(); @@ -128,12 +141,14 @@ void findReset(); // Reset Find void editURL(); // edit the URL QString getURL(); // returns URL of selection or "" + QStringList getURLs(); // returns URLs of subtree void editHeading2URL(); // copy heading to URL void editBugzilla2URL(); // create URL to Bugzilla void editFATE2URL(); // create URL to FATE void editVymLink(); // edit link to another map void deleteVymLink(); // delete link to another map QString getVymLink(); // return path to map + QStringList getVymLinks(); // return paths in subtree void toggleHideExport(); // toggle the export flag void removeBranchKeepChilds(); // remove but keep childs void removeChilds(); // remove childs @@ -156,19 +171,20 @@ void toggleScroll(); void unScrollAll(); void loadFloatImage (); - void saveFloatImage (int); + void saveFloatImage (); void setFrame(const FrameType &); void setIncludeImagesVer(bool); void setIncludeImagesHor(bool); void setHideLinkUnselected (bool); bool getHideLinkUnselected (); private: - void importDir(BranchObj *,QDir); + void importDirInt(BranchObj *,QDir); public: void importDir(); void followXLink (int); void editXLink (int); - void testFunction(); // FIXME just testing + void testFunction(); // just testing new stuff + // set /mainwindo/showTestMenu=true... protected: void ensureSelectionVisible(); @@ -182,12 +198,11 @@ virtual void contentsDragEnterEvent(QDragEnterEvent *event); virtual void contentsDropEvent(QDropEvent *event); private: - QCanvas* mapCanvas; + Q3Canvas* mapCanvas; MapCenterObj* mapCenter; bool adjustCanvasRequested; // collect requests until end of user event BranchObj *editingBO; // entering Text into BO - QLineEdit* lineedit; QColor actColor; // actual color QColor defLinkColor; // default color for links @@ -202,12 +217,14 @@ bool drawingLink; // true while creating a link bool copyingObj; // true while creating a link XLinkObj* tmpXLink; - + + Selection xelection; LinkableMapObj* selection; // select a LinkableMapObj LinkableMapObj* selectionLast; // last selection MapObj* movingObj; // moving a MapObj MapObj* linkingObj_src; // part of a link QPoint movingObj_orgPos; // org. pos of mouse before move + QPoint movingObj_orgRelPos; // org. relative pos of mouse before move QPoint movingObj_start; // rel. pos of mouse to absPos QPoint movingCont_start; // inital pos of moving Content or QPoint movingVec; // how far has Content moved @@ -228,13 +245,12 @@ QString fileDir; // dir where file is saved QString destPath; // path to .vym file (needed for vymlinks) QString mapName; // fileName without ".vym" - QString lastImageDir; // save dir for adding images bool isInteractive; // non interactive don't need tmpdirs QString tmpMapDir; // tmp directory with data for undo/redo + QString histPath; // Path to history file int undosTotal; // total number of undos - int undoNum; // current number of bakMapDir to be used - int undosAvail; // how many actions can currently be undone + SimpleSettings undoSet; // undo/redo commands bool blockReposition; // block while load or undo bool blockSaveState; // block while load or undo @@ -246,7 +262,7 @@ void resizeEvent( QResizeEvent * ); - QUrlOperator *urlOperator; + Q3UrlOperator *urlOperator; QDataStream *imageData; QBuffer *imageBuffer;