Salome HOME
Update copyrights 2014.
[modules/jobmanager.git] / src / genericgui / BL_GenericGui.hxx
1 // Copyright (C) 2009-2014  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, or (at your option) any later version.
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_GenericGuiDefines.hxx"
26
27 #include "BL_Traces.hxx"
28
29 #include "BL_SALOMEServices.hxx"
30
31 #include "BL_MainWindows_Wrap.hxx"
32
33 #include "BL_QModelManager.hxx"
34 #include "BL_JobsManager_QT.hxx"
35 #include "BL_JobsTable.hxx"
36 #include "BL_JobTab.hxx"
37 #include "BL_Buttons.hxx"
38 #include "BL_Summary.hxx"
39 #include "JM_ResourceCatalog.hxx"
40
41 namespace BL 
42 {
43   class BL_GenericGui_EXPORT GenericGui: public QObject
44   {
45     Q_OBJECT
46
47     public:
48       GenericGui(BL::MainWindows_Wrap * wrapper);
49       virtual ~GenericGui();
50
51       void createDockWidgets();
52       void createCentralWidget();
53
54       void showDockWidgets(bool isVisible);
55       void createActions();
56       void createMenus();
57
58       void delete_job_internal();
59
60       void deleteDockWidget();
61       void delete_job_external(const QString & name);
62
63       void reset_job_selection();
64
65
66     public slots:
67       void create_job();
68       void edit_clone_job();
69       void start_job();
70       void restart_job();
71       void delete_job();
72       void refresh_job();
73       void stop_job();
74       void get_results_job();
75       void job_selected(const QModelIndex & index);
76       void job_activated(const QModelIndex & index);
77       void job_state_changed(const QString & name);
78       void updateButtonsStates();
79       void updateButtonsStatesSingleSelection();
80
81     public:
82       BL::JobTab * _job_tab;
83       BL::JobsTable * _jobs_table;
84
85     protected:
86       BL::MainWindows_Wrap * _wrapper;
87
88       BL::SALOMEServices * _salome_services;
89
90       QMainWindow * _dock_parent;
91       QMainWindow * _tab_parent;
92       QDockWidget * _dw_summary;
93       QDockWidget * _dw_resource_catalog;
94
95       BL::Buttons * _buttons;
96       BL::Summary * _summary;
97
98       QAction * _create_job_action;
99       QAction * _edit_clone_job_action;
100       QAction * _start_job_action;
101       QAction * _restart_job_action;
102       QAction * _delete_job_action;
103       QAction * _stop_job_action;
104       QAction * _get_results_job_action;
105       QAction * _refresh_job_action;
106
107       BL::JobsManager_QT * _jobs_manager;
108       BL::QModelManager * _model_manager;
109       QStandardItemModel * _model;
110       JM::ResourceCatalog * _resource_catalog;
111
112       QString _job_name_selected;
113   };
114 }
115
116 #endif