Salome HOME
Fix problem with table of contents resizing
[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 //=================================================================================
38 // class    : GEOMContext
39 // purpose  :
40 //=================================================================================
41 class GEOMContext : public QObject
42 {
43   Q_OBJECT /* for QT compatibility */
44
45 public :
46   GEOMContext();
47   ~GEOMContext();
48
49 private :
50   QDialog* myActiveDialogBox; /* Unique active dialog box */
51   GEOM_Client myShapeReader;
52   Standard_CString myFatherior;
53
54 public :
55   int myNbGeom; /* Unique name for a geom entity */
56
57   static GEOMContext* GetOrCreateGeomGUI(QAD_Desktop* desktop);
58   static GEOMContext* GetGeomGUI();
59
60   OSD_SharedLibrary myGUILibrary;
61   GEOM::GEOM_Gen_var myComponentGeom;
62   int myState; /* Identify a method */
63
64   /* Returns the active DialogBox */
65   QDialog* GetActiveDialogBox(){return myActiveDialogBox ;};
66   int& GetNbGeom(){return myNbGeom;};
67   GEOM_Client& GetShapeReader(){return myShapeReader;};
68   Standard_CString& GetFatherior(){return myFatherior;};
69
70   bool LoadLibrary(QString GUILibrary);
71
72   /* Sets 'myActiveDialogBox' a pointer to the active Dialog Box  */
73   void SetActiveDialogBox(QDialog* aDlg);
74
75   /* Non modal dialog boxes magement */
76   void EmitSignalDeactivateDialog();
77   void EmitSignalCloseAllDialogs();
78   void EmitSignalDefaultStepValueChanged(double newVal);
79
80 signals :
81   void SignalDeactivateActiveDialog();
82   void SignalCloseAllDialogs();
83   void SignalDefaultStepValueChanged(double newVal);
84
85 };
86
87 #endif
88