-
Notifications
You must be signed in to change notification settings - Fork 122
/
ApplicationWindow.h
1512 lines (1313 loc) · 55.9 KB
/
ApplicationWindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/***************************************************************************
File : ApplicationWindow.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2006 by Ion Vasilief,
Tilman Hoener zu Siederdissen,
Knut Franke
Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net,
knut.franke*gmx.de
Description : QtiPlot's main window
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#ifndef APPLICATION_H
#define APPLICATION_H
#include <QMainWindow>
#include <q3listview.h>
#include <QFile>
#include <QSplitter>
#include <QDesktopServices>
#include <QBuffer>
#include <QLocale>
#include <QSet>
#include <QSettings>
#include <QPointer>
#include "MantidQtAPI/HelpWindow.h"
#include "Table.h"
#include "ScriptingEnv.h"
#include "Scripted.h"
#include "Script.h"
class QPixmap;
class QCloseEvent;
class QDropEvent;
class QTimerEvent;
class QDragEnterEvent;
class QTranslator;
class QDockWidget;
class QAction;
class QActionGroup;
class QLineEdit;
class QTranslator;
class QToolButton;
class QShortcut;
class QMenu;
class QToolBar;
//class QAssistantClient;
class QLocale;
class QMdiArea;
class QSignalMapper;
class Matrix;
class Table;
class Graph;
class ScalePicker;
class Graph3D;
class Note;
class MultiLayer;
class FunctionDialog;
class Folder;
class FolderListItem;
class FolderListView;
class Plot3DDialog;
class TableStatistics;
class CurveRangeDialog;
class LegendWidget;
class ArrowMarker;
class ImageMarker;
class TextEditor;
class AssociationsDialog;
class MantidMatrix;
class FloatingWindow;
class MantidTable;
class TiledWindow;
// On Mac (and Ubuntu 11 Unity) the menubar must be shared between the main window and other floating windows.
#ifdef Q_OS_MAC
#define SHARED_MENUBAR
#endif
namespace MantidQt
{
namespace API
{
class Message;
}
namespace MantidWidgets
{
class FitPropertyBrowser;
class MessageDisplay;
}
}
//Mantid
class MantidUI;
class ScriptingWindow;
/**
* \brief MantidPlot's main window.
*
* This class contains the main part of the user interface as well as the central project management facilities.
*
* It manages all MdiSubWindow MDI Windows in a project, knows about their organization in Folder objects
* and contains the parts of the project explorer not implemented in Folder, FolderListItem or FolderListView.
*
* Furthermore, it is responsible for displaying most MDI Windows' context menus and opening all sorts of dialogs.
*/
class ApplicationWindow: public QMainWindow, public Scripted
{
Q_OBJECT
public:
ApplicationWindow(bool factorySettings, const QStringList& args);
ApplicationWindow(bool factorySettings=false);
~ApplicationWindow();
enum ShowWindowsPolicy{HideAll, ActiveFolder, SubFolders};
enum WindowType{NoWindow, TableWindow, MatrixWindow, MultiLayerWindow, NoteWindow, Plot3DWindow};
enum MatrixToTableConversion{Direct, XYZ, YXZ};
enum EndLineChar{LF=0, CRLF=1, CR=2};
enum Analysis{NoAnalysis, Integrate, Diff, FitLinear, FitGauss, FitLorentz, FitSigmoidal};
FolderListView *lv, *folders;
QDockWidget *logWindow;
/** Generates a new unique name starting with string /param name.
You can force the output to be a name different from /param name,
even if 'name' is not used in the project, by setting /param increment = true (the default)
*/
QString generateUniqueName(const QString& name, bool increment = true);
void saveFitFunctions(const QStringList& lst);
//! \name User custom actions
//@{
void loadCustomActions();
void reloadCustomActions();
void removeCustomAction(QAction *);
void addCustomAction(QAction *, const QString& parentName, int index = -1);
QList<QAction *> customActionsList(){return d_user_actions;};
QList<QMenu *> customizableMenusList();
//------ Mantid-------
void addUserMenu(const QString &); //Mantid
void addUserMenuAction(const QString & parentMenu, const QString & itemName, const QString & itemData); //Mantid
void removeUserMenu(const QString &); //Mantid
void removeUserMenuAction(const QString & menu, const QString & action); //Mantid
const QList<QMenu*> & getCustomMenus() const; //Mantid
ScriptingWindow* getScriptWindowHandle() { return scriptingWindow; }
bool getMenuSettingsFlag(const QString & menu_item);
void setExitCode(int code);
int getExitCode();
//-------------------
//@}
QList<QMenu *> menusList();
QList<QToolBar *> toolBarsList() const;
MdiSubWindow *activeWindow(WindowType type = NoWindow);
void addMdiSubWindow(MdiSubWindow *w, bool showNormal = true);
void addMdiSubWindow(MdiSubWindow *w, bool showFloating, bool showNormal);
int matrixUndoStackSize(){return d_matrix_undo_stack_size;};
void setMatrixUndoStackSize(int size);
QString endOfLine();
bool autoUpdateTableValues(){return d_auto_update_table_values;};
void setAutoUpdateTableValues(bool on = true);
void enablesaveNexus(const QString& wsName);
public slots:
//! \name Projects and Project Files
//@{
void exitWithPresetCode();
void open();
ApplicationWindow* open(const QString& fn, bool factorySettings = false, bool newProject = true);
ApplicationWindow* openProject(const QString& fn, const int fileVersion);
void openProjectFolder(std::string lines, const int fileVersion, bool isTopLevel = false);
ApplicationWindow* importOPJ(const QString& fn, bool factorySettings = false, bool newProject = true);
/// Load mantid data files using generic load algorithm, opening user dialog
void loadDataFile();
/// Load mantid data files (generic load algorithm)
void loadDataFileByName(QString fn);
/// Open from the list of recent files
void openRecentFile(int index);
/**
* \brief Create a new project from a data file.
*
* @param fn :: is read as a data file with the default column separator (as set by the user)
* and inserted as a table into a new, empty project.
* This table is then plotted with the Graph::LineSymbols style.
*/
ApplicationWindow * plotFile(const QString& fn);
/// Runs a script from a file. Mainly useful for automatically running scripts
void executeScriptFile(const QString & filename, const Script::ExecutionMode execMode);
/// Slot to connect the script execution success
void onScriptExecuteSuccess(const QString & message);
/// Slot to connect the script execution errors to
void onScriptExecuteError(const QString & message, const QString & scriptName, int lineNumber);
/// Runs an arbitrary lump of python code, return true/false on success/failure.
bool runPythonScript(const QString & code, bool async = false, bool quiet=false, bool redirect=true);
/// Checks for the presence of the Python psutil module for the system monitor widget
bool psutilPresent();
QList<MdiSubWindow *> windowsList() const;
QList<MdiSubWindow *> getAllWindows() const;
void updateWindowLists(MdiSubWindow *w);
/**
Arranges all the visible project windows in a cascade pattern.
*/
void cascade();
void saveProjectAs(const QString& fileName = QString(), bool compress = false);
bool saveProject(bool compress = false);
/// Serialises a project folder into its string project file representation
QString saveProjectFolder(Folder* folder, int &windowCount, bool isTopLevel = false);
//! Set the project status to modifed
void modifiedProject();
//! Set the project status to saved (not modified)
void savedProject();
//! Set the project status to modified and save 'w' as the last modified widget
void modifiedProject(MdiSubWindow *w);
//@}
//! \name Settings
//@{
void readSettings();
void saveSettings();
void setSaveSettings(bool autoSaving, int min);
void changeAppStyle(const QString& s);
void changeAppFont(const QFont& f);
void updateAppFonts();
void setAppColors(const QColor& wc,const QColor& pc,const QColor& tpc, bool force = false);
QLocale locale(){return d_locale;};
void setLocale(const QLocale& l){d_locale = l;};
void initWindow();
//@}
//! \name Multilayer Plots
//@{
MultiLayer* multilayerPlot(int c, int r, int style);
MultiLayer* multilayerPlot(Table* w, const QStringList& colList, int style, int startRow = 0, int endRow = -1);
//! used when restoring a plot from a project file
MultiLayer* multilayerPlot(const QString& caption, int layers = 1, int rows = 1, int cols = 1);
//! used by the plot wizard
MultiLayer* multilayerPlot(const QStringList& colList);
MultiLayer* waterfallPlot();
MultiLayer* waterfallPlot(Table *t, const QStringList& list);
void connectMultilayerPlot(MultiLayer *g);
void addLayer();
void deleteLayer();
//! Creates a new spectrogram graph
MultiLayer* plotSpectrogram(Matrix *m, Graph::CurveType type);
MultiLayer* plotGrayScale(Matrix *m = 0);
MultiLayer* plotContour(Matrix *m = 0);
MultiLayer* plotColorMap(Matrix *m = 0);
MultiLayer* plotImage(Matrix *m = 0);
MultiLayer* plotNoContourColorMap(Matrix *m = 0);
//! Rearrange the layersin order to fit to the size of the plot window
void autoArrangeLayers();
void initMultilayerPlot(MultiLayer* g, const QString& name = QString());
void polishGraph(Graph *g, int style);
void plot2VerticalLayers();
void plot2HorizontalLayers();
void plot4Layers();
void plotStackedLayers();
void plotStackedHistograms();
//@}
//! \name 3D Data Plots
//@{
Graph3D* newPlot3D();
Graph3D* openMatrixPlot3D(const QString& caption, const QString& matrix_name,
double xl,double xr,double yl,double yr,double zl,double zr);
Graph3D* plotXYZ(Table* table,const QString& zColName, int type);
//when reading from .qti file
Graph3D* dataPlot3D(const QString& caption,const QString& formula,
double xl, double xr, double yl, double yr, double zl, double zr);
Graph3D* openPlotXYZ(const QString& caption,const QString& formula,
double xl, double xr, double yl, double yr, double zl, double zr);
//@}
//! \name Surface Plots
//@{
Graph3D* plotSurface(const QString& formula, double xl, double xr,
double yl, double yr, double zl, double zr, size_t columns = 40, size_t rows = 30);
Graph3D* plotParametricSurface(const QString& xFormula, const QString& yFormula,
const QString& zFormula, double ul, double ur, double vl, double vr,
int columns, int rows, bool uPeriodic, bool vPeriodic);
void connectSurfacePlot(Graph3D *plot);
void newSurfacePlot();
void editSurfacePlot();
void remove3DMatrixPlots(Matrix *m);
void updateMatrixPlots(MdiSubWindow *);
void add3DData();
void change3DData();
void change3DData(const QString& colName);
void change3DMatrix();
void change3DMatrix(const QString& matrix_name);
void insertNew3DData(const QString& colName);
void add3DMatrixPlot();
void insert3DMatrixPlot(const QString& matrix_name);
void initPlot3D(Graph3D *plot);
void customPlot3D(Graph3D *plot);
void setPlot3DOptions();
void plot3DWireframe();
void plot3DHiddenLine();
void plot3DPolygons();
void plot3DWireSurface();
Graph3D* plot3DMatrix(Matrix *m = 0, int style = 5);
void plot3DRibbon();
void plot3DScatter();
void plot3DTrajectory();
void plot3DBars();
//@}
//! \name User-defined Functions
//@{
MultiLayer * newFunctionPlot(QStringList &formulas, double start, double end, int points = 100, const QString& var = "x", int type = 0);
FunctionDialog* functionDialog(Graph* g = NULL);
FunctionDialog* showFunctionDialog();
FunctionDialog* showFunctionDialog(Graph * g, int curve);
void addFunctionCurve();
void clearSurfaceFunctionsList();
void clearParamFunctionsList();
void clearPolarFunctionsList();
void updateFunctionLists(int type, QStringList &formulas);
void updateSurfaceFuncList(const QString& s);
//@}
//! \name Matrices
//@{
//! Creates a new empty matrix
Matrix* newMatrix(int rows = 32, int columns = 32);
//! To be used when opening a project file only!
Matrix* newMatrix(const QString& caption, int r, int c);
Matrix* matrix(const QString& name);
Matrix* convertTableToMatrix();
void convertTableToWorkspace();
void convertTableToMatrixWorkspace();
MantidTable* convertTableToTableWorkspace(Table* t);
Matrix* tableToMatrix(Table* t);
void initMatrix(Matrix* m, const QString& caption);
void transposeMatrix();
void invertMatrix();
void matrixDeterminant();
void flipMatrixVertically();
void flipMatrixHorizontally();
void rotateMatrix90();
void rotateMatrixMinus90();
void viewMatrixImage();
void viewMatrixTable();
void exportMatrix();
void setMatrixGrayScale();
void setMatrixRainbowScale();
void viewMatrixColumnRow();
void viewMatrixXY();
void matrixDirectFFT();
void matrixInverseFFT();
//@}
//! \name Tables
//@{
//! Creates an empty table
Table* newTable();
//! Used when loading a table from a project file
Table* newTable(const QString& caption,int r, int c);
Table* newTable(int r, int c, const QString& name = QString(),const QString& legend = QString());
Table* newTable(const QString& caption, int r, int c, const QString& text);
/**
* \brief Create a Table which is initially hidden; used to return the result of an analysis operation.
*
* @param name :: window name (compare MdiSubWindow::MdiSubWindow)
* @param label :: window label (compare MdiSubWindow::MdiSubWindow)
* @param r :: number of rows
* @param c :: number of columns
* @param text :: tab/newline - seperated initial content; may be empty
*/
Table* newHiddenTable(const QString& name, const QString& label, int r, int c, const QString& text=QString());
Table* table(const QString& name);
Table* convertMatrixToTableDirect();
Table* convertMatrixToTableXYZ();
Table* convertMatrixToTableYXZ();
Table* matrixToTable(Matrix* m, MatrixToTableConversion conversionType = Direct);
QList<MdiSubWindow *> tableList();
//! Returns true if the project contains tables
bool hasTable();
//! Returns a list containing the names of all tables in the project
QStringList tableNames();
void connectTable(Table* w);
void initTable(Table* w, const QString& caption);
void customTable(Table* w);
void customizeTables(const QColor& bgColor,const QColor& textColor,
const QColor& headerColor,const QFont& textFont,
const QFont& headerFont, bool showComments);
void importASCII();
void importASCII(const QStringList& files, int import_mode, const QString& local_column_separator, int local_ignored_lines, bool local_rename_columns,
bool local_strip_spaces, bool local_simplify_spaces, bool local_import_comments, bool update_dec_separators,
QLocale local_separators, const QString& local_comment_string, bool import_read_only, int endLineChar,const QString& sepforloadAscii);
void exportAllTables(const QString& sep, bool colNames, bool colComments, bool expSelection);
void exportASCII(const QString& tableName, const QString& sep, bool colNames, bool colComments, bool expSelection);
//! recalculate selected cells of current table
void recalculateTable();
TableStatistics *newTableStatistics(Table *base, int type, QList<int>,
const QString &caption=QString::null);
//@}
//! \name Graphs
//@{
void setPreferences(Graph* g);
void setSpectrogramTickStyle(Graph* g);
void setGraphDefaultSettings(bool autoscale,bool scaleFonts,bool resizeLayers,bool antialiasing, bool fixedAspectRatio);
void setLegendDefaultSettings(int frame, const QFont& font,
const QColor& textCol, const QColor& backgroundCol);
void setArrowDefaultSettings(double lineWidth, const QColor& c, Qt::PenStyle style,
int headLength, int headAngle, bool fillHead);
void plotL();
void plotP();
void plotLP();
void plotPie();
void plotVerticalBars();
void plotHorizontalBars();
void plotArea();
void plotVertSteps();
void plotHorSteps();
void plotSpline();
void plotVerticalDropLines();
MultiLayer* plotHistogram();
MultiLayer* plotHistogram(Matrix *m);
void plotVectXYXY();
void plotVectXYAM();
void plotBoxDiagram();
/// Create a stem plot from a table and return a string representation of it
QString stemPlot(Table *t = 0, const QString& colName = QString(), int power = 0, int startRow = 0, int endRow = -1);
Note *newStemPlot();
//! Check whether a table is valid for a 3D plot and display an appropriate error if not
bool validFor3DPlot(Table *table);
//! Check whether a table is valid for a 2D plot and display an appropriate error if not
bool validFor2DPlot(Table *table);
//! Generate a new 2D graph
MultiLayer* generate2DGraph(Graph::CurveType type);
//@}
//! \name Image Analysis
//@{
void intensityTable();
void pixelLineProfile();
void loadImage();
void loadImage(const QString& fn);
Matrix* importImage(const QString& = QString());
//@}
//! \name Script Repository Interaction
//@{
void loadScriptRepo();
//@}
//! \name Export and Print
//@{
void exportLayer();
void exportGraph();
void exportAllGraphs();
void exportPDF();
void print();
void printAllPlots();
//@}
QStringList columnsList(Table::PlotDesignation plotType = Table::All);
void undo();
void redo();
//! \name MDI Windows
//@{
MdiSubWindow* clone(MdiSubWindow* w = 0);
void rename();
void renameWindow();
//! Called when the user presses F2 and an item is selected in lv.
void renameWindow(Q3ListViewItem *item, int, const QString &s);
//! Checks weather the new window name is valid and modifies the name.
bool setWindowName(MdiSubWindow *w, const QString &text);
void maximizeWindow(Q3ListViewItem * lbi = 0);
void activateWindow(Q3ListViewItem * lbi);
void maximizeWindow(MdiSubWindow *w);
void minimizeWindow(MdiSubWindow *w = 0);
//! Changes the geometry of the active MDI window
void setWindowGeometry(int x, int y, int w, int h);
void updateWindowStatus(MdiSubWindow* );
bool hidden(QWidget* window);
void closeActiveWindow();
void closeWindow(MdiSubWindow* window);
//! Does all the cleaning work before actually deleting a window!
void removeWindowFromLists(MdiSubWindow* w);
void hideWindow(MdiSubWindow* window);
void hideWindow();
void hideActiveWindow();
void activateWindow();
void activateWindow(MdiSubWindow *, bool activateOuterWindow = true);
bool existsWindow(MdiSubWindow* w) const;
//@}
//! Show about dialog
static void about();
//! Return a version string ("QtiPlot x.y.z")
static QString versionString();
void removeCurves(const QString& name);
QStringList dependingPlots(const QString& caption);
QStringList depending3DPlots(Matrix *m);
QStringList multilayerDependencies(QWidget *w);
std::string windowGeometryInfo(MdiSubWindow *w);
void restoreWindowGeometry(ApplicationWindow *app, MdiSubWindow *w, const QString& s);
void restoreApplicationGeometry();
void resizeActiveWindow();
void resizeWindow();
//! \name List View in Project Explorer
//@{
void setListView(const QString& caption,const QString& view);
void renameListViewItem(const QString& oldName,const QString& newName);
void setListViewDate(const QString& caption,const QString& date);
QString listViewDate(const QString& caption);
void setListViewSize(const QString& caption,const QString& size);
void setListViewLabel(const QString& caption,const QString& label);
//@}
void updateColNames(const QString& oldName, const QString& newName);
void updateTableNames(const QString& oldName, const QString& newName);
void changeMatrixName(const QString& oldName, const QString& newName);
void updateCurves(Table *t, const QString& name);
void showTable(const QString& curve);
void showTable(int i);
void addColToTable();
void cutSelection();
void copySelection();
void copyMarker();
void pasteSelection();
void clearSelection();
void copyActiveLayer();
void newProject();
//! Creates a new empty multilayer plot
MultiLayer* newGraph(const QString& caption = tr("Graph"));
/// Prepares MultiLayer for plotting - creates if necessary, clears, applies initial settings
MultiLayer* prepareMultiLayer(bool& isNew, MultiLayer* window, const QString& newWindowName = "Graph",
bool clearWindow = false);
void openRecentProject(int index);
//@}
//! \name Table Tools
//@{
void sortSelection();
void sortActiveTable();
void normalizeSelection();
void normalizeActiveTable();
void correlate();
void autoCorrelate();
void convolute();
void deconvolute();
void clearTable();
void goToRow();
void goToColumn();
//@}
//! \name Plot Tools
//@{
void newLegend();
void addTimeStamp();
void drawLine();
void drawArrow();
void drawPoints();
void addLabel();
void addImage();
void zoomIn();
void zoomOut();
void setAutoScale();
void showRangeSelectors();
void showCursor();
void showScreenReader();
void pickPointerCursor();
void disableTools();
void selectMultiPeak(bool showFitPropertyBrowser=true);
void selectMultiPeak(MultiLayer* plot, bool showFitPropertyBrowser=true, double xmin=0.0, double xmax=0.0);
void pickDataTool( QAction* action );
void updateLog(const QString& result);
//@}
//! \name Fitting
//@{
void deleteFitTables();
void fitLinear();
void fitSigmoidal();
void fitGauss();
void fitLorentz();
void fitMultiPeak(int profile);
void fitMultiPeakGauss();
void fitMultiPeakLorentz();
//@}
//! \name Calculus
//@{
void integrate();
void differentiate();
void analysis(Analysis operation);
void analyzeCurve(Graph *g, Analysis operation, const QString& curveTitle);
void showDataSetDialog(Analysis operation);
//@}
void addErrorBars();
void defineErrorBars(const QString& name,int type,const QString& percent,int direction,bool drawAll);
void defineErrorBars(const QString& curveName,const QString& errColumnName, int direction);
void removeErrorBars();
void removeErrorBars(const QString& name);
void movePoints();
void removePoints();
//! \name Event Handlers
//@{
void closeEvent( QCloseEvent*);
void timerEvent ( QTimerEvent *e);
void dragEnterEvent( QDragEnterEvent* e );
void dragMoveEvent( QDragMoveEvent* e );//Mantid
void dropEvent( QDropEvent* e );
void customEvent( QEvent* e);
//@}
//! \name Dialogs
//@{
void showFindDialogue();
//! Show plot style dialog for the active MultiLayer / activeGraph / specified curve or the activeGraph options dialog if no curve is specified (curveKey = -1).
void showPlotDialog(int curveKey = -1);
QDialog* showScaleDialog();
QDialog* showPlot3dDialog();
AxesDialog* showScalePageFromAxisDialog(int axisPos);
AxesDialog* showAxisPageFromAxisDialog(int axisPos);
void showAxisDialog();
void showGridDialog();
void showGeneralPlotDialog();
void showResults(bool ok);
void showResults(const QString& s, bool ok=true);
void showTextDialog();
void showLineDialog();
void showTitleDialog();
void showExportASCIIDialog();
void showCurvesDialog();
void showCurveRangeDialog();
CurveRangeDialog* showCurveRangeDialog(Graph *g, int curve);
AssociationsDialog* showPlotAssociations(int curve);
void showAxisTitleDialog();
void showColumnOptionsDialog();
void showRowsDialog();
void showDeleteRowsDialog();
void showColsDialog();
void showColMenu(int c);
void showColumnValuesDialog();
void showGraphContextMenu();
void showTableContextMenu(bool selection);
void showWindowContextMenu();
void customWindowTitleBarMenu(MdiSubWindow *w, QMenu *menu);
void showCurveContextMenu(int curveKey);
void showCurvePlotDialog();
void showCurveWorksheet();
void showCurveWorksheet(Graph *g, int curveIndex);
void showWindowPopupMenu(Q3ListViewItem *it, const QPoint &p, int);
//! Connected to the context menu signal from lv; it's called when there are several items selected in the list
void showListViewSelectionMenu(const QPoint &p);
//! Connected to the context menu signal from lv; it's called when there are no items selected in the list
void showListViewPopupMenu(const QPoint &p);
void showScriptWindow(bool forceVisible = false, bool quitting = false);
void saveScriptWindowGeometry();
void showScriptInterpreter();
void showMoreWindows();
void showMarkerPopupMenu();
void showHelp();
static void showStandAloneHelp();
void chooseHelpFolder();
void showPlotWizard();
void showFitPolynomDialog();
void showIntegrationDialog();
void showInterpolationDialog();
void showExpGrowthDialog();
void showExpDecayDialog();
void showExpDecayDialog(int type);
void showTwoExpDecayDialog();
void showExpDecay3Dialog();
void showRowStatistics();
void showColStatistics();
void showFitDialog();
void showImageDialog();
void showLayerDialog();
void showPreferencesDialog();
void showMatrixDialog();
void showMatrixSizeDialog();
void showMatrixValuesDialog();
void showSmoothSavGolDialog();
void showSmoothFFTDialog();
void showSmoothAverageDialog();
void showSmoothDialog(int m);
void showFilterDialog(int filter);
void lowPassFilterDialog();
void highPassFilterDialog();
void bandPassFilterDialog();
void bandBlockFilterDialog();
void showFFTDialog();
void showColorMapDialog();
//@}
void translateCurveHor();
void translateCurveVert();
//! Removes the curve identified by a key stored in the data() of actionRemoveCurve.
void removeCurve();
void hideCurve();
void hideOtherCurves();
void showAllCurves();
void setCurveFullRange();
void setAscValues();
void setRandomValues();
void setXCol();
void setYCol();
void setZCol();
void setXErrCol();
void setYErrCol();
void setLabelCol();
void disregardCol();
void setReadOnlyCol();
void setReadOnlyColumns();
void setReadWriteColumns();
void swapColumns();
void moveColumnRight();
void moveColumnLeft();
void moveColumnFirst();
void moveColumnLast();
void updateConfirmOptions(bool askTables, bool askMatrixes, bool askPlots2D, bool askPlots3D, bool askNotes,bool askInstrWindow);
//! \name Plot3D Tools
//@{
void toggle3DAnimation(bool on = true);
//! Turns perspective mode on or off
void togglePerspective(bool on = true);
//! Resets rotation of 3D plots to default values
void resetRotation();
//! Finds best layout for the 3D plot
void fitFrameToLayer();
void setFramed3DPlot();
void setBoxed3DPlot();
void removeAxes3DPlot();
void removeGrid3DPlot();
void setHiddenLineGrid3DPlot();
void setLineGrid3DPlot();
void setPoints3DPlot();
void setCrosses3DPlot();
void setCones3DPlot();
void setBars3DPlot();
void setFilledMesh3DPlot();
void setEmptyFloor3DPlot();
void setFloorData3DPlot();
void setFloorIso3DPlot();
void setFloorGrid3DPlot(bool on);
void setCeilGrid3DPlot(bool on);
void setRightGrid3DPlot(bool on);
void setLeftGrid3DPlot(bool on);
void setFrontGrid3DPlot(bool on);
void setBackGrid3DPlot(bool on);
void pickPlotStyle( QAction* action );
void pickCoordSystem( QAction* action);
void pickFloorStyle( QAction* action);
void custom3DActions(MdiSubWindow *w);
void custom3DGrids(int grids);
//@}
//! Updates the recent projects list and menu (but doesn't insert anything)
void updateRecentProjectsList();
//! Inserts file name in the list of recent files (if fname not empty) and updates the "recent files" menu
void updateRecentFilesList(QString fname="");
//! connected to the done(bool) signal of the http object
//void receivedVersionFile(bool error);
//! called when the user presses the actionCheckUpdates
//void searchForUpdates();
//! Open support page in external browser
//void showSupportPage();
//! Open donation page in external browser
//void showDonationsPage();
//! Open QtiPlot homepage in external browser
void showHomePage();
//! Open forums page at berliOS in external browser
//void showForums();
//! Open bug tracking system at berliOS in external browser
void showBugTracker();
//! Show download page in external browser
//void downloadManual();
//! Show translations page in external browser
//void downloadTranslation();
void parseCommandLineArguments(const QStringList& args);
void createLanguagesList();
void switchToLanguage(int param);
void switchToLanguage(const QString& locale);
bool alreadyUsedName(const QString& label);
bool projectHas2DPlots();
//! Returns a pointer to the window named "name"
MdiSubWindow* window(const QString& name);
//! Returns a list with the names of all the matrices in the project
QStringList matrixNames();
/// returns a list of all the mantid matrix objects in the project
QStringList mantidmatrixNames();
//! \name Notes
//@{
//! Creates a new empty note window
Note* newNote(const QString& caption = QString());
void saveNoteAs();
//@}
//! \name Folders
//@{
//! Returns a pointer to the current folder in the project
Folder* currentFolder() const {return d_current_folder;}
//! Adds a new folder to the project
void addFolder();
Folder* addFolder(QString name, Folder* parent = NULL);
//! Deletes the current folder
void deleteFolder();
//! Ask confirmation from user, deletes the folder f if user confirms and returns true, otherwise returns false;
bool deleteFolder(Folder *f);
//! Deletes the currently selected items from the list view #lv.
void deleteSelectedItems();
//! Hides the currently selected windows from the list view #lv.
void hideSelectedWindows();
//! Show the currently selected windows from the list view #lv.
void showSelectedWindows();
//! Sets all items in the folders list view to be desactivated (QPixmap = folder_closed_xpm)
void desactivateFolders();
//! Changes the current folder. Returns true if successfull
bool changeFolder(Folder *newFolder, bool force = false);
//! Changes the current folder when the user changes the current item in the QListView "folders"
void folderItemChanged(Q3ListViewItem *it);
//! Changes the current folder when the user double-clicks on a folder item in the QListView "lv"
void folderItemDoubleClicked(Q3ListViewItem *it);
//! creates and opens the context menu of a folder list view item
/**
* @param it :: list view item
* @param p :: mouse global position
* @param fromFolders: true means that the user clicked right mouse buttom on an item from QListView "folders"
* false means that the user clicked right mouse buttom on an item from QListView "lv"
*/
void showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, bool fromFolders);
//! connected to the SIGNAL contextMenuRequested from the list views
void showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, int);
//! starts renaming the selected folder by creating a built-in text editor
void startRenameFolder();
//! starts renaming the selected folder by creating a built-in text editor
void startRenameFolder(Q3ListViewItem *item);
//! checks weather the new folder name is valid and modifies the name
void renameFolder(Q3ListViewItem *it, int col, const QString &text);
//! forces showing all windows in the current folder and subfolders, depending on the user's viewing policy
void showAllFolderWindows();
//! forces hidding all windows in the current folder and subfolders, depending on the user's viewing policy
void hideAllFolderWindows();
//! hides all windows in folder f
void hideFolderWindows(Folder *f);
//! pops up folder information
void folderProperties();
//! pops up information about the selected window item
void windowProperties();
//! pops up information about the current project
void projectProperties();
//! Pops up a file dialog and invokes appendProject(const QString&) on the result.
void appendProject();
//! Open the specified project file and add it as a subfolder to the parentFolder or to the current folder if no parent folder is specified.
Folder* appendProject(const QString& file_name, Folder* parentFolder = 0);
void saveAsProject();
void saveFolderAsProject(Folder *f);
void saveProjectFile(Folder *folder, const QString& fn, bool compress = false);
//! adds a folder list item to the list view "lv"
void addFolderListViewItem(Folder *f);
//! adds a widget list item to the list view "lv"
void addListViewItem(MdiSubWindow *w);
//! hides or shows windows in the current folder and changes the view windows policy
void setShowWindowsPolicy(int p);
//! returns a pointer to the root project folder
Folder* projectFolder() const;
//! used by the findDialog
void find(const QString& s, bool windowNames, bool labels, bool folderNames,
bool caseSensitive, bool partialMatch, bool subfolders);
//! initializes the list of items dragged by the user
void dragFolderItems(QList<Q3ListViewItem *> items){draggedItems = items;};
//! Drop the objects in the list draggedItems to the folder of the destination item
void dropFolderItems(Q3ListViewItem *dest);
//! moves a folder item to another
/**
* @param src :: source folder item
* @param dest :: destination folder item
*/
void moveFolder(FolderListItem *src, FolderListItem *dest);
//! copies a folder to another
/**
* @param src :: source folder
* @param dest :: destination folder
*/
bool copyFolder(Folder *src, Folder *dest);
void foldersMenuActivated( int id );
//@}
//! \name Scripting
//@{