mainwindow.h
author insilmaril
Mon Jul 09 10:23:39 2007 +0000 (2007-07-09)
changeset 542 4fdcbccbc1da
parent 528 36d140349897
child 564 b8f0eefe4351
permissions -rw-r--r--
GPL V2. Added settings to 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@491
    35
    void fileNewCopy();
insilmaril@0
    36
insilmaril@0
    37
protected:
insilmaril@0
    38
	void closeEvent( QCloseEvent* );
insilmaril@0
    39
insilmaril@0
    40
private:
insilmaril@0
    41
    void setupFileActions();
insilmaril@0
    42
    void setupEditActions();
insilmaril@0
    43
    void setupFormatActions();
insilmaril@0
    44
    void setupViewActions();
insilmaril@89
    45
    void setupModeActions();
insilmaril@0
    46
    void setupWindowActions();
insilmaril@0
    47
    void setupFlagActions();
insilmaril@528
    48
    void setupNetworkActions();
insilmaril@0
    49
    void setupSettingsActions();
insilmaril@0
    50
    void setupTestActions();
insilmaril@0
    51
    void setupHelpActions();
insilmaril@0
    52
    void setupContextMenus();
insilmaril@401
    53
	void setupRecentMapsMenu();
insilmaril@445
    54
    void setupMacros();
insilmaril@0
    55
	void hideEvent (QHideEvent * );
insilmaril@0
    56
	void showEvent (QShowEvent * );
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@497
    82
    void fileExportCSV();
insilmaril@163
    83
    void fileExportLaTeX();
insilmaril@243
    84
    void fileExportKDEBookmarks();
insilmaril@228
    85
    void fileExportTaskjuggler();
insilmaril@163
    86
    void fileExportOOPresentation();
insilmaril@0
    87
    void fileCloseMap();
insilmaril@0
    88
    void filePrint();
insilmaril@0
    89
    void fileExitVYM();
insilmaril@0
    90
insilmaril@404
    91
public slots:
insilmaril@0
    92
    void editUndo();	
insilmaril@0
    93
    void editRedo();	
insilmaril@404
    94
	void gotoHistoryStep (int);
insilmaril@404
    95
private slots:	
insilmaril@0
    96
    void editCopy();	
insilmaril@0
    97
    void editPaste();	
insilmaril@0
    98
    void editCut();	
insilmaril@0
    99
    void editOpenFindWindow();
insilmaril@0
   100
	void editFind(QString);
insilmaril@0
   101
	void editFindChanged();
insilmaril@366
   102
private:
insilmaril@366
   103
	void openTabs(QStringList);
insilmaril@0
   104
public slots:
insilmaril@0
   105
	void editOpenURL();
insilmaril@266
   106
	void editOpenURLTab();
insilmaril@0
   107
private slots:
insilmaril@366
   108
	void editOpenMultipleURLTabs();
insilmaril@0
   109
	void editURL();
insilmaril@528
   110
	void editLocalURL();
insilmaril@0
   111
	void editHeading2URL();
insilmaril@0
   112
	void editBugzilla2URL();
insilmaril@175
   113
	void editFATE2URL();
insilmaril@366
   114
	void openVymLinks(const QStringList &);
insilmaril@0
   115
	void editVymLink();
insilmaril@366
   116
	void editOpenMultipleVymLinks();
insilmaril@394
   117
    void editHeadingFinished();
insilmaril@0
   118
public slots:
insilmaril@366
   119
    void editHeading();
insilmaril@0
   120
	void editOpenVymLink();
insilmaril@0
   121
private slots:
insilmaril@0
   122
	void editDeleteVymLink();
insilmaril@243
   123
	void editToggleHideExport();
insilmaril@0
   124
	void editMapInfo();
insilmaril@0
   125
    void editMoveUp();	
insilmaril@0
   126
    void editMoveDown();	
insilmaril@0
   127
    void editToggleScroll();
insilmaril@473
   128
    void editUnscrollChilds();
insilmaril@0
   129
    void editNewBranch();
insilmaril@394
   130
    void editNewBranchBefore();
insilmaril@0
   131
    void editNewBranchAbove();
insilmaril@0
   132
    void editNewBranchBelow();
insilmaril@0
   133
    void editImportAdd();
insilmaril@0
   134
    void editImportReplace();
insilmaril@0
   135
    void editSaveBranch();
insilmaril@395
   136
    void editDeleteKeepChilds();
insilmaril@395
   137
    void editDeleteChilds();
insilmaril@0
   138
    void editDeleteSelection();
insilmaril@0
   139
    void editUpperBranch();
insilmaril@0
   140
    void editLowerBranch();
insilmaril@0
   141
    void editLeftBranch();
insilmaril@0
   142
    void editRightBranch();
insilmaril@0
   143
    void editFirstBranch();
insilmaril@0
   144
    void editLastBranch();
insilmaril@0
   145
    void editLoadImage();
insilmaril@366
   146
    void editSaveImage();
insilmaril@366
   147
    void editFollowXLink (QAction *);
insilmaril@366
   148
    void editEditXLink (QAction *);
insilmaril@0
   149
insilmaril@0
   150
    void formatSelectColor();
insilmaril@0
   151
    void formatPickColor();
insilmaril@0
   152
    void colorChanged(QColor);
insilmaril@0
   153
    void formatColorBranch();
insilmaril@417
   154
    void formatColorSubtree();
insilmaril@0
   155
	void formatLinkStyleLine();
insilmaril@0
   156
	void formatLinkStyleParabel();
insilmaril@0
   157
	void formatLinkStylePolyLine();
insilmaril@0
   158
	void formatLinkStylePolyParabel();
insilmaril@0
   159
    void formatSelectBackColor();
insilmaril@408
   160
    void formatSelectBackImage();
insilmaril@0
   161
    void formatSelectLinkColor();
insilmaril@442
   162
    void formatSelectSelectionColor();
insilmaril@0
   163
    void formatToggleLinkColorHint();
insilmaril@160
   164
	void formatHideLinkUnselected();
insilmaril@0
   165
insilmaril@0
   166
    void viewZoomReset();
insilmaril@0
   167
    void viewZoomIn();
insilmaril@0
   168
    void viewZoomOut();
insilmaril@526
   169
    void viewCenter();
insilmaril@0
   170
insilmaril@0
   171
public slots:
insilmaril@528
   172
	void networkStartServer();
insilmaril@528
   173
	void networkConnect();
insilmaril@0
   174
	bool settingsPDF();
insilmaril@0
   175
	bool settingsURL();
insilmaril@450
   176
	void settingsMacroDir();
insilmaril@328
   177
	void settingsToggleDelKey();
insilmaril@473
   178
	void settingsUndoLevels();
insilmaril@473
   179
	void settingsAutosaveToggle();
insilmaril@473
   180
	void settingsAutosaveTime();
insilmaril@0
   181
insilmaril@0
   182
	void windowToggleNoteEditor();
insilmaril@294
   183
	void windowToggleHistory();
insilmaril@473
   184
	void windowToggleProperty();
insilmaril@404
   185
	void updateHistory(SimpleSettings &);
insilmaril@408
   186
	void windowToggleAntiAlias();
insilmaril@408
   187
	void windowToggleSmoothPixmap();
insilmaril@160
   188
	void updateNoteFlag();
insilmaril@442
   189
	void updateSatellites(MapEditor *);
insilmaril@390
   190
	void updateActions();
insilmaril@390
   191
	ModMode getModMode();
insilmaril@537
   192
	bool autoEditNewBranch();
insilmaril@537
   193
	bool autoSelectNewBranch();
insilmaril@390
   194
	bool useFlagGroups();
insilmaril@434
   195
	void setScript(const QString &);
insilmaril@434
   196
	void runScript(const QString &);
insilmaril@514
   197
	void runScriptEverywhere (const QString &);
insilmaril@160
   198
insilmaril@0
   199
private slots:
insilmaril@0
   200
	void windowNextEditor();
insilmaril@0
   201
	void windowPreviousEditor();
insilmaril@0
   202
	void windowShowNoteEditor();
insilmaril@0
   203
	void windowHideNoteEditor();
insilmaril@0
   204
insilmaril@0
   205
	void standardFlagChanged();
insilmaril@0
   206
insilmaril@527
   207
    void testFunction1();
insilmaril@527
   208
    void testFunction2();
insilmaril@393
   209
    void testCommand();
insilmaril@0
   210
insilmaril@0
   211
    void helpDoc();
insilmaril@505
   212
    void helpDemo();
insilmaril@0
   213
    void helpAbout();
insilmaril@0
   214
    void helpAboutQT();
insilmaril@0
   215
insilmaril@445
   216
	void callMacro ();
insilmaril@473
   217
insilmaril@0
   218
private:
insilmaril@0
   219
	QTabWidget *tabWidget;
insilmaril@0
   220
	FindWindow *findWindow;
insilmaril@266
   221
	QProcess *procBrowser;
insilmaril@366
   222
insilmaril@366
   223
	QStringList imageTypes;
insilmaril@366
   224
insilmaril@366
   225
	QLineEdit *lineedit;	// to enter headings of branches
insilmaril@394
   226
	QString prevSelection;
insilmaril@390
   227
insilmaril@404
   228
	HistoryWindow *historyWindow;
insilmaril@404
   229
insilmaril@421
   230
	BranchPropertyWindow *branchPropertyWindow;
insilmaril@432
   231
	SimpleScriptEditor *scriptEditor;
insilmaril@421
   232
insilmaril@406
   233
	QList <QAction*> actionListBranches;
insilmaril@390
   234
insilmaril@395
   235
	QColor currentColor;
insilmaril@395
   236
insilmaril@401
   237
	QMenu *recentFilesMenu;
insilmaril@401
   238
	enum { MaxRecentFiles = 9 };
insilmaril@445
   239
    QAction *recentFileActions[MaxRecentFiles];
insilmaril@445
   240
insilmaril@445
   241
    QAction *macroActions[12];
insilmaril@445
   242
	QStringList macro;
insilmaril@401
   243
insilmaril@390
   244
	QAction* actionFileSave;
insilmaril@390
   245
	QAction* actionFilePrint;
insilmaril@390
   246
	QAction* actionEditUndo;
insilmaril@390
   247
	QAction* actionEditRedo;
insilmaril@390
   248
	QAction *actionEditCopy;
insilmaril@390
   249
	QAction *actionEditCut;
insilmaril@390
   250
	QAction *actionEditPaste;
insilmaril@390
   251
	QAction *actionEditMoveUp;
insilmaril@390
   252
	QAction *actionEditMoveDown;
insilmaril@390
   253
	QAction *actionEditToggleScroll;
insilmaril@390
   254
	QAction* actionEditOpenURL;
insilmaril@390
   255
	QAction* actionEditOpenURLTab;
insilmaril@390
   256
	QAction* actionEditOpenMultipleURLTabs;
insilmaril@390
   257
	QAction* actionEditURL;
insilmaril@528
   258
	QAction* actionEditLocalURL;
insilmaril@390
   259
	QAction* actionEditHeading2URL;
insilmaril@390
   260
	QAction* actionEditBugzilla2URL;
insilmaril@390
   261
	QAction* actionEditFATE2URL;
insilmaril@390
   262
	QAction *actionEditOpenVymLink;
insilmaril@390
   263
	QAction *actionEditOpenMultipleVymLinks;
insilmaril@390
   264
	QAction *actionEditVymLink;
insilmaril@390
   265
	QAction *actionEditDeleteVymLink;
insilmaril@390
   266
	QAction *actionEditToggleHideExport;
insilmaril@390
   267
	QAction *actionEditMapInfo;
insilmaril@390
   268
	QAction *actionEditHeading;
insilmaril@390
   269
	QAction *actionEditDelete;
insilmaril@390
   270
	QAction *actionEditAddBranch;
insilmaril@394
   271
	QAction *actionEditAddBranchBefore;
insilmaril@390
   272
	QAction *actionEditAddBranchAbove;
insilmaril@390
   273
	QAction *actionEditAddBranchBelow;
insilmaril@395
   274
	QAction *actionEditDeleteKeepChilds;
insilmaril@395
   275
	QAction *actionEditDeleteChilds;
insilmaril@390
   276
	QAction *actionEditImportAdd;
insilmaril@390
   277
	QAction *actionEditImportReplace;
insilmaril@390
   278
	QAction *actionEditSaveBranch;
insilmaril@390
   279
	QAction *actionEditSelectFirst;
insilmaril@390
   280
	QAction *actionEditSelectLast;
insilmaril@390
   281
	QAction *actionEditLoadImage;
insilmaril@390
   282
insilmaril@390
   283
	QAction* actionFormatColor;
insilmaril@390
   284
	QAction* actionFormatPickColor;
insilmaril@390
   285
	QAction* actionFormatColorBranch;
insilmaril@390
   286
	QAction* actionFormatColorSubtree;
insilmaril@390
   287
	QAction* actionFormatLinkColorHint;
insilmaril@390
   288
	QAction* actionFormatBackColor;
insilmaril@408
   289
	QAction* actionFormatBackImage;
insilmaril@390
   290
	QAction* actionFormatLinkColor;
insilmaril@442
   291
	QAction* actionFormatSelectionColor;
insilmaril@390
   292
insilmaril@390
   293
	QActionGroup* actionGroupModModes;
insilmaril@390
   294
	QAction* actionModModeColor;
insilmaril@390
   295
	QAction* actionModModeXLink;
insilmaril@390
   296
	QAction* actionModModeCopy;
insilmaril@390
   297
insilmaril@390
   298
	QActionGroup *actionGroupFormatFrameTypes;
insilmaril@421
   299
insilmaril@390
   300
insilmaril@390
   301
	QActionGroup *actionGroupFormatLinkStyles;
insilmaril@390
   302
	QAction *actionFormatLinkStyleLine;
insilmaril@390
   303
	QAction *actionFormatLinkStyleParabel;
insilmaril@390
   304
	QAction *actionFormatLinkStylePolyLine;
insilmaril@390
   305
	QAction *actionFormatLinkStylePolyParabel;
insilmaril@390
   306
	QAction *actionFormatHideLinkUnselected;
insilmaril@390
   307
insilmaril@390
   308
	QAction *actionViewToggleNoteEditor;
insilmaril@390
   309
	QAction *actionViewToggleHistoryWindow;
insilmaril@486
   310
	QAction *actionViewTogglePropertyWindow;
insilmaril@408
   311
	QAction *actionViewToggleAntiAlias;
insilmaril@408
   312
	QAction *actionViewToggleSmoothPixmapTransform;
insilmaril@526
   313
	QAction* actionViewCenter;
insilmaril@390
   314
insilmaril@537
   315
	QAction* actionSettingsAutoEditNewBranch;
insilmaril@537
   316
	QAction* actionSettingsAutoSelectNewBranch;
insilmaril@390
   317
	QAction* actionSettingsAutoSelectText;
insilmaril@390
   318
	QAction* actionSettingsUseDelKey;
insilmaril@390
   319
	QAction* actionSettingsUseFlagGroups;
insilmaril@390
   320
	QAction* actionSettingsUseHideExport;
insilmaril@473
   321
	QAction* actionSettingsAutosaveToggle;
insilmaril@473
   322
	QAction* actionSettingsAutosaveTime;
insilmaril@0
   323
};
insilmaril@0
   324
insilmaril@0
   325
insilmaril@0
   326
#endif
insilmaril@0
   327