Salome HOME
Simplification and refactoring of unit tests for SketchPlugin
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Plugin.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchPlugin_Plugin.hxx
4 // Created:     31 Mar 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef SKETCHPLUGIN_PLUGIN_H_
8 #define SKETCHPLUGIN_PLUGIN_H_
9
10 #include <SketchPlugin.h>
11 #include <Events_Listener.h>
12 #include <ModelAPI_Plugin.h>
13 #include <ModelAPI_Feature.h>
14 #include <ModelAPI_Events.h>
15
16 /**\class SketchPlugin_Plugin
17  * \ingroup Plugins
18  * \brief Interface common for any plugin: allows to use plugin by the plugins manager.
19  */
20 class SketchPlugin_Plugin : public ModelAPI_Plugin, public Events_Listener
21 {
22 public:
23   /// Creates the feature object of this plugin by the feature string ID
24   SKETCHPLUGIN_EXPORT virtual FeaturePtr createFeature(std::string theFeatureID);
25
26   /// Constructor that registers features and other plugin elements.
27   SKETCHPLUGIN_EXPORT SketchPlugin_Plugin();
28
29   //! Redefinition of Events_Listener method
30   SKETCHPLUGIN_EXPORT virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
31
32 protected:
33   //! Returns the state of the feature in the WorkBench: enabled or disabled for the moment.
34   std::shared_ptr<ModelAPI_FeatureStateMessage> getFeaturesState(
35       const std::shared_ptr<ModelAPI_Feature>& theFeature) const;
36 };
37
38 #endif