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 settingsToggleDelKey();
166 void windowToggleNoteEditor();
167 void windowToggleHistory();
168 void updateHistory(SimpleSettings &);
169 void windowToggleAntiAlias();
170 void windowToggleSmoothPixmap();
171 void updateNoteFlag();
172 void updateSatellites(MapEditor *);
173 void updateActions();
174 ModMode getModMode();
176 bool autoSelectHeading();
177 bool useFlagGroups();
178 void setScript(const QString &);
179 void runScript(const QString &);
182 void showPropertyDialog();
183 void windowNextEditor();
184 void windowPreviousEditor();
185 void windowShowNoteEditor();
186 void windowHideNoteEditor();
188 void standardFlagChanged();
199 QTabWidget *tabWidget;
200 FindWindow *findWindow;
201 QProcess *procBrowser;
203 QStringList imageTypes;
205 QLineEdit *lineedit; // to enter headings of branches
206 QString prevSelection;
208 HistoryWindow *historyWindow;
210 BranchPropertyWindow *branchPropertyWindow;
211 SimpleScriptEditor *scriptEditor;
213 QList <QAction*> actionListBranches;
217 QMenu *recentFilesMenu;
218 enum { MaxRecentFiles = 9 };
219 QAction *recentFileActions[MaxRecentFiles];
221 QAction *macroActions[12];
224 QAction* actionFileSave;
225 QAction* actionFilePrint;
226 QAction* actionEditUndo;
227 QAction* actionEditRedo;
228 QAction *actionEditCopy;
229 QAction *actionEditCut;
230 QAction *actionEditPaste;
231 QAction *actionEditMoveUp;
232 QAction *actionEditMoveDown;
233 QAction *actionEditToggleScroll;
234 QAction* actionEditOpenURL;
235 QAction* actionEditOpenURLTab;
236 QAction* actionEditOpenMultipleURLTabs;
237 QAction* actionEditURL;
238 QAction* actionEditHeading2URL;
239 QAction* actionEditBugzilla2URL;
240 QAction* actionEditFATE2URL;
241 QAction *actionEditOpenVymLink;
242 QAction *actionEditOpenMultipleVymLinks;
243 QAction *actionEditVymLink;
244 QAction *actionEditDeleteVymLink;
245 QAction *actionEditToggleHideExport;
246 QAction *actionEditMapInfo;
247 QAction *actionEditHeading;
248 QAction *actionEditDelete;
249 QAction *actionEditAddBranch;
250 QAction *actionEditAddBranchBefore;
251 QAction *actionEditAddBranchAbove;
252 QAction *actionEditAddBranchBelow;
253 QAction *actionEditDeleteKeepChilds;
254 QAction *actionEditDeleteChilds;
255 QAction *actionEditImportAdd;
256 QAction *actionEditImportReplace;
257 QAction *actionEditSaveBranch;
258 QAction *actionEditSelectFirst;
259 QAction *actionEditSelectLast;
260 QAction *actionEditLoadImage;
262 QAction* actionFormatColor;
263 QAction* actionFormatPickColor;
264 QAction* actionFormatColorBranch;
265 QAction* actionFormatColorSubtree;
266 QAction* actionFormatLinkColorHint;
267 QAction* actionFormatBackColor;
268 QAction* actionFormatBackImage;
269 QAction* actionFormatLinkColor;
270 QAction* actionFormatSelectionColor;
271 QAction *actionFormatIncludeImagesVer;
272 QAction *actionFormatIncludeImagesHor;
274 QActionGroup* actionGroupModModes;
275 QAction* actionModModeColor;
276 QAction* actionModModeXLink;
277 QAction* actionModModeCopy;
279 QActionGroup *actionGroupFormatFrameTypes;
281 QAction *actionTogglePropertyDialog;
283 QActionGroup *actionGroupFormatLinkStyles;
284 QAction *actionFormatLinkStyleLine;
285 QAction *actionFormatLinkStyleParabel;
286 QAction *actionFormatLinkStylePolyLine;
287 QAction *actionFormatLinkStylePolyParabel;
288 QAction *actionFormatHideLinkUnselected;
290 QAction *actionViewToggleNoteEditor;
291 QAction *actionViewToggleHistoryWindow;
292 QAction *actionViewToggleAntiAlias;
293 QAction *actionViewToggleSmoothPixmapTransform;
295 QAction* actionSettingsAutoEdit;
296 QAction* actionSettingsAutoSelectHeading;
297 QAction* actionSettingsAutoSelectText;
298 QAction* actionSettingsUseDelKey;
299 QAction* actionSettingsUseFlagGroups;
300 QAction* actionSettingsUseHideExport;