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();
122 void editOpenVymLink();
124 void editDeleteVymLink();
125 void editToggleHideExport();
129 void editToggleScroll();
130 void editUnscrollChilds();
131 void editNewBranch();
132 void editNewBranchBefore();
133 void editNewBranchAbove();
134 void editNewBranchBelow();
135 void editImportAdd();
136 void editImportReplace();
137 void editSaveBranch();
138 void editDeleteKeepChilds();
139 void editDeleteChilds();
140 void editDeleteSelection();
141 void editUpperBranch();
142 void editLowerBranch();
143 void editLeftBranch();
144 void editRightBranch();
145 void editFirstBranch();
146 void editLastBranch();
147 void editLoadImage();
148 void editSaveImage();
149 void editFollowXLink (QAction *);
150 void editEditXLink (QAction *);
152 void formatSelectColor();
153 void formatPickColor();
154 void colorChanged(QColor);
155 void formatColorBranch();
156 void formatColorSubtree();
157 void formatLinkStyleLine();
158 void formatLinkStyleParabel();
159 void formatLinkStylePolyLine();
160 void formatLinkStylePolyParabel();
161 void formatSelectBackColor();
162 void formatSelectBackImage();
163 void formatSelectLinkColor();
164 void formatSelectSelectionColor();
165 void formatToggleLinkColorHint();
166 void formatHideLinkUnselected();
168 void viewZoomReset();
174 void networkStartServer();
175 void networkConnect();
178 void settingsMacroDir();
179 void settingsToggleDelKey();
180 void settingsUndoLevels();
181 void settingsAutosaveToggle();
182 void settingsAutosaveTime();
184 void windowToggleNoteEditor();
185 void windowToggleHistory();
186 void windowToggleProperty();
187 void updateHistory(SimpleSettings &);
188 void windowToggleAntiAlias();
189 void windowToggleSmoothPixmap();
190 void updateNoteFlag();
191 void updateSatellites(MapEditor *);
192 void updateActions();
193 ModMode getModMode();
194 bool autoEditNewBranch();
195 bool autoSelectNewBranch();
196 bool useFlagGroups();
197 void setScript(const QString &);
198 void runScript(const QString &);
199 void runScriptEverywhere (const QString &);
202 void windowNextEditor();
203 void windowPreviousEditor();
204 void windowShowNoteEditor();
205 void windowHideNoteEditor();
207 void standardFlagChanged();
209 void testFunction1();
210 void testFunction2();
221 QTabWidget *tabWidget;
222 FindWindow *findWindow;
223 QProcess *procBrowser;
225 QStringList imageTypes;
227 QLineEdit *lineedit; // to enter headings of branches
228 QString prevSelection;
230 HistoryWindow *historyWindow;
232 BranchPropertyWindow *branchPropertyWindow;
233 SimpleScriptEditor *scriptEditor;
235 QList <QAction*> actionListBranches;
239 QMenu *recentFilesMenu;
240 enum { MaxRecentFiles = 9 };
241 QAction *recentFileActions[MaxRecentFiles];
243 QAction *macroActions[12];
246 QAction* actionFileSave;
247 QAction* actionFilePrint;
248 QAction* actionEditUndo;
249 QAction* actionEditRedo;
250 QAction *actionEditCopy;
251 QAction *actionEditCut;
252 QAction *actionEditPaste;
253 QAction *actionEditMoveUp;
254 QAction *actionEditMoveDown;
255 QAction *actionEditToggleScroll;
256 QAction* actionEditOpenURL;
257 QAction* actionEditOpenURLTab;
258 QAction* actionEditOpenMultipleURLTabs;
259 QAction* actionEditURL;
260 QAction* actionEditLocalURL;
261 QAction* actionEditHeading2URL;
262 QAction* actionEditBugzilla2URL;
263 QAction* actionEditFATE2URL;
264 QAction *actionEditOpenVymLink;
265 QAction *actionEditOpenMultipleVymLinks;
266 QAction *actionEditVymLink;
267 QAction *actionEditDeleteVymLink;
268 QAction *actionEditToggleHideExport;
269 QAction *actionEditMapInfo;
270 QAction *actionEditHeading;
271 QAction *actionEditDelete;
272 QAction *actionEditAddBranch;
273 QAction *actionEditAddBranchBefore;
274 QAction *actionEditAddBranchAbove;
275 QAction *actionEditAddBranchBelow;
276 QAction *actionEditDeleteKeepChilds;
277 QAction *actionEditDeleteChilds;
278 QAction *actionEditImportAdd;
279 QAction *actionEditImportReplace;
280 QAction *actionEditSaveBranch;
281 QAction *actionEditSelectFirst;
282 QAction *actionEditSelectLast;
283 QAction *actionEditLoadImage;
285 QAction* actionFormatColor;
286 QAction* actionFormatPickColor;
287 QAction* actionFormatColorBranch;
288 QAction* actionFormatColorSubtree;
289 QAction* actionFormatLinkColorHint;
290 QAction* actionFormatBackColor;
291 QAction* actionFormatBackImage;
292 QAction* actionFormatLinkColor;
293 QAction* actionFormatSelectionColor;
295 QActionGroup* actionGroupModModes;
296 QAction* actionModModeColor;
297 QAction* actionModModeXLink;
298 QAction* actionModModeCopy;
300 QActionGroup *actionGroupFormatFrameTypes;
303 QActionGroup *actionGroupFormatLinkStyles;
304 QAction *actionFormatLinkStyleLine;
305 QAction *actionFormatLinkStyleParabel;
306 QAction *actionFormatLinkStylePolyLine;
307 QAction *actionFormatLinkStylePolyParabel;
308 QAction *actionFormatHideLinkUnselected;
310 QAction *actionViewToggleNoteEditor;
311 QAction *actionViewToggleHistoryWindow;
312 QAction *actionViewTogglePropertyWindow;
313 QAction *actionViewToggleAntiAlias;
314 QAction *actionViewToggleSmoothPixmapTransform;
315 QAction* actionViewCenter;
317 QAction* actionSettingsAutoEditNewBranch;
318 QAction* actionSettingsAutoSelectNewBranch;
319 QAction* actionSettingsAutoSelectText;
320 QAction* actionSettingsUseDelKey;
321 QAction* actionSettingsUseFlagGroups;
322 QAction* actionSettingsUseHideExport;
323 QAction* actionSettingsAutosaveToggle;
324 QAction* actionSettingsAutosaveTime;