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