1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
6 * Created on: Apr 1, 2014
10 #ifndef CONFIG_WIDGETAPI_H_
11 #define CONFIG_WIDGETAPI_H_
13 #include <Config_def.h>
18 //>> Forward declaration of xmlNodePtr.
19 typedef struct _xmlNode xmlNode;
20 typedef xmlNode *xmlNodePtr;
24 //>> Forward declaration of xmlDocPtr.
25 typedef struct _xmlDoc xmlDoc;
26 typedef xmlDoc *xmlDocPtr;
31 * \class Config_WidgetAPI
32 * \brief Provides low-level API for WidgetFactory for reading xml definitions of widgets
34 class CONFIG_EXPORT Config_WidgetAPI
37 virtual ~Config_WidgetAPI();
39 std::string widgetType() const;
40 bool isContainerWidget() const;
41 bool isPagedWidget() const;
43 std::string widgetId() const;
44 std::string widgetIcon() const;
45 std::string widgetLabel() const;
46 std::string widgetTooltip() const;
48 std::string getProperty(const char* thePropName) const;
50 /// Checks if the XML representation of widget has given attribute,
51 /// if yes - returns it's bool value, if no, or if the value can not
52 /// be converted to bool - returns theDefault.
53 /// \param theAttributeName attribute to check
54 /// \param theDefault default value on bad data
55 /// \return the boolean result
56 bool getBooleanAttribute(const char* theAttributeName, bool theDefault) const;
58 bool isComputedDefault() const;
61 /// These fields are accessible for ModuleBase_WidgetFactory only
62 Config_WidgetAPI(std::string theRawXml);
65 bool toParentWidget();
69 xmlNodePtr myCurrentNode;
71 friend class ModuleBase_WidgetFactory;
74 #endif /* CONFIG_WIDGETAPI_H_ */