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 editNewBranch();
135 void editNewBranchBefore();
136 void editNewBranchAbove();
137 void editNewBranchBelow();
138 void editImportAdd();
139 void editImportReplace();
140 void editSaveBranch();
141 void editDeleteKeepChilds();
142 void editDeleteChilds();
143 void editDeleteSelection();
144 void editUpperBranch();
145 void editLowerBranch();
146 void editLeftBranch();
147 void editRightBranch();
148 void editFirstBranch();
149 void editLastBranch();
150 void editLoadImage();
151 void editSaveImage();
152 void editFollowXLink (QAction *);
153 void editEditXLink (QAction *);
155 void formatSelectColor();
156 void formatPickColor();
157 void colorChanged(QColor);
158 void formatColorBranch();
159 void formatColorSubtree();
160 void formatLinkStyleLine();
161 void formatLinkStyleParabel();
162 void formatLinkStylePolyLine();
163 void formatLinkStylePolyParabel();
164 void formatSelectBackColor();
165 void formatSelectBackImage();
166 void formatSelectLinkColor();
167 void formatSelectSelectionColor();
168 void formatToggleLinkColorHint();
169 void formatHideLinkUnselected();
171 void viewZoomReset();
177 void networkStartServer();
178 void networkConnect();
181 void settingsMacroDir();
182 void settingsToggleDelKey();
183 void settingsUndoLevels();
184 void settingsAutosaveToggle();
185 void settingsAutosaveTime();
186 void settingsWriteBackupFileToggle();
188 void windowToggleNoteEditor();
189 void windowToggleHistory();
190 void windowToggleProperty();
191 void updateHistory(SimpleSettings &);
192 void windowToggleAntiAlias();
193 void windowToggleSmoothPixmap();
194 void updateNoteFlag();
195 void updateSatellites(MapEditor *);
196 void updateActions();
197 ModMode getModMode();
198 bool autoEditNewBranch();
199 bool autoSelectNewBranch();
200 bool useFlagGroups();
201 void setScript(const QString &);
202 void runScript(const QString &);
203 void runScriptEverywhere (const QString &);
206 void windowNextEditor();
207 void windowPreviousEditor();
208 void windowShowNoteEditor();
209 void windowHideNoteEditor();
211 void standardFlagChanged();
213 void testFunction1();
214 void testFunction2();
225 QTabWidget *tabWidget;
226 FindWindow *findWindow;
227 QProcess *procBrowser;
229 QStringList imageTypes;
231 QLineEdit *lineedit; // to enter headings of branches
232 QString prevSelection;
234 HistoryWindow *historyWindow;
236 BranchPropertyWindow *branchPropertyWindow;
237 SimpleScriptEditor *scriptEditor;
239 QList <QAction*> actionListBranches;
245 QMenu *recentFilesMenu;
246 enum { MaxRecentFiles = 9 };
247 QAction *recentFileActions[MaxRecentFiles];
249 QAction *macroActions[12];
252 QAction* actionFileSave;
253 QAction* actionFilePrint;
254 QAction* actionEditUndo;
255 QAction* actionEditRedo;
256 QAction *actionEditCopy;
257 QAction *actionEditCut;
258 QAction *actionEditPaste;
259 QAction *actionEditMoveUp;
260 QAction *actionEditMoveDown;
261 QAction *actionEditSortChildren;
262 QAction *actionEditToggleScroll;
263 QAction* actionEditOpenURL;
264 QAction* actionEditOpenURLTab;
265 QAction* actionEditOpenMultipleURLTabs;
266 QAction* actionEditURL;
267 QAction* actionEditLocalURL;
268 QAction* actionEditHeading2URL;
269 QAction* actionEditBugzilla2URL;
270 QAction* actionEditFATE2URL;
271 QAction *actionEditOpenVymLink;
272 QAction *actionEditOpenMultipleVymLinks;
273 QAction *actionEditVymLink;
274 QAction *actionEditDeleteVymLink;
275 QAction *actionEditToggleHideExport;
276 QAction *actionEditMapInfo;
277 QAction *actionEditHeading;
278 QAction *actionEditDelete;
279 QAction *actionEditAddBranch;
280 QAction *actionEditAddBranchBefore;
281 QAction *actionEditAddBranchAbove;
282 QAction *actionEditAddBranchBelow;
283 QAction *actionEditDeleteKeepChilds;
284 QAction *actionEditDeleteChilds;
285 QAction *actionEditImportAdd;
286 QAction *actionEditImportReplace;
287 QAction *actionEditSaveBranch;
288 QAction *actionEditSelectFirst;
289 QAction *actionEditSelectLast;
290 QAction *actionEditLoadImage;
292 QAction* actionFormatColor;
293 QAction* actionFormatPickColor;
294 QAction* actionFormatColorBranch;
295 QAction* actionFormatColorSubtree;
296 QAction* actionFormatLinkColorHint;
297 QAction* actionFormatBackColor;
298 QAction* actionFormatBackImage;
299 QAction* actionFormatLinkColor;
300 QAction* actionFormatSelectionColor;
302 QActionGroup* actionGroupModModes;
303 QAction* actionModModeColor;
304 QAction* actionModModeXLink;
305 QAction* actionModModeCopy;
307 QActionGroup *actionGroupFormatFrameTypes;
310 QActionGroup *actionGroupFormatLinkStyles;
311 QAction *actionFormatLinkStyleLine;
312 QAction *actionFormatLinkStyleParabel;
313 QAction *actionFormatLinkStylePolyLine;
314 QAction *actionFormatLinkStylePolyParabel;
315 QAction *actionFormatHideLinkUnselected;
317 QAction *actionViewToggleNoteEditor;
318 QAction *actionViewToggleHistoryWindow;
319 QAction *actionViewTogglePropertyWindow;
320 QAction *actionViewToggleAntiAlias;
321 QAction *actionViewToggleSmoothPixmapTransform;
322 QAction* actionViewCenter;
324 QAction* actionSettingsAutoEditNewBranch;
325 QAction* actionSettingsAutoSelectNewBranch;
326 QAction* actionSettingsAutoSelectText;
327 QAction* actionSettingsUseDelKey;
328 QAction* actionSettingsUseFlagGroups;
329 QAction* actionSettingsUseHideExport;
330 QAction* actionSettingsAutosaveToggle;
331 QAction* actionSettingsAutosaveTime;
332 QAction* actionSettingsWriteBackupFile;