Salome HOME
ed339a2169cd6a3e8a214cc6ef4c75ee43ec5698
[modules/geom.git] / src / GEOMContext / GEOMContext.h
1 //  GEOMCONTEXT
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //
23 //
24 //  File   : GEOMContext.h
25 //  Author : Damien COQUERET
26 //  Module : GEOM
27 //  $Header: 
28
29 #ifndef GEOMCONTEXT_H
30 #define GEOMCONTEXT_H
31
32 #include "QAD_Desktop.h"
33 #include "GEOM_Client.hxx"
34 #include <OSD_SharedLibrary.hxx>
35 #include <qapplication.h>
36
37 #ifdef WNT
38  #if defined GEOMCONTEXT_EXPORTS
39   #if defined WIN32
40    #define GEOM_CONTEXT_EXPORT __declspec( dllexport )
41   #else
42    #define GEOM_CONTEXT_EXPORT
43   #endif
44  #else
45   #if defined WIN32
46    #define GEOM_CONTEXT_EXPORT __declspec( dllimport )
47   #else
48    #define GEOM_CONTEXT_EXPORT
49   #endif
50  #endif
51 #else
52  #define GEOM_CONTEXT_EXPORT
53 #endif
54
55 //=================================================================================
56 // class    : GEOMContext
57 // purpose  :
58 //=================================================================================
59 class GEOM_CONTEXT_EXPORT GEOMContext : public QObject
60 {
61   Q_OBJECT /* for QT compatibility */
62
63 public :
64   GEOMContext();
65   ~GEOMContext();
66
67 private :
68   QDialog* myActiveDialogBox; /* Unique active dialog box */
69   GEOM_Client myShapeReader;
70   Standard_CString myFatherior;
71
72 public :
73   int myNbGeom; /* Unique name for a geom entity */
74
75   static GEOMContext* GetOrCreateGeomGUI(QAD_Desktop* desktop);
76   static GEOMContext* GetGeomGUI();
77
78   OSD_SharedLibrary myGUILibrary;
79   GEOM::GEOM_Gen_var myComponentGeom;
80   int myState; /* Identify a method */
81
82   /* Returns the active DialogBox */
83   QDialog* GetActiveDialogBox(){return myActiveDialogBox ;};
84   int& GetNbGeom(){return myNbGeom;};
85   GEOM_Client& GetShapeReader(){return myShapeReader;};
86   Standard_CString& GetFatherior(){return myFatherior;};
87
88   bool LoadLibrary(QString GUILibrary);
89
90   /* Sets 'myActiveDialogBox' a pointer to the active Dialog Box  */
91   void SetActiveDialogBox(QDialog* aDlg);
92
93   /* Non modal dialog boxes magement */
94   void EmitSignalDeactivateDialog();
95   void EmitSignalCloseAllDialogs();
96   void EmitSignalDefaultStepValueChanged(double newVal);
97
98 signals :
99   void SignalDeactivateActiveDialog();
100   void SignalCloseAllDialogs();
101   void SignalDefaultStepValueChanged(double newVal);
102
103 };
104
105 #endif
106