Spanish doc is found, if LANG is set. Fixed wrong position of floatimages
7 #include "mapcenterobj.h"
9 #include "historywindow.h"
11 #include "selection.h"
14 class Q3NetworkOperation;
17 class MapEditor : public Q3CanvasView , public xmlObj {
21 MapEditor(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
23 QColor getBackgroundColor();
24 MapCenterObj* getMapCenter();
25 Q3Canvas* getCanvas();
26 void adjustCanvasSize();// adjust canvas size to map and scrollview
27 bool isRepositionBlocked(); // block while load or undo
30 QString getName(LinkableMapObj*); // Get e.g. heading or filename
31 void makeTmpDirs(); // create temporary directories
32 QString saveToDir(const QString&,const QString &,bool, const QPoint &,LinkableMapObj*);
33 void saveStateComplete (const QString &);
34 void saveStateChangingPart (LinkableMapObj *, LinkableMapObj *, const QString &, const QString &);
35 void saveStateRemovingPart (LinkableMapObj *, const QString &);
36 void saveState(LinkableMapObj *, const QString &, LinkableMapObj *, const QString &, const QString &);
37 void saveState(const QString &, const QString &, const QString &, const QString &, const QString &);
38 void saveState(const SaveMode&, const QString &, const QString &, const QString &, const QString &, const QString &, LinkableMapObj *);
40 void parseAtom(const QString &);
42 void addFloatImageInt(const QPixmap &img);
45 void fetchImage(const QString &img);
46 void imageDataFetched(const QByteArray &, Q3NetworkOperation *);
47 void imageDataFinished(Q3NetworkOperation *);
50 void toggleHistoryWindow();
51 bool isDefault(); // false, if map was changed once
52 bool isUnsaved(); // save necessary
53 bool hasChanged(); // undo possible
54 void setChanged(); // called from NoteEditor via LMO
56 void setFilePath (QString);
57 void setFilePath (QString,QString);
58 QString getFilePath (); // Full path e.g. "/home/tux/map.xml"
59 QString getFileName (); // e.g. "map.xml"
60 QString getMapName (); // e.g. "map"
61 QString getDestPath (); // e.g. "/home/tux/map.vym"
62 ErrorCode load (QString, LoadMode ); // newmap, import/replace selection
64 int save(const SaveMode &); // Save map
65 void setZipped(bool); // save map zipped
66 bool saveZipped(); // 1 if file will be saved zipped
67 void print(); // print canvas
70 void setHideTmpMode (HideTmpMode); // temporary hide stuff
71 HideTmpMode getHideTmpMode(); // temporary hide stuff
73 void setExportMode (bool); // temporary hide stuff during export
74 void exportImage (QString fn); // export as PNG
75 void exportImage (QString fn, QString); // export in given format
76 void exportOOPresentation(const QString &,const QString &);
77 void exportXML(const QString&); // export to directory
78 void clear(); // clear map
79 void copy(); // copy branch to clipboard
80 void redo(); // redo last action
81 bool isRedoAvailable();
82 void undo(); // undo last action
83 bool isUndoAvailable();
84 void gotoStep (int);// goto a step in history
86 void addMapReplaceInt(const QString & undoSel, const QString & path);
87 void addMapInsertInt (const QString & path, int pos);
88 void pasteNoSave(); // paste clipboard to branch
89 void cutNoSave(); // cut to clipboard
91 void paste(); // paste clipboard to branch and backup
92 void cut(); // cut to clipboard and backup
93 void move (const int &x, const int &y);
94 void moveRel (const int &x, const int &y);
96 void moveBranchDown();
97 QString getHeading (bool &ok,QPoint &p); // Get heading, ok if selection is branch
98 void setHeading(const QString &);
100 void setHeadingInt(const QString &);
101 void setURLInt(const QString &); // Just set the URL for selection
102 void setVymLinkInt(const QString &); // Set vymLink for selection
103 BranchObj* addNewBranchInt(int); // pos allows to add above/below selection
105 BranchObj* addNewBranch(int); // pos allows to add above/below selection
106 BranchObj* addNewBranchBefore(); // insert and make selection its
107 void deleteSelection();
108 LinkableMapObj* getSelection(); // returns selection
109 void unselect(); // before changing current noteedit
110 void reselect(); // after changing current noteedit
111 bool select(const QString &); // Select by string
112 QString getSelectString();
114 void selectInt(LinkableMapObj*);
115 void selectNextBranchInt(); // Increment number of branch
116 void selectPrevBranchInt(); // Decrement number of branch
118 void selectUpperBranch();
119 void selectLowerBranch();
120 void selectLeftBranch();
121 void selectRightBranch();
122 void selectFirstBranch();
123 void selectLastBranch();
124 void selectBackgroundColor();
125 void setBackgroundColor(QColor);
126 QColor getCurrentHeadingColor();
127 void colorItem(QColor);
128 void colorBranch(QColor);
129 void toggleStandardFlag(QString);
130 virtual void setViewCenter(); // needed for zooming
131 BranchObj* findText(QString,bool); // Find object
132 void findReset(); // Reset Find
133 void setURL(const QString &); // set the URL
134 void editURL(); // edit the URL
135 QString getURL(); // returns URL of selection or ""
136 QStringList getURLs(); // returns URLs of subtree
137 void editHeading2URL(); // copy heading to URL
138 void editBugzilla2URL(); // create URL to Bugzilla
139 void editFATE2URL(); // create URL to FATE
140 void editVymLink(); // edit link to another map
141 void deleteVymLink(); // delete link to another map
142 QString getVymLink(); // return path to map
143 QStringList getVymLinks(); // return paths in subtree
144 void setHideExport(bool); // toggle the export flag
145 void toggleHideExport(); // toggle the export flag
146 void deleteKeepChilds(); // remove but keep childs
147 void deleteChilds(); // remove childs
148 void editMapInfo(); // dialog to enter author, ...
149 void updateActions(); // update e.g. format buttons
150 void updateNoteFlag(); // when TextEditor changes
151 void setLinkStyle (LinkStyle); // Set style of link
152 LinkStyle getLinkStyle (); // requested in LMO
153 void setLinkColor(QColor); // default color of links
154 void setLinkColorHint(); // color of links
155 void setLinkColorHint(LinkColorHint); // color of links
156 LinkColorHint getLinkColorHint();
157 QColor getDefLinkColor();
158 void setDefXLinkColor(QColor);
159 QColor getDefXLinkColor();
160 void setDefXLinkWidth (int);
161 int getDefXLinkWidth();
162 void toggleLinkColorHint(); // after changing linkStyles
163 void selectLinkColor();
166 void loadFloatImage ();
167 void saveFloatImage ();
168 void setFrame(const FrameType &);
169 void setIncludeImagesVer(bool);
170 void setIncludeImagesHor(bool);
171 void setHideLinkUnselected (bool);
172 bool getHideLinkUnselected ();
174 void importDirInt(BranchObj *,QDir);
177 void followXLink (int);
178 void editXLink (int);
179 void testFunction(); // just testing new stuff
180 // set /mainwindo/showTestMenu=true...
183 void ensureSelectionVisible();
184 virtual void updateViewCenter(); // needed for zooming
185 virtual void contentsContextMenuEvent ( QContextMenuEvent *e );
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
209 bool drawingLink; // true while creating a link
210 bool copyingObj; // true while creating a link
214 LinkableMapObj* selection; // select a LinkableMapObj
215 LinkableMapObj* selectionLast; // last selection
216 MapObj* movingObj; // moving a MapObj
217 MapObj* linkingObj_src; // part of a link
218 QPoint movingObj_orgPos; // org. pos of mouse before move
219 QPoint movingObj_orgRelPos; // org. relative pos of mouse before move
220 QPoint movingObj_start; // rel. pos of mouse to absPos
221 QPoint movingCont_start; // inital pos of moving Content or
222 QPoint movingVec; // how far has Content moved
223 QPoint movingCenter; // used when zooming
224 QPrinter* printer; // Printing
226 bool mapDefault; // Flag if map is untouched
227 bool mapChanged; // Flag if undo is possible
228 bool mapUnsaved; // Flag if map should be saved
230 bool printFrame; // Print frame around map
231 bool printFooter; // Print footer below map
233 bool zipped; // should map be zipped
234 static int mapNum; // unique number for Editor
235 QString fileName; // short name of file (for tab)
236 QString filePath; // path to file which will be saved
237 QString fileDir; // dir where file is saved
238 QString destPath; // path to .vym file (needed for vymlinks)
239 QString mapName; // fileName without ".vym"
241 QString tmpMapDir; // tmp directory with undo history
242 QString histPath; // Path to history file
243 int stepsTotal; // total number of steps (undos+redos)
244 SimpleSettings undoSet; // undo/redo commands
245 bool blockReposition; // block while load or undo
246 bool blockSaveState; // block while load or undo
248 BranchObj* itFind; // next object in find process
249 bool EOFind; // true, if search failed
251 QPoint exportOffset; // set before export, used in save
252 HideTmpMode hidemode; // true while exporting to hide some stuff
254 void resizeEvent( QResizeEvent * );
256 Q3UrlOperator *urlOperator;
257 QDataStream *imageData;
258 QBuffer *imageBuffer;
260 HistoryWindow historyWindow;