Salome HOME
Fixed the problem with several parts creation.
[modules/shaper.git] / src / ModelAPI / ModelAPI_PluginManager.h
index c4033c3b1dcba53ba8229eb482ccc76156f6fb6c..47c42562ffdcd87682973ccdd152d595593a0290 100644 (file)
@@ -10,6 +10,8 @@
 #include <boost/shared_ptr.hpp>
 
 class ModelAPI_Feature;
+class ModelAPI_Plugin;
+class ModelAPI_Document;
 
 /**\class ModelAPI_PluginManager
  * \ingroup DataModel
@@ -21,17 +23,42 @@ class ModelAPI_Feature;
 class MODELAPI_EXPORT ModelAPI_PluginManager
 {
 public:
-  /// Creates the feature object using plugins functionality
-  virtual boost::shared_ptr<ModelAPI_Feature> CreateFeature(std::string theFeatureID) = 0;
-
   /// Returns the real implementation (the alone instance per application) of the plugin manager
-  static boost::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 
+  /// the plugin manager on call of the feature)
+  virtual void registerPlugin(ModelAPI_Plugin* thePlugin) = 0;
+
+  /// Returns the root document of the application (that may contains sub-documents)
+  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 boost::shared_ptr<ModelAPI_Document> currentDocument() = 0;
+
+  /// Defines the current document that used for current work in the application
+  virtual void setCurrentDocument(boost::shared_ptr<ModelAPI_Document> theDoc) = 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 boost::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID) = 0;
+
   static void SetPluginManager(boost::shared_ptr<ModelAPI_PluginManager> theManager);
+
+  friend class Model_Document;
 };
 
+typedef boost::shared_ptr<ModelAPI_PluginManager> PluginManagerPtr;
+
+
 #endif