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 <VymView*> vymViews; //! Keeps track of models and views related to a tab
247 QString prevSelection;
249 HistoryWindow *historyWindow;
251 BranchPropertyWindow *branchPropertyWindow;
252 SimpleScriptEditor *scriptEditor;
254 QList <QAction*> actionListBranches;
260 QMenu *recentFilesMenu;
261 enum { MaxRecentFiles = 9 };
262 QAction *recentFileActions[MaxRecentFiles];
264 QAction *macroActions[12];
267 QAction* actionFileNewCopy;
268 QAction* actionFileSave;
269 QAction* actionFilePrint;
274 QAction *actionPaste;
275 QAction *actionMoveUp;
276 QAction *actionMoveDown;
277 QAction *actionSortChildren;
278 QAction *actionToggleScroll;
279 QAction *actionExpandAll;
280 QAction* actionOpenURL;
281 QAction* actionOpenURLTab;
282 QAction* actionOpenMultipleURLTabs;
284 QAction* actionLocalURL;
285 QAction* actionHeading2URL;
286 QAction* actionBugzilla2URL;
287 QAction* actionFATE2URL;
288 QAction *actionOpenVymLink;
289 QAction *actionOpenMultipleVymLinks;
290 QAction *actionVymLink;
291 QAction *actionDeleteVymLink;
292 QAction *actionToggleHideExport;
293 QAction *actionMapInfo;
294 QAction *actionHeading;
295 QAction *actionDelete;
298 QAction *actionAddMapCenter;
301 QAction *actionAddBranch;
302 QAction *actionAddBranchBefore;
303 QAction *actionAddBranchAbove;
304 QAction *actionAddBranchBelow;
305 QAction *actionDeleteKeepChildren;
306 QAction *actionDeleteChildren;
307 QAction *actionImportAdd;
308 QAction *actionImportReplace;
309 QAction *actionSaveBranch;
310 QAction *actionLoadImage;
312 QAction* actionFormatColor;
313 QAction* actionFormatPickColor;
314 QAction* actionFormatColorBranch;
315 QAction* actionFormatColorSubtree;
316 QAction* actionFormatLinkColorHint;
317 QAction* actionFormatBackColor;
318 QAction* actionFormatBackImage;
319 QAction* actionFormatLinkColor;
320 QAction* actionFormatSelectionColor;
322 QActionGroup* actionGroupModModes;
323 QAction* actionModModeColor;
324 QAction* actionModModeXLink;
325 QAction* actionModModeCopy;
327 QActionGroup *actionGroupFormatFrameTypes;
330 QActionGroup *actionGroupFormatLinkStyles;
331 QAction *actionFormatLinkStyleLine;
332 QAction *actionFormatLinkStyleParabel;
333 QAction *actionFormatLinkStylePolyLine;
334 QAction *actionFormatLinkStylePolyParabel;
335 QAction *actionFormatHideLinkUnselected;
337 QAction *actionViewToggleNoteEditor;
338 QAction *actionViewToggleHistoryWindow;
339 QAction *actionViewTogglePropertyWindow;
340 QAction *actionViewToggleAntiAlias;
341 QAction *actionViewToggleSmoothPixmapTransform;
342 QAction* actionViewCenter;
344 QAction* actionSettingsAutoEditNewBranch;
345 QAction* actionSettingsAutoSelectNewBranch;
346 QAction* actionSettingsAutoSelectText;
347 QAction* actionSettingsUseDelKey;
348 QAction* actionSettingsUseFlagGroups;
349 QAction* actionSettingsUseHideExport;
350 QAction* actionSettingsAutosaveToggle;
351 QAction* actionSettingsAutosaveTime;
352 QAction* actionSettingsWriteBackupFile;
353 QAction* actionSettingsUseAnimation;