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;
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 editFindDuplicateURLs();
127 void openTabs(QStringList);
130 void editOpenURLTab();
132 void editOpenMultipleVisURLTabs(bool ignoreScrolled=true);
133 void editOpenMultipleURLTabs();
136 void editHeading2URL();
137 void editBugzilla2URL();
138 void getBugzillaData();
140 void openVymLinks(const QStringList &);
142 void editOpenMultipleVymLinks();
144 void editHeadingFinished(VymModel *m);
145 // void editHeading();
146 void editOpenVymLink();
148 void editDeleteVymLink();
149 void editToggleHideExport();
150 void editAddTimestamp();
155 void editSortChildren();
156 void editSortBackChildren();
157 void editToggleScroll();
158 void editExpandAll();
159 void editExpandOneLevel();
160 void editCollapseOneLevel();
161 void editUnscrollChildren();
162 void editAddAttribute();
163 void editAddMapCenter();
164 void editNewBranch();
165 void editNewBranchBefore();
166 void editNewBranchAbove();
167 void editNewBranchBelow();
168 void editImportAdd();
169 void editImportReplace();
170 void editSaveBranch();
171 void editDeleteKeepChildren();
172 void editDeleteChildren();
173 void editDeleteSelection();
174 void editLoadImage();
175 void editSaveImage();
176 void editEditXLink (QAction *);
178 void formatSelectColor();
179 void formatPickColor();
180 void colorChanged(QColor);
181 void formatColorBranch();
182 void formatColorSubtree();
183 void formatLinkStyleLine();
184 void formatLinkStyleParabel();
185 void formatLinkStylePolyLine();
186 void formatLinkStylePolyParabel();
187 void formatSelectBackColor();
188 void formatSelectBackImage();
189 void formatSelectLinkColor();
190 void formatSelectSelectionColor();
191 void formatToggleLinkColorHint();
192 void formatHideLinkUnselected();
195 void viewZoomReset();
201 void networkStartServer();
202 void networkConnect();
205 void settingsMacroDir();
206 void settingsToggleDelKey();
207 void settingsUndoLevels();
208 void settingsAutosaveToggle();
209 void settingsAutosaveTime();
210 void settingsWriteBackupFileToggle();
211 void settingsToggleAnimation();
213 void windowToggleNoteEditor();
214 void windowToggleTreeEditor();
215 void windowToggleHistory();
216 void windowToggleProperty();
217 void updateHistory(SimpleSettings &);
218 void windowToggleAntiAlias();
221 bool hasSmoothPixmapTransform();
223 void windowToggleSmoothPixmap();
224 void updateNoteFlag();
225 void updateNoteEditor (QModelIndex index);
226 void changeSelection (VymModel *model,const QItemSelection &newSel, const QItemSelection &delSel);
228 void updateActions();
229 ModMode getModMode();
230 bool autoEditNewBranch();
231 bool autoSelectNewBranch();
232 void setScript(const QString &);
233 void runScript(const QString &);
234 void runScriptEverywhere (const QString &);
237 void windowNextEditor();
238 void windowPreviousEditor();
239 void windowShowNoteEditor();
240 void windowHideNoteEditor();
242 void standardFlagChanged();
244 void testFunction1();
245 void testFunction2();
256 QTabWidget *tabWidget;
257 QProcess *procBrowser; //FIXME-2 remove this...
260 QStringList imageTypes;
262 QList <VymView*> vymViews; //! Keeps track of models and views related to a tab
263 QString prevSelection;
265 HistoryWindow *historyWindow;
267 BranchPropertyWindow *branchPropertyWindow;
268 SimpleScriptEditor *scriptEditor;
270 QList <QAction*> actionListBranches;
276 QMenu *recentFilesMenu;
277 enum { MaxRecentFiles = 9 };
278 QAction *recentFileActions[MaxRecentFiles];
280 QAction *macroActions[12];
283 QAction* actionFileNewCopy;
284 QAction* actionFileSave;
285 QAction* actionFilePrint;
290 QAction *actionPaste;
291 QAction *actionMoveUp;
292 QAction *actionMoveDown;
293 QAction *actionDetach;
294 QAction *actionSortChildren;
295 QAction *actionSortBackChildren;
296 QAction *actionToggleScroll;
297 QAction *actionExpandAll;
298 QAction *actionExpandOneLevel;
299 QAction *actionCollapseOneLevel;
300 QAction* actionOpenURL;
301 QAction* actionOpenURLTab;
302 QAction* actionOpenMultipleVisURLTabs;
303 QAction* actionOpenMultipleURLTabs;
305 QAction* actionLocalURL;
306 QAction* actionHeading2URL;
307 QAction* actionBugzilla2URL;
308 QAction* actionGetBugzillaData;
309 QAction* actionFATE2URL;
310 QAction *actionOpenVymLink;
311 QAction *actionOpenMultipleVymLinks;
312 QAction *actionVymLink;
313 QAction *actionDeleteVymLink;
314 QAction *actionAddTimestamp;
315 QAction *actionToggleHideExport;
316 QAction *actionMapInfo;
317 QAction *actionHeading;
318 QAction *actionDelete;
319 QAction *actionAddAttribute;
321 QAction *actionAddMapCenter;
324 QAction *actionAddBranch;
325 QAction *actionAddBranchBefore;
326 QAction *actionAddBranchAbove;
327 QAction *actionAddBranchBelow;
328 QAction *actionDeleteKeepChildren;
329 QAction *actionDeleteChildren;
330 QAction *actionImportAdd;
331 QAction *actionImportReplace;
332 QAction *actionSaveBranch;
333 QAction *actionLoadImage;
335 QAction* actionFormatColor;
336 QAction* actionFormatPickColor;
337 QAction* actionFormatColorBranch;
338 QAction* actionFormatColorSubtree;
339 QAction* actionFormatLinkColorHint;
340 QAction* actionFormatBackColor;
341 QAction* actionFormatBackImage;
342 QAction* actionFormatLinkColor;
343 QAction* actionFormatSelectionColor;
345 QActionGroup* actionGroupModModes;
346 QAction* actionModModeColor;
347 QAction* actionModModeXLink;
348 QAction* actionModModeCopy;
350 QActionGroup *actionGroupFormatFrameTypes;
353 QActionGroup *actionGroupFormatLinkStyles;
354 QAction *actionFormatLinkStyleLine;
355 QAction *actionFormatLinkStyleParabel;
356 QAction *actionFormatLinkStylePolyLine;
357 QAction *actionFormatLinkStylePolyParabel;
358 QAction *actionFormatHideLinkUnselected;
360 QAction *actionViewToggleNoteEditor;
361 QAction *actionViewToggleTreeEditor;
362 QAction *actionViewToggleHistoryWindow;
363 QAction *actionViewTogglePropertyWindow;
364 QAction *actionViewToggleAntiAlias;
365 QAction *actionViewToggleSmoothPixmapTransform;
366 QAction* actionViewCenter;
368 QAction* actionSettingsAutoEditNewBranch;
369 QAction* actionSettingsAutoSelectNewBranch;
370 QAction* actionSettingsAutoSelectText;
371 QAction* actionSettingsUseDelKey;
372 QAction* actionSettingsUseFlagGroups;
373 QAction* actionSettingsUseHideExport;
374 QAction* actionSettingsAutosaveToggle;
375 QAction* actionSettingsAutosaveTime;
376 QAction* actionSettingsWriteBackupFile;
377 QAction* actionSettingsUseAnimation;