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 VymModel* getModel(uint) const;
80 void editorChanged(QWidget*);
82 ErrorCode fileLoad(QString ,const LoadMode &, const FileType & ftype=VymMap);
83 void fileLoad(const LoadMode &);
85 void fileLoadRecent();
86 void addRecentMap (const QString &);
87 void fileSave(VymModel*, const SaveMode & );
90 void fileSave(VymModel*); // autosave from MapEditor
92 void fileSaveAs(const SaveMode &);
94 void fileImportKDE3Bookmarks();
95 void fileImportKDE4Bookmarks();
96 void fileImportFirefoxBookmarks();
97 void fileImportFreemind();
100 void fileExportXML();
101 void fileExportHTML();
102 void fileExportXHTML();
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 settingsWriteBackupFileToggle();
213 void settingsToggleAnimation();
215 void windowToggleNoteEditor();
216 void windowToggleTreeEditor();
217 void windowToggleHistory();
218 void windowToggleProperty();
219 void updateHistory(SimpleSettings &);
220 void windowToggleAntiAlias();
223 bool hasSmoothPixmapTransform();
225 void windowToggleSmoothPixmap();
226 void updateNoteFlag();
227 void updateNoteEditor (QModelIndex index);
228 void changeSelection (VymModel *model,const QItemSelection &newSel, const QItemSelection &delSel);
230 void updateActions();
231 ModMode getModMode();
232 bool autoEditNewBranch();
233 bool autoSelectNewBranch();
234 void setScript(const QString &);
235 void runScript(const QString &);
236 void runScriptEverywhere (const QString &);
239 void windowNextEditor();
240 void windowPreviousEditor();
241 void windowShowNoteEditor();
242 void windowHideNoteEditor();
244 void standardFlagChanged();
246 void testFunction1();
247 void testFunction2();
258 QTabWidget *tabWidget;
259 QProcess *procBrowser; //FIXME-2 remove this...
262 QStringList imageTypes;
264 QList <VymView*> vymViews; //! Keeps track of models and views related to a tab
265 QString prevSelection;
267 HistoryWindow *historyWindow;
269 BranchPropertyWindow *branchPropertyWindow;
270 SimpleScriptEditor *scriptEditor;
272 QList <QAction*> actionListBranches;
278 QMenu *recentFilesMenu;
279 enum { MaxRecentFiles = 9 };
280 QAction *recentFileActions[MaxRecentFiles];
282 QAction *macroActions[12];
285 Switchboard switchboard;
287 QAction* actionFileNewCopy;
288 QAction* actionFileSave;
289 QAction* actionFilePrint;
294 QAction *actionPaste;
295 QAction *actionMoveUp;
296 QAction *actionMoveDown;
297 QAction *actionDetach;
298 QAction *actionSortChildren;
299 QAction *actionSortBackChildren;
300 QAction *actionToggleScroll;
301 QAction *actionExpandAll;
302 QAction *actionExpandOneLevel;
303 QAction *actionCollapseOneLevel;
304 QAction* actionOpenURL;
305 QAction* actionOpenURLTab;
306 QAction* actionOpenMultipleVisURLTabs;
307 QAction* actionOpenMultipleURLTabs;
309 QAction* actionLocalURL;
310 QAction* actionHeading2URL;
311 QAction* actionBugzilla2URL;
312 QAction* actionGetBugzillaData;
313 QAction* actionFATE2URL;
314 QAction *actionOpenVymLink;
315 QAction *actionOpenMultipleVymLinks;
316 QAction *actionVymLink;
317 QAction *actionDeleteVymLink;
318 QAction *actionAddTimestamp;
319 QAction *actionToggleHideExport;
320 QAction *actionMapInfo;
321 QAction *actionHeading;
322 QAction *actionDelete;
323 QAction *actionAddAttribute;
325 QAction *actionAddMapCenter;
328 QAction *actionAddBranch;
329 QAction *actionAddBranchBefore;
330 QAction *actionAddBranchAbove;
331 QAction *actionAddBranchBelow;
332 QAction *actionDeleteKeepChildren;
333 QAction *actionDeleteChildren;
334 QAction *actionImportAdd;
335 QAction *actionImportReplace;
336 QAction *actionSaveBranch;
337 QAction *actionLoadImage;
339 QAction* actionFormatColor;
340 QAction* actionFormatPickColor;
341 QAction* actionFormatColorBranch;
342 QAction* actionFormatColorSubtree;
343 QAction* actionFormatLinkColorHint;
344 QAction* actionFormatBackColor;
345 QAction* actionFormatBackImage;
346 QAction* actionFormatLinkColor;
347 QAction* actionFormatSelectionColor;
349 QActionGroup* actionGroupModModes;
350 QAction* actionModModeColor;
351 QAction* actionModModeXLink;
352 QAction* actionModModeCopy;
354 QActionGroup *actionGroupFormatFrameTypes;
357 QActionGroup *actionGroupFormatLinkStyles;
358 QAction *actionFormatLinkStyleLine;
359 QAction *actionFormatLinkStyleParabel;
360 QAction *actionFormatLinkStylePolyLine;
361 QAction *actionFormatLinkStylePolyParabel;
362 QAction *actionFormatHideLinkUnselected;
364 QAction *actionViewToggleNoteEditor;
365 QAction *actionViewToggleTreeEditor;
366 QAction *actionViewToggleHistoryWindow;
367 QAction *actionViewTogglePropertyWindow;
368 QAction *actionViewToggleAntiAlias;
369 QAction *actionViewToggleSmoothPixmapTransform;
370 QAction* actionViewCenter;
372 QAction* actionSettingsAutoEditNewBranch;
373 QAction* actionSettingsAutoSelectNewBranch;
374 QAction* actionSettingsAutoSelectText;
375 QAction* actionSettingsUseDelKey;
376 QAction* actionSettingsUseFlagGroups;
377 QAction* actionSettingsUseHideExport;
378 QAction* actionSettingsAutosaveToggle;
379 QAction* actionSettingsAutosaveTime;
380 QAction* actionSettingsWriteBackupFile;
381 QAction* actionSettingsUseAnimation;