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 &);
37 void closeEvent( QCloseEvent* );
40 void setupFileActions();
41 void setupEditActions();
42 void setupFormatActions();
43 void setupViewActions();
44 void setupModeActions();
45 void setupWindowActions();
46 void setupFlagActions();
47 void setupSettingsActions();
48 void setupTestActions();
49 void setupHelpActions();
50 void setupContextMenus();
51 void setupRecentMapsMenu();
53 void hideEvent (QHideEvent * );
54 void showEvent (QShowEvent * );
55 bool reallyWriteDirectory(const QString&);
56 QString browseDirectory(const QString&);
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();
82 void fileExportLaTeX();
83 void fileExportKDEBookmarks();
84 void fileExportTaskjuggler();
85 void fileExportOOPresentation();
93 void gotoHistoryStep (int);
98 void editOpenFindWindow();
99 void editFind(QString);
100 void editFindChanged();
102 void openTabs(QStringList);
105 void editOpenURLTab();
107 void editOpenMultipleURLTabs();
109 void editHeading2URL();
110 void editBugzilla2URL();
112 void openVymLinks(const QStringList &);
114 void editOpenMultipleVymLinks();
115 void editHeadingFinished();
118 void editOpenVymLink();
120 void editDeleteVymLink();
121 void editToggleHideExport();
125 void editToggleScroll();
126 void editUnscrollChilds();
127 void editNewBranch();
128 void editNewBranchBefore();
129 void editNewBranchAbove();
130 void editNewBranchBelow();
131 void editImportAdd();
132 void editImportReplace();
133 void editSaveBranch();
134 void editDeleteKeepChilds();
135 void editDeleteChilds();
136 void editDeleteSelection();
137 void editUpperBranch();
138 void editLowerBranch();
139 void editLeftBranch();
140 void editRightBranch();
141 void editFirstBranch();
142 void editLastBranch();
143 void editLoadImage();
144 void editSaveImage();
145 void editFollowXLink (QAction *);
146 void editEditXLink (QAction *);
148 void formatSelectColor();
149 void formatPickColor();
150 void colorChanged(QColor);
151 void formatColorBranch();
152 void formatColorSubtree();
153 void formatLinkStyleLine();
154 void formatLinkStyleParabel();
155 void formatLinkStylePolyLine();
156 void formatLinkStylePolyParabel();
157 void formatSelectBackColor();
158 void formatSelectBackImage();
159 void formatSelectLinkColor();
160 void formatSelectSelectionColor();
161 void formatToggleLinkColorHint();
162 void formatHideLinkUnselected();
164 void viewZoomReset();
171 void settingsMacroDir();
172 void settingsToggleDelKey();
173 void settingsUndoLevels();
174 void settingsAutosaveToggle();
175 void settingsAutosaveTime();
177 void windowToggleNoteEditor();
178 void windowToggleHistory();
179 void windowToggleProperty();
180 void updateHistory(SimpleSettings &);
181 void windowToggleAntiAlias();
182 void windowToggleSmoothPixmap();
183 void updateNoteFlag();
184 void updateSatellites(MapEditor *);
185 void updateActions();
186 ModMode getModMode();
188 bool autoSelectHeading();
189 bool useFlagGroups();
190 void setScript(const QString &);
191 void runScript(const QString &);
194 void windowNextEditor();
195 void windowPreviousEditor();
196 void windowShowNoteEditor();
197 void windowHideNoteEditor();
199 void standardFlagChanged();
211 QTabWidget *tabWidget;
212 FindWindow *findWindow;
213 QProcess *procBrowser;
215 QStringList imageTypes;
217 QLineEdit *lineedit; // to enter headings of branches
218 QString prevSelection;
220 HistoryWindow *historyWindow;
222 BranchPropertyWindow *branchPropertyWindow;
223 SimpleScriptEditor *scriptEditor;
225 QList <QAction*> actionListBranches;
229 QMenu *recentFilesMenu;
230 enum { MaxRecentFiles = 9 };
231 QAction *recentFileActions[MaxRecentFiles];
233 QAction *macroActions[12];
236 QAction* actionFileSave;
237 QAction* actionFilePrint;
238 QAction* actionEditUndo;
239 QAction* actionEditRedo;
240 QAction *actionEditCopy;
241 QAction *actionEditCut;
242 QAction *actionEditPaste;
243 QAction *actionEditMoveUp;
244 QAction *actionEditMoveDown;
245 QAction *actionEditToggleScroll;
246 QAction* actionEditOpenURL;
247 QAction* actionEditOpenURLTab;
248 QAction* actionEditOpenMultipleURLTabs;
249 QAction* actionEditURL;
250 QAction* actionEditHeading2URL;
251 QAction* actionEditBugzilla2URL;
252 QAction* actionEditFATE2URL;
253 QAction *actionEditOpenVymLink;
254 QAction *actionEditOpenMultipleVymLinks;
255 QAction *actionEditVymLink;
256 QAction *actionEditDeleteVymLink;
257 QAction *actionEditToggleHideExport;
258 QAction *actionEditMapInfo;
259 QAction *actionEditHeading;
260 QAction *actionEditDelete;
261 QAction *actionEditAddBranch;
262 QAction *actionEditAddBranchBefore;
263 QAction *actionEditAddBranchAbove;
264 QAction *actionEditAddBranchBelow;
265 QAction *actionEditDeleteKeepChilds;
266 QAction *actionEditDeleteChilds;
267 QAction *actionEditImportAdd;
268 QAction *actionEditImportReplace;
269 QAction *actionEditSaveBranch;
270 QAction *actionEditSelectFirst;
271 QAction *actionEditSelectLast;
272 QAction *actionEditLoadImage;
274 QAction* actionFormatColor;
275 QAction* actionFormatPickColor;
276 QAction* actionFormatColorBranch;
277 QAction* actionFormatColorSubtree;
278 QAction* actionFormatLinkColorHint;
279 QAction* actionFormatBackColor;
280 QAction* actionFormatBackImage;
281 QAction* actionFormatLinkColor;
282 QAction* actionFormatSelectionColor;
284 QActionGroup* actionGroupModModes;
285 QAction* actionModModeColor;
286 QAction* actionModModeXLink;
287 QAction* actionModModeCopy;
289 QActionGroup *actionGroupFormatFrameTypes;
291 QAction *actionTogglePropertyWindow;
293 QActionGroup *actionGroupFormatLinkStyles;
294 QAction *actionFormatLinkStyleLine;
295 QAction *actionFormatLinkStyleParabel;
296 QAction *actionFormatLinkStylePolyLine;
297 QAction *actionFormatLinkStylePolyParabel;
298 QAction *actionFormatHideLinkUnselected;
300 QAction *actionViewToggleNoteEditor;
301 QAction *actionViewToggleHistoryWindow;
302 QAction *actionViewToggleAntiAlias;
303 QAction *actionViewToggleSmoothPixmapTransform;
305 QAction* actionSettingsAutoEdit;
306 QAction* actionSettingsAutoSelectHeading;
307 QAction* actionSettingsAutoSelectText;
308 QAction* actionSettingsUseDelKey;
309 QAction* actionSettingsUseFlagGroups;
310 QAction* actionSettingsUseHideExport;
311 QAction* actionSettingsAutosaveToggle;
312 QAction* actionSettingsAutosaveTime;