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