Salome HOME
Issue #2602: Check selection with validators before its using.
[modules/shaper.git] / src / ModuleBase / ModuleBase_Operation.h
index 09b6257786cd4c10dcb9d1d5b1f4bcbc1047759a..4ea8c6c4493267c41597323cf0d420e1b80768ba 100644 (file)
@@ -1,11 +1,22 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-/*
- * ModuleBase_Operation.h
- *
- *  Created on: Apr 2, 2014
- *      Author: sbh
- */
+// Copyright (C) 2014-2017  CEA/DEN, EDF 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, or (at your option) any later version.
+//
+// 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/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
 
 #ifndef ModuleBase_Operation_H
 #define ModuleBase_Operation_H
@@ -56,8 +67,15 @@ Q_OBJECT
   /// /returns the instance of the description class
   ModuleBase_OperationDescription* getDescription() const { return myDescription; }
 
+  /// Returns list of granted operation indices
+  const QStringList& grantedOperationIds() const;
+
+  /// Sets list of operation indices, which can be started without the current operation stop
+  /// \param theList an ids
+  void setGrantedOperationIds(const QStringList& theList);
+
   /// Must return true if this operation can be launched as nested for any current operation
-  /// and it is not necessary to check this operation on validity. By default 
+  /// and it is not necessary to check this operation on validity. By default
   /// the operation is not granted.
   /// The method has to be redefined for granted operations.
   virtual bool isGranted(QString theId) const;
@@ -82,13 +100,25 @@ Q_OBJECT
   /// \return Currently installed property panel
   ModuleBase_IPropertyPanel* propertyPanel() const { return myPropertyPanel; }
 
+  QString helpFileName() const { return myHelpFileName; }
+
+  void setHelpFileName(QString theName) {
+    myHelpFileName = theName;
+  }
+
 signals:
+  /// The operation is started
+  void beforeStarted();
   /// The operation is started
   void started();
 
+  /// The operation is aborted
+  void beforeAborted();
   /// The operation is aborted
   void aborted();
 
+  /// The operation is committed
+  void beforeCommitted();
   /// The operation is committed
   void committed();
 
@@ -108,7 +138,8 @@ signals:
   /// to change behavior of operation. There is no point in using this method. It would
   /// be better to inherit own operator from base one and redefine startOperation method
   /// instead.
-  virtual void start();
+  /// \return true if the start is successful
+  virtual bool start();
 
   /// Deactivates current operation which can be resumed later.
   virtual void postpone();
@@ -134,6 +165,10 @@ signals:
   /// Changes the modified flag of the operation
   void onValuesChanged();
 
+  /// Changes the modified flag of the operation if the current state of the widget is modified
+  /// \param thePreviousState the previous vlaue state of the widget
+  void onValueStateChanged(int thePreviousState);
+
  protected:
   /// Virtual method called when operation started (see start() method for more description)
   /// Default impl calls corresponding slot and commits immediately.
@@ -168,8 +203,13 @@ private:
   /// Modified feature flag
   bool myIsModified;
 
+  /// List of operations IDs which are granted of the current operation
+  QStringList myGrantedIds;
+
   /// Access to property panel
   ModuleBase_IPropertyPanel* myPropertyPanel;
+
+  QString myHelpFileName;
 };
 
 #endif