]> SALOME platform Git repositories - modules/gui.git/blob - src/Session/Session_Session_i.hxx
Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/gui.git] / src / Session / Session_Session_i.hxx
1 //  SALOME Session : implementation of Session.idl
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   : Session_Session_i.hxx
25 //  Author : Paul RASCLE, EDF
26 //  Module : SALOME
27 //  $Header$
28
29 #ifndef _SESSION_SESSION_I_HXX_
30 #define _SESSION_SESSION_I_HXX_
31
32 #include <SALOME_Session.hxx>
33
34 #include <qthread.h> 
35
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(SALOME_Component)
38 #include CORBA_SERVER_HEADER(SALOME_Session)
39 class SALOME_NamingService;
40
41 class SESSION_EXPORT SALOME_Session_i:  public virtual POA_SALOME::Session,
42                          public virtual PortableServer::ServantBase
43 {
44 public:
45   SALOME_Session_i(int argc, 
46                    char ** argv, 
47                    CORBA::ORB_ptr orb, 
48                    PortableServer::POA_ptr poa, 
49                    QMutex* GUIMutex,
50                    QWaitCondition* GUILauncher);
51   ~SALOME_Session_i();
52
53   //! Launch Graphical User Interface
54   void GetInterface();
55
56   //! Return VISU component
57   Engines::Component_ptr GetComponent(const char* theLibraryName);
58
59   //! Stop the Session (must be idle): kill servant & server
60   void StopSession();
61
62   //! Get session state
63   SALOME::StatSession GetStatSession();
64
65   //! Register the servant to Naming Service
66   void NSregister();
67
68   CORBA::Long GetActiveStudyId();
69
70   void ping(){};
71   CORBA::Long getPID() { return (CORBA::Long)getpid(); };
72
73   //! Restors a visual state of the study at theSavePoint
74   bool restoreVisualState(CORBA::Long theSavePoint);
75
76   //! Emit a qt signal from the session GUI desktop window.
77   void emitMessage(const char* theMessage);
78   void emitMessageOneWay(const char* theMessage);
79
80 protected:
81
82   //! Naming service interface
83   SALOME_NamingService *_NS;
84
85   int _argc ;
86   char **_argv;
87   CORBA::Boolean _isGUI ;
88   QMutex* _GUIMutex ;
89   QWaitCondition* _GUILauncher;
90   int _runningStudies ;
91   CORBA::ORB_var _orb;
92   PortableServer::POA_var _poa;
93 };
94
95 #endif
96