Salome HOME
Initial commit
[modules/jobmanager.git] / src / genericgui / BL_GenericGui.hxx
1 //  Copyright (C) 2009 CEA/DEN, EDF R&D
2 //
3 //  This library is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU Lesser General Public
5 //  License as published by the Free Software Foundation; either
6 //  version 2.1 of the License.
7 //
8 //  This library is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 //  Lesser General Public License for more details.
12 //
13 //  You should have received a copy of the GNU Lesser General Public
14 //  License along with this library; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _BL_GENERICGUI_HXX_
21 #define _BL_GENERICGUI_HXX_
22
23 #include <QtGui>
24
25 #include "BL_Traces.hxx"
26
27 #include "BL_SALOMEServices.hxx"
28
29 #include "BL_MainWindows_Wrap.hxx"
30
31 #include "BL_QModelManager.hxx"
32 #include "BL_JobsManager_QT.hxx"
33 #include "BL_JobsTable.hxx"
34 #include "BL_JobTab.hxx"
35 #include "BL_Buttons.hxx"
36 #include "BL_Summary.hxx"
37 #include "BL_MachineCatalog.hxx"
38
39 namespace BL 
40 {
41   class GenericGui: public QObject
42   {
43     Q_OBJECT
44
45     public:
46       GenericGui(BL::MainWindows_Wrap * wrapper);
47       virtual ~GenericGui();
48
49       void showDockWidgets(bool isVisible);
50       void createActions();
51       void createMenus();
52
53     public slots:
54       void create_job();
55       void start_job();
56       void delete_job();
57       void refresh_job();
58       void get_results_job();
59       void job_selected(const QModelIndex & index);
60       void job_state_changed(const QString & name);
61       void updateButtonsStates();
62
63     signals:
64       void job_deleted(QString job_name);
65
66     protected:
67      
68       BL::MainWindows_Wrap * _wrapper;
69
70       BL::SALOMEServices * _salome_services;
71
72       QMainWindow * _dock_parent;
73       QMainWindow * _tab_parent;
74       QDockWidget * _dw_summary;
75       QDockWidget * _dw_machine_catalog;
76      
77       BL::Buttons * _buttons;
78       BL::JobsTable * _jobs_table;  
79       BL::JobTab * _job_tab;
80       BL::Summary * _summary;
81
82       QAction * _create_job_action;
83       QAction * _start_job_action;
84       QAction * _delete_job_action;
85       QAction * _get_results_job_action;
86       QAction * _refresh_job_action;
87
88       BL::JobsManager_QT * _jobs_manager;
89       BL::QModelManager * _model_manager;
90       QStandardItemModel * _model;
91       BL::MachineCatalog * _machine_catalog;
92
93       int _row_selected;
94       QString _job_name_selected;
95   };
96 }
97
98 #endif