operations.h

Go to the documentation of this file.
00001 /* Copyright (C) 2006 P.L. Lucas
00002  *
00003  * This program is free software; you can redistribute it and/or modify
00004  * it under the terms of the GNU General Public License as published by
00005  * the Free Software Foundation; either version 2 of the License, or
00006  * (at your option) any later version.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  * GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program; if not, write to the Free Software
00015  * Foundation, Inc., 59 Temple Place, Suite 330, 
00016  * Boston, MA 02111-1307, USA. 
00017  */
00018 
00019 #ifndef __OPERATIONS_H__
00020 #define __OPERATIONS_H__
00021 #include "mainwindow.h"
00022 #include "octave_connection.h"
00023 #include "basewidget.h"
00024 #include "table.h"
00025 #include <QDialog>
00026 #include <QLineEdit>
00027 #include <QTreeWidget>
00028 #include <QComboBox>
00029 #include <QCheckBox>
00030 
00031 
00032 /**This class is used to show plots menus.
00033  */
00034 class Plot:public QDialog
00035 {
00036         Q_OBJECT
00037         public:
00038         /**Menu type.*/
00039         enum Type {PLOT,SEMILOGY, SEMILOGX, LOGLOG, POLAR};
00040         Plot(QWidget *parent=0, Plot::Type type=PLOT);
00041         /**Command to send to Octave.
00042          * @return QString representing command. This command is used by Octave to plot.
00043          */
00044         QString command();
00045         
00046         private:
00047         QLineEdit *x_lineedit, *y_lineedit, *title_lineedit;
00048         QVBoxLayout *vlayout;
00049         QComboBox *style_combo, *color_combo, *pointStyle_combo;
00050         QTreeWidget *plots_tree;
00051         QCheckBox *no_title;
00052         Plot::Type type;
00053         
00054         public slots:
00055         void add_callback();
00056         void remove_callback();
00057         void copy_clipboard_callback();
00058 };
00059 
00060 
00061 /*
00062 Muestra asistentes para realizar operaciones básicas con octave. 
00063 */
00064 
00065 class Operations:public QObject
00066 {
00067         Q_OBJECT
00068         public:
00069         Operations( QObject * parent = 0, BaseWidget **active_widget=0, MainWindow *main_window=0 );
00070         void setOctaveConnection(OctaveConnection *octave_connection);
00071         void setMatrix(QString matrix);
00072         private:
00073         OctaveConnection *octave_connection;
00074         QString matrix;
00075         BaseWidget **active_widget;
00076         MainWindow *main_window;
00077         enum MenuResult {ACCEPTED, COPY_CLIPBOARD, CANCEL}; //Se usa para saber el tipo de salida de un menú
00078         bool copy_clipboard_ok;
00079         /**Shows simple dialog with one label and line edit.
00080          * @param title Dialog title.
00081          * @param label Dialog label.
00082          * @param input Value of line edit
00083          * @return true if user press ok button.
00084          */
00085         bool input_dialog(QString title, QString label, QString &input);
00086         /**Shows simple dialog with one label and line edit, and executes _command with line edit value.
00087          * @param title Dialog title.
00088          * @param label Dialog label.
00089          * @param _command Command to execute.
00090          * @return true if user press ok button.
00091          */
00092         void simple_comand(QString title, QString label, QString _command);
00093         /**Shows dialog with labels and line edits.
00094          * @param title Dialog title.
00095          * @param parameters_labels Dialog labels for input parameters.
00096          * @param parameters Value of line edits for input parameters.
00097          * @param output_labels Dialog labels for output parameters.
00098          * @param output Value of line edits for output parameters.
00099          * @param help Html text with help.
00100          * @param accept_blank_parameters If user lefts parameters in blank, this option lets them. Otherwise function returns CANCEL.
00101          * @return Result of dialog.
00102          */
00103         MenuResult menu_window(QString title, QStringList parameters_labels, QStringList &parameters, QStringList output_labels, QStringList &output, QString help=QString(), bool accept_blank_parameters=false);
00104         /**Shows dialog with labels and line edits, and executes _command with line edit value..
00105          * @param title Dialog title.
00106          * @param _command Command to execute.
00107          * @param parameters_labels Dialog labels for input parameters.
00108          * @param parameters Value of line edits for input parameters.
00109          * @param output_labels Dialog labels for output parameters.
00110          * @param output Value of line edits for output parameters.
00111          * @param help Html text with help.
00112          * @param is_table If focused window is a table window, asigs value to table.
00113          * @param accept_blank_parameters If user lefts parameters in blank, this option lets them. Otherwise function returns.
00114          */
00115         void compex_comand(QString title, QString _command, QStringList parameters_labels, QStringList &parameters, QStringList output_labels, QStringList &output, QString help=QString(), bool is_table=false, bool accept_blank_parameters=false);
00116         
00117         public slots:
00118         /**Makes copy_clipboard_ok true. This callback function deals with menu_window and input_dialog methods.
00119          * @see copy_clipboard_ok, menu_window, input_dialog.
00120          */
00121         void copy_clipboard_callback();
00122         
00123         //Operaciones con matrices
00124         void inverse_callback();
00125         void determinant_callback();
00126         void eigenvalues_callback();
00127         void transpose_callback();
00128         void submatrix_callback();
00129         
00130         //Operaciones estadísticas
00131         void mean_callback();
00132         void median_callback();
00133         void std_callback();
00134         void cov_callback();
00135         void corrcoef_callback();
00136         
00137         //Plot menu
00138         void plot_callback();
00139         void axis_callback();
00140         void title_label_callback();
00141         void to_eps_callback();
00142         void to_pdf_callback();
00143         void to_png_callback();
00144         void semilogy_callback();
00145         void semilogx_callback();
00146         void log_log_callback();
00147         void polar_callback();
00148         void error_bars_callback();
00149         /**Callback for histogram menu. Shows dialog for histogram.*/
00150         void hist_callback();
00151         
00152         //General actions
00153         void editor_callback();
00154         
00155         //Config actions
00156         void general_config_callback();
00157 
00158 };
00159 
00160 
00161 
00162 
00163 
00164 #endif

Generated on Thu Feb 1 12:34:25 2007 for QtOctave by  doxygen 1.4.7