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