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