8 #include "branchpropwindow.h"
9 #include "extrainfodialog.h"
12 #include "historywindow.h"
13 #include "mapeditor.h"
14 #include "shortcuts.h"
15 #include "simplescripteditor.h"
16 #include "texteditor.h"
20 class Main : public QMainWindow
25 /*! Modifier modes are used when CTRL together with a mouse button is pressed */
27 ModModeNone, //!< Unused
28 ModModeColor, //!< Pick color from object
29 ModModeCopy, //!< Copy object
30 ModModeXLink //!< Create a XLink (XLinkObj) from selected object
33 Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
38 QProgressDialog progressDialog;
42 int progressCounterTotal;
44 void statusMessage (const QString &);
45 void setProgressMaximum (int max);
46 void addProgressValue (float v);
47 void setProgressCounter (int v);
48 void removeProgressCounter();
55 void closeEvent( QCloseEvent* );
58 void setupFileActions();
59 void setupEditActions();
60 void setupFormatActions();
61 void setupViewActions();
62 void setupModeActions();
63 void setupWindowActions();
64 void setupFlag(Flag *flag, QToolBar *tb, const QString &name, const QString &tooltip);
65 void setupFlagActions();
66 void setupNetworkActions();
67 void setupSettingsActions();
68 void setupTestActions();
69 void setupHelpActions();
70 void setupContextMenus();
71 void setupRecentMapsMenu();
73 void hideEvent (QHideEvent * );
74 void showEvent (QShowEvent * );
75 MapEditor* currentMapEditor() const;
76 VymModel* currentModel() const;
78 VymModel* getModel(uint) const;
81 void editorChanged(QWidget*);
83 ErrorCode fileLoad(QString ,const LoadMode &, const FileType & ftype=VymMap);
84 void fileLoad(const LoadMode &);
86 void fileLoadRecent();
87 void addRecentMap (const QString &);
88 void fileSave(VymModel*, const SaveMode & );
91 void fileSave(VymModel*); // autosave from MapEditor
93 void fileSaveAs(const SaveMode &);
95 void fileImportKDE3Bookmarks();
96 void fileImportKDE4Bookmarks();
97 void fileImportFirefoxBookmarks();
98 void fileImportFreemind();
100 void fileImportDir();
101 void fileExportXML();
102 void fileExportHTML();
103 void fileExportXHTML();
104 void fileExportImage();
106 void fileExportASCII();
107 void fileExportCSV();
108 void fileExportLaTeX();
109 void fileExportKDE3Bookmarks();
110 void fileExportKDE4Bookmarks();
111 void fileExportTaskjuggler();
112 void fileExportOOPresentation();
120 void gotoHistoryStep (int);
125 void editOpenFindWidget();
126 void editFindDuplicateURLs();
128 void openTabs(QStringList);
131 void editOpenURLTab();
133 void editOpenMultipleVisURLTabs(bool ignoreScrolled=true);
134 void editOpenMultipleURLTabs();
137 void editHeading2URL();
138 void editBugzilla2URL();
139 void getBugzillaData();
141 void openVymLinks(const QStringList &);
143 void editOpenMultipleVymLinks();
145 void editHeadingFinished(VymModel *m);
146 // void editHeading();
147 void editOpenVymLink();
149 void editDeleteVymLink();
150 void editToggleHideExport();
151 void editAddTimestamp();
156 void editSortChildren();
157 void editSortBackChildren();
158 void editToggleScroll();
159 void editExpandAll();
160 void editExpandOneLevel();
161 void editCollapseOneLevel();
162 void editUnscrollChildren();
163 void editAddAttribute();
164 void editAddMapCenter();
165 void editNewBranch();
166 void editNewBranchBefore();
167 void editNewBranchAbove();
168 void editNewBranchBelow();
169 void editImportAdd();
170 void editImportReplace();
171 void editSaveBranch();
172 void editDeleteKeepChildren();
173 void editDeleteChildren();
174 void editDeleteSelection();
175 void editLoadImage();
176 void editSaveImage();
177 void editEditXLink (QAction *);
179 void formatSelectColor();
180 void formatPickColor();
181 void colorChanged(QColor);
182 void formatColorBranch();
183 void formatColorSubtree();
184 void formatLinkStyleLine();
185 void formatLinkStyleParabel();
186 void formatLinkStylePolyLine();
187 void formatLinkStylePolyParabel();
188 void formatSelectBackColor();
189 void formatSelectBackImage();
190 void formatSelectLinkColor();
191 void formatSelectSelectionColor();
192 void formatToggleLinkColorHint();
193 void formatHideLinkUnselected();
196 void viewZoomReset();
202 void networkStartServer();
203 void networkConnect();
206 void settingsMacroDir();
207 void settingsToggleDelKey();
208 void settingsUndoLevels();
209 void settingsAutosaveToggle();
210 void settingsAutosaveTime();
211 void settingsWriteBackupFileToggle();
212 void settingsToggleAnimation();
214 void windowToggleNoteEditor();
215 void windowToggleTreeEditor();
216 void windowToggleHistory();
217 void windowToggleProperty();
218 void updateHistory(SimpleSettings &);
219 void windowToggleAntiAlias();
222 bool hasSmoothPixmapTransform();
224 void windowToggleSmoothPixmap();
225 void updateNoteFlag();
226 void updateNoteEditor (QModelIndex index);
227 void changeSelection (VymModel *model,const QItemSelection &newSel, const QItemSelection &delSel);
229 void updateActions();
230 ModMode getModMode();
231 bool autoEditNewBranch();
232 bool autoSelectNewBranch();
233 void setScript(const QString &);
234 void runScript(const QString &);
235 void runScriptEverywhere (const QString &);
238 void windowNextEditor();
239 void windowPreviousEditor();
240 void windowShowNoteEditor();
241 void windowHideNoteEditor();
243 void standardFlagChanged();
245 void testFunction1();
246 void testFunction2();
257 QTabWidget *tabWidget;
258 QProcess *procBrowser; //FIXME-2 remove this...
261 QStringList imageTypes;
263 QList <VymView*> vymViews; //! Keeps track of models and views related to a tab
264 QString prevSelection;
266 HistoryWindow *historyWindow;
268 BranchPropertyWindow *branchPropertyWindow;
269 SimpleScriptEditor *scriptEditor;
271 QList <QAction*> actionListBranches;
277 QMenu *recentFilesMenu;
278 enum { MaxRecentFiles = 9 };
279 QAction *recentFileActions[MaxRecentFiles];
281 QAction *macroActions[12];
284 Switchboard switchboard;
286 QAction* actionFileNewCopy;
287 QAction* actionFileSave;
288 QAction* actionFilePrint;
293 QAction *actionPaste;
294 QAction *actionMoveUp;
295 QAction *actionMoveDown;
296 QAction *actionDetach;
297 QAction *actionSortChildren;
298 QAction *actionSortBackChildren;
299 QAction *actionToggleScroll;
300 QAction *actionExpandAll;
301 QAction *actionExpandOneLevel;
302 QAction *actionCollapseOneLevel;
303 QAction* actionOpenURL;
304 QAction* actionOpenURLTab;
305 QAction* actionOpenMultipleVisURLTabs;
306 QAction* actionOpenMultipleURLTabs;
308 QAction* actionLocalURL;
309 QAction* actionHeading2URL;
310 QAction* actionBugzilla2URL;
311 QAction* actionGetBugzillaData;
312 QAction* actionFATE2URL;
313 QAction *actionOpenVymLink;
314 QAction *actionOpenMultipleVymLinks;
315 QAction *actionVymLink;
316 QAction *actionDeleteVymLink;
317 QAction *actionAddTimestamp;
318 QAction *actionToggleHideExport;
319 QAction *actionMapInfo;
320 QAction *actionHeading;
321 QAction *actionDelete;
322 QAction *actionAddAttribute;
324 QAction *actionAddMapCenter;
327 QAction *actionAddBranch;
328 QAction *actionAddBranchBefore;
329 QAction *actionAddBranchAbove;
330 QAction *actionAddBranchBelow;
331 QAction *actionDeleteKeepChildren;
332 QAction *actionDeleteChildren;
333 QAction *actionImportAdd;
334 QAction *actionImportReplace;
335 QAction *actionSaveBranch;
336 QAction *actionLoadImage;
338 QAction* actionFormatColor;
339 QAction* actionFormatPickColor;
340 QAction* actionFormatColorBranch;
341 QAction* actionFormatColorSubtree;
342 QAction* actionFormatLinkColorHint;
343 QAction* actionFormatBackColor;
344 QAction* actionFormatBackImage;
345 QAction* actionFormatLinkColor;
346 QAction* actionFormatSelectionColor;
348 QActionGroup* actionGroupModModes;
349 QAction* actionModModeColor;
350 QAction* actionModModeXLink;
351 QAction* actionModModeCopy;
353 QActionGroup *actionGroupFormatFrameTypes;
356 QActionGroup *actionGroupFormatLinkStyles;
357 QAction *actionFormatLinkStyleLine;
358 QAction *actionFormatLinkStyleParabel;
359 QAction *actionFormatLinkStylePolyLine;
360 QAction *actionFormatLinkStylePolyParabel;
361 QAction *actionFormatHideLinkUnselected;
363 QAction *actionViewToggleNoteEditor;
364 QAction *actionViewToggleTreeEditor;
365 QAction *actionViewToggleHistoryWindow;
366 QAction *actionViewTogglePropertyWindow;
367 QAction *actionViewToggleAntiAlias;
368 QAction *actionViewToggleSmoothPixmapTransform;
369 QAction* actionViewCenter;
371 QAction* actionSettingsAutoEditNewBranch;
372 QAction* actionSettingsAutoSelectNewBranch;
373 QAction* actionSettingsAutoSelectText;
374 QAction* actionSettingsUseDelKey;
375 QAction* actionSettingsUseFlagGroups;
376 QAction* actionSettingsUseHideExport;
377 QAction* actionSettingsAutosaveToggle;
378 QAction* actionSettingsAutosaveTime;
379 QAction* actionSettingsWriteBackupFile;
380 QAction* actionSettingsUseAnimation;