Salome HOME
studyActivated() virtual method has been added
[modules/gui.git] / src / SUIT / SUIT_Application.h
index bcf33bae3e4f55f4ac7290d76cff451dc717b933..5ee41624be0b4facd4ee94c0a1700314105cbe2b 100755 (executable)
@@ -45,11 +45,16 @@ public:
   //! Returns Name of application. Using is not defined.
   virtual QString       applicationName() const = 0;
 
+  virtual QString       applicationVersion() const;
+
   //! Shows the application's main widget. For non GUI application must be redefined.
   virtual void          start();
 
-  //! Loads document <theFileName> into active Study. If Study is empty - creates it.
-  virtual void          useFile( const QString& );
+  //! Opens document <theFileName> into active Study. If Study is empty - creates it.
+  virtual bool          useFile( const QString& theFileName);
+
+  //! Loads document <theName> into active Study. If Study is empty - creates it.
+  virtual bool          useStudy( const QString& theName);
 
   //! Creates new empty Study if active Study = 0
   virtual void          createEmptyStudy();
@@ -67,8 +72,16 @@ public:
   //! Puts the message to the status bar  
   void putInfo ( const QString&, const int = 0 );
 
+  //! Invokes application-specific "Open/Save File" dialog and returns the selected file name.
+  virtual QString getFileName( bool open, const QString& initial, const QString& filters, 
+                              const QString& caption, QWidget* parent ) = 0;
+
+  //! Invokes application-specific "Select Directory" dialog and returns the selected directory name.
+  virtual QString getDirectory( const QString& initial, const QString& caption, QWidget* parent ) = 0;
+
 signals:
   void                  applicationClosed( SUIT_Application* );
+  void                  activated( SUIT_Application* );
 
 protected:
   SUIT_Application*     startApplication( int, char** ) const;
@@ -106,6 +119,9 @@ protected:
                                       const QString&, const int, QObject* = 0,
                                       const bool = false, QObject* = 0, const char* = 0 );
 
+protected slots:
+  virtual void          onDesktopActivated();
+
 private:
   SUIT_Study*           myStudy;
   SUIT_Desktop*         myDesktop;
@@ -114,7 +130,8 @@ private:
 //! This function must return a new application instance.
 extern "C"
 {
-  typedef SUIT_Application* (*APP_CREATE_FUNC)( int, char** );
+  //jfa 22.06.2005:typedef SUIT_Application* (*APP_CREATE_FUNC)( int, char** );
+  typedef SUIT_Application* (*APP_CREATE_FUNC)();
 }
 
 #define APP_CREATE_NAME "createApplication"