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"
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 QProgressDialog progressDialog;
41 int progressCounterTotal;
43 void statusMessage (const QString &);
44 void setProgressMaximum (int max);
45 void addProgressValue (float v);
46 void setProgressCounter (int v);
47 void removeProgressCounter();
54 void closeEvent( QCloseEvent* );
57 void setupFileActions();
58 void setupEditActions();
59 void setupFormatActions();
60 void setupViewActions();
61 void setupModeActions();
62 void setupWindowActions();
63 void setupFlag(Flag *flag, QToolBar *tb, const QString &name, const QString &tooltip);
64 void setupFlagActions();
65 void setupNetworkActions();
66 void setupSettingsActions();
67 void setupTestActions();
68 void setupHelpActions();
69 void setupContextMenus();
70 void setupRecentMapsMenu();
72 void hideEvent (QHideEvent * );
73 void showEvent (QShowEvent * );
74 MapEditor* currentMapEditor() const;
75 VymModel* currentModel() const;
77 uint currentModelID() 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 fileExportImage();
105 void fileExportASCII();
106 void fileExportCSV();
107 void fileExportLaTeX();
108 void fileExportKDE3Bookmarks();
109 void fileExportKDE4Bookmarks();
110 void fileExportTaskjuggler();
111 void fileExportOOPresentation();
119 void gotoHistoryStep (int);
124 void editOpenFindWidget();
125 void editHideFindWidget();
126 void editFindNext(QString s);
127 void editFindDuplicateURLs();
129 void openTabs(QStringList);
132 void editOpenURLTab();
134 void editOpenMultipleVisURLTabs(bool ignoreScrolled=true);
135 void editOpenMultipleURLTabs();
138 void editHeading2URL();
139 void editBugzilla2URL();
140 void getBugzillaData();
142 void openVymLinks(const QStringList &);
144 void editOpenMultipleVymLinks();
146 void editHeadingFinished(VymModel *m);
147 // void editHeading();
148 void editOpenVymLink();
150 void editDeleteVymLink();
151 void editToggleHideExport();
152 void editAddTimestamp();
157 void editSortChildren();
158 void editSortBackChildren();
159 void editToggleScroll();
160 void editExpandAll();
161 void editExpandOneLevel();
162 void editCollapseOneLevel();
163 void editUnscrollChildren();
164 void editAddAttribute();
165 void editAddMapCenter();
166 void editNewBranch();
167 void editNewBranchBefore();
168 void editNewBranchAbove();
169 void editNewBranchBelow();
170 void editImportAdd();
171 void editImportReplace();
172 void editSaveBranch();
173 void editDeleteKeepChildren();
174 void editDeleteChildren();
175 void editDeleteSelection();
176 void editLoadImage();
177 void editSaveImage();
178 void editEditXLink (QAction *);
180 void formatSelectColor();
181 void formatPickColor();
182 void colorChanged(QColor);
183 void formatColorBranch();
184 void formatColorSubtree();
185 void formatLinkStyleLine();
186 void formatLinkStyleParabel();
187 void formatLinkStylePolyLine();
188 void formatLinkStylePolyParabel();
189 void formatSelectBackColor();
190 void formatSelectBackImage();
191 void formatSelectLinkColor();
192 void formatSelectSelectionColor();
193 void formatToggleLinkColorHint();
194 void formatHideLinkUnselected();
197 void viewZoomReset();
203 void networkStartServer();
204 void networkConnect();
207 void settingsMacroDir();
208 void settingsToggleDelKey();
209 void settingsUndoLevels();
210 void settingsAutosaveToggle();
211 void settingsAutosaveTime();
212 void settingsAutoLayoutToggle();
213 void settingsWriteBackupFileToggle();
214 void settingsToggleAnimation();
216 void windowToggleNoteEditor();
217 void windowToggleTreeEditor();
218 void windowToggleHistory();
219 void windowToggleProperty();
220 void updateHistory(SimpleSettings &);
221 void windowToggleAntiAlias();
224 bool hasSmoothPixmapTransform();
226 void windowToggleSmoothPixmap();
227 void updateNoteFlag();
228 void updateNoteEditor (QModelIndex index);
229 void selectInNoteEditor (QString s, int i);
230 void changeSelection (VymModel *model,const QItemSelection &newSel, const QItemSelection &delSel);
232 void updateActions();
233 ModMode getModMode();
234 bool autoEditNewBranch();
235 bool autoSelectNewBranch();
236 void setScript(const QString &);
237 void runScript(const QString &);
238 void runScriptEverywhere (const QString &);
241 void windowNextEditor();
242 void windowPreviousEditor();
243 void windowShowNoteEditor();
244 void windowHideNoteEditor();
246 void standardFlagChanged();
248 void testFunction1();
249 void testFunction2();
260 QTabWidget *tabWidget;
261 QProcess *procBrowser; //FIXME-2 remove this...
264 QStringList imageTypes;
266 QList <VymView*> vymViews; //! Keeps track of models and views related to a tab
267 QString prevSelection;
269 HistoryWindow *historyWindow;
271 BranchPropertyWindow *branchPropertyWindow;
272 SimpleScriptEditor *scriptEditor;
274 QList <QAction*> actionListBranches;
280 QMenu *recentFilesMenu;
281 enum { MaxRecentFiles = 9 };
282 QAction *recentFileActions[MaxRecentFiles];
284 QAction *macroActions[12];
287 Switchboard switchboard;
289 QAction* actionFileNewCopy;
290 QAction* actionFileSave;
291 QAction* actionFilePrint;
296 QAction *actionPaste;
297 QAction *actionMoveUp;
298 QAction *actionMoveDown;
299 QAction *actionDetach;
300 QAction *actionSortChildren;
301 QAction *actionSortBackChildren;
302 QAction *actionToggleScroll;
303 QAction *actionExpandAll;
304 QAction *actionExpandOneLevel;
305 QAction *actionCollapseOneLevel;
306 QAction* actionOpenURL;
307 QAction* actionOpenURLTab;
308 QAction* actionOpenMultipleVisURLTabs;
309 QAction* actionOpenMultipleURLTabs;
311 QAction* actionLocalURL;
312 QAction* actionHeading2URL;
313 QAction* actionBugzilla2URL;
314 QAction* actionGetBugzillaData;
315 QAction* actionFATE2URL;
316 QAction *actionOpenVymLink;
317 QAction *actionOpenMultipleVymLinks;
318 QAction *actionVymLink;
319 QAction *actionDeleteVymLink;
320 QAction *actionAddTimestamp;
321 QAction *actionToggleHideExport;
322 QAction *actionMapInfo;
323 QAction *actionHeading;
324 QAction *actionDelete;
325 QAction *actionAddAttribute;
327 QAction *actionAddMapCenter;
330 QAction *actionAddBranch;
331 QAction *actionAddBranchBefore;
332 QAction *actionAddBranchAbove;
333 QAction *actionAddBranchBelow;
334 QAction *actionDeleteKeepChildren;
335 QAction *actionDeleteChildren;
336 QAction *actionImportAdd;
337 QAction *actionImportReplace;
338 QAction *actionSaveBranch;
339 QAction *actionLoadImage;
341 QAction* actionFormatColor;
342 QAction* actionFormatPickColor;
343 QAction* actionFormatColorBranch;
344 QAction* actionFormatColorSubtree;
345 QAction* actionFormatLinkColorHint;
346 QAction* actionFormatBackColor;
347 QAction* actionFormatBackImage;
348 QAction* actionFormatLinkColor;
349 QAction* actionFormatSelectionColor;
351 QActionGroup* actionGroupModModes;
352 QAction* actionModModeColor;
353 QAction* actionModModeXLink;
354 QAction* actionModModeCopy;
356 QActionGroup *actionGroupFormatFrameTypes;
359 QActionGroup *actionGroupFormatLinkStyles;
360 QAction *actionFormatLinkStyleLine;
361 QAction *actionFormatLinkStyleParabel;
362 QAction *actionFormatLinkStylePolyLine;
363 QAction *actionFormatLinkStylePolyParabel;
364 QAction *actionFormatHideLinkUnselected;
366 QAction *actionViewToggleNoteEditor;
367 QAction *actionViewToggleTreeEditor;
368 QAction *actionViewToggleHistoryWindow;
369 QAction *actionViewTogglePropertyWindow;
370 QAction *actionViewToggleAntiAlias;
371 QAction *actionViewToggleSmoothPixmapTransform;
372 QAction* actionViewCenter;
374 QAction* actionSettingsAutoEditNewBranch;
375 QAction* actionSettingsAutoSelectNewBranch;
376 QAction* actionSettingsAutoSelectText;
377 QAction* actionSettingsUseDelKey;
378 QAction* actionSettingsUseFlagGroups;
379 QAction* actionSettingsUseHideExport;
380 QAction* actionSettingsAutosaveToggle;
381 QAction* actionSettingsAutosaveTime;
382 QAction* actionSettingsAutoLayoutToggle;
383 QAction* actionSettingsWriteBackupFile;
384 QAction* actionSettingsUseAnimation;