Salome HOME
Sources formated according to the codeing standards
[modules/shaper.git] / src / ModuleBase / ModuleBase_IOperation.h
index 0d304c0a2a7bebc1d684914ef6bba0b4bf48dc2b..8d738763e0ae598d39e412c9ea1f779462232112 100644 (file)
@@ -5,7 +5,6 @@
  *      Author: nds
  */
 
-
 #ifndef ModuleBase_IOperation_H
 #define ModuleBase_IOperation_H
 
@@ -37,11 +36,11 @@ class ModuleBase_OperationDescription;
  *  - virtual void      commitOperation();
  */
 
-class MODULEBASE_EXPORT ModuleBase_IOperation: public QObject
+class MODULEBASE_EXPORT ModuleBase_IOperation : public QObject
 {
 Q_OBJECT
 
-public:
+ public:
   /// Constructor
   /// Constructs an empty operation. Constructor should work very fast because many
   /// operators may be created after starting workshop but only several from them
@@ -57,10 +56,6 @@ public:
   /// /returns the instance of the description class
   ModuleBase_OperationDescription* getDescription() const;
 
-  /// Verifies whether this operator can be commited.
-  /// \return Returns TRUE if current operation can be committed, e.g. all parameters are filled
-  virtual bool canBeCommitted() const;
-
   /// Verifies whether this operator can be always started above any already running one
   /// \return Returns TRUE if current operation must not be checked for ActiveOperation->IsValid( this )
   /// This method must be redefined in derived operation if operation of derived class
@@ -77,19 +72,25 @@ public:
   //                     QList<ModuleBase_ModelWidget*> theWidgets);
 
   /// Returns True if data of its feature was modified during operation
-  virtual bool isModified() const { return myIsModified; }
+  virtual bool isModified() const
+  {
+    return myIsModified;
+  }
 
   /// Returns True id the current operation is launched in editing mode
-  bool isEditOperation() const { return myIsEditing; }
+  bool isEditOperation() const
+  {
+    return myIsEditing;
+  }
 
 signals:
-  void started(); /// the operation is started
-  void aborted(); /// the operation is aborted
-  void committed(); /// the operation is committed
-  void stopped(); /// the operation is aborted or committed
-  void resumed(); /// the operation is resumed
+  void started();  /// the operation is started
+  void aborted();  /// the operation is aborted
+  void committed();  /// the operation is committed
+  void stopped();  /// the operation is aborted or committed
+  void resumed();  /// the operation is resumed
 
-public slots:
+ public slots:
   /// Starts operation
   /// Public slot. Verifies whether operation can be started and starts operation.
   /// This slot is not virtual and cannot be redefined. Redefine startOperation method
@@ -111,7 +112,7 @@ public slots:
   /// Commits operation
   /// Public slot. Commits operation. This slot is not virtual and cannot be redefined.
   /// Redefine commitOperation method to change behavior of operation instead
-  void commit();
+  bool commit();
 
   /// Alias for start/abort slots
   /// Public slot. Aborts operation if false, else does nothing.
@@ -123,20 +124,28 @@ public slots:
   /// Stores a custom value in model.
   virtual void storeCustomValue() = 0;
 
-protected:
+ protected:
   /// Virtual method called when operation started (see start() method for more description)
   /// Default impl calls corresponding slot and commits immediately.
   virtual void startOperation() = 0;
+
   /// Virtual method called when operation stopped - committed or aborted.
   virtual void stopOperation() = 0;
+
   /// Virtual method called when operation aborted (see abort() method for more description)
   virtual void abortOperation() = 0;
+
   /// Virtual method called when operation committed (see commit() method for more description)
   virtual void commitOperation() = 0;
+
   /// Virtual method called after operation committed (see commit() method for more description)
   /// it is important that the method is called after the stop() signal is emitted
   virtual void afterCommitOperation() = 0;
 
+  /// Verifies whether this operator can be commited.
+  /// \return Returns TRUE if current operation can be committed, e.g. all parameters are filled
+  virtual bool canBeCommitted() const;
+
   /// Returns pointer to the root document.
   boost::shared_ptr<ModelAPI_Document> document() const;
 
@@ -146,8 +155,8 @@ protected:
   /// Modified feature flag
   bool myIsModified;
 
-private:
-  ModuleBase_OperationDescription* myDescription; /// the container to have the operation description
+ private:
+  ModuleBase_OperationDescription* myDescription;  /// the container to have the operation description
 };
 
 #endif