6 #include "branchpropwindow.h"
8 #include "findwindow.h"
9 #include "historywindow.h"
10 #include "mapeditor.h"
11 #include "simplescripteditor.h"
12 #include "texteditor.h"
15 class Main : public QMainWindow
20 /*! Modifier modes are used when CTRL together with a mouse button is pressed */
22 ModModeNone, //!< Unused
23 ModModeColor, //!< Pick color from object
24 ModModeCopy, //!< Copy object
25 ModModeXLink //!< Create a XLink (XLinkObj) from selected object
28 Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
31 void statusMessage (const QString &);
38 void closeEvent( QCloseEvent* );
41 void setupFileActions();
42 void setupEditActions();
43 void setupFormatActions();
44 void setupViewActions();
45 void setupModeActions();
46 void setupWindowActions();
47 void setupFlag(FlagObj *fo, QToolBar *tb, bool aw, const QString &name, const QString &tooltip);
48 void setupFlagActions();
49 void setupNetworkActions();
50 void setupSettingsActions();
51 void setupTestActions();
52 void setupHelpActions();
53 void setupContextMenus();
54 void setupRecentMapsMenu();
56 void hideEvent (QHideEvent * );
57 void showEvent (QShowEvent * );
58 MapEditor* currentMapEditor() const;
61 void editorChanged(QWidget*);
63 ErrorCode fileLoad(QString ,const LoadMode &, const FileType & ftype=VymMap);
64 void fileLoad(const LoadMode &);
66 void fileLoadRecent();
67 void addRecentMap (const QString &);
68 void fileSave(MapEditor*, const SaveMode & );
71 void fileSave(MapEditor *); // autosave from MapEditor
73 void fileSaveAs(const SaveMode &);
75 void fileImportKDEBookmarks();
76 void fileImportFirefoxBookmarks();
77 void fileImportFreemind();
81 void fileExportXHTML();
82 void fileExportImage();
83 void fileExportASCII();
85 void fileExportLaTeX();
86 void fileExportKDEBookmarks();
87 void fileExportTaskjuggler();
88 void fileExportOOPresentation();
96 void gotoHistoryStep (int);
101 void editOpenFindWindow();
102 void editFind(QString);
103 void editFindChanged();
105 void openTabs(QStringList);
108 void editOpenURLTab();
110 void editOpenMultipleURLTabs();
113 void editHeading2URL();
114 void editBugzilla2URL();
116 void openVymLinks(const QStringList &);
118 void editOpenMultipleVymLinks();
119 void editHeadingFinished();
120 void editAttributeFinished();
123 void editAttribute();
124 void editOpenVymLink();
126 void editDeleteVymLink();
127 void editToggleHideExport();
131 void editSortChildren();
132 void editToggleScroll();
133 void editUnscrollChilds();
134 void editAddMapCenter();
135 void editNewBranch();
136 void editNewBranchBefore();
137 void editNewBranchAbove();
138 void editNewBranchBelow();
139 void editImportAdd();
140 void editImportReplace();
141 void editSaveBranch();
142 void editDeleteKeepChilds();
143 void editDeleteChilds();
144 void editDeleteSelection();
145 void editUpperBranch();
146 void editLowerBranch();
147 void editLeftBranch();
148 void editRightBranch();
149 void editFirstBranch();
150 void editLastBranch();
151 void editLoadImage();
152 void editSaveImage();
153 void editFollowXLink (QAction *);
154 void editEditXLink (QAction *);
156 void formatSelectColor();
157 void formatPickColor();
158 void colorChanged(QColor);
159 void formatColorBranch();
160 void formatColorSubtree();
161 void formatLinkStyleLine();
162 void formatLinkStyleParabel();
163 void formatLinkStylePolyLine();
164 void formatLinkStylePolyParabel();
165 void formatSelectBackColor();
166 void formatSelectBackImage();
167 void formatSelectLinkColor();
168 void formatSelectSelectionColor();
169 void formatToggleLinkColorHint();
170 void formatHideLinkUnselected();
172 void viewZoomReset();
178 void networkStartServer();
179 void networkConnect();
182 void settingsMacroDir();
183 void settingsToggleDelKey();
184 void settingsUndoLevels();
185 void settingsAutosaveToggle();
186 void settingsAutosaveTime();
187 void settingsWriteBackupFileToggle();
188 void settingsToggleAnimation();
190 void windowToggleNoteEditor();
191 void windowToggleHistory();
192 void windowToggleProperty();
193 void updateHistory(SimpleSettings &);
194 void windowToggleAntiAlias();
195 void windowToggleSmoothPixmap();
196 void updateNoteFlag();
197 void updateSatellites(MapEditor *);
198 void updateActions();
199 ModMode getModMode();
200 bool autoEditNewBranch();
201 bool autoSelectNewBranch();
202 bool useFlagGroups();
203 void setScript(const QString &);
204 void runScript(const QString &);
205 void runScriptEverywhere (const QString &);
208 void windowNextEditor();
209 void windowPreviousEditor();
210 void windowShowNoteEditor();
211 void windowHideNoteEditor();
213 void standardFlagChanged();
215 void testFunction1();
216 void testFunction2();
227 QTabWidget *tabWidget;
228 FindWindow *findWindow;
229 QProcess *procBrowser;
231 QStringList imageTypes;
233 QLineEdit *lineedit; // to enter headings of branches
234 QString prevSelection;
236 HistoryWindow *historyWindow;
238 BranchPropertyWindow *branchPropertyWindow;
239 SimpleScriptEditor *scriptEditor;
241 QList <QAction*> actionListBranches;
247 QMenu *recentFilesMenu;
248 enum { MaxRecentFiles = 9 };
249 QAction *recentFileActions[MaxRecentFiles];
251 QAction *macroActions[12];
254 QAction* actionFileNewCopy;
255 QAction* actionFileSave;
256 QAction* actionFilePrint;
257 QAction* actionEditUndo;
258 QAction* actionEditRedo;
259 QAction *actionEditCopy;
260 QAction *actionEditCut;
261 QAction *actionEditPaste;
262 QAction *actionEditMoveUp;
263 QAction *actionEditMoveDown;
264 QAction *actionEditSortChildren;
265 QAction *actionEditToggleScroll;
266 QAction* actionEditOpenURL;
267 QAction* actionEditOpenURLTab;
268 QAction* actionEditOpenMultipleURLTabs;
269 QAction* actionEditURL;
270 QAction* actionEditLocalURL;
271 QAction* actionEditHeading2URL;
272 QAction* actionEditBugzilla2URL;
273 QAction* actionEditFATE2URL;
274 QAction *actionEditOpenVymLink;
275 QAction *actionEditOpenMultipleVymLinks;
276 QAction *actionEditVymLink;
277 QAction *actionEditDeleteVymLink;
278 QAction *actionEditToggleHideExport;
279 QAction *actionEditMapInfo;
280 QAction *actionEditHeading;
281 QAction *actionEditDelete;
282 QAction *actionEditAddMapCenter;
283 QAction *actionEditAddBranch;
284 QAction *actionEditAddBranchBefore;
285 QAction *actionEditAddBranchAbove;
286 QAction *actionEditAddBranchBelow;
287 QAction *actionEditDeleteKeepChilds;
288 QAction *actionEditDeleteChilds;
289 QAction *actionEditImportAdd;
290 QAction *actionEditImportReplace;
291 QAction *actionEditSaveBranch;
292 QAction *actionEditSelectFirst;
293 QAction *actionEditSelectLast;
294 QAction *actionEditLoadImage;
296 QAction* actionFormatColor;
297 QAction* actionFormatPickColor;
298 QAction* actionFormatColorBranch;
299 QAction* actionFormatColorSubtree;
300 QAction* actionFormatLinkColorHint;
301 QAction* actionFormatBackColor;
302 QAction* actionFormatBackImage;
303 QAction* actionFormatLinkColor;
304 QAction* actionFormatSelectionColor;
306 QActionGroup* actionGroupModModes;
307 QAction* actionModModeColor;
308 QAction* actionModModeXLink;
309 QAction* actionModModeCopy;
311 QActionGroup *actionGroupFormatFrameTypes;
314 QActionGroup *actionGroupFormatLinkStyles;
315 QAction *actionFormatLinkStyleLine;
316 QAction *actionFormatLinkStyleParabel;
317 QAction *actionFormatLinkStylePolyLine;
318 QAction *actionFormatLinkStylePolyParabel;
319 QAction *actionFormatHideLinkUnselected;
321 QAction *actionViewToggleNoteEditor;
322 QAction *actionViewToggleHistoryWindow;
323 QAction *actionViewTogglePropertyWindow;
324 QAction *actionViewToggleAntiAlias;
325 QAction *actionViewToggleSmoothPixmapTransform;
326 QAction* actionViewCenter;
328 QAction* actionSettingsAutoEditNewBranch;
329 QAction* actionSettingsAutoSelectNewBranch;
330 QAction* actionSettingsAutoSelectText;
331 QAction* actionSettingsUseDelKey;
332 QAction* actionSettingsUseFlagGroups;
333 QAction* actionSettingsUseHideExport;
334 QAction* actionSettingsAutosaveToggle;
335 QAction* actionSettingsAutosaveTime;
336 QAction* actionSettingsWriteBackupFile;
337 QAction* actionSettingsUseAnimation;