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 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 editHideFindWidget();
127 void editFindNext(QString s);
128 void editFindDuplicateURLs();
130 void openTabs(QStringList);
133 void editOpenURLTab();
135 void editOpenMultipleVisURLTabs(bool ignoreScrolled=true);
136 void editOpenMultipleURLTabs();
139 void editHeading2URL();
140 void editBugzilla2URL();
141 void getBugzillaData();
143 void openVymLinks(const QStringList &);
145 void editOpenMultipleVymLinks();
147 void editHeadingFinished(VymModel *m);
148 // void editHeading();
149 void editOpenVymLink();
151 void editDeleteVymLink();
152 void editToggleHideExport();
153 void editAddTimestamp();
158 void editSortChildren();
159 void editSortBackChildren();
160 void editToggleScroll();
161 void editExpandAll();
162 void editExpandOneLevel();
163 void editCollapseOneLevel();
164 void editUnscrollChildren();
165 void editAddAttribute();
166 void editAddMapCenter();
167 void editNewBranch();
168 void editNewBranchBefore();
169 void editNewBranchAbove();
170 void editNewBranchBelow();
171 void editImportAdd();
172 void editImportReplace();
173 void editSaveBranch();
174 void editDeleteKeepChildren();
175 void editDeleteChildren();
176 void editDeleteSelection();
177 void editLoadImage();
178 void editSaveImage();
179 void editEditXLink (QAction *);
181 void formatSelectColor();
182 void formatPickColor();
183 void colorChanged(QColor);
184 void formatColorBranch();
185 void formatColorSubtree();
186 void formatLinkStyleLine();
187 void formatLinkStyleParabel();
188 void formatLinkStylePolyLine();
189 void formatLinkStylePolyParabel();
190 void formatSelectBackColor();
191 void formatSelectBackImage();
192 void formatSelectLinkColor();
193 void formatSelectSelectionColor();
194 void formatToggleLinkColorHint();
195 void formatHideLinkUnselected();
198 void viewZoomReset();
204 void networkStartServer();
205 void networkConnect();
208 void settingsMacroDir();
209 void settingsToggleDelKey();
210 void settingsUndoLevels();
211 void settingsAutosaveToggle();
212 void settingsAutosaveTime();
213 void settingsAutoLayoutToggle();
214 void settingsWriteBackupFileToggle();
215 void settingsToggleAnimation();
217 void windowToggleNoteEditor();
218 void windowToggleTreeEditor();
219 void windowToggleHistory();
220 void windowToggleProperty();
221 void updateHistory(SimpleSettings &);
222 void windowToggleAntiAlias();
225 bool hasSmoothPixmapTransform();
227 void windowToggleSmoothPixmap();
228 void updateNoteFlag();
229 void updateNoteEditor (QModelIndex index);
230 void selectInNoteEditor (QString s, int i);
231 void changeSelection (VymModel *model,const QItemSelection &newSel, const QItemSelection &delSel);
233 void updateActions();
234 ModMode getModMode();
235 bool autoEditNewBranch();
236 bool autoSelectNewBranch();
237 void setScript(const QString &);
238 void runScript(const QString &);
239 void runScriptEverywhere (const QString &);
242 void windowNextEditor();
243 void windowPreviousEditor();
244 void windowShowNoteEditor();
245 void windowHideNoteEditor();
247 void standardFlagChanged();
249 void testFunction1();
250 void testFunction2();
261 QTabWidget *tabWidget;
262 QProcess *procBrowser; //FIXME-2 remove this...
265 QStringList imageTypes;
267 QList <VymView*> vymViews; //! Keeps track of models and views related to a tab
268 QString prevSelection;
270 HistoryWindow *historyWindow;
272 BranchPropertyWindow *branchPropertyWindow;
273 SimpleScriptEditor *scriptEditor;
275 QList <QAction*> actionListBranches;
281 QMenu *recentFilesMenu;
282 enum { MaxRecentFiles = 9 };
283 QAction *recentFileActions[MaxRecentFiles];
285 QAction *macroActions[12];
288 Switchboard switchboard;
290 QAction* actionFileNewCopy;
291 QAction* actionFileSave;
292 QAction* actionFilePrint;
297 QAction *actionPaste;
298 QAction *actionMoveUp;
299 QAction *actionMoveDown;
300 QAction *actionDetach;
301 QAction *actionSortChildren;
302 QAction *actionSortBackChildren;
303 QAction *actionToggleScroll;
304 QAction *actionExpandAll;
305 QAction *actionExpandOneLevel;
306 QAction *actionCollapseOneLevel;
307 QAction* actionOpenURL;
308 QAction* actionOpenURLTab;
309 QAction* actionOpenMultipleVisURLTabs;
310 QAction* actionOpenMultipleURLTabs;
312 QAction* actionLocalURL;
313 QAction* actionHeading2URL;
314 QAction* actionBugzilla2URL;
315 QAction* actionGetBugzillaData;
316 QAction* actionFATE2URL;
317 QAction *actionOpenVymLink;
318 QAction *actionOpenMultipleVymLinks;
319 QAction *actionVymLink;
320 QAction *actionDeleteVymLink;
321 QAction *actionAddTimestamp;
322 QAction *actionToggleHideExport;
323 QAction *actionMapInfo;
324 QAction *actionHeading;
325 QAction *actionDelete;
326 QAction *actionAddAttribute;
328 QAction *actionAddMapCenter;
331 QAction *actionAddBranch;
332 QAction *actionAddBranchBefore;
333 QAction *actionAddBranchAbove;
334 QAction *actionAddBranchBelow;
335 QAction *actionDeleteKeepChildren;
336 QAction *actionDeleteChildren;
337 QAction *actionImportAdd;
338 QAction *actionImportReplace;
339 QAction *actionSaveBranch;
340 QAction *actionLoadImage;
342 QAction* actionFormatColor;
343 QAction* actionFormatPickColor;
344 QAction* actionFormatColorBranch;
345 QAction* actionFormatColorSubtree;
346 QAction* actionFormatLinkColorHint;
347 QAction* actionFormatBackColor;
348 QAction* actionFormatBackImage;
349 QAction* actionFormatLinkColor;
350 QAction* actionFormatSelectionColor;
352 QActionGroup* actionGroupModModes;
353 QAction* actionModModeColor;
354 QAction* actionModModeXLink;
355 QAction* actionModModeCopy;
357 QActionGroup *actionGroupFormatFrameTypes;
360 QActionGroup *actionGroupFormatLinkStyles;
361 QAction *actionFormatLinkStyleLine;
362 QAction *actionFormatLinkStyleParabel;
363 QAction *actionFormatLinkStylePolyLine;
364 QAction *actionFormatLinkStylePolyParabel;
365 QAction *actionFormatHideLinkUnselected;
367 QAction *actionViewToggleNoteEditor;
368 QAction *actionViewToggleTreeEditor;
369 QAction *actionViewToggleHistoryWindow;
370 QAction *actionViewTogglePropertyWindow;
371 QAction *actionViewToggleAntiAlias;
372 QAction *actionViewToggleSmoothPixmapTransform;
373 QAction* actionViewCenter;
375 QAction* actionSettingsAutoEditNewBranch;
376 QAction* actionSettingsAutoSelectNewBranch;
377 QAction* actionSettingsAutoSelectText;
378 QAction* actionSettingsUseDelKey;
379 QAction* actionSettingsUseFlagGroups;
380 QAction* actionSettingsUseHideExport;
381 QAction* actionSettingsAutosaveToggle;
382 QAction* actionSettingsAutosaveTime;
383 QAction* actionSettingsAutoLayoutToggle;
384 QAction* actionSettingsWriteBackupFile;
385 QAction* actionSettingsUseAnimation;