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