Salome HOME
Base implementation of dumping study document in to Python script (Feature #14).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_DataModel.h
index 84a07b79de8a1f3f01be76e789cd1bd864b3ac66..a0e597647d9a4d902bb3a16932f669e6c6e069d9 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef HYDROGUI_DATAMODEL_H
 #define HYDROGUI_DATAMODEL_H
 
+#include <HYDROData_Document.h>
 #include <HYDROData_Object.h>
 
 #include <QMap>
@@ -139,16 +140,62 @@ public:
    * Find a data object by the specified entry and kind
    */
   Handle(HYDROData_Object) objectByEntry( const QString& theEntry,
-                                          const ObjectKind theObjectKind );
+                                          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
    * \param theObject model object
    */
   LightApp_DataObject* createObject( SUIT_DataObject* theParent,
-                                     Handle(HYDROData_Object) theModelObject );
+                                     Handle(HYDROData_Object) theModelObject,
+                                     const QString& theParentEntry = QString() );
 
   /**
    * Creates the GUI data object without corresponding model object: just by name