Salome HOME
HYDRO Feature 1: Import images (T 1.3)
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_DataModel.h
index 063d0166461cda7a54af1ec9672738a5b4ff8a21..eb6f374f65b4757967af4953fc84425aadb55d01 100644 (file)
@@ -23,8 +23,7 @@
 #ifndef HYDROGUI_DATAMODEL_H
 #define HYDROGUI_DATAMODEL_H
 
-#include "HYDROGUI.h"
-
+#include <HYDROData_Document.h>
 #include <HYDROData_Object.h>
 
 #include <QMap>
@@ -36,25 +35,25 @@ class CAM_DataObject;
 class SUIT_DataObject;
 class HYDROGUI_DataObject;
 
-/*!
+/**
  * \class HYDROGUI_DataModel
  * \brief The class representing the HYDROGUI data model
  */
 class HYDROGUI_DataModel : public LightApp_DataModel, public SUIT_DataSearcher
 {
 public:
- /**
-  * Constructor.
-  * \param theModule module object
-  */
 /**
+   * Constructor.
+   * \param theModule module object
+   */
   HYDROGUI_DataModel( CAM_Module* theModule );
   virtual ~HYDROGUI_DataModel();
 
   /**
    * Open the document into the data model. Reimplemented.
-   * /param theURL opened study path
-   * /param theStudy object study
-   * /param theFileList list of opened files for this model.
+   * \param theURL opened study path
+   * \param theStudy object study
+   * \param theFileList list of opened files for this model.
    */
   virtual bool open( const QString& theURL,
                      CAM_Study* theStudy,
@@ -62,15 +61,15 @@ public:
 
   /**
    * Saves the document. Reimplemented.
-   * /param returned theFileList list of saved files of this model.
+   * \param returned theFileList list of saved files of this model.
    */
   virtual bool save( QStringList& theFileList );
 
   /**
    * Saves as the document. Reimplemented.
-   * /param theURL saved study path
-   * /param theStudy object study
-   * /param returned theFileList list of saved files of this model.
+   * \param theURL saved study path
+   * \param theStudy object study
+   * \param returned theFileList list of saved files of this model.
    */
   virtual bool saveAs( const QString& theURL,
                        CAM_Study* theStudy,
@@ -83,7 +82,7 @@ public:
 
   /**
    * Returns modification status. Reimplemented.
-   * /return boolean value of modification status
+   * \return boolean value of modification status
    */
   virtual bool isModified() const;
 
@@ -121,8 +120,8 @@ public:
 
   /**
    * Updates the internal structure of data object tree starting from specified data object \a obj.
-   * /param theObject start data object
-   * /param theStudy study object
+   * \param theObject start data object
+   * \param theStudy study object
    */
   virtual void update( LightApp_DataObject* theObject = 0,
                        LightApp_Study* theStudy = 0 );
@@ -137,7 +136,58 @@ public:
    */
   void updateModel();
 
+  /**
+   * Find a data object by the specified entry and kind
+   */
+  Handle(HYDROData_Object) objectByEntry( const QString& theEntry,
+                                          const ObjectKind theObjectKind = KIND_UNKNOWN );
+
+  /**
+   * Check if it is possible to perform 'undo' operation
+   */
+  bool canUndo() const;
+
+  /**
+   * Check if it is possible to perform 'redo' operation
+   */
+  bool canRedo() const;
+
+  /**
+   * Returns the list of names of available 'undo' actions
+   */
+  QStringList undoNames() const;
+
+  /**
+   * Returns the list of names of available 'redo' actions
+   */
+  QStringList redoNames() const;
+
+  /**
+   * Clear the list of stored 'undo' actions
+   */
+  void clearUndos();
+
+  /**
+   * Clear the list of stored 'redo' actions
+   */
+  void clearRedos();
+
+  /**
+   * Perform the 'undo' operation
+   */
+  bool undo();
+
+  /**
+   * Perform the 'redo' operation
+   */
+  bool redo();
+
 protected:
+  /**
+   * Returns the document for the current study
+   */
+  Handle(HYDROData_Document) getDocument() const;
+
   /**
    * Creates the GUI data object according to the model object.
    * \param theParent a created object will be appended as a child of this object