X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FModel%2FModel_PluginManager.h;h=4efef6a4cd5034c79e8ff69a405cc49b852ceb33;hb=4ee6972a725f02500c2c543abeef2909180e09c1;hp=47b326ac2d3121a15d2578b3df1a3cb1bd07f2ff;hpb=90bbd2eb64d0fa76030e5b93f4436ae2ec2a2e65;p=modules%2Fshaper.git diff --git a/src/Model/Model_PluginManager.h b/src/Model/Model_PluginManager.h index 47b326ac2..4efef6a4c 100644 --- a/src/Model/Model_PluginManager.h +++ b/src/Model/Model_PluginManager.h @@ -7,7 +7,7 @@ #include "Model.h" #include -#include +#include #include class Model_Document; @@ -18,35 +18,51 @@ class Model_Document; * plugin contains which feature, loads and stores reference to loaded plugins by * the feature functionality request. */ - -class Model_PluginManager : public ModelAPI_PluginManager, public Event_Listener +class Model_PluginManager : public ModelAPI_PluginManager, public Events_Listener { bool myPluginsInfoLoaded; ///< it true if plugins information is loaded - /// map of feature IDs to plugin name and object + /// map of feature IDs to plugin name std::map myPlugins; std::map myPluginObjs; ///< instances of the already plugins std::string myCurrentPluginName; ///< name of the plugin that must be loaded currently + boost::shared_ptr myCurrentDoc; ///< current working document + bool myCheckTransactions; ///< if true, generates error if document is updated outside of transaction public: - /// Creates the feature object using plugins functionality - MODEL_EXPORT virtual std::shared_ptr createFeature(std::string theFeatureID); - /// Returns the root document of the application (that may contains sub-documents) - virtual std::shared_ptr rootDocument(); + MODEL_EXPORT virtual boost::shared_ptr rootDocument(); + + /// Return true if root document has been already created + MODEL_EXPORT virtual bool hasRootDocument(); + + /// Returns the current document that used for current work in the application + MODEL_EXPORT virtual boost::shared_ptr currentDocument(); + + /// Defines the current document that used for current work in the application + MODEL_EXPORT virtual void setCurrentDocument(boost::shared_ptr theDoc); /// 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); + MODEL_EXPORT virtual void registerPlugin(ModelAPI_Plugin* thePlugin); /// Processes the configuration file reading - MODEL_EXPORT virtual void processEvent(const Event_Message* theMessage); + MODEL_EXPORT virtual void processEvent(const Events_Message* theMessage); + + /// Copies the document to the new one wit hthe given id + MODEL_EXPORT virtual boost::shared_ptr copy( + boost::shared_ptr theSource, std::string theID); + + void setCheckTransactions(const bool theCheck) {myCheckTransactions = theCheck;} /// Is called only once, on startup of the application Model_PluginManager(); -private: +protected: /// Loads (if not done yet) the information about the features and plugins void LoadPluginsInfo(); + + /// Creates the feature object using plugins functionality + virtual boost::shared_ptr createFeature(std::string theFeatureID); }; #endif