X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_PluginManager.h;h=47c42562ffdcd87682973ccdd152d595593a0290;hb=5dfed65281f80488610fa9817350611277c6b0aa;hp=c4033c3b1dcba53ba8229eb482ccc76156f6fb6c;hpb=263d0f7bef75e1979c33f0d5a3d3fbc3b71d76a1;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_PluginManager.h b/src/ModelAPI/ModelAPI_PluginManager.h index c4033c3b1..47c42562f 100644 --- a/src/ModelAPI/ModelAPI_PluginManager.h +++ b/src/ModelAPI/ModelAPI_PluginManager.h @@ -10,6 +10,8 @@ #include 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 CreateFeature(std::string theFeatureID) = 0; - /// Returns the real implementation (the alone instance per application) of the plugin manager - static boost::shared_ptr Get(); + static boost::shared_ptr 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 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 currentDocument() = 0; + + /// Defines the current document that used for current work in the application + virtual void setCurrentDocument(boost::shared_ptr 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 createFeature(std::string theFeatureID) = 0; + static void SetPluginManager(boost::shared_ptr theManager); + + friend class Model_Document; }; +typedef boost::shared_ptr PluginManagerPtr; + + #endif