Salome HOME
ADD a end user module (services.py) to help the manipulation of SALOME KERNEL service...
[modules/kernel.git] / idl / SALOME_Session.idl
1 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  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 //  File   : SALOME_Session.idl
23 //  Author : Paul RASCLE, EDF
24
25 #include "SALOME_Component.idl"
26
27 /*! \file SALOME_Session.idl \brief file that contains interface of the session
28  */
29
30 module SALOME
31 {
32 /*! \brief State of the session
33
34    This enumeration contains values defining the state of the session
35
36 */
37   enum SessionState {asleep, /*!< Session is inactive */
38                      running /*!< Session is running */
39   } ;
40
41 /*! \brief %Session State and Statistics
42
43     This struct contains a field list with general information about the session
44 */
45
46   struct StatSession
47   {
48 /*! \brief State of the session
49
50    It can be:
51         -# asleep  : no running study
52         -# running : one or more running studies
53 */
54     SessionState state ;
55     //! Number of running studies
56     short        runningStudies ;
57     //! It is True if GUI is active in the session
58     boolean      activeGUI ;
59   } ;
60
61 /*! \brief Interface of the session
62
63     The %session Server launches and stops GUI (Graphical User Interface).
64     The %session can be active without GUI (It can contain one or more running studies)
65 */
66
67   interface Session
68   {
69 //!  This exception is raised when trying to stop the %session with active GUI
70     exception GUIActive {} ;
71 //!  This exception is raised when trying to stop the %session with a number of running studies.
72     exception RunningStudies {} ;
73
74 //!  Launches GUI in the session
75     void GetInterface();
76
77 //!  Returns a standalone component
78     Engines::EngineComponent GetComponent(in string theLibraryName);
79
80 //!  Stops the %Session (It must be idle)
81     void StopSession() raises(GUIActive, RunningStudies) ;
82
83 //!  Gets Session State
84     StatSession GetStatSession() ;
85
86 //!  Determines whether the server has already been loaded or not.
87     void ping();
88 //!  Returns the PID of the server
89     long getPID();
90 //!  Returns host name
91     string getHostname();
92 //!  Get Active study ID
93     long GetActiveStudyId();
94 //!  Restores a state of the study at theSavePoint
95     boolean restoreVisualState(in long theSavePoint);
96
97  //! Send a message to the session GUI desktop that will emit a qt signal
98 /*!
99     This method can be used to send a message to the GUI from the standalone
100     container.
101     Caution: this method can block the Session and the calling container
102     if it is called when container processes some request from the GUI
103     (mutual lock takes place).
104     In such a case it is recommended to use oneway method.
105 */
106     void emitMessage(in string theMessage);
107
108     //! same as emitMessage but in a non blocking way
109 /*!
110     Emit a qt signal from the session GUI desktop window.
111     This method can be used to send a message to the GUI from the standalone
112     container.
113     This method never blocks the Session and the calling container.
114 */
115     oneway void emitMessageOneWay(in string theMessage);
116   } ;
117 } ;