X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSUIT%2FSUIT_Session.h;h=2a11526e911cce98564e8f3e460cd5d37d7a77d1;hb=81f45cc1076110965c403b903c5b44147c613049;hp=7496955f3cddf30634a6664bf74f227986788ee2;hpb=4520adfc050edcd145464c01d076255ac00b28a0;p=modules%2Fgui.git diff --git a/src/SUIT/SUIT_Session.h b/src/SUIT/SUIT_Session.h index 7496955f3..2a11526e9 100755 --- a/src/SUIT/SUIT_Session.h +++ b/src/SUIT/SUIT_Session.h @@ -1,15 +1,38 @@ +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + #ifndef SUIT_SESSION_H #define SUIT_SESSION_H #include "SUIT.h" - #include "SUIT_Application.h" -#include "SUIT_ResourceMgr.h" -#include -#include -#include -#include +#include +#include +#include + +#ifdef WIN32 +#include +#endif #ifdef WIN32 #define LIB_HANDLE HINSTANCE @@ -20,17 +43,15 @@ class SUIT_ResourceMgr; class SUIT_ExceptionHandler; +#ifdef WIN32 +#pragma warning( disable:4251 ) +#endif /*! - The class Sesssion manages launching of Applications. Application must be returned - by static function "createApplication" in external library. The Library must be loaded with + The class Sesssion manages launching of Applications. Application must be returned \n + by static function "createApplication" in external library. The Library must be loaded with \n loadLibrary method and after that application can be started. */ - -#ifdef WNT -#pragma warning( disable:4251 ) -#endif - -class SUIT_EXPORT SUIT_Session: public QObject +class SUIT_EXPORT SUIT_Session : public QObject { Q_OBJECT @@ -38,7 +59,7 @@ public: typedef LIB_HANDLE AppLib; enum { ASK = 0, SAVE, DONT_SAVE } CloseMode; - enum { FROM_GUI = 0, FROM_CORBA_SESSION } ExitStatus; + enum { NORMAL = 0, FORCED } ExitStatus; public: SUIT_Session(); @@ -48,15 +69,18 @@ public: SUIT_Application* startApplication( const QString&, int = 0, char** = 0 ); - QPtrList applications() const; + QList applications() const; SUIT_Application* activeApplication() const; SUIT_ResourceMgr* resourceMgr() const; - void closeSession( int mode = ASK ); + void closeSession( int mode = ASK, int flags = 0 ); + int exitFlags() const; SUIT_ExceptionHandler* handler() const; + void insertApplication( SUIT_Application* ); + signals: void applicationClosed( SUIT_Application* ); @@ -68,13 +92,12 @@ private slots: void onApplicationActivated( SUIT_Application* ); private: - typedef QPtrList AppList; - typedef QMap AppLibMap; - typedef QPtrListIterator AppListIterator; + typedef QList AppList; + typedef QMap AppLibMap; private: QString lastError() const; - AppLib loadLibrary( const QString& ); + AppLib loadLibrary( const QString&, QString& ); QString applicationName( const QString& ) const; private: @@ -87,6 +110,7 @@ private: static SUIT_Session* mySession; int myExitStatus; + int myExitFlags; }; #endif