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;
30 class CONFIG_EXPORT Config_WidgetAPI
33 virtual ~Config_WidgetAPI();
35 std::string widgetType() const;
36 bool isContainerWidget() const;
37 bool isPagedWidget() const;
39 std::string widgetId() const;
40 std::string widgetIcon() const;
41 std::string widgetLabel() const;
42 std::string widgetTooltip() const;
44 std::string getProperty(const char* thePropName) const;
46 /// Checks if the XML representation of widget has given attribute,
47 /// if yes - returns it's bool value, if no, or if the value can not
48 /// be converted to bool - returns theDefault.
49 /// \param theAttributeName attribute to check
50 /// \param theDefault default value on bad data
51 /// \return the boolean result
52 bool getBooleanAttribute(const char* theAttributeName, bool theDefault) const;
54 bool isComputedDefault() const;
57 /// These fields are accessible for ModuleBase_WidgetFactory only
58 Config_WidgetAPI(std::string theRawXml);
61 bool toParentWidget();
65 xmlNodePtr myCurrentNode;
67 friend class ModuleBase_WidgetFactory;
70 #endif /* CONFIG_WIDGETAPI_H_ */