6 #include "branchpropwindow.h"
8 #include "findwindow.h"
9 #include "historywindow.h"
10 #include "mapeditor.h"
11 #include "simplescripteditor.h"
12 #include "texteditor.h"
15 class Main : public QMainWindow
20 /*! Modifier modes are used when CTRL together with a mouse button is pressed */
22 ModModeNone, //!< Unused
23 ModModeColor, //!< Pick color from object
24 ModModeCopy, //!< Copy object
25 ModModeXLink //!< Create a XLink (XLinkObj) from selected object
28 Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
31 void statusMessage (const QString &);
38 void closeEvent( QCloseEvent* );
41 void setupFileActions();
42 void setupEditActions();
43 void setupFormatActions();
44 void setupViewActions();
45 void setupModeActions();
46 void setupWindowActions();
47 void setupFlagActions();
48 void setupNetworkActions();
49 void setupSettingsActions();
50 void setupTestActions();
51 void setupHelpActions();
52 void setupContextMenus();
53 void setupRecentMapsMenu();
55 void hideEvent (QHideEvent * );
56 void showEvent (QShowEvent * );
57 MapEditor* currentMapEditor() const;
60 void editorChanged(QWidget*);
62 ErrorCode fileLoad(QString ,const LoadMode &);
63 void fileLoad(const LoadMode &);
65 void fileLoadRecent();
66 void addRecentMap (const QString &);
67 void fileSave(MapEditor*, const SaveMode & );
70 void fileSave(MapEditor *); // autosave from MapEditor
72 void fileSaveAs(const SaveMode &);
74 void fileImportKDEBookmarks();
75 void fileImportFirefoxBookmarks();
79 void fileExportXHTML();
80 void fileExportImage();
81 void fileExportASCII();
83 void fileExportLaTeX();
84 void fileExportKDEBookmarks();
85 void fileExportTaskjuggler();
86 void fileExportOOPresentation();
94 void gotoHistoryStep (int);
99 void editOpenFindWindow();
100 void editFind(QString);
101 void editFindChanged();
103 void openTabs(QStringList);
106 void editOpenURLTab();
108 void editOpenMultipleURLTabs();
111 void editHeading2URL();
112 void editBugzilla2URL();
114 void openVymLinks(const QStringList &);
116 void editOpenMultipleVymLinks();
117 void editHeadingFinished();
120 void editOpenVymLink();
122 void editDeleteVymLink();
123 void editToggleHideExport();
127 void editToggleScroll();
128 void editUnscrollChilds();
129 void editNewBranch();
130 void editNewBranchBefore();
131 void editNewBranchAbove();
132 void editNewBranchBelow();
133 void editImportAdd();
134 void editImportReplace();
135 void editSaveBranch();
136 void editDeleteKeepChilds();
137 void editDeleteChilds();
138 void editDeleteSelection();
139 void editUpperBranch();
140 void editLowerBranch();
141 void editLeftBranch();
142 void editRightBranch();
143 void editFirstBranch();
144 void editLastBranch();
145 void editLoadImage();
146 void editSaveImage();
147 void editFollowXLink (QAction *);
148 void editEditXLink (QAction *);
150 void formatSelectColor();
151 void formatPickColor();
152 void colorChanged(QColor);
153 void formatColorBranch();
154 void formatColorSubtree();
155 void formatLinkStyleLine();
156 void formatLinkStyleParabel();
157 void formatLinkStylePolyLine();
158 void formatLinkStylePolyParabel();
159 void formatSelectBackColor();
160 void formatSelectBackImage();
161 void formatSelectLinkColor();
162 void formatSelectSelectionColor();
163 void formatToggleLinkColorHint();
164 void formatHideLinkUnselected();
166 void viewZoomReset();
172 void networkStartServer();
173 void networkConnect();
176 void settingsMacroDir();
177 void settingsToggleDelKey();
178 void settingsUndoLevels();
179 void settingsAutosaveToggle();
180 void settingsAutosaveTime();
182 void windowToggleNoteEditor();
183 void windowToggleHistory();
184 void windowToggleProperty();
185 void updateHistory(SimpleSettings &);
186 void windowToggleAntiAlias();
187 void windowToggleSmoothPixmap();
188 void updateNoteFlag();
189 void updateSatellites(MapEditor *);
190 void updateActions();
191 ModMode getModMode();
192 bool autoEditNewBranch();
193 bool autoSelectNewBranch();
194 bool useFlagGroups();
195 void setScript(const QString &);
196 void runScript(const QString &);
197 void runScriptEverywhere (const QString &);
200 void windowNextEditor();
201 void windowPreviousEditor();
202 void windowShowNoteEditor();
203 void windowHideNoteEditor();
205 void standardFlagChanged();
207 void testFunction1();
208 void testFunction2();
219 QTabWidget *tabWidget;
220 FindWindow *findWindow;
221 QProcess *procBrowser;
223 QStringList imageTypes;
225 QLineEdit *lineedit; // to enter headings of branches
226 QString prevSelection;
228 HistoryWindow *historyWindow;
230 BranchPropertyWindow *branchPropertyWindow;
231 SimpleScriptEditor *scriptEditor;
233 QList <QAction*> actionListBranches;
237 QMenu *recentFilesMenu;
238 enum { MaxRecentFiles = 9 };
239 QAction *recentFileActions[MaxRecentFiles];
241 QAction *macroActions[12];
244 QAction* actionFileSave;
245 QAction* actionFilePrint;
246 QAction* actionEditUndo;
247 QAction* actionEditRedo;
248 QAction *actionEditCopy;
249 QAction *actionEditCut;
250 QAction *actionEditPaste;
251 QAction *actionEditMoveUp;
252 QAction *actionEditMoveDown;
253 QAction *actionEditToggleScroll;
254 QAction* actionEditOpenURL;
255 QAction* actionEditOpenURLTab;
256 QAction* actionEditOpenMultipleURLTabs;
257 QAction* actionEditURL;
258 QAction* actionEditLocalURL;
259 QAction* actionEditHeading2URL;
260 QAction* actionEditBugzilla2URL;
261 QAction* actionEditFATE2URL;
262 QAction *actionEditOpenVymLink;
263 QAction *actionEditOpenMultipleVymLinks;
264 QAction *actionEditVymLink;
265 QAction *actionEditDeleteVymLink;
266 QAction *actionEditToggleHideExport;
267 QAction *actionEditMapInfo;
268 QAction *actionEditHeading;
269 QAction *actionEditDelete;
270 QAction *actionEditAddBranch;
271 QAction *actionEditAddBranchBefore;
272 QAction *actionEditAddBranchAbove;
273 QAction *actionEditAddBranchBelow;
274 QAction *actionEditDeleteKeepChilds;
275 QAction *actionEditDeleteChilds;
276 QAction *actionEditImportAdd;
277 QAction *actionEditImportReplace;
278 QAction *actionEditSaveBranch;
279 QAction *actionEditSelectFirst;
280 QAction *actionEditSelectLast;
281 QAction *actionEditLoadImage;
283 QAction* actionFormatColor;
284 QAction* actionFormatPickColor;
285 QAction* actionFormatColorBranch;
286 QAction* actionFormatColorSubtree;
287 QAction* actionFormatLinkColorHint;
288 QAction* actionFormatBackColor;
289 QAction* actionFormatBackImage;
290 QAction* actionFormatLinkColor;
291 QAction* actionFormatSelectionColor;
293 QActionGroup* actionGroupModModes;
294 QAction* actionModModeColor;
295 QAction* actionModModeXLink;
296 QAction* actionModModeCopy;
298 QActionGroup *actionGroupFormatFrameTypes;
301 QActionGroup *actionGroupFormatLinkStyles;
302 QAction *actionFormatLinkStyleLine;
303 QAction *actionFormatLinkStyleParabel;
304 QAction *actionFormatLinkStylePolyLine;
305 QAction *actionFormatLinkStylePolyParabel;
306 QAction *actionFormatHideLinkUnselected;
308 QAction *actionViewToggleNoteEditor;
309 QAction *actionViewToggleHistoryWindow;
310 QAction *actionViewTogglePropertyWindow;
311 QAction *actionViewToggleAntiAlias;
312 QAction *actionViewToggleSmoothPixmapTransform;
313 QAction* actionViewCenter;
315 QAction* actionSettingsAutoEditNewBranch;
316 QAction* actionSettingsAutoSelectNewBranch;
317 QAction* actionSettingsAutoSelectText;
318 QAction* actionSettingsUseDelKey;
319 QAction* actionSettingsUseFlagGroups;
320 QAction* actionSettingsUseHideExport;
321 QAction* actionSettingsAutosaveToggle;
322 QAction* actionSettingsAutosaveTime;