Salome HOME
updated copyright message
[modules/gui.git] / src / SUIT / SUIT_Application.h
old mode 100755 (executable)
new mode 100644 (file)
index 8150634..a9574a8
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  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
@@ -33,6 +33,7 @@ class QLabel;
 class QString;
 class QAction;
 class QWidget;
+class QKeySequence;
 
 class SUIT_Desktop;
 class SUIT_ViewManager;
@@ -67,7 +68,7 @@ public:
   //! Returns main widget (Desktop) of the application (if it exists)
   virtual SUIT_Desktop* desktop();
 
-  /*! Returns FALSE if application can not be closed (because of non saved data for example). 
+  /*! Returns \c 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( bool& );
 
@@ -115,9 +116,28 @@ public:
   virtual void          viewManagers( const QString&, QList<SUIT_ViewManager*>& ) const = 0;
   QAction*              action( const int ) const;
 
+  void                  addPostRoutine( void (*theRoutine)() );
+
+  /** @name Create tool functions*/ //@{
+  int                   createTool( const QString&, const QString& = 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 );//@}
+  void                  clearTool( const QString& );
+
+  /** @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 );//@}
+
 signals:
   void                  applicationClosed( SUIT_Application* );
   void                  activated( SUIT_Application* );
+//  void                  moving();
   void                  infoChanged( QString );
 
 public slots:
@@ -137,21 +157,6 @@ protected:
   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 );//@}
-
-  /** @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 );//@}
-
   /** @name Set menu shown functions*/ //@{
   void                  setMenuShown( QAction*, const bool );
   void                  setMenuShown( const int, const bool );//@}
@@ -173,9 +178,14 @@ protected:
                                       const QString&, const int, QObject* = 0,
                                       const bool = false, QObject* = 0, const char* = 0,
                                      const QString& = QString() );
+  QAction*              createAction( const int, const QString&, const QIcon&, const QString&,
+                                      const QString&, const QKeySequence&, QObject* = 0,
+                                      const bool = false, QObject* = 0, const char* = 0,
+                                     const QString& = QString() );
 
 protected slots:
   virtual void          onDesktopActivated();
+//  void                  onDesktopMoved();
 
 private:
   SUIT_Study*           myStudy;
@@ -184,6 +194,9 @@ private:
   SUIT_ShortcutMgr*     myShortcutMgr;
 
   QLabel*               myStatusLabel;
+
+  typedef void (*PostRoutine)();
+  QList<PostRoutine>    myPostRoutines;
 };
 
 //! This function must return a new application instance.