generate_menu.h

Go to the documentation of this file.
00001 #ifndef __GENERATE_MENU_H__
00002 #define __GENERATE_MENU_H__
00003 #include "mainwindow.h"
00004 #include "octave_connection.h"
00005 #include "operations.h"
00006 #include <QProcess>
00007 
00008 /**This class generates new menus from dirs.
00009  */
00010 class GenerateMenu:public QObject
00011 {
00012         Q_OBJECT
00013         public:
00014         GenerateMenu(MainWindow *mainwindow, Operations *operations);
00015         void setPath(QString path);
00016         void load_menu();
00017         private:
00018         void load_menu(QString dir_name, QMenu *parent_menu);
00019                 
00020         //Directorio en el que se encuentran los menús
00021         QString path;
00022         Operations *operations;
00023         MainWindow *mainwindow;
00024         /**Parse files with .menu extension.*/
00025         bool process_menu_file(QString _file,  QStringList &  input_labels,  QStringList &  input_parameters, QStringList & output_labels, QStringList & output_parameters, QString & command, QString & menu_name, QString & help, bool & accept_blank_parameters);
00026         /**Removes path from file_path.*/
00027         QString menu_path(QString file_path);
00028         /**Finds icon for given menu.*/
00029         QString find_icon(QString file_path, QString menu);
00030 };
00031 
00032 /**Simple Callback for menus genetates using GenerateMenu*/
00033 class MenuCallBack:public QObject
00034 {
00035         Q_OBJECT
00036         public:
00037         MenuCallBack(QString menu_name, OctaveConnection *oc);
00038         private:
00039         QProcess process;
00040         QString menu_name;
00041         QString output;
00042         OctaveConnection *octave_connection;
00043         public slots:
00044         void actions_callback();
00045         void readyReadStandardOutput();
00046         void finished( int exitCode, QProcess::ExitStatus exitStatus );
00047 };
00048 
00049 /**Callback for menus files*/
00050 class MenuFileCallBack: public QObject
00051 {
00052         Q_OBJECT
00053         public:
00054                 MenuFileCallBack(QString menu_name, OctaveConnection *oc, Operations *operations, QStringList &  input_labels,  QStringList &  input_parameters, QStringList & output_labels, QStringList & output_parameters, QString & command, QString & help, bool & accept_blank_parameters);
00055         private:
00056                 Operations *operations;
00057                 QString menu_name;
00058                 OctaveConnection *oc;
00059                 QStringList input_parameters, output_parameters, output_labels, input_labels;
00060                 QString command, help;
00061                 bool accept_blank_parameters;
00062         public slots:
00063                 void actions_callback();
00064         
00065 };
00066 
00067 #endif

Generated on Wed Mar 7 10:15:11 2007 for QtOctave by  doxygen 1.4.7