Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[modules/gui.git] / src / SUIT / SUIT_Application.h
index 5ee41624be0b4facd4ee94c0a1700314105cbe2b..5bab83a1445a7154eb515c0d995bc3158ac9498a 100755 (executable)
@@ -1,3 +1,21 @@
+// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// 
+// 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/
+//
 #ifndef SUIT_APPLICATION_H
 #define SUIT_APPLICATION_H
 
@@ -12,7 +30,12 @@ class SUIT_Desktop;
 class SUIT_Convertor;
 class SUIT_ViewModel;
 class SUIT_ResourceMgr;
-
+class QString;
+class QIconSet;
+class QLabel;
+/*! \class QObject
+ * \brief For more information see <a href="http://doc.trolltech.com">QT documentation</a>.
+ */
 /*!
   An <b>Application</b> is a class which defines application configuration and behaviour.
   For example Application object defines what Viewers are used in this application, what auxilliary windows
@@ -33,10 +56,12 @@ public:
   //! Returns main widget (Desktop) of the application (if it exists)
   virtual SUIT_Desktop* desktop();
 
-  /*! Returns FALSE if applic ation can not be closed (because of non saved data for example). 
+  /*! Returns FALSE if application can not be closed (because of non saved data for example). 
       This method called by SUIT_Session whin closing of application was requested. */
   virtual bool          isPossibleToClose();
 
+  /*! Performs some finalization of life cycle of this application.
+      For instance, the application can force its documents(s) to close. */
   virtual void          closeApplication();
 
   //! Returns active Study. If Application supports wirking with several studies this method should be redefined
@@ -87,34 +112,41 @@ protected:
   SUIT_Application*     startApplication( int, char** ) const;
   SUIT_Application*     startApplication( const QString&, int, char** ) const;
 
-  void                  setDesktop( SUIT_Desktop* );
+  virtual void          setDesktop( SUIT_Desktop* );
 
   //! Creates a new Study instance. Must be redefined in new application according to its Study type.
   virtual SUIT_Study*   createNewStudy();
   virtual void          setActiveStudy( SUIT_Study* );
-
+  
+  /** @name Create tool functions*/ //@{
   int                   createTool( const QString& );
   int                   createTool( const int, const int, const int = -1 );
   int                   createTool( const int, const QString&, const int = -1 );
   int                   createTool( QAction*, const int, const int = -1, const int = -1 );
-  int                   createTool( QAction*, const QString&, const int = -1, const int = -1 );
+  int                   createTool( QAction*, const QString&, const int = -1, const int = -1 );//@}
 
+  /** @name Create menu functions*/ //@{
   int                   createMenu( const QString&, const int, const int = -1, const int = -1, const int = -1 );
   int                   createMenu( const QString&, const QString&, const int = -1, const int = -1, const int = -1 );
   int                   createMenu( const int, const int, const int = -1, const int = -1 );
   int                   createMenu( const int, const QString&, const int = -1, const int = -1 );
   int                   createMenu( QAction*, const int, const int = -1, const int = -1, const int = -1 );
-  int                   createMenu( QAction*, const QString&, const int = -1, const int = -1, const int = -1 );
+  int                   createMenu( QAction*, const QString&, const int = -1, const int = -1, const int = -1 );//@}
 
+  /** @name Set menu shown functions*/ //@{
   void                  setMenuShown( QAction*, const bool );
-  void                  setMenuShown( const int, const bool );
+  void                  setMenuShown( const int, const bool );//@}
+  /** @name Set tool shown functions*/ //@{
   void                  setToolShown( QAction*, const bool );
-  void                  setToolShown( const int, const bool );
+  void                  setToolShown( const int, const bool );//@}
+
+  void                  setActionShown( QAction*, const bool );
+  void                  setActionShown( const int, const bool );
 
   static QAction*       separator();
   QAction*              action( const int ) const;
   int                   actionId( const QAction* ) const;
-  void                  registerAction( const int, QAction* );
+  int                   registerAction( const int, QAction* );
   QAction*              createAction( const int, const QString&, const QIconSet&, const QString&,
                                       const QString&, const int, QObject* = 0,
                                       const bool = false, QObject* = 0, const char* = 0 );
@@ -125,6 +157,9 @@ protected slots:
 private:
   SUIT_Study*           myStudy;
   SUIT_Desktop*         myDesktop;
+  QMap<int, QAction*>   myActionMap;
+
+  QLabel*               myStatusLabel;
 };
 
 //! This function must return a new application instance.