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