8 #include "branchpropwindow.h"
9 #include "extrainfodialog.h"
12 #include "findwindow.h"
13 #include "historywindow.h"
14 #include "mapeditor.h"
15 #include "simplescripteditor.h"
16 #include "texteditor.h"
19 class Main : public QMainWindow
24 /*! Modifier modes are used when CTRL together with a mouse button is pressed */
26 ModModeNone, //!< Unused
27 ModModeColor, //!< Pick color from object
28 ModModeCopy, //!< Copy object
29 ModModeXLink //!< Create a XLink (XLinkObj) from selected object
32 Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
37 QProgressBar *progressBar;
41 void statusMessage (const QString &);
42 void setProgressMinimum (int min);
43 void setProgressMaximum (int max);
44 void setProgressValue (int v);
45 void removeProgressBar();
52 void closeEvent( QCloseEvent* );
55 void setupFileActions();
56 void setupEditActions();
57 void setupFormatActions();
58 void setupViewActions();
59 void setupModeActions();
60 void setupWindowActions();
61 void setupFlag(Flag *flag, QToolBar *tb, const QString &name, const QString &tooltip);
62 void setupFlagActions();
63 void setupNetworkActions();
64 void setupSettingsActions();
65 void setupTestActions();
66 void setupHelpActions();
67 void setupContextMenus();
68 void setupRecentMapsMenu();
70 void hideEvent (QHideEvent * );
71 void showEvent (QShowEvent * );
72 MapEditor* currentMapEditor() const;
73 VymModel* currentModel() const;
76 void editorChanged(QWidget*);
78 ErrorCode fileLoad(QString ,const LoadMode &, const FileType & ftype=VymMap);
79 void fileLoad(const LoadMode &);
81 void fileLoadRecent();
82 void addRecentMap (const QString &);
83 void fileSave(VymModel*, const SaveMode & );
86 void fileSave(VymModel*); // autosave from MapEditor
88 void fileSaveAs(const SaveMode &);
90 void fileImportKDE3Bookmarks();
91 void fileImportKDE4Bookmarks();
92 void fileImportFirefoxBookmarks();
93 void fileImportFreemind();
97 void fileExportXHTML();
98 void fileExportImage();
99 void fileExportASCII();
100 void fileExportCSV();
101 void fileExportLaTeX();
102 void fileExportKDE3Bookmarks();
103 void fileExportKDE4Bookmarks();
104 void fileExportTaskjuggler();
105 void fileExportOOPresentation();
113 void gotoHistoryStep (int);
118 void editOpenFindWindow();
119 void editFind(QString);
120 void editFindChanged();
122 void openTabs(QStringList);
125 void editOpenURLTab();
127 void editOpenMultipleURLTabs();
130 void editHeading2URL();
131 void editBugzilla2URL();
133 void openVymLinks(const QStringList &);
135 void editOpenMultipleVymLinks();
137 void editHeadingFinished(VymModel *m);
138 // void editHeading();
139 void editOpenVymLink();
141 void editDeleteVymLink();
142 void editToggleHideExport();
146 void editSortChildren();
147 void editToggleScroll();
148 void editExpandAll();
149 void editUnscrollChildren();
150 void editAddMapCenter();
151 void editNewBranch();
152 void editNewBranchBefore();
153 void editNewBranchAbove();
154 void editNewBranchBelow();
155 void editImportAdd();
156 void editImportReplace();
157 void editSaveBranch();
158 void editDeleteKeepChildren();
159 void editDeleteChildren();
160 void editDeleteSelection();
161 void editLoadImage();
162 void editSaveImage();
163 void editFollowXLink (QAction *);
164 void editEditXLink (QAction *);
166 void formatSelectColor();
167 void formatPickColor();
168 void colorChanged(QColor);
169 void formatColorBranch();
170 void formatColorSubtree();
171 void formatLinkStyleLine();
172 void formatLinkStyleParabel();
173 void formatLinkStylePolyLine();
174 void formatLinkStylePolyParabel();
175 void formatSelectBackColor();
176 void formatSelectBackImage();
177 void formatSelectLinkColor();
178 void formatSelectSelectionColor();
179 void formatToggleLinkColorHint();
180 void formatHideLinkUnselected();
182 void viewZoomReset();
188 void networkStartServer();
189 void networkConnect();
192 void settingsMacroDir();
193 void settingsToggleDelKey();
194 void settingsUndoLevels();
195 void settingsAutosaveToggle();
196 void settingsAutosaveTime();
197 void settingsWriteBackupFileToggle();
198 void settingsToggleAnimation();
200 void windowToggleNoteEditor();
201 void windowToggleHistory();
202 void windowToggleProperty();
203 void updateHistory(SimpleSettings &);
204 void windowToggleAntiAlias();
207 bool hasSmoothPixmapTransform();
209 void windowToggleSmoothPixmap();
210 void updateNoteFlag();
211 void updateNoteEditor (QModelIndex index);
212 void changeSelection (VymModel *model,const QItemSelection &newSel, const QItemSelection &delSel);
214 void updateActions();
215 ModMode getModMode();
216 bool autoEditNewBranch();
217 bool autoSelectNewBranch();
218 void setScript(const QString &);
219 void runScript(const QString &);
220 void runScriptEverywhere (const QString &);
223 void windowNextEditor();
224 void windowPreviousEditor();
225 void windowShowNoteEditor();
226 void windowHideNoteEditor();
228 void standardFlagChanged();
230 void testFunction1();
231 void testFunction2();
242 QTabWidget *tabWidget;
243 FindWindow *findWindow;
244 QProcess *procBrowser;
246 QStringList imageTypes;
248 QList <VymView*> vymViews; //! Keeps track of models and views related to a tab
249 QString prevSelection;
251 HistoryWindow *historyWindow;
253 BranchPropertyWindow *branchPropertyWindow;
254 SimpleScriptEditor *scriptEditor;
256 QList <QAction*> actionListBranches;
262 QMenu *recentFilesMenu;
263 enum { MaxRecentFiles = 9 };
264 QAction *recentFileActions[MaxRecentFiles];
266 QAction *macroActions[12];
269 QAction* actionFileNewCopy;
270 QAction* actionFileSave;
271 QAction* actionFilePrint;
276 QAction *actionPaste;
277 QAction *actionMoveUp;
278 QAction *actionMoveDown;
279 QAction *actionSortChildren;
280 QAction *actionToggleScroll;
281 QAction *actionExpandAll;
282 QAction* actionOpenURL;
283 QAction* actionOpenURLTab;
284 QAction* actionOpenMultipleURLTabs;
286 QAction* actionLocalURL;
287 QAction* actionHeading2URL;
288 QAction* actionBugzilla2URL;
289 QAction* actionFATE2URL;
290 QAction *actionOpenVymLink;
291 QAction *actionOpenMultipleVymLinks;
292 QAction *actionVymLink;
293 QAction *actionDeleteVymLink;
294 QAction *actionToggleHideExport;
295 QAction *actionMapInfo;
296 QAction *actionHeading;
297 QAction *actionDelete;
300 QAction *actionAddMapCenter;
303 QAction *actionAddBranch;
304 QAction *actionAddBranchBefore;
305 QAction *actionAddBranchAbove;
306 QAction *actionAddBranchBelow;
307 QAction *actionDeleteKeepChildren;
308 QAction *actionDeleteChildren;
309 QAction *actionImportAdd;
310 QAction *actionImportReplace;
311 QAction *actionSaveBranch;
312 QAction *actionLoadImage;
314 QAction* actionFormatColor;
315 QAction* actionFormatPickColor;
316 QAction* actionFormatColorBranch;
317 QAction* actionFormatColorSubtree;
318 QAction* actionFormatLinkColorHint;
319 QAction* actionFormatBackColor;
320 QAction* actionFormatBackImage;
321 QAction* actionFormatLinkColor;
322 QAction* actionFormatSelectionColor;
324 QActionGroup* actionGroupModModes;
325 QAction* actionModModeColor;
326 QAction* actionModModeXLink;
327 QAction* actionModModeCopy;
329 QActionGroup *actionGroupFormatFrameTypes;
332 QActionGroup *actionGroupFormatLinkStyles;
333 QAction *actionFormatLinkStyleLine;
334 QAction *actionFormatLinkStyleParabel;
335 QAction *actionFormatLinkStylePolyLine;
336 QAction *actionFormatLinkStylePolyParabel;
337 QAction *actionFormatHideLinkUnselected;
339 QAction *actionViewToggleNoteEditor;
340 QAction *actionViewToggleHistoryWindow;
341 QAction *actionViewTogglePropertyWindow;
342 QAction *actionViewToggleAntiAlias;
343 QAction *actionViewToggleSmoothPixmapTransform;
344 QAction* actionViewCenter;
346 QAction* actionSettingsAutoEditNewBranch;
347 QAction* actionSettingsAutoSelectNewBranch;
348 QAction* actionSettingsAutoSelectText;
349 QAction* actionSettingsUseDelKey;
350 QAction* actionSettingsUseFlagGroups;
351 QAction* actionSettingsUseHideExport;
352 QAction* actionSettingsAutosaveToggle;
353 QAction* actionSettingsAutosaveTime;
354 QAction* actionSettingsWriteBackupFile;
355 QAction* actionSettingsUseAnimation;