Salome HOME
Copyright update 2022
[plugins/hybridplugin.git] / src / GUI / HYBRIDPluginGUI_Dlg.h
1 // Copyright (C) 2007-2022  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 // File   : HYBRIDPluginGUI_Dlg.h
21 // Author : Renaud NEDELEC (OpenCascade)
22
23 #ifndef HYBRIDPLUGINGUI_H
24 #define HYBRIDPLUGINGUI_H
25
26 enum {
27   OPTION_ID_COLUMN = 0,
28   OPTION_TYPE_COLUMN,
29   OPTION_NAME_COLUMN = 0,
30   OPTION_VALUE_COLUMN,
31   NB_COLUMNS,
32 };
33
34
35 #include "ui_HYBRIDPluginGUI_StdWidget_QTD.h"
36 #include "ui_HYBRIDPluginGUI_AdvWidget_QTD.h"
37 #include "HYBRIDPluginGUI_HypothesisCreator.h"
38
39 //////////////////////////////////////////
40 // HYBRIDPluginGUI_StdWidget
41 //////////////////////////////////////////
42
43 class HYBRIDPLUGINGUI_EXPORT HYBRIDPluginGUI_StdWidget : public QWidget,
44                                             public Ui::HYBRIDPluginGUI_StdWidget_QTD
45 {
46   Q_OBJECT
47
48 public:
49   HYBRIDPluginGUI_StdWidget( QWidget* = 0, Qt::WindowFlags = 0 );
50   ~HYBRIDPluginGUI_StdWidget();
51
52   bool GetLayersOnAllWrap() const
53   {
54     return myBoundaryLayersSizeMode->currentIndex() == 0; // == global
55   }
56   void SetLayersOnAllWrap(bool is)
57   {
58     myBoundaryLayersSizeMode->setCurrentIndex( !is ); // Global == 0, Local == 1
59   }
60
61 public:
62 };
63
64 //////////////////////////////////////////
65 // HYBRIDPluginGUI_AdvWidget
66 //////////////////////////////////////////
67
68 class HYBRIDPLUGINGUI_EXPORT HYBRIDPluginGUI_AdvWidget : public QWidget, 
69                                             public Ui::HYBRIDPluginGUI_AdvWidget_QTD
70 {
71   Q_OBJECT
72
73 public:
74   HYBRIDPluginGUI_AdvWidget( QWidget* = 0, Qt::WindowFlags = 0 );
75   ~HYBRIDPluginGUI_AdvWidget();
76
77   void AddOption( const char* name_value_type, bool isCustom = false );
78   void GetOptionAndValue( QTreeWidgetItem * tblRow, QString& option, QString& value, bool& dflt );
79
80 public slots:
81
82   void itemChanged(QTreeWidgetItem * tblRow, int column);
83 };
84
85 #endif