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 setupFlag(FlagObj *fo, QToolBar *tb, bool aw, const QString &name, const QString &tooltip);
48 void setupFlagActions();
49 void setupNetworkActions();
50 void setupSettingsActions();
51 void setupTestActions();
52 void setupHelpActions();
53 void setupContextMenus();
54 void setupRecentMapsMenu();
56 void hideEvent (QHideEvent * );
57 void showEvent (QShowEvent * );
58 MapEditor* currentMapEditor() const;
61 void editorChanged(QWidget*);
63 ErrorCode fileLoad(QString ,const LoadMode &, const FileType & ftype=VymMap);
64 void fileLoad(const LoadMode &);
66 void fileLoadRecent();
67 void addRecentMap (const QString &);
68 void fileSave(MapEditor*, const SaveMode & );
71 void fileSave(MapEditor *); // autosave from MapEditor
73 void fileSaveAs(const SaveMode &);
75 void fileImportKDEBookmarks();
76 void fileImportFirefoxBookmarks();
77 void fileImportFreemind();
81 void fileExportXHTML();
82 void fileExportImage();
83 void fileExportASCII();
85 void fileExportLaTeX();
86 void fileExportKDEBookmarks();
87 void fileExportTaskjuggler();
88 void fileExportOOPresentation();
96 void gotoHistoryStep (int);
101 void editOpenFindWindow();
102 void editFind(QString);
103 void editFindChanged();
105 void openTabs(QStringList);
108 void editOpenURLTab();
110 void editOpenMultipleURLTabs();
113 void editHeading2URL();
114 void editBugzilla2URL();
116 void openVymLinks(const QStringList &);
118 void editOpenMultipleVymLinks();
119 void editHeadingFinished();
120 void editAttributeFinished();
123 void editAttribute();
124 void editOpenVymLink();
126 void editDeleteVymLink();
127 void editToggleHideExport();
131 void editSortChildren();
132 void editToggleScroll();
133 void editUnscrollChilds();
134 void editAddMapCenter();
135 void editNewBranch();
136 void editNewBranchBefore();
137 void editNewBranchAbove();
138 void editNewBranchBelow();
139 void editImportAdd();
140 void editImportReplace();
141 void editSaveBranch();
142 void editDeleteKeepChilds();
143 void editDeleteChilds();
144 void editDeleteSelection();
145 void editUpperBranch();
146 void editLowerBranch();
147 void editLeftBranch();
148 void editRightBranch();
149 void editFirstBranch();
150 void editLastBranch();
151 void editLoadImage();
152 void editSaveImage();
153 void editFollowXLink (QAction *);
154 void editEditXLink (QAction *);
156 void formatSelectColor();
157 void formatPickColor();
158 void colorChanged(QColor);
159 void formatColorBranch();
160 void formatColorSubtree();
161 void formatLinkStyleLine();
162 void formatLinkStyleParabel();
163 void formatLinkStylePolyLine();
164 void formatLinkStylePolyParabel();
165 void formatSelectBackColor();
166 void formatSelectBackImage();
167 void formatSelectLinkColor();
168 void formatSelectSelectionColor();
169 void formatToggleLinkColorHint();
170 void formatHideLinkUnselected();
172 void viewZoomReset();
178 void networkStartServer();
179 void networkConnect();
182 void settingsMacroDir();
183 void settingsToggleDelKey();
184 void settingsUndoLevels();
185 void settingsAutosaveToggle();
186 void settingsAutosaveTime();
187 void settingsWriteBackupFileToggle();
189 void windowToggleNoteEditor();
190 void windowToggleHistory();
191 void windowToggleProperty();
192 void updateHistory(SimpleSettings &);
193 void windowToggleAntiAlias();
194 void windowToggleSmoothPixmap();
195 void updateNoteFlag();
196 void updateSatellites(MapEditor *);
197 void updateActions();
198 ModMode getModMode();
199 bool autoEditNewBranch();
200 bool autoSelectNewBranch();
201 bool useFlagGroups();
202 void setScript(const QString &);
203 void runScript(const QString &);
204 void runScriptEverywhere (const QString &);
207 void windowNextEditor();
208 void windowPreviousEditor();
209 void windowShowNoteEditor();
210 void windowHideNoteEditor();
212 void standardFlagChanged();
214 void testFunction1();
215 void testFunction2();
226 QTabWidget *tabWidget;
227 FindWindow *findWindow;
228 QProcess *procBrowser;
230 QStringList imageTypes;
232 QLineEdit *lineedit; // to enter headings of branches
233 QString prevSelection;
235 HistoryWindow *historyWindow;
237 BranchPropertyWindow *branchPropertyWindow;
238 SimpleScriptEditor *scriptEditor;
240 QList <QAction*> actionListBranches;
246 QMenu *recentFilesMenu;
247 enum { MaxRecentFiles = 9 };
248 QAction *recentFileActions[MaxRecentFiles];
250 QAction *macroActions[12];
253 QAction* actionFileSave;
254 QAction* actionFilePrint;
255 QAction* actionEditUndo;
256 QAction* actionEditRedo;
257 QAction *actionEditCopy;
258 QAction *actionEditCut;
259 QAction *actionEditPaste;
260 QAction *actionEditMoveUp;
261 QAction *actionEditMoveDown;
262 QAction *actionEditSortChildren;
263 QAction *actionEditToggleScroll;
264 QAction* actionEditOpenURL;
265 QAction* actionEditOpenURLTab;
266 QAction* actionEditOpenMultipleURLTabs;
267 QAction* actionEditURL;
268 QAction* actionEditLocalURL;
269 QAction* actionEditHeading2URL;
270 QAction* actionEditBugzilla2URL;
271 QAction* actionEditFATE2URL;
272 QAction *actionEditOpenVymLink;
273 QAction *actionEditOpenMultipleVymLinks;
274 QAction *actionEditVymLink;
275 QAction *actionEditDeleteVymLink;
276 QAction *actionEditToggleHideExport;
277 QAction *actionEditMapInfo;
278 QAction *actionEditHeading;
279 QAction *actionEditDelete;
280 QAction *actionEditAddMapCenter;
281 QAction *actionEditAddBranch;
282 QAction *actionEditAddBranchBefore;
283 QAction *actionEditAddBranchAbove;
284 QAction *actionEditAddBranchBelow;
285 QAction *actionEditDeleteKeepChilds;
286 QAction *actionEditDeleteChilds;
287 QAction *actionEditImportAdd;
288 QAction *actionEditImportReplace;
289 QAction *actionEditSaveBranch;
290 QAction *actionEditSelectFirst;
291 QAction *actionEditSelectLast;
292 QAction *actionEditLoadImage;
294 QAction* actionFormatColor;
295 QAction* actionFormatPickColor;
296 QAction* actionFormatColorBranch;
297 QAction* actionFormatColorSubtree;
298 QAction* actionFormatLinkColorHint;
299 QAction* actionFormatBackColor;
300 QAction* actionFormatBackImage;
301 QAction* actionFormatLinkColor;
302 QAction* actionFormatSelectionColor;
304 QActionGroup* actionGroupModModes;
305 QAction* actionModModeColor;
306 QAction* actionModModeXLink;
307 QAction* actionModModeCopy;
309 QActionGroup *actionGroupFormatFrameTypes;
312 QActionGroup *actionGroupFormatLinkStyles;
313 QAction *actionFormatLinkStyleLine;
314 QAction *actionFormatLinkStyleParabel;
315 QAction *actionFormatLinkStylePolyLine;
316 QAction *actionFormatLinkStylePolyParabel;
317 QAction *actionFormatHideLinkUnselected;
319 QAction *actionViewToggleNoteEditor;
320 QAction *actionViewToggleHistoryWindow;
321 QAction *actionViewTogglePropertyWindow;
322 QAction *actionViewToggleAntiAlias;
323 QAction *actionViewToggleSmoothPixmapTransform;
324 QAction* actionViewCenter;
326 QAction* actionSettingsAutoEditNewBranch;
327 QAction* actionSettingsAutoSelectNewBranch;
328 QAction* actionSettingsAutoSelectText;
329 QAction* actionSettingsUseDelKey;
330 QAction* actionSettingsUseFlagGroups;
331 QAction* actionSettingsUseHideExport;
332 QAction* actionSettingsAutosaveToggle;
333 QAction* actionSettingsAutosaveTime;
334 QAction* actionSettingsWriteBackupFile;