QtiPlot  0.9.8.2
ApplicationWindow.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : ApplicationWindow.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2004 - 2011 by Ion Vasilief,
6  (C) 2006 - june 2007 Tilman Hoener zu Siederdissen, Knut Franke
7  Email (use @ for *) : ion_vasilief*yahoo.fr
8  Description : QtiPlot's main window
9 
10  ***************************************************************************/
11 
12 /***************************************************************************
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * *
19  * This program is distributed in the hope that it will be useful, *
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22  * GNU General Public License for more details. *
23  * *
24  * You should have received a copy of the GNU General Public License *
25  * along with this program; if not, write to the Free Software *
26  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
27  * Boston, MA 02110-1301 USA *
28  * *
29  ***************************************************************************/
30 #ifndef APPLICATION_H
31 #define APPLICATION_H
32 
33 #include <QMainWindow>
34 #include <q3listview.h>
35 #include <QHttp>
36 #include <QFile>
37 #include <QSplitter>
38 #include <QDesktopServices>
39 #include <QBuffer>
40 #include <QLineEdit>
41 #include <QMessageBox>
42 
43 #include <MultiLayer.h>
44 #include <Graph.h>
45 #include <Table.h>
46 #include <ScriptingEnv.h>
47 #include <Script.h>
48 #include <TranslateCurveTool.h>
49 #include <LinearColorMap.h>
50 
51 #ifdef BROWSER_PLUGIN
52 #include <qtbrowserplugin.h>
53 #endif
54 
55 #ifdef QAXSERVER
56 #include <ActiveQt/QAxBindable>
57 #include <ActiveQt/QAxFactory>
58 #include <qt_windows.h>
59 #endif
60 
61 class QPixmap;
62 class QCloseEvent;
63 class QDropEvent;
64 class QTimerEvent;
65 class QDragEnterEvent;
66 class QTranslator;
67 class QDockWidget;
68 class QAction;
69 class QActionGroup;
70 class QTranslator;
71 class QToolButton;
72 class QShortcut;
73 class QMenu;
74 class QToolBar;
75 class QAssistantClient;
76 class QLocale;
77 class QMdiArea;
78 class QUndoView;
79 class QCompleter;
80 class QFileInfo;
81 
82 class Matrix;
83 class Table;
84 class ScalePicker;
85 class Graph3D;
86 class Note;
87 class FunctionDialog;
88 class Folder;
89 class FolderListItem;
90 class FolderListView;
91 class ScriptWindow;
92 class Plot3DDialog;
93 class TableStatistics;
94 class CurveRangeDialog;
95 class LegendWidget;
96 class ArrowMarker;
97 class TextEditor;
98 class AssociationsDialog;
99 class ScriptEdit;
100 class ExportDialog;
101 class Grid;
102 class ImportExportPlugin;
103 
133 class ApplicationWindow: public QMainWindow, public scripted
134 #ifdef BROWSER_PLUGIN
135  , public QtNPBindable
136 #endif
137 #ifdef QAXSERVER
138  , public QAxBindable
139 #endif
140 {
141  Q_OBJECT
142 
143 #ifdef BROWSER_PLUGIN
144  Q_CLASSINFO("ClassID", "{2e5b2715-46b2-4831-ba9b-6a3b195d5ec8}")
145  Q_CLASSINFO("InterfaceID", "{94581136-3c0c-46cc-97a1-066061356d43}")
146  Q_CLASSINFO("EventsID", "{8c191b77-1894-45c7-9d6b-201dede95410}")
147 
148  Q_CLASSINFO("MIME", "application/x-qtiplot")
149 #endif
150 
151 public:
152  ApplicationWindow(bool factorySettings = false);
153  ApplicationWindow(const QStringList& l);
155 
163 
165  QDockWidget *logWindow;
166 
171  QString generateUniqueName(const QString& name, bool increment = true);
172  void saveFitFunctions(const QStringList& lst);
173 
175 
176  void loadCustomActions();
177  void reloadCustomActions();
178  void removeCustomAction(QAction *);
179  void addCustomAction(QAction *, const QString& parentName, int index = -1);
180  QList<QAction *> customActionsList(){return d_user_actions;};
181  QList<QMenu *> customizableMenusList();
182 
183  void reloadCustomMenus();
184  QMenu* addCustomMenu(const QString& title, const QString& parentName);
185  void removeCustomMenu(const QString& title);
186  QList<QMenu *> customMenusList(){return d_user_menus;};
188 
189  QList<QMenu *> menusList();
190  QList<QToolBar *> toolBarsList();
191 
194  QMdiArea* workspace(){return d_workspace;};
195 
197  void setMatrixUndoStackSize(int size);
198 
199  QString endOfLine();
200  static QString guessEndOfLine(const QString& sample);
202  void setAutoUpdateTableValues(bool on = true);
203 
204  QCompleter* completer(){return d_completer;};
205  void enableCompletion(bool on = true);
207 
209  void setClipboardLocale(const QLocale& locale){d_clipboard_locale = locale;};
210 
211  QTextEdit *resultsLog(){return results;};
212 #ifdef SCRIPTING_CONSOLE
213  QTextEdit *scriptingConsole(){return console;};
214 #endif
215 
216  static QString imageFilter();
217  static QString getFileName(QWidget *parent = 0, const QString & caption = QString(),
218  const QString & dir = QString(), const QString & filter = QString(),
219  QString * selectedFilter = 0, bool save = true, bool confirmOverwrite = true);
220 
221  static void memoryAllocationError();
222  QColor readColorFromProject(const QString& name);
223 
224  void enableMdiArea(bool on = true);
226 
227  void displayInfo(const QString& text){info->setText(text);};
228  QLineEdit *infoLineEdit(){return info;};
229 
230  QList<QColor> indexedColors(){return d_indexed_colors;};
231  void setIndexedColors(const QList<QColor>& lst){d_indexed_colors = lst;};
232 
233  QList<int> indexedSymbols(){return d_symbols_list;};
234  void setIndexedSymbols(const QList<int>& lst){d_symbols_list = lst;};
235 
236  QStringList indexedColorNames(){return d_indexed_color_names;};
237  void setIndexedColorNames(const QStringList& lst){d_indexed_color_names = lst;};
238 
240 
242 
243  ImportExportPlugin* exportPlugin(const QString& suffix);
244  ImportExportPlugin* importPlugin(const QString& fileName);
246 
247  bool isFileReadable(const QString&);
248 #ifdef Q_OS_WIN
249  bool importUsingExcel();
250  bool isExcelInstalled(){return d_has_excel;};
251 #endif
252 
255 
256  void showNoDataMessage();
257 
258 public slots:
260 
261  void open();
262  ApplicationWindow* open(const QString& fn, bool factorySettings = false, bool newProject = true);
263  ApplicationWindow* openProject(const QString& fn, bool factorySettings = false, bool newProject = true);
264  ApplicationWindow* importOPJ(const QString& fn, bool factorySettings = false, bool newProject = true);
265  void closeProject();
266 
274  ApplicationWindow * plotFile(const QString& fn);
275 
282  ApplicationWindow * loadScript(const QString& fn, bool execute = false, bool noGui = false);
283 
284  QList<MdiSubWindow *> windowsList();
285  QStringList windowsNameList();
290  void cascade();
291 
292  void saveProjectAs(const QString& fileName = QString(), bool compress = false);
293  bool saveProject(bool compress = false);
294  void saveWindowAs(const QString& fileName = QString(), bool compress = false);
295  bool saveWindow(MdiSubWindow *w, const QString& fileName = QString(), bool compress = false);
296 
298  void modifiedProject();
300  void savedProject();
302  void modifiedProject(MdiSubWindow *w);
304 
306 
307  void setDefaultOptions();
308  void readSettings();
309  void saveSettings();
310  void setSaveSettings(bool autoSaving, int min);
311  void changeAppStyle(const QString& s);
312  void changeAppFont(const QFont& f);
313  void updateAppFonts();
314  void setAppColors(const QColor& wc,const QColor& pc,const QColor& tpc, bool force = false);
315 
316  void initWindow();
318 
320 
321  MultiLayer* newGraph(const QString& caption = tr("Graph") + "1");
323  MultiLayer* multilayerPlot(int c, int r, int style, const MultiLayer::AlignPolicy& align = MultiLayer::AlignLayers);
324  MultiLayer* multilayerPlot(Table* w, const QStringList& colList, int style, int startRow = 0, int endRow = -1);
326  MultiLayer* multilayerPlot(const QString& caption, int layers = 1, int rows = 1, int cols = 1);
328  MultiLayer* waterfallPlot(Table *t, const QStringList& list);
330  void addLayer();
331  void addInsetLayer(bool curves = false);
332  void addInsetCurveLayer();
333  void deleteLayer();
334  void extractGraphs();
335  void extractLayers();
336 
340  MultiLayer* plotContour(Matrix *m = 0);
341  MultiLayer* plotColorMap(Matrix *m = 0);
342  MultiLayer* plotImage(Matrix *m = 0);
344 
346  void autoArrangeLayers();
347  void initMultilayerPlot(MultiLayer* g, const QString& name = QString());
348  void plot2VerticalLayers();
349  void plot2HorizontalLayers();
350  void plot4Layers();
351  void plotStackedLayers();
352  void plotStackedHistograms();
353 
357  void plotSharedAxesLayers();
358  void plotCustomLayout(bool sharedAxes = false);
361 
363 
364  Graph3D* newPlot3D(const QString& title = QString());
365  Graph3D* plotXYZ(Table* table,const QString& zColName, int type);
367 
369 
370  Graph3D* plotSurface(const QString& formula, double xl, double xr,
371  double yl, double yr, double zl, double zr, int columns = 40, int rows = 30);
372  Graph3D* plotParametricSurface(const QString& xFormula, const QString& yFormula,
373  const QString& zFormula, double ul, double ur, double vl, double vr,
374  int columns, int rows, bool uPeriodic, bool vPeriodic);
375 
376  void connectSurfacePlot(Graph3D *plot);
377  void newSurfacePlot();
378  void editSurfacePlot();
379  void remove3DMatrixPlots(Matrix *m);
380  void updateMatrixPlots(Matrix *);
381  void add3DData();
382  void change3DData();
383  void change3DData(const QString& colName);
384  void change3DMatrix();
385  void change3DMatrix(const QString& matrix_name);
386  void insertNew3DData(const QString& colName);
387  void add3DMatrixPlot();
388  void insert3DMatrixPlot(const QString& matrix_name);
389 
390  void plot3DWireframe();
391  void plot3DHiddenLine();
392  void plot3DPolygons();
393  void plot3DWireSurface();
394 
395  Graph3D* plot3DMatrix(Matrix *m = 0, int style = 5);
396 
397  void plot3DRibbon();
398  void plot3DScatter();
399  void plot3DTrajectory();
400  void plot3DBars();
402 
404 
405  MultiLayer * newFunctionPlot(QStringList &formulas, double start, double end, int points = 100, const QString& var = "x", int type = 0);
406 
408  FunctionDialog* showFunctionDialog(Graph * g, int curve);
409  void addFunctionCurve();
410  void clearLogInfo();
411  void updateFunctionLists(int type, QStringList &formulas);
412  void updateSurfaceFuncList(const QString& s);
414 
416 
417  Matrix* newMatrix(int rows = 32, int columns = 32);
420  Matrix* newMatrix(const QString& caption, int r, int c);
421  Matrix* matrix(const QString& name);
424  Matrix* tableToMatrixRegularXYZ(Table* t = 0, const QString& colName = QString::null);
425 #ifdef HAVE_ALGLIB
426  void convertTableToMatrixRandomXYZ();
427  void expandMatrix();
428  void shrinkMatrix();
429  void smoothMatrix();
430  void showMatrixResamplingDialog(bool shrink = false);
431 #endif
432  void showBinMatrixDialog();
433  void initMatrix(Matrix* m, const QString& caption);
434  void transposeMatrix();
435  void invertMatrix();
436  void matrixDeterminant();
437  void flipMatrixVertically();
438  void flipMatrixHorizontally();
439  void rotateMatrix90();
440  void rotateMatrixMinus90();
441  void viewMatrixImage();
442  void viewMatrixTable();
443  void exportMatrix(const QString& exportFilter = QString::null);
444  void setMatrixDefaultScale();
445  void setMatrixGrayScale();
446  void setMatrixRainbowScale();
447  void viewMatrixColumnRow();
448  void viewMatrixXY();
449  void matrixDirectFFT();
450  void matrixInverseFFT();
452 
454 
455  Table* newTable();
457 
458  // getCurrent... functions for python interface
459  Table* currentTable();
461  Note* currentNote();
463 
465  Table* newTable(const QString& caption,int r, int c);
466  Table* newTable(int r, int c, const QString& name = QString(),const QString& legend = QString());
476  Table* newHiddenTable(const QString& name, const QString& label, int r, int c, const QString& text=QString());
477  Table* table(const QString& name);
482  QList<MdiSubWindow *> tableList();
484  bool hasTable();
486  QStringList tableNames();
487 
488  void connectTable(Table* w);
489  void initTable(Table* w, const QString& caption);
490  void customTable(Table* w);
491  Table* importOdfSpreadsheet(const QString& = QString::null, int sheet = -1);
492  Table* importExcel(const QString& = QString::null, int sheet = -1);
493  void exportExcel();
494  void exportOds();
495 
496  Table* importDatabase(const QString& = QString::null, int sheet = -1);
498  void importASCII(const QString& fileName = QString::null);
499  void importASCII(const QStringList& files, int import_mode, const QString& local_column_separator, int local_ignored_lines, bool local_rename_columns,
500  bool local_strip_spaces, bool local_simplify_spaces, bool local_import_comments,
501  QLocale local_separators, const QString& local_comment_string, bool import_read_only, int endLineChar,
502  const QList<int>& colTypes = QList<int>(), const QStringList& colFormats = QStringList());
503  void exportAllTables(const QString& dir, const QString& filter, const QString& sep, bool colNames, bool colComments, bool expSelection);
504 
506  void recalculateTable();
507 
508  TableStatistics *newTableStatistics(Table *base, int type, QList<int>, int start = 0, int end = -1, const QString &caption = QString::null);
510 
512 
513  void setPreferences(Graph* g);
514  void setGraphDefaultSettings(bool autoscale,bool scaleFonts,bool resizeLayers,bool antialiasing);
515  void setArrowDefaultSettings(double lineWidth, const QColor& c, Qt::PenStyle style,
516  int headLength, int headAngle, bool fillHead);
517 
518  void plotL();
519  void plotP();
520  void plotLP();
521  void plotPie();
522  void plotVerticalBars();
523  void plotHorizontalBars();
524  void plotStackBar();
525  void plotStackColumn();
526  void plotArea();
527  void plotVertSteps();
528  void plotHorSteps();
529  void plotSpline();
530  void plotVerticalDropLines();
533  void plotVectXYXY();
534  void plotVectXYAM();
535  void plotBox();
536  void plotDoubleYAxis();
537  void zoomRectanglePlot();
538  QString stemPlot(Table *t = 0, const QString& colName = QString(), int power = 0, int startRow = 0, int endRow = -1);
539  Note *newStemPlot();
540 
542  bool validFor3DPlot(Table *table);
548 
550 
551  void intensityTable();
552  void pixelLineProfile();
553  void loadImage();
554  void loadImage(const QString& fn);
555  Matrix* importImage(const QString& = QString(), bool newWindow = false);
557 
559 
560  void exportLayer();
561  void exportGraph(const QString& exportFilter = QString::null);
562  void exportAllGraphs();
563 #if QT_VERSION >= 0x040500
564  void exportPresentationODF();
565 #endif
566  void exportPDF();
567  void print();
568  void printPreview();
569  void setPrintPreviewOptions(QPrinter *);
570  void printAllPlots();
572 
573  QStringList columnsList(Table::PlotDesignation plotType = Table::All);
574 
575  void undo();
576  void redo();
577 
579 
581  void rename();
582  void renameWindow();
583 
585  void renameWindow(Q3ListViewItem *item, int, const QString &s);
586 
588  bool setWindowName(MdiSubWindow *w, const QString &text);
589 
590  void maximizeWindow(Q3ListViewItem * lbi = 0);
591  void maximizeWindow(MdiSubWindow *w);
592  void minimizeWindow(MdiSubWindow *w = 0);
593 
595 
596  bool hidden(QWidget* window);
597  void closeActiveWindow();
599 
602 
604  void hideWindow();
605  void hideActiveWindow();
606  void activateWindow();
609 
611  static QMessageBox* about(bool dialog = true);
613  static QString versionString();
614  void removeCurves(const QString& name);
615  QStringList dependingPlots(const QString& caption);
616  QStringList depending3DPlots(Matrix *m);
617  QStringList multilayerDependencies(QWidget *w);
618 
619  void saveAsTemplate(MdiSubWindow* w = 0, const QString& = QString());
620  void openTemplate();
621  MdiSubWindow* openTemplate(const QString& fn);
622 
623  QString windowGeometryInfo(MdiSubWindow *w);
624  static void restoreWindowGeometry(ApplicationWindow *app, MdiSubWindow *w, const QString s);
626  void resizeActiveWindow();
627  void resizeWindow();
628 
630 
631  void setListView(const QString& caption,const QString& view);
632  void renameListViewItem(const QString& oldName,const QString& newName);
633  void setListViewDate(const QString& caption,const QString& date);
634  QString listViewDate(const QString& caption);
635  void setListViewSize(const QString& caption,const QString& size);
636  void setListViewLabel(const QString& caption,const QString& label);
638 
639  void updateColNames(const QString& oldName, const QString& newName);
640  void updateTableNames(const QString& oldName, const QString& newName);
641  void changeMatrixName(const QString& oldName, const QString& newName);
642  void updateCurves(Table *t, const QString& name);
643 
644  void showTable(Table *, const QString& curve);
645  void showTable(int i);
646 
647  void addColToTable();
648  void cutSelection();
649  void copySelection();
650  void copyMarker();
651  void pasteSelection();
652  void clearSelection();
653  void copyActiveLayer();
654 
655  void newProject();
656 
658 
659  Matrix* openMatrix(ApplicationWindow* app, const QStringList &flist);
660  Table* openTable(ApplicationWindow* app, const QStringList &flist);
661  TableStatistics* openTableStatistics(const QStringList &flist);
662  Graph* openGraph(ApplicationWindow* app, MultiLayer *plot, const QStringList &list);
663 
664  void openRecentProject(int index);
666 
668 
669  void sortSelection();
670  void sortActiveTable();
671  void normalizeSelection();
672  void normalizeActiveTable();
673  void correlate();
674  void autoCorrelate();
675  void convolute();
676  void deconvolute();
677  void clearTable();
678  void goToRow();
679  void goToColumn();
680  void moveTableRowUp();
681  void moveTableRowDown();
682  void adjustColumnWidth();
684  void showStudentTestDialog(bool twoSamples = false);
686  void testNormality();
687 #ifdef HAVE_TAMUANOVA
688  void showANOVADialog(bool twoWay = false);
689  void showTwoWayANOVADialog(){return showANOVADialog(true);};
690 #endif
691 
692 
694 
696  void lowerActiveEnrichment();
697  void raiseActiveEnrichment(bool = true);
698  void alignTop();
699  void alignBottom();
700  void alignLeft();
701  void alignRight();
702  void newLegend();
703  void addTimeStamp();
704  void drawLine();
705  void drawArrow();
706  void drawPoints();
707  void addText();
708  void addTexFormula();
709  void addRectangle();
710  void addEllipse();
711  void addImage();
712  void zoomIn();
713  void zoomOut();
714  void magnify(int mode = 0);
715  void setAutoScale();
716  void showRangeSelectors();
717  void showCursor();
718  void showScreenReader();
719  void pickPointerCursor();
720  void disableTools();
721  void pickDataTool( QAction* action );
722 
723  void updateLog(const QString& result);
725 
727 
728  void deleteFitTables();
729  void fitLinear();
730  void fitSigmoidal();
731  void fitGauss();
732  void fitLorentz();
733  void fitMultiPeak(int profile);
734  void fitMultiPeakGauss();
735  void fitMultiPeakLorentz();
736  void fitSlope();
738 
740 
741  void integrate();
742  void differentiate();
743  void analysis(Analysis operation);
744  void analyzeCurve(Graph *g, QwtPlotCurve *c, Analysis operation);
745  void showDataSetDialog(Analysis operation);
747 
748  void addErrorBars();
749  void movePoints(bool wholeCurve = false);
750  void removePoints();
751 
753 
754  void closeEvent( QCloseEvent*);
755  void timerEvent ( QTimerEvent *e);
756  void dragEnterEvent( QDragEnterEvent* e );
757  void dropEvent( QDropEvent* e );
758  void customEvent( QEvent* e);
759 #ifdef Q_WS_MAC
760  void hideEvent (QHideEvent *);
761 #endif
762 
763 
765 
766  void showFindDialogue();
768  void showPlotDialog(int curveKey = -1);
769  QDialog* showScaleDialog();
770  QDialog* showPlot3dDialog();
773  void showAxisDialog();
774  void showGridDialog();
775  void showGeneralPlotDialog();
776  void showResults(bool ok);
777  void showResults(const QString& s, bool ok=true);
778  void showEnrichementDialog();
779  void showLineDialog();
780  void showTitleDialog();
782  void showCurvesDialog();
783  void showCurveRangeDialog();
786 
787  void showAxisTitleDialog();
789  void showRowsDialog();
790  void showDeleteRowsDialog();
791  void showColsDialog();
792  void showColMenu(int c);
793  void showColumnValuesDialog();
794  void showExtractDataDialog();
795 
796  void showGraphContextMenu();
797  void showTableContextMenu(bool selection);
798  void showWindowContextMenu();
799  void customWindowTitleBarMenu(MdiSubWindow *w, QMenu *menu);
800  void showCurveContextMenu(QwtPlotItem *);
801  void showCurvePlotDialog();
802  void showCurveWorksheet();
803  void showCurveWorksheet(Graph *g, int curveIndex);
804  void showWindowPopupMenu(Q3ListViewItem *it, const QPoint &p, int);
805 
807  void showListViewSelectionMenu(const QPoint &p);
808 
810  void showListViewPopupMenu(const QPoint &p);
811 
812  void showScriptWindow(bool parent = true);
813  void showMoreWindows();
814  void showMarkerPopupMenu();
815  void showHelp();
816  static void showStandAloneHelp();
817  void chooseHelpFolder();
818  void showPlotWizard();
819  void showFitPolynomDialog();
823  void showExpGrowthDialog();
824  void showExpDecayDialog();
825  void showExpDecayDialog(int type);
826  void showTwoExpDecayDialog();
827  void showExpDecay3Dialog();
828  void showRowStatistics();
829  void showColStatistics();
830  void showFitDialog();
831  void showLayerDialog();
832  void showPreferencesDialog();
833  void showMatrixDialog();
834  void showMatrixSizeDialog();
835  void showMatrixValuesDialog();
836  void showSmoothSavGolDialog();
837  void showSmoothFFTDialog();
839  void showSmoothLowessDialog();
840  void showSmoothDialog(int m);
841  void showFilterDialog(int filter);
842  void lowPassFilterDialog();
843  void highPassFilterDialog();
844  void bandPassFilterDialog();
845  void bandBlockFilterDialog();
846  void showFFTDialog();
847  void showColorMapDialog();
849 
850  void baselineDialog();
851  void subtractReferenceData();
852  void subtractStraightLine();
853  void translateCurveHor();
855 
857  void removeCurve();
858  void hideCurve();
859  void hideOtherCurves();
860  void showAllCurves();
861  void setCurveFullRange();
862 
863  void setAscValues();
864  void setRandomValues();
865  void setNormalRandomValues();
866  void setXCol();
867  void setYCol();
868  void setZCol();
869  void setXErrCol();
870  void setYErrCol();
871  void setLabelCol();
872  void disregardCol();
873  void setReadOnlyCol();
874  void setReadOnlyColumns();
875  void setReadWriteColumns();
876  void swapColumns();
877  void moveColumnRight();
878  void moveColumnLeft();
879  void moveColumnFirst();
880  void moveColumnLast();
881 
882  void updateConfirmOptions(bool askTables, bool askMatrixes, bool askPlots2D, bool askPlots3D, bool askNotes);
883 
885 
886  void toggle3DAnimation(bool on = true);
888  void togglePerspective(bool on = true);
890  void resetRotation();
892  void fitFrameToLayer();
893  void setFramed3DPlot();
894  void setBoxed3DPlot();
895  void removeAxes3DPlot();
896  void removeGrid3DPlot();
898  void setLineGrid3DPlot();
899  void setPoints3DPlot();
900  void setCrosses3DPlot();
901  void setCones3DPlot();
902  void setBars3DPlot();
903  void setFilledMesh3DPlot();
904  void setEmptyFloor3DPlot();
905  void setFloorData3DPlot();
906  void setFloorIso3DPlot();
907  void setFloorGrid3DPlot(bool on);
908  void setCeilGrid3DPlot(bool on);
909  void setRightGrid3DPlot(bool on);
910  void setLeftGrid3DPlot(bool on);
911  void setFrontGrid3DPlot(bool on);
912  void setBackGrid3DPlot(bool on);
913  void pickPlotStyle( QAction* action );
914  void pickCoordSystem( QAction* action);
915  void pickFloorStyle( QAction* action);
916  void custom3DActions(QMdiSubWindow *w);
917  void custom3DGrids(int grids);
919 
920  void updateRecentProjectsList(const QString& fn = QString::null);
921 
923  void receivedVersionFile(bool error);
925  void searchForUpdates();
926  void showDonationDialog();
928  void showSupportPage();
930  void showDonationsPage();
932  void showHomePage();
934  void showForums();
936  void showBugTracker();
938  void downloadManual();
940  void downloadTranslation();
942  void showDemoVersionMessage();
943  void showProVersionMessage();
944 
945  void parseCommandLineArguments(const QStringList& args);
946  void createLanguagesList();
947  void switchToLanguage(int param);
948  void switchToLanguage(const QString& locale);
949 
950  bool alreadyUsedName(const QString& label);
951  bool projectHas2DPlots();
952 
954  MdiSubWindow* window(const QString& name, bool label = false);
955 
957  QStringList matrixNames();
958 
960 
961  Note* newNote(const QString& caption = QString());
963  Note* openNote(ApplicationWindow* app, const QStringList &flist);
964  void saveNoteAs();
965  void showNoteLineNumbers(bool show = true);
966  void increaseNoteIndent();
967  void decreaseNoteIndent();
968  void noteFindDialogue();
969  void noteFindNext();
970  void noteFindPrev();
971  void noteReplaceDialogue();
972  void renameCurrentNoteTab();
973  void addNoteTab();
974  void closeNoteTab();
975  void execute();
976  void executeAll();
977  void evaluate();
978  void commentSelection();
979  void uncommentSelection();
981 
983 
984  Folder* currentFolder(){return current_folder;};
987  void addFolder();
988  Folder* addFolder(QString name, Folder* parent = NULL);
990  void deleteFolder();
991 
993  bool deleteFolder(Folder *f);
994 
996  void deleteSelectedItems();
998  void hideSelectedWindows();
1000  void showSelectedWindows();
1001 
1003  void desactivateFolders();
1004 
1006  bool changeFolder(Folder *newFolder, bool force = false);
1007 
1009  void folderItemChanged(Q3ListViewItem *it);
1011  void folderItemDoubleClicked(Q3ListViewItem *it);
1012 
1014 
1020  void showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, bool fromFolders);
1021 
1023  void showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, int);
1024 
1026  void startRenameFolder();
1027 
1029  void startRenameFolder(Q3ListViewItem *item);
1030 
1032  void renameFolder(Q3ListViewItem *it, int col, const QString &text);
1033 
1035  void showAllFolderWindows();
1036 
1038  void hideAllFolderWindows();
1039 
1041  void hideFolderWindows(Folder *f);
1042 
1044  void folderProperties();
1045 
1047  void windowProperties();
1048 
1050  void projectProperties();
1051 
1053  void appendProject();
1055  Folder* appendProject(const QString& file_name, Folder* parentFolder = 0);
1056  void saveAsProject();
1057  void saveFolderAsProject(Folder *f);
1058  void saveFolder(Folder *folder, const QString& fn, bool compress = false);
1059 
1061  void addFolderListViewItem(Folder *f);
1062 
1064  void addListViewItem(MdiSubWindow *w);
1065 
1067  void setShowWindowsPolicy(int p);
1068 
1070  Folder* projectFolder();
1071 
1073  void find(const QString& s, bool windowNames, bool labels, bool folderNames,
1074  bool caseSensitive, bool partialMatch, bool subfolders);
1075 
1077  void dragFolderItems(QList<Q3ListViewItem *> items){draggedItems = items;};
1078 
1080  void dropFolderItems(Q3ListViewItem *dest);
1081 
1083 
1087  void moveFolder(FolderListItem *src, FolderListItem *dest);
1089 
1093  bool copyFolder(Folder *src, Folder *dest);
1094 
1095  void foldersMenuActivated( int id );
1097 
1099 
1100  void scriptError(const QString &message, const QString &scriptName, int lineNumber);
1103  void executeNotes();
1105  void showScriptingLangDialog();
1107  void restartScriptingEnv();
1109  void scriptPrint(const QString &text);
1111  bool setScriptingLanguage(const QString &lang, bool force=false);
1112 
1113  void scriptsDirPathChanged(const QString& path);
1115 
1116  void showToolBarsMenu();
1117  void setFormatBarFont(const QFont &);
1118  void setFormatBarColor(const QColor&);
1119 
1120 signals:
1121  void modified();
1122 
1123 private:
1125 
1126  void init(bool factorySettings = false);
1127  void initCompleter();
1128  void createActions();
1129  void initMainMenu();
1130  void initToolBars();
1131  void initPlot3DToolBar();
1132  void initPlot3D(Graph3D *plot);
1133  void insertTranslatedStrings();
1134  void translateActionsStrings();
1136  virtual QMenu * createPopupMenu(){return NULL;};
1137  void updateCompleter(const QString& windowName, bool remove = false, const QString& newName = QString::null);
1138  QMessageBox::StandardButton showSaveProjectMessage();
1139  QString getSaveProjectName(const QString& fileName, bool *compress = 0, int scope = 0);
1140  void goToParentFolder();
1141  bool isProjectFile(const QString& fn);
1142  void initSearchForUpdates();
1143 
1144 private slots:
1145  void addColumnNameToCompleter(const QString& colName, bool remove = false);
1146  void removeColumnNameFromCompleter(const QString& colName){addColumnNameToCompleter(colName, true);};
1147 
1148  void disableActions();
1149  void customColumnActions();
1150  void disableToolbars();
1151  void customToolBars(QMdiSubWindow* w);
1152  void customMenu(QMdiSubWindow* w);
1153  void windowActivated(QMdiSubWindow *w);
1154  void custom2DPlotTools(MultiLayer *);
1155  void updateExplorerWindowLayout(Qt::DockWidgetArea);
1156 
1157  void analysisMenuAboutToShow();
1158  void scriptingMenuAboutToShow();
1159  void fileMenuAboutToShow();
1160  void editMenuAboutToShow();
1161  void matrixMenuAboutToShow();
1162  void plotMenuAboutToShow();
1163  void plotDataMenuAboutToShow();
1164  void tableMenuAboutToShow();
1165  void windowsMenuAboutToShow();
1166  void windowsMenuActivated( int id );
1167 
1169 
1170  void enableTextEditor(Graph *g);
1171  void setFontSize(int);
1172  void setFontFamily(const QFont &);
1173  void setItalicFont(bool);
1174  void setBoldFont(bool);
1175  void insertSuperscript();
1176  void insertSubscript();
1177  void underline();
1178  void insertGreekSymbol();
1179  void insertGreekMajSymbol();
1180  void insertMathSymbol();
1181  void setTextColor();
1183 
1184  void showCustomActionDialog();
1185  void performCustomAction(QAction *);
1186 
1187  void hideSelectedColumns();
1188  void showAllColumns();
1190 
1191  void increasePrecision();
1192  void decreasePrecision();
1193 
1194 #ifdef SCRIPTING_PYTHON
1195  void openQtDesignerUi();
1196  void executeStartupScripts();
1197 #endif
1198 
1199 // TODO: a lot of this stuff should be private
1200 public:
1224  QPrinter::PaperSize d_print_paper_size;
1225  QPrinter::Orientation d_printer_orientation;
1233  QString d_java_path;
1308 
1311 
1314 
1317 
1319 
1322 
1325 
1328 
1333  enum {MaxRecentProjects = 10};
1336 
1338 
1345 
1347  QString templatesDir;
1353 
1354  QVector<bool> d_show_axes;
1357  QVector<bool> d_show_axes_labels;
1377  QFont appFont;
1384  QStringList recentProjects;
1385  bool saved;
1386  QStringList locales;
1387  QStringList d_recent_functions; //user-defined functions;
1388  QStringList xFunctions, yFunctions, rFunctions, thetaFunctions; // user functions for parametric and polar plots
1389  QStringList surfaceFunc; //user-defined surface functions;
1390  QStringList d_param_surface_func; //user-defined parametric surface functions;
1392  QStringList renamedTables;
1393 
1395 
1399 
1402 
1405 
1409 
1411 
1425 
1426  void setPlot3DOptions();
1428 
1429 private:
1430  void loadPlugins();
1431  QList<ImportExportPlugin *> d_import_export_plugins;
1432 
1436  // Flag telling if table values should be automatically recalculated when values in a column are modified.
1439 
1441  int convertOldToNewColorIndex(int cindex);
1442 
1444  QList<Q3ListViewItem *> draggedItems;
1445 
1447  QHttp *http;
1450 
1452  QSplitter *explorerSplitter;
1453 
1454  QAssistantClient *assistant;
1456  QTranslator *appTranslator, *qtTranslator;
1458  QTextEdit *results;
1459 #ifdef SCRIPTING_CONSOLE
1460  QDockWidget *consoleWindow;
1461  QTextEdit *console;
1462 #endif
1463  QMdiArea *d_workspace;
1464 
1467  QToolButton *btnResults;
1468  QWidgetList *hiddenWindows;
1469  QLineEdit *info;
1471  QCompleter *d_completer;
1472 
1477 
1489 #ifdef SCRIPTING_CONSOLE
1490  QAction *actionShowConsole;
1491 #endif
1492 #ifdef SCRIPTING_PYTHON
1493  QAction *actionOpenQtDesignerUi, *actionCommentSelection, *actionUncommentSelection;
1494 #endif
1516 #ifdef HAVE_ALGLIB
1517  QAction *actionConvertTableRandomXYZ, *actionExpandMatrix, *actionShrinkMatrix, *actionSmoothMatrix;
1518 #endif
1556  QAction *Box, *Frame, *None;
1560  QActionGroup *coord, *floorstyle, *grids, *plotstyle, *dataTools;
1563 #if QT_VERSION >= 0x040500
1564  QAction *actionPresentationODF;
1565 #endif
1573 
1574  QList<QAction *> d_user_actions;
1575  QUndoView *d_undo_view;
1576  QList<QMenu *> d_user_menus;
1577 
1578  QList<QColor> d_indexed_colors;
1580  QList<int> d_symbols_list;
1581 #ifdef HAVE_TAMUANOVA
1582  QAction *actionOneWayANOVA, *actionTwoWayANOVA;
1583 #endif
1584 #ifdef Q_OS_WIN
1585  void detectExcel();
1586  bool d_has_excel;
1587 #endif
1589 };
1590 #endif