1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SamplePanelPlugin_ModelWidgetCreator.h
4 // Created: 29 Mar 2015
5 // Author: Natalia ERMOLAEVA
7 #ifndef SamplePanelPlugin_ModelWidgetCreator_H
8 #define SamplePanelPlugin_ModelWidgetCreator_H
10 #include "SamplePanelPlugin.h"
12 #include <ModuleBase_IWidgetCreator.h>
17 class ModuleBase_IWorkshop;
18 class Config_WidgetAPI;
23 * Interface to WidgetCreator which can create specific widgets by type
25 class SamplePanelPlugin_ModelWidgetCreator : public ModuleBase_IWidgetCreator
28 /// Default constructor
29 SamplePanelPlugin_ModelWidgetCreator();
31 /// Virtual destructor
32 ~SamplePanelPlugin_ModelWidgetCreator() {}
34 /// Returns a container of possible widget types, which this creator can process
35 /// \param a list of type names
36 virtual void widgetTypes(std::set<std::string>& theTypes);
38 /// Create widget by its type
39 /// The default implementation is empty
40 /// \param theType a type
41 /// \param theParent a parent widget
42 /// \param theData a low-level API for reading xml definitions of widgets
43 /// \param theWorkshop a current workshop
44 /// \return a created model widget or null
45 virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType,
47 Config_WidgetAPI* theWidgetApi,
48 ModuleBase_IWorkshop* /*theWorkshop*/);
50 std::set<std::string> myModelWidgetTypes; /// types of widgets