Removed even more QT3 stuff. Drag & Drop not 100% functional at the moment
7 #include "mapcenterobj.h"
10 #include "selection.h"
14 class MapEditor : public Q3CanvasView , public xmlObj {
18 MapEditor(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
20 MapCenterObj* getMapCenter();
21 Q3Canvas* getCanvas();
22 void adjustCanvasSize();// adjust canvas size to map and scrollview
23 bool isRepositionBlocked(); // block while load or undo
26 QString getName(LinkableMapObj*); // Get e.g. heading or filename
27 void makeTmpDirs(); // create temporary directories
28 QString saveToDir(const QString&,const QString &,bool, const QPoint &,LinkableMapObj*);
29 void saveStateChangingPart (LinkableMapObj *, LinkableMapObj *, const QString &, const QString &);
30 void saveStateRemovingPart (LinkableMapObj *, const QString &);
31 void saveState(LinkableMapObj *, const QString &, LinkableMapObj *, const QString &, const QString &);
32 void saveState(const QString &, const QString &, const QString &, const QString &, const QString &);
33 void saveState(const SaveMode&, const QString &, const QString &, const QString &, const QString &, const QString &, LinkableMapObj *);
35 void parseAtom(const QString &);
37 void addFloatImageInt(const QPixmap &img);
40 //FIXME not needed QT4 void fetchImage(const QString &img);
41 //FIXME not needed QT4 void imageDataFetched(const QByteArray &, Q3NetworkOperation *);
42 //FIXME not needed QT4 void imageDataFinished(Q3NetworkOperation *);
45 void toggleHistoryWindow();
46 bool isDefault(); // false, if map was changed once
47 bool isUnsaved(); // save necessary
48 bool hasChanged(); // undo possible
49 void setChanged(); // called from NoteEditor via LMO
51 void setFilePath (QString);
52 void setFilePath (QString,QString);
53 QString getFilePath (); // Full path e.g. "/home/tux/map.xml"
54 QString getFileName (); // e.g. "map.xml"
55 QString getMapName (); // e.g. "map"
56 QString getDestPath (); // e.g. "/home/tux/map.vym"
57 ErrorCode load (QString, LoadMode ); // newmap, import/replace selection
59 int save(const SaveMode &); // Save map
60 void setZipped(bool); // save map zipped
61 bool saveZipped(); // 1 if file will be saved zipped
62 void print(); // print canvas
65 void setHideTmpMode (HideTmpMode); // temporary hide stuff
66 HideTmpMode getHideTmpMode(); // temporary hide stuff
68 void setExportMode (bool); // temporary hide stuff during export
69 void exportImage (QString fn); // export as PNG
70 void exportImage (QString fn, QString); // export in given format
71 void exportOOPresentation(const QString &,const QString &);
72 void exportXML(const QString&); // export to directory
73 void clear(); // clear map
74 void copy(); // copy branch to clipboard
75 void redo(); // redo last action
76 bool isRedoAvailable();
77 void undo(); // undo last action
78 bool isUndoAvailable();
79 void gotoHistoryStep (int);// goto a step in history
81 void addMapReplaceInt(const QString & undoSel, const QString & path);
82 void addMapInsertInt (const QString & path, int pos);
83 void pasteNoSave(); // paste clipboard to branch
84 void cutNoSave(); // cut to clipboard
86 void paste(); // paste clipboard to branch and backup
87 void cut(); // cut to clipboard and backup
88 void move (const int &x, const int &y);
89 void moveRel (const int &x, const int &y);
91 void moveBranchDown();
92 QString getHeading (bool &ok,QPoint &p); // Get heading, ok if selection is branch
93 void setHeading(const QString &);
95 void setHeadingInt(const QString &);
96 void setURLInt(const QString &); // Just set the URL for selection
97 void setVymLinkInt(const QString &); // Set vymLink for selection
98 BranchObj* addNewBranchInt(int); // pos allows to add above/below selection
100 BranchObj* addNewBranch(int); // pos allows to add above/below selection
101 BranchObj* addNewBranchBefore(); // insert and make selection its
102 void deleteSelection();
103 LinkableMapObj* getSelection(); // returns selection
104 void unselect(); // before changing current noteedit
105 void reselect(); // after changing current noteedit
106 bool select(const QString &); // Select by string
107 QString getSelectString();
109 void selectInt(LinkableMapObj*);
110 void selectNextBranchInt(); // Increment number of branch
111 void selectPrevBranchInt(); // Decrement number of branch
113 void selectUpperBranch();
114 void selectLowerBranch();
115 void selectLeftBranch();
116 void selectRightBranch();
117 void selectFirstBranch();
118 void selectLastBranch();
119 void selectMapBackgroundColor();
120 void setMapBackgroundColor(QColor);
121 QColor getMapBackgroundColor();
122 QColor getCurrentHeadingColor();
123 void colorItem(QColor);
124 void colorBranch(QColor);
125 void toggleStandardFlag(QString);
126 virtual void setViewCenter(); // needed for zooming
127 BranchObj* findText(QString,bool); // Find object
128 void findReset(); // Reset Find
129 void setURL(const QString &); // set the URL
130 void editURL(); // edit the URL
131 QString getURL(); // returns URL of selection or ""
132 QStringList getURLs(); // returns URLs of subtree
133 void editHeading2URL(); // copy heading to URL
134 void editBugzilla2URL(); // create URL to Bugzilla
135 void editFATE2URL(); // create URL to FATE
136 void editVymLink(); // edit link to another map
137 void deleteVymLink(); // delete link to another map
138 QString getVymLink(); // return path to map
139 QStringList getVymLinks(); // return paths in subtree
140 void setHideExport(bool); // toggle the export flag
141 void toggleHideExport(); // toggle the export flag
142 void deleteKeepChilds(); // remove but keep childs
143 void deleteChilds(); // remove childs
144 void editMapInfo(); // dialog to enter author, ...
145 void updateActions(); // update e.g. format buttons
146 void updateNoteFlag(); // when TextEditor changes
147 void setMapAuthor (const QString &);
148 void setMapComment(const QString &);
149 void setMapLinkStyle (const QString &); // Set style of link
150 LinkStyle getMapLinkStyle (); // requested in LMO
151 void setMapDefLinkColor(QColor); // default color of links
152 void setMapLinkColorHintInt(); // color of links
153 void setMapLinkColorHint(LinkColorHint);// color of links
154 LinkColorHint getMapLinkColorHint();
155 QColor getMapDefLinkColor();
156 void setMapDefXLinkColor(QColor);
157 QColor getMapDefXLinkColor();
158 void setMapDefXLinkWidth (int);
159 int getMapDefXLinkWidth();
160 void toggleMapLinkColorHint(); // after changing linkStyles
161 void selectMapLinkColor();
164 void loadFloatImage ();
165 void saveFloatImage ();
166 void setFrame(const FrameType &);
167 void setIncludeImagesVer(bool);
168 void setIncludeImagesHor(bool);
169 void setHideLinkUnselected (bool);
170 bool getHideLinkUnselected ();
172 void importDirInt(BranchObj *,QDir);
175 void followXLink (int);
176 void editXLink (int);
177 void testFunction(); // just testing new stuff
178 // set /mainwindo/showTestMenu=true...
181 void ensureSelectionVisible();
182 virtual void updateViewCenter(); // needed for zooming
183 virtual void contentsContextMenuEvent ( QContextMenuEvent *e );
184 virtual void keyPressEvent(QKeyEvent*);
185 virtual void keyReleaseEvent(QKeyEvent*);
186 virtual void contentsMousePressEvent(QMouseEvent*);
187 virtual void contentsMouseReleaseEvent(QMouseEvent*);
188 virtual void contentsMouseDoubleClickEvent(QMouseEvent*);
189 virtual void contentsMouseMoveEvent(QMouseEvent*);
191 virtual void contentsDragEnterEvent(QDragEnterEvent *event);
192 virtual void contentsDropEvent(QDropEvent *event);
195 MapCenterObj* mapCenter;
197 bool adjustCanvasRequested; // collect requests until end of user event
198 BranchObj *editingBO; // entering Text into BO
200 QColor defLinkColor; // default color for links
201 QColor defXLinkColor; // default color for xlinks
202 int defXLinkWidth; // default width for xlinks
203 LinkColorHint linkcolorhint;// use heading color or own color
204 LinkStyle linkstyle; // default style for links
206 QCursor HandOpenCursor; // cursor while moving canvas view
207 QCursor PickColorCursor; // cursor while picking color
208 QCursor CopyCursor; // cursor while picking color
209 QCursor XLinkCursor; // cursor while picking color
211 bool drawingLink; // true while creating a link
212 bool copyingObj; // true while creating a link
216 LinkableMapObj* selection; // select a LinkableMapObj
217 LinkableMapObj* selectionLast; // last selection
218 MapObj* movingObj; // moving a MapObj
219 MapObj* linkingObj_src; // part of a link
220 QPoint movingObj_orgPos; // org. pos of mouse before move
221 QPoint movingObj_orgRelPos; // org. relative pos of mouse before move
222 QPoint movingObj_start; // rel. pos of mouse to absPos
223 QPoint movingCont_start; // inital pos of moving Content or
224 QPoint movingVec; // how far has Content moved
225 QPoint movingCenter; // used when zooming
226 QPrinter* printer; // Printing
228 bool mapDefault; // Flag if map is untouched
229 bool mapChanged; // Flag if undo is possible
230 bool mapUnsaved; // Flag if map should be saved
232 bool printFrame; // Print frame around map
233 bool printFooter; // Print footer below map
235 bool zipped; // should map be zipped
236 static int mapNum; // unique number for Editor
237 QString fileName; // short name of file (for tab)
238 QString filePath; // path to file which will be saved
239 QString fileDir; // dir where file is saved
240 QString destPath; // path to .vym file (needed for vymlinks)
241 QString mapName; // fileName without ".vym"
243 QString tmpMapDir; // tmp directory with undo history
244 QString histPath; // Path to history file
245 int stepsTotal; // total number of steps (undos+redos)
246 SimpleSettings undoSet; // undo/redo commands
247 bool blockReposition; // block while load or undo
248 bool blockSaveState; // block while load or undo
250 BranchObj* itFind; // next object in find process
251 bool EOFind; // true, if search failed
253 QPoint exportOffset; // set before export, used in save
254 HideTmpMode hidemode; // true while exporting to hide some stuff
256 void resizeEvent( QResizeEvent * );
258 Q3UrlOperator *urlOperator;
259 QDataStream *imageData;
260 QBuffer *imageBuffer;