mainwindow.h
author insilmaril
Wed Oct 29 17:42:34 2008 +0000 (2008-10-29)
changeset 727 96402b172173
parent 725 7ea31701156e
child 732 b77b56f707f1
permissions -rw-r--r--
subtrees can be deleted now
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@721
     7
#include "extrainfodialog.h"
insilmaril@175
     8
#include "file.h"
insilmaril@175
     9
#include "findwindow.h"
insilmaril@404
    10
#include "historywindow.h"
insilmaril@175
    11
#include "mapeditor.h"
insilmaril@432
    12
#include "simplescripteditor.h"
insilmaril@175
    13
#include "texteditor.h"
insilmaril@726
    14
#include "vymview.h"
insilmaril@0
    15
insilmaril@0
    16
class Main : public QMainWindow 
insilmaril@0
    17
{
insilmaril@0
    18
    Q_OBJECT
insilmaril@0
    19
insilmaril@0
    20
public:
insilmaril@473
    21
	/*! Modifier modes are used when CTRL together with a mouse button is pressed */
insilmaril@473
    22
	enum ModMode {
insilmaril@473
    23
		ModModeNone,	//!< Unused
insilmaril@473
    24
		ModModeColor,	//!< Pick color from object
insilmaril@473
    25
		ModModeCopy,	//!< Copy object
insilmaril@473
    26
		ModModeXLink	//!< Create a XLink (XLinkObj) from selected object
insilmaril@473
    27
		};
insilmaril@473
    28
insilmaril@366
    29
    Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
insilmaril@0
    30
    ~Main();
insilmaril@0
    31
	void loadCmdLine();
insilmaril@0
    32
	void statusMessage (const QString &);
insilmaril@0
    33
insilmaril@725
    34
private:
insilmaril@725
    35
	VymView* createView (VymModel*);
insilmaril@725
    36
insilmaril@0
    37
public slots:
insilmaril@0
    38
    void fileNew();
insilmaril@491
    39
    void fileNewCopy();
insilmaril@0
    40
insilmaril@0
    41
protected:
insilmaril@0
    42
	void closeEvent( QCloseEvent* );
insilmaril@0
    43
insilmaril@0
    44
private:
insilmaril@0
    45
    void setupFileActions();
insilmaril@0
    46
    void setupEditActions();
insilmaril@0
    47
    void setupFormatActions();
insilmaril@0
    48
    void setupViewActions();
insilmaril@89
    49
    void setupModeActions();
insilmaril@0
    50
    void setupWindowActions();
insilmaril@582
    51
    void setupFlag(FlagObj *fo, QToolBar *tb, bool aw, const QString &name, const QString &tooltip);
insilmaril@0
    52
    void setupFlagActions();
insilmaril@528
    53
    void setupNetworkActions();
insilmaril@0
    54
    void setupSettingsActions();
insilmaril@0
    55
    void setupTestActions();
insilmaril@0
    56
    void setupHelpActions();
insilmaril@0
    57
    void setupContextMenus();
insilmaril@401
    58
	void setupRecentMapsMenu();
insilmaril@445
    59
    void setupMacros();
insilmaril@0
    60
	void hideEvent (QHideEvent * );
insilmaril@0
    61
	void showEvent (QShowEvent * );
insilmaril@0
    62
	MapEditor* currentMapEditor() const;
insilmaril@721
    63
	VymModel* currentModel() const;
insilmaril@0
    64
    
insilmaril@0
    65
private slots:
insilmaril@0
    66
	void editorChanged(QWidget*);
insilmaril@0
    67
insilmaril@571
    68
    ErrorCode fileLoad(QString ,const LoadMode &, const FileType & ftype=VymMap);
insilmaril@0
    69
    void fileLoad(const LoadMode &);
insilmaril@0
    70
    void fileLoad();
insilmaril@401
    71
	void fileLoadRecent();
insilmaril@401
    72
	void addRecentMap (const QString &);
insilmaril@721
    73
    void fileSave(VymModel*, const SaveMode & );
insilmaril@0
    74
    void fileSave();
insilmaril@473
    75
public slots:	
insilmaril@721
    76
    void fileSave(VymModel*);	// autosave from MapEditor
insilmaril@473
    77
private slots:	
insilmaril@0
    78
    void fileSaveAs(const SaveMode &);
insilmaril@0
    79
    void fileSaveAs();
insilmaril@215
    80
    void fileImportKDEBookmarks();
insilmaril@314
    81
    void fileImportFirefoxBookmarks();
insilmaril@571
    82
    void fileImportFreemind();
insilmaril@215
    83
    void fileImportMM();
insilmaril@0
    84
    void fileImportDir();
insilmaril@0
    85
    void fileExportXML();
insilmaril@0
    86
    void fileExportXHTML();
insilmaril@366
    87
    void fileExportImage();
insilmaril@0
    88
    void fileExportASCII();
insilmaril@497
    89
    void fileExportCSV();
insilmaril@163
    90
    void fileExportLaTeX();
insilmaril@243
    91
    void fileExportKDEBookmarks();
insilmaril@228
    92
    void fileExportTaskjuggler();
insilmaril@163
    93
    void fileExportOOPresentation();
insilmaril@0
    94
    void fileCloseMap();
insilmaril@0
    95
    void filePrint();
insilmaril@0
    96
    void fileExitVYM();
insilmaril@0
    97
insilmaril@404
    98
public slots:
insilmaril@0
    99
    void editUndo();	
insilmaril@0
   100
    void editRedo();	
insilmaril@404
   101
	void gotoHistoryStep (int);
insilmaril@404
   102
private slots:	
insilmaril@0
   103
    void editCopy();	
insilmaril@0
   104
    void editPaste();	
insilmaril@0
   105
    void editCut();	
insilmaril@0
   106
    void editOpenFindWindow();
insilmaril@0
   107
	void editFind(QString);
insilmaril@0
   108
	void editFindChanged();
insilmaril@366
   109
private:
insilmaril@366
   110
	void openTabs(QStringList);
insilmaril@0
   111
public slots:
insilmaril@0
   112
	void editOpenURL();
insilmaril@266
   113
	void editOpenURLTab();
insilmaril@0
   114
private slots:
insilmaril@366
   115
	void editOpenMultipleURLTabs();
insilmaril@0
   116
	void editURL();
insilmaril@528
   117
	void editLocalURL();
insilmaril@0
   118
	void editHeading2URL();
insilmaril@0
   119
	void editBugzilla2URL();
insilmaril@175
   120
	void editFATE2URL();
insilmaril@366
   121
	void openVymLinks(const QStringList &);
insilmaril@0
   122
	void editVymLink();
insilmaril@366
   123
	void editOpenMultipleVymLinks();
insilmaril@616
   124
    void editAttributeFinished();
insilmaril@0
   125
public slots:
insilmaril@721
   126
    void editHeadingFinished(VymModel *m);
insilmaril@721
   127
//    void editHeading();
insilmaril@616
   128
    void editAttribute();
insilmaril@0
   129
	void editOpenVymLink();
insilmaril@0
   130
private slots:
insilmaril@0
   131
	void editDeleteVymLink();
insilmaril@243
   132
	void editToggleHideExport();
insilmaril@0
   133
	void editMapInfo();
insilmaril@0
   134
    void editMoveUp();	
insilmaril@0
   135
    void editMoveDown();	
insilmaril@608
   136
	void editSortChildren();
insilmaril@0
   137
    void editToggleScroll();
insilmaril@721
   138
    void editUnscrollChildren();
insilmaril@684
   139
    void editAddMapCenter();
insilmaril@0
   140
    void editNewBranch();
insilmaril@394
   141
    void editNewBranchBefore();
insilmaril@0
   142
    void editNewBranchAbove();
insilmaril@0
   143
    void editNewBranchBelow();
insilmaril@0
   144
    void editImportAdd();
insilmaril@0
   145
    void editImportReplace();
insilmaril@0
   146
    void editSaveBranch();
insilmaril@721
   147
    void editDeleteKeepChildren();
insilmaril@721
   148
    void editDeleteChildren();
insilmaril@0
   149
    void editDeleteSelection();
insilmaril@0
   150
    void editUpperBranch();
insilmaril@0
   151
    void editLowerBranch();
insilmaril@0
   152
    void editLeftBranch();
insilmaril@0
   153
    void editRightBranch();
insilmaril@0
   154
    void editFirstBranch();
insilmaril@0
   155
    void editLastBranch();
insilmaril@0
   156
    void editLoadImage();
insilmaril@366
   157
    void editSaveImage();
insilmaril@366
   158
    void editFollowXLink (QAction *);
insilmaril@366
   159
    void editEditXLink (QAction *);
insilmaril@0
   160
insilmaril@0
   161
    void formatSelectColor();
insilmaril@0
   162
    void formatPickColor();
insilmaril@0
   163
    void colorChanged(QColor);
insilmaril@0
   164
    void formatColorBranch();
insilmaril@417
   165
    void formatColorSubtree();
insilmaril@0
   166
	void formatLinkStyleLine();
insilmaril@0
   167
	void formatLinkStyleParabel();
insilmaril@0
   168
	void formatLinkStylePolyLine();
insilmaril@0
   169
	void formatLinkStylePolyParabel();
insilmaril@0
   170
    void formatSelectBackColor();
insilmaril@408
   171
    void formatSelectBackImage();
insilmaril@0
   172
    void formatSelectLinkColor();
insilmaril@442
   173
    void formatSelectSelectionColor();
insilmaril@0
   174
    void formatToggleLinkColorHint();
insilmaril@160
   175
	void formatHideLinkUnselected();
insilmaril@0
   176
insilmaril@0
   177
    void viewZoomReset();
insilmaril@0
   178
    void viewZoomIn();
insilmaril@0
   179
    void viewZoomOut();
insilmaril@526
   180
    void viewCenter();
insilmaril@0
   181
insilmaril@0
   182
public slots:
insilmaril@528
   183
	void networkStartServer();
insilmaril@528
   184
	void networkConnect();
insilmaril@0
   185
	bool settingsPDF();
insilmaril@0
   186
	bool settingsURL();
insilmaril@450
   187
	void settingsMacroDir();
insilmaril@328
   188
	void settingsToggleDelKey();
insilmaril@473
   189
	void settingsUndoLevels();
insilmaril@473
   190
	void settingsAutosaveToggle();
insilmaril@473
   191
	void settingsAutosaveTime();
insilmaril@625
   192
	void settingsWriteBackupFileToggle();
insilmaril@690
   193
	void settingsToggleAnimation();
insilmaril@0
   194
insilmaril@0
   195
	void windowToggleNoteEditor();
insilmaril@294
   196
	void windowToggleHistory();
insilmaril@473
   197
	void windowToggleProperty();
insilmaril@404
   198
	void updateHistory(SimpleSettings &);
insilmaril@408
   199
	void windowToggleAntiAlias();
insilmaril@408
   200
	void windowToggleSmoothPixmap();
insilmaril@160
   201
	void updateNoteFlag();
insilmaril@723
   202
	void updateSatellites(VymModel*);
insilmaril@390
   203
	void updateActions();
insilmaril@390
   204
	ModMode getModMode();
insilmaril@537
   205
	bool autoEditNewBranch();
insilmaril@537
   206
	bool autoSelectNewBranch();
insilmaril@390
   207
	bool useFlagGroups();
insilmaril@434
   208
	void setScript(const QString &);
insilmaril@434
   209
	void runScript(const QString &);
insilmaril@514
   210
	void runScriptEverywhere (const QString &);
insilmaril@160
   211
insilmaril@0
   212
private slots:
insilmaril@0
   213
	void windowNextEditor();
insilmaril@0
   214
	void windowPreviousEditor();
insilmaril@0
   215
	void windowShowNoteEditor();
insilmaril@0
   216
	void windowHideNoteEditor();
insilmaril@0
   217
insilmaril@0
   218
	void standardFlagChanged();
insilmaril@0
   219
insilmaril@527
   220
    void testFunction1();
insilmaril@527
   221
    void testFunction2();
insilmaril@393
   222
    void testCommand();
insilmaril@0
   223
insilmaril@0
   224
    void helpDoc();
insilmaril@505
   225
    void helpDemo();
insilmaril@0
   226
    void helpAbout();
insilmaril@0
   227
    void helpAboutQT();
insilmaril@0
   228
insilmaril@445
   229
	void callMacro ();
insilmaril@473
   230
insilmaril@0
   231
private:
insilmaril@0
   232
	QTabWidget *tabWidget;
insilmaril@0
   233
	FindWindow *findWindow;
insilmaril@266
   234
	QProcess *procBrowser;
insilmaril@366
   235
insilmaril@366
   236
	QStringList imageTypes;
insilmaril@366
   237
insilmaril@725
   238
	QList <VymModel*> tabModel;		//!< the corresponding model to a tab
insilmaril@721
   239
insilmaril@394
   240
	QString prevSelection;
insilmaril@390
   241
insilmaril@404
   242
	HistoryWindow *historyWindow;
insilmaril@404
   243
insilmaril@421
   244
	BranchPropertyWindow *branchPropertyWindow;
insilmaril@432
   245
	SimpleScriptEditor *scriptEditor;
insilmaril@421
   246
insilmaril@406
   247
	QList <QAction*> actionListBranches;
insilmaril@390
   248
insilmaril@395
   249
	QColor currentColor;
insilmaril@395
   250
insilmaril@600
   251
	int xLinkMenuWidth;
insilmaril@600
   252
insilmaril@401
   253
	QMenu *recentFilesMenu;
insilmaril@401
   254
	enum { MaxRecentFiles = 9 };
insilmaril@445
   255
    QAction *recentFileActions[MaxRecentFiles];
insilmaril@445
   256
insilmaril@445
   257
    QAction *macroActions[12];
insilmaril@445
   258
	QStringList macro;
insilmaril@401
   259
insilmaril@690
   260
	QAction* actionFileNewCopy;
insilmaril@390
   261
	QAction* actionFileSave;
insilmaril@390
   262
	QAction* actionFilePrint;
insilmaril@723
   263
	QAction* actionUndo;
insilmaril@723
   264
	QAction* actionRedo;
insilmaril@723
   265
	QAction *actionCopy;
insilmaril@723
   266
	QAction *actionCut;
insilmaril@723
   267
	QAction *actionPaste;
insilmaril@723
   268
	QAction *actionMoveUp;
insilmaril@723
   269
	QAction *actionMoveDown;
insilmaril@723
   270
	QAction *actionSortChildren;
insilmaril@723
   271
	QAction *actionToggleScroll;
insilmaril@723
   272
	QAction* actionOpenURL;
insilmaril@723
   273
	QAction* actionOpenURLTab;
insilmaril@723
   274
	QAction* actionOpenMultipleURLTabs;
insilmaril@723
   275
	QAction* actionURL;
insilmaril@723
   276
	QAction* actionLocalURL;
insilmaril@723
   277
	QAction* actionHeading2URL;
insilmaril@723
   278
	QAction* actionBugzilla2URL;
insilmaril@723
   279
	QAction* actionFATE2URL;
insilmaril@723
   280
	QAction *actionOpenVymLink;
insilmaril@723
   281
	QAction *actionOpenMultipleVymLinks;
insilmaril@723
   282
	QAction *actionVymLink;
insilmaril@723
   283
	QAction *actionDeleteVymLink;
insilmaril@723
   284
	QAction *actionToggleHideExport;
insilmaril@723
   285
	QAction *actionMapInfo;
insilmaril@723
   286
	QAction *actionHeading;
insilmaril@723
   287
	QAction *actionDelete;
insilmaril@723
   288
insilmaril@723
   289
public:
insilmaril@723
   290
	QAction *actionAddMapCenter;
insilmaril@723
   291
insilmaril@723
   292
private:	
insilmaril@723
   293
	QAction *actionAddBranch;
insilmaril@723
   294
	QAction *actionAddBranchBefore;
insilmaril@723
   295
	QAction *actionAddBranchAbove;
insilmaril@723
   296
	QAction *actionAddBranchBelow;
insilmaril@723
   297
	QAction *actionDeleteKeepChildren;
insilmaril@723
   298
	QAction *actionDeleteChildren;
insilmaril@723
   299
	QAction *actionImportAdd;
insilmaril@723
   300
	QAction *actionImportReplace;
insilmaril@723
   301
	QAction *actionSaveBranch;
insilmaril@723
   302
	QAction *actionSelectFirst;
insilmaril@723
   303
	QAction *actionSelectLast;
insilmaril@723
   304
	QAction *actionLoadImage;
insilmaril@390
   305
insilmaril@390
   306
	QAction* actionFormatColor;
insilmaril@390
   307
	QAction* actionFormatPickColor;
insilmaril@390
   308
	QAction* actionFormatColorBranch;
insilmaril@390
   309
	QAction* actionFormatColorSubtree;
insilmaril@390
   310
	QAction* actionFormatLinkColorHint;
insilmaril@390
   311
	QAction* actionFormatBackColor;
insilmaril@408
   312
	QAction* actionFormatBackImage;
insilmaril@390
   313
	QAction* actionFormatLinkColor;
insilmaril@442
   314
	QAction* actionFormatSelectionColor;
insilmaril@390
   315
insilmaril@390
   316
	QActionGroup* actionGroupModModes;
insilmaril@390
   317
	QAction* actionModModeColor;
insilmaril@390
   318
	QAction* actionModModeXLink;
insilmaril@390
   319
	QAction* actionModModeCopy;
insilmaril@390
   320
insilmaril@390
   321
	QActionGroup *actionGroupFormatFrameTypes;
insilmaril@421
   322
insilmaril@390
   323
insilmaril@390
   324
	QActionGroup *actionGroupFormatLinkStyles;
insilmaril@390
   325
	QAction *actionFormatLinkStyleLine;
insilmaril@390
   326
	QAction *actionFormatLinkStyleParabel;
insilmaril@390
   327
	QAction *actionFormatLinkStylePolyLine;
insilmaril@390
   328
	QAction *actionFormatLinkStylePolyParabel;
insilmaril@390
   329
	QAction *actionFormatHideLinkUnselected;
insilmaril@390
   330
insilmaril@390
   331
	QAction *actionViewToggleNoteEditor;
insilmaril@390
   332
	QAction *actionViewToggleHistoryWindow;
insilmaril@486
   333
	QAction *actionViewTogglePropertyWindow;
insilmaril@408
   334
	QAction *actionViewToggleAntiAlias;
insilmaril@408
   335
	QAction *actionViewToggleSmoothPixmapTransform;
insilmaril@526
   336
	QAction* actionViewCenter;
insilmaril@390
   337
insilmaril@537
   338
	QAction* actionSettingsAutoEditNewBranch;
insilmaril@537
   339
	QAction* actionSettingsAutoSelectNewBranch;
insilmaril@390
   340
	QAction* actionSettingsAutoSelectText;
insilmaril@390
   341
	QAction* actionSettingsUseDelKey;
insilmaril@390
   342
	QAction* actionSettingsUseFlagGroups;
insilmaril@390
   343
	QAction* actionSettingsUseHideExport;
insilmaril@473
   344
	QAction* actionSettingsAutosaveToggle;
insilmaril@473
   345
	QAction* actionSettingsAutosaveTime;
insilmaril@625
   346
	QAction* actionSettingsWriteBackupFile;
insilmaril@690
   347
	QAction* actionSettingsUseAnimation;
insilmaril@0
   348
};
insilmaril@0
   349
insilmaril@0
   350
insilmaril@0
   351
#endif
insilmaril@0
   352