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();
46 void hideEvent (QHideEvent * );
47 void showEvent (QShowEvent * );
48 bool reallyWriteDirectory(const QString&);
49 QString browseDirectory(const QString&);
50 MapEditor* currentMapEditor() const;
53 void editorChanged(QWidget*);
55 ErrorCode fileLoad(QString ,const LoadMode &);
56 void fileLoad(const LoadMode &);
58 void fileLoadRecent();
59 void addRecentMap (const QString &);
60 void fileSave(const SaveMode & );
62 void fileSaveAs(const SaveMode &);
64 void fileImportKDEBookmarks();
65 void fileImportFirefoxBookmarks();
69 void fileExportXHTML();
70 void fileExportImage();
71 void fileExportASCII();
72 void fileExportLaTeX();
73 void fileExportKDEBookmarks();
74 void fileExportTaskjuggler();
75 void fileExportOOPresentation();
83 void gotoHistoryStep (int);
88 void editOpenFindWindow();
89 void editFind(QString);
90 void editFindChanged();
92 void openTabs(QStringList);
95 void editOpenURLTab();
97 void editOpenMultipleURLTabs();
99 void editHeading2URL();
100 void editBugzilla2URL();
102 void openVymLinks(const QStringList &);
104 void editOpenMultipleVymLinks();
105 void editHeadingFinished();
108 void editOpenVymLink();
110 void editDeleteVymLink();
111 void editToggleHideExport();
115 void editToggleScroll();
116 void editUnScrollAll();
117 void editNewBranch();
118 void editNewBranchBefore();
119 void editNewBranchAbove();
120 void editNewBranchBelow();
121 void editImportAdd();
122 void editImportReplace();
123 void editSaveBranch();
124 void editDeleteKeepChilds();
125 void editDeleteChilds();
126 void editDeleteSelection();
127 void editUpperBranch();
128 void editLowerBranch();
129 void editLeftBranch();
130 void editRightBranch();
131 void editFirstBranch();
132 void editLastBranch();
133 void editLoadImage();
134 void editSaveImage();
135 void editFollowXLink (QAction *);
136 void editEditXLink (QAction *);
138 void formatSelectColor();
139 void formatPickColor();
140 void colorChanged(QColor);
141 void formatColorBranch();
142 void formatColorSubtree();
143 void formatLinkStyleLine();
144 void formatLinkStyleParabel();
145 void formatLinkStylePolyLine();
146 void formatLinkStylePolyParabel();
147 void formatSelectBackColor();
148 void formatSelectBackImage();
149 void formatSelectLinkColor();
150 void formatToggleLinkColorHint();
151 void formatIncludeImagesVer();
152 void formatIncludeImagesHor();
153 void formatHideLinkUnselected();
155 void viewZoomReset();
162 void settingsToggleDelKey();
164 void windowToggleNoteEditor();
165 void windowToggleHistory();
166 void updateHistory(SimpleSettings &);
167 void windowToggleAntiAlias();
168 void windowToggleSmoothPixmap();
169 void updateNoteFlag();
170 void updateActions();
171 ModMode getModMode();
173 bool autoSelectHeading();
174 bool useFlagGroups();
175 void setScript(const QString &);
176 void runScript(const QString &);
179 void showPropertyDialog();
180 void windowNextEditor();
181 void windowPreviousEditor();
182 void windowShowNoteEditor();
183 void windowHideNoteEditor();
185 void standardFlagChanged();
195 QTabWidget *tabWidget;
196 FindWindow *findWindow;
197 QProcess *procBrowser;
199 QStringList imageTypes;
201 QLineEdit *lineedit; // to enter headings of branches
202 QString prevSelection;
204 HistoryWindow *historyWindow;
206 BranchPropertyWindow *branchPropertyWindow;
207 SimpleScriptEditor *scriptEditor;
209 QList <QAction*> actionListBranches;
213 QMenu *recentFilesMenu;
214 enum { MaxRecentFiles = 9 };
215 QAction *recentFileActs[MaxRecentFiles];
217 QAction* actionFileSave;
218 QAction* actionFilePrint;
219 QAction* actionEditUndo;
220 QAction* actionEditRedo;
221 QAction *actionEditCopy;
222 QAction *actionEditCut;
223 QAction *actionEditPaste;
224 QAction *actionEditMoveUp;
225 QAction *actionEditMoveDown;
226 QAction *actionEditToggleScroll;
227 QAction* actionEditOpenURL;
228 QAction* actionEditOpenURLTab;
229 QAction* actionEditOpenMultipleURLTabs;
230 QAction* actionEditURL;
231 QAction* actionEditHeading2URL;
232 QAction* actionEditBugzilla2URL;
233 QAction* actionEditFATE2URL;
234 QAction *actionEditOpenVymLink;
235 QAction *actionEditOpenMultipleVymLinks;
236 QAction *actionEditVymLink;
237 QAction *actionEditDeleteVymLink;
238 QAction *actionEditToggleHideExport;
239 QAction *actionEditMapInfo;
240 QAction *actionEditHeading;
241 QAction *actionEditDelete;
242 QAction *actionEditAddBranch;
243 QAction *actionEditAddBranchBefore;
244 QAction *actionEditAddBranchAbove;
245 QAction *actionEditAddBranchBelow;
246 QAction *actionEditDeleteKeepChilds;
247 QAction *actionEditDeleteChilds;
248 QAction *actionEditImportAdd;
249 QAction *actionEditImportReplace;
250 QAction *actionEditSaveBranch;
251 QAction *actionEditSelectFirst;
252 QAction *actionEditSelectLast;
253 QAction *actionEditLoadImage;
255 QAction* actionFormatColor;
256 QAction* actionFormatPickColor;
257 QAction* actionFormatColorBranch;
258 QAction* actionFormatColorSubtree;
259 QAction* actionFormatLinkColorHint;
260 QAction* actionFormatBackColor;
261 QAction* actionFormatBackImage;
262 QAction* actionFormatLinkColor;
263 QAction *actionFormatIncludeImagesVer;
264 QAction *actionFormatIncludeImagesHor;
266 QActionGroup* actionGroupModModes;
267 QAction* actionModModeColor;
268 QAction* actionModModeXLink;
269 QAction* actionModModeCopy;
271 QActionGroup *actionGroupFormatFrameTypes;
273 QAction *actionOpenPropertyDialog;
275 QActionGroup *actionGroupFormatLinkStyles;
276 QAction *actionFormatLinkStyleLine;
277 QAction *actionFormatLinkStyleParabel;
278 QAction *actionFormatLinkStylePolyLine;
279 QAction *actionFormatLinkStylePolyParabel;
280 QAction *actionFormatHideLinkUnselected;
282 QAction *actionViewToggleNoteEditor;
283 QAction *actionViewToggleHistoryWindow;
284 QAction *actionViewToggleAntiAlias;
285 QAction *actionViewToggleSmoothPixmapTransform;
287 QAction* actionSettingsAutoEdit;
288 QAction* actionSettingsAutoSelectHeading;
289 QAction* actionSettingsAutoSelectText;
290 QAction* actionSettingsUseDelKey;
291 QAction* actionSettingsUseFlagGroups;
292 QAction* actionSettingsUseHideExport;