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