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 enum ModMode {ModModeNone,ModModeColor,ModModeCopy,ModModeXLink};
17 class Main : public QMainWindow
22 Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
25 void statusMessage (const QString &);
31 void closeEvent( QCloseEvent* );
34 void setupFileActions();
35 void setupEditActions();
36 void setupFormatActions();
37 void setupViewActions();
38 void setupModeActions();
39 void setupWindowActions();
40 void setupFlagActions();
41 void setupSettingsActions();
42 void setupTestActions();
43 void setupHelpActions();
44 void setupContextMenus();
45 void setupRecentMapsMenu();
47 void hideEvent (QHideEvent * );
48 void showEvent (QShowEvent * );
49 bool reallyWriteDirectory(const QString&);
50 QString browseDirectory(const QString&);
51 MapEditor* currentMapEditor() const;
54 void editorChanged(QWidget*);
56 ErrorCode fileLoad(QString ,const LoadMode &);
57 void fileLoad(const LoadMode &);
59 void fileLoadRecent();
60 void addRecentMap (const QString &);
61 void fileSave(const SaveMode & );
63 void fileSaveAs(const SaveMode &);
65 void fileImportKDEBookmarks();
66 void fileImportFirefoxBookmarks();
70 void fileExportXHTML();
71 void fileExportImage();
72 void fileExportASCII();
73 void fileExportLaTeX();
74 void fileExportKDEBookmarks();
75 void fileExportTaskjuggler();
76 void fileExportOOPresentation();
84 void gotoHistoryStep (int);
89 void editOpenFindWindow();
90 void editFind(QString);
91 void editFindChanged();
93 void openTabs(QStringList);
96 void editOpenURLTab();
98 void editOpenMultipleURLTabs();
100 void editHeading2URL();
101 void editBugzilla2URL();
103 void openVymLinks(const QStringList &);
105 void editOpenMultipleVymLinks();
106 void editHeadingFinished();
109 void editOpenVymLink();
111 void editDeleteVymLink();
112 void editToggleHideExport();
116 void editToggleScroll();
117 void editUnScrollAll();
118 void editNewBranch();
119 void editNewBranchBefore();
120 void editNewBranchAbove();
121 void editNewBranchBelow();
122 void editImportAdd();
123 void editImportReplace();
124 void editSaveBranch();
125 void editDeleteKeepChilds();
126 void editDeleteChilds();
127 void editDeleteSelection();
128 void editUpperBranch();
129 void editLowerBranch();
130 void editLeftBranch();
131 void editRightBranch();
132 void editFirstBranch();
133 void editLastBranch();
134 void editLoadImage();
135 void editSaveImage();
136 void editFollowXLink (QAction *);
137 void editEditXLink (QAction *);
139 void formatSelectColor();
140 void formatPickColor();
141 void colorChanged(QColor);
142 void formatColorBranch();
143 void formatColorSubtree();
144 void formatLinkStyleLine();
145 void formatLinkStyleParabel();
146 void formatLinkStylePolyLine();
147 void formatLinkStylePolyParabel();
148 void formatSelectBackColor();
149 void formatSelectBackImage();
150 void formatSelectLinkColor();
151 void formatSelectSelectionColor();
152 void formatToggleLinkColorHint();
153 void formatIncludeImagesVer();
154 void formatIncludeImagesHor();
155 void formatHideLinkUnselected();
157 void viewZoomReset();
164 void settingsMacroDir();
165 void settingsToggleDelKey();
167 void windowToggleNoteEditor();
168 void windowToggleHistory();
169 void updateHistory(SimpleSettings &);
170 void windowToggleAntiAlias();
171 void windowToggleSmoothPixmap();
172 void updateNoteFlag();
173 void updateSatellites(MapEditor *);
174 void updateActions();
175 ModMode getModMode();
177 bool autoSelectHeading();
178 bool useFlagGroups();
179 void setScript(const QString &);
180 void runScript(const QString &);
183 void showPropertyDialog();
184 void windowNextEditor();
185 void windowPreviousEditor();
186 void windowShowNoteEditor();
187 void windowHideNoteEditor();
189 void standardFlagChanged();
200 QTabWidget *tabWidget;
201 FindWindow *findWindow;
202 QProcess *procBrowser;
204 QStringList imageTypes;
206 QLineEdit *lineedit; // to enter headings of branches
207 QString prevSelection;
209 HistoryWindow *historyWindow;
211 BranchPropertyWindow *branchPropertyWindow;
212 SimpleScriptEditor *scriptEditor;
214 QList <QAction*> actionListBranches;
218 QMenu *recentFilesMenu;
219 enum { MaxRecentFiles = 9 };
220 QAction *recentFileActions[MaxRecentFiles];
222 QAction *macroActions[12];
225 QAction* actionFileSave;
226 QAction* actionFilePrint;
227 QAction* actionEditUndo;
228 QAction* actionEditRedo;
229 QAction *actionEditCopy;
230 QAction *actionEditCut;
231 QAction *actionEditPaste;
232 QAction *actionEditMoveUp;
233 QAction *actionEditMoveDown;
234 QAction *actionEditToggleScroll;
235 QAction* actionEditOpenURL;
236 QAction* actionEditOpenURLTab;
237 QAction* actionEditOpenMultipleURLTabs;
238 QAction* actionEditURL;
239 QAction* actionEditHeading2URL;
240 QAction* actionEditBugzilla2URL;
241 QAction* actionEditFATE2URL;
242 QAction *actionEditOpenVymLink;
243 QAction *actionEditOpenMultipleVymLinks;
244 QAction *actionEditVymLink;
245 QAction *actionEditDeleteVymLink;
246 QAction *actionEditToggleHideExport;
247 QAction *actionEditMapInfo;
248 QAction *actionEditHeading;
249 QAction *actionEditDelete;
250 QAction *actionEditAddBranch;
251 QAction *actionEditAddBranchBefore;
252 QAction *actionEditAddBranchAbove;
253 QAction *actionEditAddBranchBelow;
254 QAction *actionEditDeleteKeepChilds;
255 QAction *actionEditDeleteChilds;
256 QAction *actionEditImportAdd;
257 QAction *actionEditImportReplace;
258 QAction *actionEditSaveBranch;
259 QAction *actionEditSelectFirst;
260 QAction *actionEditSelectLast;
261 QAction *actionEditLoadImage;
263 QAction* actionFormatColor;
264 QAction* actionFormatPickColor;
265 QAction* actionFormatColorBranch;
266 QAction* actionFormatColorSubtree;
267 QAction* actionFormatLinkColorHint;
268 QAction* actionFormatBackColor;
269 QAction* actionFormatBackImage;
270 QAction* actionFormatLinkColor;
271 QAction* actionFormatSelectionColor;
272 QAction *actionFormatIncludeImagesVer;
273 QAction *actionFormatIncludeImagesHor;
275 QActionGroup* actionGroupModModes;
276 QAction* actionModModeColor;
277 QAction* actionModModeXLink;
278 QAction* actionModModeCopy;
280 QActionGroup *actionGroupFormatFrameTypes;
282 QAction *actionTogglePropertyDialog;
284 QActionGroup *actionGroupFormatLinkStyles;
285 QAction *actionFormatLinkStyleLine;
286 QAction *actionFormatLinkStyleParabel;
287 QAction *actionFormatLinkStylePolyLine;
288 QAction *actionFormatLinkStylePolyParabel;
289 QAction *actionFormatHideLinkUnselected;
291 QAction *actionViewToggleNoteEditor;
292 QAction *actionViewToggleHistoryWindow;
293 QAction *actionViewToggleAntiAlias;
294 QAction *actionViewToggleSmoothPixmapTransform;
296 QAction* actionSettingsAutoEdit;
297 QAction* actionSettingsAutoSelectHeading;
298 QAction* actionSettingsAutoSelectText;
299 QAction* actionSettingsUseDelKey;
300 QAction* actionSettingsUseFlagGroups;
301 QAction* actionSettingsUseHideExport;