Salome HOME
Define guards are corrected according to the code style
[modules/shaper.git] / src / ModelAPI / ModelAPI_PluginManager.h
index 3250bea97894ae162f2266645a16dbbd2ad47c6c..355e9814f3fcfec38c28ebae6dd017193990cea3 100644 (file)
@@ -2,16 +2,17 @@
 // Created:     20 Mar 2014
 // Author:      Mikhail PONIKAROV
 
-#ifndef ModelAPI_PluginManager_HeaderFile
-#define ModelAPI_PluginManager_HeaderFile
+#ifndef ModelAPI_PluginManager_H_
+#define ModelAPI_PluginManager_H_
 
 #include "ModelAPI.h"
 #include <string>
-#include <memory>
+#include <boost/shared_ptr.hpp>
 
 class ModelAPI_Feature;
 class ModelAPI_Plugin;
 class ModelAPI_Document;
+class ModelAPI_ValidatorsFactory;
 
 /**\class ModelAPI_PluginManager
  * \ingroup DataModel
@@ -24,7 +25,7 @@ class MODELAPI_EXPORT ModelAPI_PluginManager
 {
 public:
   /// Returns the real implementation (the alone instance per application) of the plugin manager
-  static std::shared_ptr<ModelAPI_PluginManager> get();
+  static boost::shared_ptr<ModelAPI_PluginManager> get();
 
   /// Registers the plugin that creates features.
   /// It is obligatory for each plugin to call this function on loading to be found by 
@@ -32,27 +33,39 @@ public:
   virtual void registerPlugin(ModelAPI_Plugin* thePlugin) = 0;
 
   /// Returns the root document of the application (that may contains sub-documents)
-  virtual std::shared_ptr<ModelAPI_Document> rootDocument() = 0;
+  virtual boost::shared_ptr<ModelAPI_Document> rootDocument() = 0;
+
+  /// Return true if root document has been already created
+  virtual bool hasRootDocument() = 0;
 
   /// Returns the current document that used for current work in the application
-  virtual std::shared_ptr<ModelAPI_Document> currentDocument() = 0;
+  virtual boost::shared_ptr<ModelAPI_Document> currentDocument() = 0;
 
   /// Defines the current document that used for current work in the application
-  virtual void setCurrentDocument(std::shared_ptr<ModelAPI_Document> theDoc) = 0;
+  virtual void setCurrentDocument(boost::shared_ptr<ModelAPI_Document> theDoc) = 0;
+
+  /// Copies the document to the new one wit hthe given id
+  virtual boost::shared_ptr<ModelAPI_Document> copy(
+    boost::shared_ptr<ModelAPI_Document> theSource, std::string theID) = 0;
 
-  /// loads the library with specific name, appends "lib*.dll" or "*.so" depending on the platform
-  static void ModelAPI_PluginManager::loadLibrary(const std::string theLibName);
+  /// Returns the validators factory: the only one instance per application
+  virtual ModelAPI_ValidatorsFactory* validators() = 0;
 
   /// Is needed for python wrapping by swig, call Get to get an instance
   ModelAPI_PluginManager();
 
+  /// To virtually destroy the fields of successors
+  virtual ~ModelAPI_PluginManager() {}
+
 protected:
   /// Creates the feature object using plugins functionality
-  virtual std::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID) = 0;
+  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID) = 0;
 
-  static void SetPluginManager(std::shared_ptr<ModelAPI_PluginManager> theManager);
+  static void setPluginManager(boost::shared_ptr<ModelAPI_PluginManager> theManager);
 
   friend class Model_Document;
 };
 
+typedef boost::shared_ptr<ModelAPI_PluginManager> PluginManagerPtr;
+
 #endif