6 #include "branchpropwindow.h"
7 #include "extrainfodialog.h"
9 #include "findwindow.h"
10 #include "historywindow.h"
11 #include "mapeditor.h"
12 #include "simplescripteditor.h"
13 #include "texteditor.h"
16 class Main : public QMainWindow
21 /*! Modifier modes are used when CTRL together with a mouse button is pressed */
23 ModModeNone, //!< Unused
24 ModModeColor, //!< Pick color from object
25 ModModeCopy, //!< Copy object
26 ModModeXLink //!< Create a XLink (XLinkObj) from selected object
29 Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
34 QProgressBar *progressBar;
38 void statusMessage (const QString &);
39 void setProgressMinimum (int min);
40 void setProgressMaximum (int max);
41 void setProgressValue (int v);
42 void removeProgressBar();
45 VymView* createView (VymModel*);
52 void closeEvent( QCloseEvent* );
55 void setupFileActions();
56 void setupEditActions();
57 void setupFormatActions();
58 void setupViewActions();
59 void setupModeActions();
60 void setupWindowActions();
61 void setupFlag(FlagObj *fo, QToolBar *tb, bool aw, const QString &name, const QString &tooltip);
62 void setupFlagActions();
63 void setupNetworkActions();
64 void setupSettingsActions();
65 void setupTestActions();
66 void setupHelpActions();
67 void setupContextMenus();
68 void setupRecentMapsMenu();
70 void hideEvent (QHideEvent * );
71 void showEvent (QShowEvent * );
72 MapEditor* currentMapEditor() const;
73 VymModel* currentModel() const;
76 void editorChanged(QWidget*);
78 ErrorCode fileLoad(QString ,const LoadMode &, const FileType & ftype=VymMap);
79 void fileLoad(const LoadMode &);
81 void fileLoadRecent();
82 void addRecentMap (const QString &);
83 void fileSave(VymModel*, const SaveMode & );
86 void fileSave(VymModel*); // autosave from MapEditor
88 void fileSaveAs(const SaveMode &);
90 void fileImportKDE3Bookmarks();
91 void fileImportKDE4Bookmarks();
92 void fileImportFirefoxBookmarks();
93 void fileImportFreemind();
97 void fileExportXHTML();
98 void fileExportImage();
99 void fileExportASCII();
100 void fileExportCSV();
101 void fileExportLaTeX();
102 void fileExportKDE3Bookmarks();
103 void fileExportKDE4Bookmarks();
104 void fileExportTaskjuggler();
105 void fileExportOOPresentation();
113 void gotoHistoryStep (int);
118 void editOpenFindWindow();
119 void editFind(QString);
120 void editFindChanged();
122 void openTabs(QStringList);
125 void editOpenURLTab();
127 void editOpenMultipleURLTabs();
130 void editHeading2URL();
131 void editBugzilla2URL();
133 void openVymLinks(const QStringList &);
135 void editOpenMultipleVymLinks();
136 void editAttributeFinished();
138 void editHeadingFinished(VymModel *m);
139 // void editHeading();
140 void editAttribute();
141 void editOpenVymLink();
143 void editDeleteVymLink();
144 void editToggleHideExport();
148 void editSortChildren();
149 void editToggleScroll();
150 void editExpandAll();
151 void editUnscrollChildren();
152 void editAddMapCenter();
153 void editNewBranch();
154 void editNewBranchBefore();
155 void editNewBranchAbove();
156 void editNewBranchBelow();
157 void editImportAdd();
158 void editImportReplace();
159 void editSaveBranch();
160 void editDeleteKeepChildren();
161 void editDeleteChildren();
162 void editDeleteSelection();
163 void editUpperBranch();
164 void editLowerBranch();
165 void editLeftBranch();
166 void editRightBranch();
167 void editFirstBranch();
168 void editLastBranch();
169 void editLoadImage();
170 void editSaveImage();
171 void editFollowXLink (QAction *);
172 void editEditXLink (QAction *);
174 void formatSelectColor();
175 void formatPickColor();
176 void colorChanged(QColor);
177 void formatColorBranch();
178 void formatColorSubtree();
179 void formatLinkStyleLine();
180 void formatLinkStyleParabel();
181 void formatLinkStylePolyLine();
182 void formatLinkStylePolyParabel();
183 void formatSelectBackColor();
184 void formatSelectBackImage();
185 void formatSelectLinkColor();
186 void formatSelectSelectionColor();
187 void formatToggleLinkColorHint();
188 void formatHideLinkUnselected();
190 void viewZoomReset();
196 void networkStartServer();
197 void networkConnect();
200 void settingsMacroDir();
201 void settingsToggleDelKey();
202 void settingsUndoLevels();
203 void settingsAutosaveToggle();
204 void settingsAutosaveTime();
205 void settingsWriteBackupFileToggle();
206 void settingsToggleAnimation();
208 void windowToggleNoteEditor();
209 void windowToggleHistory();
210 void windowToggleProperty();
211 void updateHistory(SimpleSettings &);
212 void windowToggleAntiAlias();
215 bool hasSmoothPixmapTransform();
217 void windowToggleSmoothPixmap();
218 void updateNoteFlag();
219 void updateNoteEditor (QModelIndex index);
220 void changeSelection (VymModel *model,const QItemSelection &newSel, const QItemSelection &delSel);
222 void updateActions();
223 ModMode getModMode();
224 bool autoEditNewBranch();
225 bool autoSelectNewBranch();
226 bool useFlagGroups();
227 void setScript(const QString &);
228 void runScript(const QString &);
229 void runScriptEverywhere (const QString &);
232 void windowNextEditor();
233 void windowPreviousEditor();
234 void windowShowNoteEditor();
235 void windowHideNoteEditor();
237 void standardFlagChanged();
239 void testFunction1();
240 void testFunction2();
251 QTabWidget *tabWidget;
252 FindWindow *findWindow;
253 QProcess *procBrowser;
255 QStringList imageTypes;
257 QList <VymModel*> tabModel; //!< the corresponding model to a tab
259 QString prevSelection;
261 HistoryWindow *historyWindow;
263 BranchPropertyWindow *branchPropertyWindow;
264 SimpleScriptEditor *scriptEditor;
266 QList <QAction*> actionListBranches;
272 QMenu *recentFilesMenu;
273 enum { MaxRecentFiles = 9 };
274 QAction *recentFileActions[MaxRecentFiles];
276 QAction *macroActions[12];
279 QAction* actionFileNewCopy;
280 QAction* actionFileSave;
281 QAction* actionFilePrint;
286 QAction *actionPaste;
287 QAction *actionMoveUp;
288 QAction *actionMoveDown;
289 QAction *actionSortChildren;
290 QAction *actionToggleScroll;
291 QAction *actionExpandAll;
292 QAction* actionOpenURL;
293 QAction* actionOpenURLTab;
294 QAction* actionOpenMultipleURLTabs;
296 QAction* actionLocalURL;
297 QAction* actionHeading2URL;
298 QAction* actionBugzilla2URL;
299 QAction* actionFATE2URL;
300 QAction *actionOpenVymLink;
301 QAction *actionOpenMultipleVymLinks;
302 QAction *actionVymLink;
303 QAction *actionDeleteVymLink;
304 QAction *actionToggleHideExport;
305 QAction *actionMapInfo;
306 QAction *actionHeading;
307 QAction *actionDelete;
310 QAction *actionAddMapCenter;
313 QAction *actionAddBranch;
314 QAction *actionAddBranchBefore;
315 QAction *actionAddBranchAbove;
316 QAction *actionAddBranchBelow;
317 QAction *actionDeleteKeepChildren;
318 QAction *actionDeleteChildren;
319 QAction *actionImportAdd;
320 QAction *actionImportReplace;
321 QAction *actionSaveBranch;
322 QAction *actionSelectFirst;
323 QAction *actionSelectLast;
324 QAction *actionLoadImage;
326 QAction* actionFormatColor;
327 QAction* actionFormatPickColor;
328 QAction* actionFormatColorBranch;
329 QAction* actionFormatColorSubtree;
330 QAction* actionFormatLinkColorHint;
331 QAction* actionFormatBackColor;
332 QAction* actionFormatBackImage;
333 QAction* actionFormatLinkColor;
334 QAction* actionFormatSelectionColor;
336 QActionGroup* actionGroupModModes;
337 QAction* actionModModeColor;
338 QAction* actionModModeXLink;
339 QAction* actionModModeCopy;
341 QActionGroup *actionGroupFormatFrameTypes;
344 QActionGroup *actionGroupFormatLinkStyles;
345 QAction *actionFormatLinkStyleLine;
346 QAction *actionFormatLinkStyleParabel;
347 QAction *actionFormatLinkStylePolyLine;
348 QAction *actionFormatLinkStylePolyParabel;
349 QAction *actionFormatHideLinkUnselected;
351 QAction *actionViewToggleNoteEditor;
352 QAction *actionViewToggleHistoryWindow;
353 QAction *actionViewTogglePropertyWindow;
354 QAction *actionViewToggleAntiAlias;
355 QAction *actionViewToggleSmoothPixmapTransform;
356 QAction* actionViewCenter;
358 QAction* actionSettingsAutoEditNewBranch;
359 QAction* actionSettingsAutoSelectNewBranch;
360 QAction* actionSettingsAutoSelectText;
361 QAction* actionSettingsUseDelKey;
362 QAction* actionSettingsUseFlagGroups;
363 QAction* actionSettingsUseHideExport;
364 QAction* actionSettingsAutosaveToggle;
365 QAction* actionSettingsAutosaveTime;
366 QAction* actionSettingsWriteBackupFile;
367 QAction* actionSettingsUseAnimation;