author | insilmaril |
Wed Apr 25 16:02:54 2007 +0000 (2007-04-25) | |
changeset 469 | e21e3b8c312c |
parent 445 | 0796c5592f00 |
child 473 | 8b9cfc26638c |
permissions | -rw-r--r-- |
insilmaril@0 | 1 |
#ifndef MAINWINDOW_H |
insilmaril@0 | 2 |
#define MAINWINDOW_H |
insilmaril@0 | 3 |
|
insilmaril@366 | 4 |
#include <QMainWindow> |
insilmaril@0 | 5 |
|
insilmaril@421 | 6 |
#include "branchpropwindow.h" |
insilmaril@175 | 7 |
#include "file.h" |
insilmaril@175 | 8 |
#include "findwindow.h" |
insilmaril@404 | 9 |
#include "historywindow.h" |
insilmaril@175 | 10 |
#include "mapeditor.h" |
insilmaril@432 | 11 |
#include "simplescripteditor.h" |
insilmaril@175 | 12 |
#include "texteditor.h" |
insilmaril@0 | 13 |
#include "xml.h" |
insilmaril@0 | 14 |
|
insilmaril@390 | 15 |
enum ModMode {ModModeNone,ModModeColor,ModModeCopy,ModModeXLink}; |
insilmaril@390 | 16 |
|
insilmaril@0 | 17 |
class Main : public QMainWindow |
insilmaril@0 | 18 |
{ |
insilmaril@0 | 19 |
Q_OBJECT |
insilmaril@0 | 20 |
|
insilmaril@0 | 21 |
public: |
insilmaril@366 | 22 |
Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0); |
insilmaril@0 | 23 |
~Main(); |
insilmaril@0 | 24 |
void loadCmdLine(); |
insilmaril@0 | 25 |
void statusMessage (const QString &); |
insilmaril@0 | 26 |
|
insilmaril@0 | 27 |
public slots: |
insilmaril@0 | 28 |
void fileNew(); |
insilmaril@0 | 29 |
|
insilmaril@0 | 30 |
protected: |
insilmaril@0 | 31 |
void closeEvent( QCloseEvent* ); |
insilmaril@0 | 32 |
|
insilmaril@0 | 33 |
private: |
insilmaril@0 | 34 |
void setupFileActions(); |
insilmaril@0 | 35 |
void setupEditActions(); |
insilmaril@0 | 36 |
void setupFormatActions(); |
insilmaril@0 | 37 |
void setupViewActions(); |
insilmaril@89 | 38 |
void setupModeActions(); |
insilmaril@0 | 39 |
void setupWindowActions(); |
insilmaril@0 | 40 |
void setupFlagActions(); |
insilmaril@0 | 41 |
void setupSettingsActions(); |
insilmaril@0 | 42 |
void setupTestActions(); |
insilmaril@0 | 43 |
void setupHelpActions(); |
insilmaril@0 | 44 |
void setupContextMenus(); |
insilmaril@401 | 45 |
void setupRecentMapsMenu(); |
insilmaril@445 | 46 |
void setupMacros(); |
insilmaril@0 | 47 |
void hideEvent (QHideEvent * ); |
insilmaril@0 | 48 |
void showEvent (QShowEvent * ); |
insilmaril@0 | 49 |
bool reallyWriteDirectory(const QString&); |
insilmaril@0 | 50 |
QString browseDirectory(const QString&); |
insilmaril@0 | 51 |
MapEditor* currentMapEditor() const; |
insilmaril@0 | 52 |
|
insilmaril@0 | 53 |
private slots: |
insilmaril@0 | 54 |
void editorChanged(QWidget*); |
insilmaril@0 | 55 |
|
insilmaril@205 | 56 |
ErrorCode fileLoad(QString ,const LoadMode &); |
insilmaril@0 | 57 |
void fileLoad(const LoadMode &); |
insilmaril@0 | 58 |
void fileLoad(); |
insilmaril@401 | 59 |
void fileLoadRecent(); |
insilmaril@401 | 60 |
void addRecentMap (const QString &); |
insilmaril@0 | 61 |
void fileSave(const SaveMode & ); |
insilmaril@0 | 62 |
void fileSave(); |
insilmaril@0 | 63 |
void fileSaveAs(const SaveMode &); |
insilmaril@0 | 64 |
void fileSaveAs(); |
insilmaril@215 | 65 |
void fileImportKDEBookmarks(); |
insilmaril@314 | 66 |
void fileImportFirefoxBookmarks(); |
insilmaril@215 | 67 |
void fileImportMM(); |
insilmaril@0 | 68 |
void fileImportDir(); |
insilmaril@0 | 69 |
void fileExportXML(); |
insilmaril@0 | 70 |
void fileExportXHTML(); |
insilmaril@366 | 71 |
void fileExportImage(); |
insilmaril@0 | 72 |
void fileExportASCII(); |
insilmaril@163 | 73 |
void fileExportLaTeX(); |
insilmaril@243 | 74 |
void fileExportKDEBookmarks(); |
insilmaril@228 | 75 |
void fileExportTaskjuggler(); |
insilmaril@163 | 76 |
void fileExportOOPresentation(); |
insilmaril@0 | 77 |
void fileCloseMap(); |
insilmaril@0 | 78 |
void filePrint(); |
insilmaril@0 | 79 |
void fileExitVYM(); |
insilmaril@0 | 80 |
|
insilmaril@404 | 81 |
public slots: |
insilmaril@0 | 82 |
void editUndo(); |
insilmaril@0 | 83 |
void editRedo(); |
insilmaril@404 | 84 |
void gotoHistoryStep (int); |
insilmaril@404 | 85 |
private slots: |
insilmaril@0 | 86 |
void editCopy(); |
insilmaril@0 | 87 |
void editPaste(); |
insilmaril@0 | 88 |
void editCut(); |
insilmaril@0 | 89 |
void editOpenFindWindow(); |
insilmaril@0 | 90 |
void editFind(QString); |
insilmaril@0 | 91 |
void editFindChanged(); |
insilmaril@366 | 92 |
private: |
insilmaril@366 | 93 |
void openTabs(QStringList); |
insilmaril@0 | 94 |
public slots: |
insilmaril@0 | 95 |
void editOpenURL(); |
insilmaril@266 | 96 |
void editOpenURLTab(); |
insilmaril@0 | 97 |
private slots: |
insilmaril@366 | 98 |
void editOpenMultipleURLTabs(); |
insilmaril@0 | 99 |
void editURL(); |
insilmaril@0 | 100 |
void editHeading2URL(); |
insilmaril@0 | 101 |
void editBugzilla2URL(); |
insilmaril@175 | 102 |
void editFATE2URL(); |
insilmaril@366 | 103 |
void openVymLinks(const QStringList &); |
insilmaril@0 | 104 |
void editVymLink(); |
insilmaril@366 | 105 |
void editOpenMultipleVymLinks(); |
insilmaril@394 | 106 |
void editHeadingFinished(); |
insilmaril@0 | 107 |
public slots: |
insilmaril@366 | 108 |
void editHeading(); |
insilmaril@0 | 109 |
void editOpenVymLink(); |
insilmaril@0 | 110 |
private slots: |
insilmaril@0 | 111 |
void editDeleteVymLink(); |
insilmaril@243 | 112 |
void editToggleHideExport(); |
insilmaril@0 | 113 |
void editMapInfo(); |
insilmaril@0 | 114 |
void editMoveUp(); |
insilmaril@0 | 115 |
void editMoveDown(); |
insilmaril@0 | 116 |
void editToggleScroll(); |
insilmaril@0 | 117 |
void editUnScrollAll(); |
insilmaril@0 | 118 |
void editNewBranch(); |
insilmaril@394 | 119 |
void editNewBranchBefore(); |
insilmaril@0 | 120 |
void editNewBranchAbove(); |
insilmaril@0 | 121 |
void editNewBranchBelow(); |
insilmaril@0 | 122 |
void editImportAdd(); |
insilmaril@0 | 123 |
void editImportReplace(); |
insilmaril@0 | 124 |
void editSaveBranch(); |
insilmaril@395 | 125 |
void editDeleteKeepChilds(); |
insilmaril@395 | 126 |
void editDeleteChilds(); |
insilmaril@0 | 127 |
void editDeleteSelection(); |
insilmaril@0 | 128 |
void editUpperBranch(); |
insilmaril@0 | 129 |
void editLowerBranch(); |
insilmaril@0 | 130 |
void editLeftBranch(); |
insilmaril@0 | 131 |
void editRightBranch(); |
insilmaril@0 | 132 |
void editFirstBranch(); |
insilmaril@0 | 133 |
void editLastBranch(); |
insilmaril@0 | 134 |
void editLoadImage(); |
insilmaril@366 | 135 |
void editSaveImage(); |
insilmaril@366 | 136 |
void editFollowXLink (QAction *); |
insilmaril@366 | 137 |
void editEditXLink (QAction *); |
insilmaril@0 | 138 |
|
insilmaril@0 | 139 |
void formatSelectColor(); |
insilmaril@0 | 140 |
void formatPickColor(); |
insilmaril@0 | 141 |
void colorChanged(QColor); |
insilmaril@0 | 142 |
void formatColorBranch(); |
insilmaril@417 | 143 |
void formatColorSubtree(); |
insilmaril@0 | 144 |
void formatLinkStyleLine(); |
insilmaril@0 | 145 |
void formatLinkStyleParabel(); |
insilmaril@0 | 146 |
void formatLinkStylePolyLine(); |
insilmaril@0 | 147 |
void formatLinkStylePolyParabel(); |
insilmaril@0 | 148 |
void formatSelectBackColor(); |
insilmaril@408 | 149 |
void formatSelectBackImage(); |
insilmaril@0 | 150 |
void formatSelectLinkColor(); |
insilmaril@442 | 151 |
void formatSelectSelectionColor(); |
insilmaril@0 | 152 |
void formatToggleLinkColorHint(); |
insilmaril@175 | 153 |
void formatIncludeImagesVer(); |
insilmaril@175 | 154 |
void formatIncludeImagesHor(); |
insilmaril@160 | 155 |
void formatHideLinkUnselected(); |
insilmaril@0 | 156 |
|
insilmaril@0 | 157 |
void viewZoomReset(); |
insilmaril@0 | 158 |
void viewZoomIn(); |
insilmaril@0 | 159 |
void viewZoomOut(); |
insilmaril@0 | 160 |
|
insilmaril@0 | 161 |
public slots: |
insilmaril@0 | 162 |
bool settingsPDF(); |
insilmaril@0 | 163 |
bool settingsURL(); |
insilmaril@450 | 164 |
void settingsMacroDir(); |
insilmaril@328 | 165 |
void settingsToggleDelKey(); |
insilmaril@0 | 166 |
|
insilmaril@0 | 167 |
void windowToggleNoteEditor(); |
insilmaril@294 | 168 |
void windowToggleHistory(); |
insilmaril@404 | 169 |
void updateHistory(SimpleSettings &); |
insilmaril@408 | 170 |
void windowToggleAntiAlias(); |
insilmaril@408 | 171 |
void windowToggleSmoothPixmap(); |
insilmaril@160 | 172 |
void updateNoteFlag(); |
insilmaril@442 | 173 |
void updateSatellites(MapEditor *); |
insilmaril@390 | 174 |
void updateActions(); |
insilmaril@390 | 175 |
ModMode getModMode(); |
insilmaril@390 | 176 |
bool autoEdit(); |
insilmaril@390 | 177 |
bool autoSelectHeading(); |
insilmaril@390 | 178 |
bool useFlagGroups(); |
insilmaril@434 | 179 |
void setScript(const QString &); |
insilmaril@434 | 180 |
void runScript(const QString &); |
insilmaril@160 | 181 |
|
insilmaril@0 | 182 |
private slots: |
insilmaril@421 | 183 |
void showPropertyDialog(); |
insilmaril@0 | 184 |
void windowNextEditor(); |
insilmaril@0 | 185 |
void windowPreviousEditor(); |
insilmaril@0 | 186 |
void windowShowNoteEditor(); |
insilmaril@0 | 187 |
void windowHideNoteEditor(); |
insilmaril@0 | 188 |
|
insilmaril@0 | 189 |
void standardFlagChanged(); |
insilmaril@0 | 190 |
|
insilmaril@0 | 191 |
void testFunction(); |
insilmaril@393 | 192 |
void testCommand(); |
insilmaril@0 | 193 |
|
insilmaril@0 | 194 |
void helpDoc(); |
insilmaril@0 | 195 |
void helpAbout(); |
insilmaril@0 | 196 |
void helpAboutQT(); |
insilmaril@0 | 197 |
|
insilmaril@445 | 198 |
void callMacro (); |
insilmaril@0 | 199 |
private: |
insilmaril@0 | 200 |
QTabWidget *tabWidget; |
insilmaril@0 | 201 |
FindWindow *findWindow; |
insilmaril@266 | 202 |
QProcess *procBrowser; |
insilmaril@366 | 203 |
|
insilmaril@366 | 204 |
QStringList imageTypes; |
insilmaril@366 | 205 |
|
insilmaril@366 | 206 |
QLineEdit *lineedit; // to enter headings of branches |
insilmaril@394 | 207 |
QString prevSelection; |
insilmaril@390 | 208 |
|
insilmaril@404 | 209 |
HistoryWindow *historyWindow; |
insilmaril@404 | 210 |
|
insilmaril@421 | 211 |
BranchPropertyWindow *branchPropertyWindow; |
insilmaril@432 | 212 |
SimpleScriptEditor *scriptEditor; |
insilmaril@421 | 213 |
|
insilmaril@406 | 214 |
QList <QAction*> actionListBranches; |
insilmaril@390 | 215 |
|
insilmaril@395 | 216 |
QColor currentColor; |
insilmaril@395 | 217 |
|
insilmaril@401 | 218 |
QMenu *recentFilesMenu; |
insilmaril@401 | 219 |
enum { MaxRecentFiles = 9 }; |
insilmaril@445 | 220 |
QAction *recentFileActions[MaxRecentFiles]; |
insilmaril@445 | 221 |
|
insilmaril@445 | 222 |
QAction *macroActions[12]; |
insilmaril@445 | 223 |
QStringList macro; |
insilmaril@401 | 224 |
|
insilmaril@390 | 225 |
QAction* actionFileSave; |
insilmaril@390 | 226 |
QAction* actionFilePrint; |
insilmaril@390 | 227 |
QAction* actionEditUndo; |
insilmaril@390 | 228 |
QAction* actionEditRedo; |
insilmaril@390 | 229 |
QAction *actionEditCopy; |
insilmaril@390 | 230 |
QAction *actionEditCut; |
insilmaril@390 | 231 |
QAction *actionEditPaste; |
insilmaril@390 | 232 |
QAction *actionEditMoveUp; |
insilmaril@390 | 233 |
QAction *actionEditMoveDown; |
insilmaril@390 | 234 |
QAction *actionEditToggleScroll; |
insilmaril@390 | 235 |
QAction* actionEditOpenURL; |
insilmaril@390 | 236 |
QAction* actionEditOpenURLTab; |
insilmaril@390 | 237 |
QAction* actionEditOpenMultipleURLTabs; |
insilmaril@390 | 238 |
QAction* actionEditURL; |
insilmaril@390 | 239 |
QAction* actionEditHeading2URL; |
insilmaril@390 | 240 |
QAction* actionEditBugzilla2URL; |
insilmaril@390 | 241 |
QAction* actionEditFATE2URL; |
insilmaril@390 | 242 |
QAction *actionEditOpenVymLink; |
insilmaril@390 | 243 |
QAction *actionEditOpenMultipleVymLinks; |
insilmaril@390 | 244 |
QAction *actionEditVymLink; |
insilmaril@390 | 245 |
QAction *actionEditDeleteVymLink; |
insilmaril@390 | 246 |
QAction *actionEditToggleHideExport; |
insilmaril@390 | 247 |
QAction *actionEditMapInfo; |
insilmaril@390 | 248 |
QAction *actionEditHeading; |
insilmaril@390 | 249 |
QAction *actionEditDelete; |
insilmaril@390 | 250 |
QAction *actionEditAddBranch; |
insilmaril@394 | 251 |
QAction *actionEditAddBranchBefore; |
insilmaril@390 | 252 |
QAction *actionEditAddBranchAbove; |
insilmaril@390 | 253 |
QAction *actionEditAddBranchBelow; |
insilmaril@395 | 254 |
QAction *actionEditDeleteKeepChilds; |
insilmaril@395 | 255 |
QAction *actionEditDeleteChilds; |
insilmaril@390 | 256 |
QAction *actionEditImportAdd; |
insilmaril@390 | 257 |
QAction *actionEditImportReplace; |
insilmaril@390 | 258 |
QAction *actionEditSaveBranch; |
insilmaril@390 | 259 |
QAction *actionEditSelectFirst; |
insilmaril@390 | 260 |
QAction *actionEditSelectLast; |
insilmaril@390 | 261 |
QAction *actionEditLoadImage; |
insilmaril@390 | 262 |
|
insilmaril@390 | 263 |
QAction* actionFormatColor; |
insilmaril@390 | 264 |
QAction* actionFormatPickColor; |
insilmaril@390 | 265 |
QAction* actionFormatColorBranch; |
insilmaril@390 | 266 |
QAction* actionFormatColorSubtree; |
insilmaril@390 | 267 |
QAction* actionFormatLinkColorHint; |
insilmaril@390 | 268 |
QAction* actionFormatBackColor; |
insilmaril@408 | 269 |
QAction* actionFormatBackImage; |
insilmaril@390 | 270 |
QAction* actionFormatLinkColor; |
insilmaril@442 | 271 |
QAction* actionFormatSelectionColor; |
insilmaril@390 | 272 |
QAction *actionFormatIncludeImagesVer; |
insilmaril@390 | 273 |
QAction *actionFormatIncludeImagesHor; |
insilmaril@390 | 274 |
|
insilmaril@390 | 275 |
QActionGroup* actionGroupModModes; |
insilmaril@390 | 276 |
QAction* actionModModeColor; |
insilmaril@390 | 277 |
QAction* actionModModeXLink; |
insilmaril@390 | 278 |
QAction* actionModModeCopy; |
insilmaril@390 | 279 |
|
insilmaril@390 | 280 |
QActionGroup *actionGroupFormatFrameTypes; |
insilmaril@421 | 281 |
|
insilmaril@442 | 282 |
QAction *actionTogglePropertyDialog; |
insilmaril@390 | 283 |
|
insilmaril@390 | 284 |
QActionGroup *actionGroupFormatLinkStyles; |
insilmaril@390 | 285 |
QAction *actionFormatLinkStyleLine; |
insilmaril@390 | 286 |
QAction *actionFormatLinkStyleParabel; |
insilmaril@390 | 287 |
QAction *actionFormatLinkStylePolyLine; |
insilmaril@390 | 288 |
QAction *actionFormatLinkStylePolyParabel; |
insilmaril@390 | 289 |
QAction *actionFormatHideLinkUnselected; |
insilmaril@390 | 290 |
|
insilmaril@390 | 291 |
QAction *actionViewToggleNoteEditor; |
insilmaril@390 | 292 |
QAction *actionViewToggleHistoryWindow; |
insilmaril@408 | 293 |
QAction *actionViewToggleAntiAlias; |
insilmaril@408 | 294 |
QAction *actionViewToggleSmoothPixmapTransform; |
insilmaril@390 | 295 |
|
insilmaril@390 | 296 |
QAction* actionSettingsAutoEdit; |
insilmaril@390 | 297 |
QAction* actionSettingsAutoSelectHeading; |
insilmaril@390 | 298 |
QAction* actionSettingsAutoSelectText; |
insilmaril@390 | 299 |
QAction* actionSettingsUseDelKey; |
insilmaril@390 | 300 |
QAction* actionSettingsUseFlagGroups; |
insilmaril@390 | 301 |
QAction* actionSettingsUseHideExport; |
insilmaril@0 | 302 |
}; |
insilmaril@0 | 303 |
|
insilmaril@0 | 304 |
|
insilmaril@0 | 305 |
#endif |
insilmaril@0 | 306 |