8 #include "branchpropwindow.h"
9 #include "extrainfodialog.h"
12 #include "historywindow.h"
13 #include "mapeditor.h"
14 #include "simplescripteditor.h"
15 #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;
78 void editorChanged(QWidget*);
80 ErrorCode fileLoad(QString ,const LoadMode &, const FileType & ftype=VymMap);
81 void fileLoad(const LoadMode &);
83 void fileLoadRecent();
84 void addRecentMap (const QString &);
85 void fileSave(VymModel*, const SaveMode & );
88 void fileSave(VymModel*); // autosave from MapEditor
90 void fileSaveAs(const SaveMode &);
92 void fileImportKDE3Bookmarks();
93 void fileImportKDE4Bookmarks();
94 void fileImportFirefoxBookmarks();
95 void fileImportFreemind();
99 void fileExportHTML();
100 void fileExportXHTML();
101 void fileExportImage();
103 void fileExportASCII();
104 void fileExportCSV();
105 void fileExportLaTeX();
106 void fileExportKDE3Bookmarks();
107 void fileExportKDE4Bookmarks();
108 void fileExportTaskjuggler();
109 void fileExportOOPresentation();
117 void gotoHistoryStep (int);
122 void editOpenFindWidget();
123 void editFindDuplicateURLs();
125 void openTabs(QStringList);
128 void editOpenURLTab();
130 void editOpenMultipleVisURLTabs(bool ignoreScrolled=true);
131 void editOpenMultipleURLTabs();
134 void editHeading2URL();
135 void editBugzilla2URL();
136 void getBugzillaData();
138 void openVymLinks(const QStringList &);
140 void editOpenMultipleVymLinks();
142 void editHeadingFinished(VymModel *m);
143 // void editHeading();
144 void editOpenVymLink();
146 void editDeleteVymLink();
147 void editToggleHideExport();
148 void editAddTimestamp();
153 void editSortChildren();
154 void editSortBackChildren();
155 void editToggleScroll();
156 void editExpandAll();
157 void editExpandOneLevel();
158 void editCollapseOneLevel();
159 void editUnscrollChildren();
160 void editAddAttribute();
161 void editAddMapCenter();
162 void editNewBranch();
163 void editNewBranchBefore();
164 void editNewBranchAbove();
165 void editNewBranchBelow();
166 void editImportAdd();
167 void editImportReplace();
168 void editSaveBranch();
169 void editDeleteKeepChildren();
170 void editDeleteChildren();
171 void editDeleteSelection();
172 void editLoadImage();
173 void editSaveImage();
174 void editEditXLink (QAction *);
176 void formatSelectColor();
177 void formatPickColor();
178 void colorChanged(QColor);
179 void formatColorBranch();
180 void formatColorSubtree();
181 void formatLinkStyleLine();
182 void formatLinkStyleParabel();
183 void formatLinkStylePolyLine();
184 void formatLinkStylePolyParabel();
185 void formatSelectBackColor();
186 void formatSelectBackImage();
187 void formatSelectLinkColor();
188 void formatSelectSelectionColor();
189 void formatToggleLinkColorHint();
190 void formatHideLinkUnselected();
193 void viewZoomReset();
199 void networkStartServer();
200 void networkConnect();
203 void settingsMacroDir();
204 void settingsToggleDelKey();
205 void settingsUndoLevels();
206 void settingsAutosaveToggle();
207 void settingsAutosaveTime();
208 void settingsWriteBackupFileToggle();
209 void settingsToggleAnimation();
211 void windowToggleNoteEditor();
212 void windowToggleHistory();
213 void windowToggleProperty();
214 void updateHistory(SimpleSettings &);
215 void windowToggleAntiAlias();
218 bool hasSmoothPixmapTransform();
220 void windowToggleSmoothPixmap();
221 void updateNoteFlag();
222 void updateNoteEditor (QModelIndex index);
223 void changeSelection (VymModel *model,const QItemSelection &newSel, const QItemSelection &delSel);
225 void updateActions();
226 ModMode getModMode();
227 bool autoEditNewBranch();
228 bool autoSelectNewBranch();
229 void setScript(const QString &);
230 void runScript(const QString &);
231 void runScriptEverywhere (const QString &);
234 void windowNextEditor();
235 void windowPreviousEditor();
236 void windowShowNoteEditor();
237 void windowHideNoteEditor();
239 void standardFlagChanged();
241 void testFunction1();
242 void testFunction2();
253 QTabWidget *tabWidget;
254 QProcess *procBrowser; //FIXME-2 remove this...
257 QStringList imageTypes;
259 QList <VymView*> vymViews; //! Keeps track of models and views related to a tab
260 QString prevSelection;
262 HistoryWindow *historyWindow;
264 BranchPropertyWindow *branchPropertyWindow;
265 SimpleScriptEditor *scriptEditor;
267 QList <QAction*> actionListBranches;
273 QMenu *recentFilesMenu;
274 enum { MaxRecentFiles = 9 };
275 QAction *recentFileActions[MaxRecentFiles];
277 QAction *macroActions[12];
280 QAction* actionFileNewCopy;
281 QAction* actionFileSave;
282 QAction* actionFilePrint;
287 QAction *actionPaste;
288 QAction *actionMoveUp;
289 QAction *actionMoveDown;
290 QAction *actionDetach;
291 QAction *actionSortChildren;
292 QAction *actionSortBackChildren;
293 QAction *actionToggleScroll;
294 QAction *actionExpandAll;
295 QAction *actionExpandOneLevel;
296 QAction *actionCollapseOneLevel;
297 QAction* actionOpenURL;
298 QAction* actionOpenURLTab;
299 QAction* actionOpenMultipleVisURLTabs;
300 QAction* actionOpenMultipleURLTabs;
302 QAction* actionLocalURL;
303 QAction* actionHeading2URL;
304 QAction* actionBugzilla2URL;
305 QAction* actionGetBugzillaData;
306 QAction* actionFATE2URL;
307 QAction *actionOpenVymLink;
308 QAction *actionOpenMultipleVymLinks;
309 QAction *actionVymLink;
310 QAction *actionDeleteVymLink;
311 QAction *actionAddTimestamp;
312 QAction *actionToggleHideExport;
313 QAction *actionMapInfo;
314 QAction *actionHeading;
315 QAction *actionDelete;
316 QAction *actionAddAttribute;
318 QAction *actionAddMapCenter;
321 QAction *actionAddBranch;
322 QAction *actionAddBranchBefore;
323 QAction *actionAddBranchAbove;
324 QAction *actionAddBranchBelow;
325 QAction *actionDeleteKeepChildren;
326 QAction *actionDeleteChildren;
327 QAction *actionImportAdd;
328 QAction *actionImportReplace;
329 QAction *actionSaveBranch;
330 QAction *actionLoadImage;
332 QAction* actionFormatColor;
333 QAction* actionFormatPickColor;
334 QAction* actionFormatColorBranch;
335 QAction* actionFormatColorSubtree;
336 QAction* actionFormatLinkColorHint;
337 QAction* actionFormatBackColor;
338 QAction* actionFormatBackImage;
339 QAction* actionFormatLinkColor;
340 QAction* actionFormatSelectionColor;
342 QActionGroup* actionGroupModModes;
343 QAction* actionModModeColor;
344 QAction* actionModModeXLink;
345 QAction* actionModModeCopy;
347 QActionGroup *actionGroupFormatFrameTypes;
350 QActionGroup *actionGroupFormatLinkStyles;
351 QAction *actionFormatLinkStyleLine;
352 QAction *actionFormatLinkStyleParabel;
353 QAction *actionFormatLinkStylePolyLine;
354 QAction *actionFormatLinkStylePolyParabel;
355 QAction *actionFormatHideLinkUnselected;
357 QAction *actionViewToggleNoteEditor;
358 QAction *actionViewToggleHistoryWindow;
359 QAction *actionViewTogglePropertyWindow;
360 QAction *actionViewToggleAntiAlias;
361 QAction *actionViewToggleSmoothPixmapTransform;
362 QAction* actionViewCenter;
364 QAction* actionSettingsAutoEditNewBranch;
365 QAction* actionSettingsAutoSelectNewBranch;
366 QAction* actionSettingsAutoSelectText;
367 QAction* actionSettingsUseDelKey;
368 QAction* actionSettingsUseFlagGroups;
369 QAction* actionSettingsUseHideExport;
370 QAction* actionSettingsAutosaveToggle;
371 QAction* actionSettingsAutosaveTime;
372 QAction* actionSettingsWriteBackupFile;
373 QAction* actionSettingsUseAnimation;