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