6 #include "branchpropwindow.h"
7 #include "extrainfodialog.h"
10 #include "findwindow.h"
11 #include "historywindow.h"
12 #include "mapeditor.h"
13 #include "simplescripteditor.h"
14 #include "texteditor.h"
17 class Main : public QMainWindow
22 /*! Modifier modes are used when CTRL together with a mouse button is pressed */
24 ModModeNone, //!< Unused
25 ModModeColor, //!< Pick color from object
26 ModModeCopy, //!< Copy object
27 ModModeXLink //!< Create a XLink (XLinkObj) from selected object
30 Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
35 QProgressBar *progressBar;
39 void statusMessage (const QString &);
40 void setProgressMinimum (int min);
41 void setProgressMaximum (int max);
42 void setProgressValue (int v);
43 void removeProgressBar();
50 void closeEvent( QCloseEvent* );
53 void setupFileActions();
54 void setupEditActions();
55 void setupFormatActions();
56 void setupViewActions();
57 void setupModeActions();
58 void setupWindowActions();
59 void setupFlag(Flag *flag, QToolBar *tb, const QString &name, const QString &tooltip);
60 void setupFlagActions();
61 void setupNetworkActions();
62 void setupSettingsActions();
63 void setupTestActions();
64 void setupHelpActions();
65 void setupContextMenus();
66 void setupRecentMapsMenu();
68 void hideEvent (QHideEvent * );
69 void showEvent (QShowEvent * );
70 MapEditor* currentMapEditor() const;
71 VymModel* currentModel() const;
74 void editorChanged(QWidget*);
76 ErrorCode fileLoad(QString ,const LoadMode &, const FileType & ftype=VymMap);
77 void fileLoad(const LoadMode &);
79 void fileLoadRecent();
80 void addRecentMap (const QString &);
81 void fileSave(VymModel*, const SaveMode & );
84 void fileSave(VymModel*); // autosave from MapEditor
86 void fileSaveAs(const SaveMode &);
88 void fileImportKDE3Bookmarks();
89 void fileImportKDE4Bookmarks();
90 void fileImportFirefoxBookmarks();
91 void fileImportFreemind();
95 void fileExportXHTML();
96 void fileExportImage();
97 void fileExportASCII();
99 void fileExportLaTeX();
100 void fileExportKDE3Bookmarks();
101 void fileExportKDE4Bookmarks();
102 void fileExportTaskjuggler();
103 void fileExportOOPresentation();
111 void gotoHistoryStep (int);
116 void editOpenFindWindow();
117 void editFind(QString);
118 void editFindChanged();
120 void openTabs(QStringList);
123 void editOpenURLTab();
125 void editOpenMultipleURLTabs();
128 void editHeading2URL();
129 void editBugzilla2URL();
131 void openVymLinks(const QStringList &);
133 void editOpenMultipleVymLinks();
135 void editHeadingFinished(VymModel *m);
136 // void editHeading();
137 void editOpenVymLink();
139 void editDeleteVymLink();
140 void editToggleHideExport();
144 void editSortChildren();
145 void editToggleScroll();
146 void editExpandAll();
147 void editUnscrollChildren();
148 void editAddMapCenter();
149 void editNewBranch();
150 void editNewBranchBefore();
151 void editNewBranchAbove();
152 void editNewBranchBelow();
153 void editImportAdd();
154 void editImportReplace();
155 void editSaveBranch();
156 void editDeleteKeepChildren();
157 void editDeleteChildren();
158 void editDeleteSelection();
159 void editLoadImage();
160 void editSaveImage();
161 void editFollowXLink (QAction *);
162 void editEditXLink (QAction *);
164 void formatSelectColor();
165 void formatPickColor();
166 void colorChanged(QColor);
167 void formatColorBranch();
168 void formatColorSubtree();
169 void formatLinkStyleLine();
170 void formatLinkStyleParabel();
171 void formatLinkStylePolyLine();
172 void formatLinkStylePolyParabel();
173 void formatSelectBackColor();
174 void formatSelectBackImage();
175 void formatSelectLinkColor();
176 void formatSelectSelectionColor();
177 void formatToggleLinkColorHint();
178 void formatHideLinkUnselected();
180 void viewZoomReset();
186 void networkStartServer();
187 void networkConnect();
190 void settingsMacroDir();
191 void settingsToggleDelKey();
192 void settingsUndoLevels();
193 void settingsAutosaveToggle();
194 void settingsAutosaveTime();
195 void settingsWriteBackupFileToggle();
196 void settingsToggleAnimation();
198 void windowToggleNoteEditor();
199 void windowToggleHistory();
200 void windowToggleProperty();
201 void updateHistory(SimpleSettings &);
202 void windowToggleAntiAlias();
205 bool hasSmoothPixmapTransform();
207 void windowToggleSmoothPixmap();
208 void updateNoteFlag();
209 void updateNoteEditor (QModelIndex index);
210 void changeSelection (VymModel *model,const QItemSelection &newSel, const QItemSelection &delSel);
212 void updateActions();
213 ModMode getModMode();
214 bool autoEditNewBranch();
215 bool autoSelectNewBranch();
216 void setScript(const QString &);
217 void runScript(const QString &);
218 void runScriptEverywhere (const QString &);
221 void windowNextEditor();
222 void windowPreviousEditor();
223 void windowShowNoteEditor();
224 void windowHideNoteEditor();
226 void standardFlagChanged();
228 void testFunction1();
229 void testFunction2();
240 QTabWidget *tabWidget;
241 FindWindow *findWindow;
242 QProcess *procBrowser;
244 QStringList imageTypes;
246 QList <VymModel*> tabModel; //!< the corresponding model to a tab
248 QString prevSelection;
250 HistoryWindow *historyWindow;
252 BranchPropertyWindow *branchPropertyWindow;
253 SimpleScriptEditor *scriptEditor;
255 QList <QAction*> actionListBranches;
261 QMenu *recentFilesMenu;
262 enum { MaxRecentFiles = 9 };
263 QAction *recentFileActions[MaxRecentFiles];
265 QAction *macroActions[12];
268 QAction* actionFileNewCopy;
269 QAction* actionFileSave;
270 QAction* actionFilePrint;
275 QAction *actionPaste;
276 QAction *actionMoveUp;
277 QAction *actionMoveDown;
278 QAction *actionSortChildren;
279 QAction *actionToggleScroll;
280 QAction *actionExpandAll;
281 QAction* actionOpenURL;
282 QAction* actionOpenURLTab;
283 QAction* actionOpenMultipleURLTabs;
285 QAction* actionLocalURL;
286 QAction* actionHeading2URL;
287 QAction* actionBugzilla2URL;
288 QAction* actionFATE2URL;
289 QAction *actionOpenVymLink;
290 QAction *actionOpenMultipleVymLinks;
291 QAction *actionVymLink;
292 QAction *actionDeleteVymLink;
293 QAction *actionToggleHideExport;
294 QAction *actionMapInfo;
295 QAction *actionHeading;
296 QAction *actionDelete;
299 QAction *actionAddMapCenter;
302 QAction *actionAddBranch;
303 QAction *actionAddBranchBefore;
304 QAction *actionAddBranchAbove;
305 QAction *actionAddBranchBelow;
306 QAction *actionDeleteKeepChildren;
307 QAction *actionDeleteChildren;
308 QAction *actionImportAdd;
309 QAction *actionImportReplace;
310 QAction *actionSaveBranch;
311 QAction *actionLoadImage;
313 QAction* actionFormatColor;
314 QAction* actionFormatPickColor;
315 QAction* actionFormatColorBranch;
316 QAction* actionFormatColorSubtree;
317 QAction* actionFormatLinkColorHint;
318 QAction* actionFormatBackColor;
319 QAction* actionFormatBackImage;
320 QAction* actionFormatLinkColor;
321 QAction* actionFormatSelectionColor;
323 QActionGroup* actionGroupModModes;
324 QAction* actionModModeColor;
325 QAction* actionModModeXLink;
326 QAction* actionModModeCopy;
328 QActionGroup *actionGroupFormatFrameTypes;
331 QActionGroup *actionGroupFormatLinkStyles;
332 QAction *actionFormatLinkStyleLine;
333 QAction *actionFormatLinkStyleParabel;
334 QAction *actionFormatLinkStylePolyLine;
335 QAction *actionFormatLinkStylePolyParabel;
336 QAction *actionFormatHideLinkUnselected;
338 QAction *actionViewToggleNoteEditor;
339 QAction *actionViewToggleHistoryWindow;
340 QAction *actionViewTogglePropertyWindow;
341 QAction *actionViewToggleAntiAlias;
342 QAction *actionViewToggleSmoothPixmapTransform;
343 QAction* actionViewCenter;
345 QAction* actionSettingsAutoEditNewBranch;
346 QAction* actionSettingsAutoSelectNewBranch;
347 QAction* actionSettingsAutoSelectText;
348 QAction* actionSettingsUseDelKey;
349 QAction* actionSettingsUseFlagGroups;
350 QAction* actionSettingsUseHideExport;
351 QAction* actionSettingsAutosaveToggle;
352 QAction* actionSettingsAutosaveTime;
353 QAction* actionSettingsWriteBackupFile;
354 QAction* actionSettingsUseAnimation;