X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_WidgetAPI.h;h=ed58bb4f50b6ff05a0d8df052359280d4e979634;hb=3f19a9c3fb9c6fc844229db1f925a8a2b0b8a96f;hp=4030ff257a204b12e70af6d7c14cdbd6f4677f10;hpb=4d6a5c7e00c6d8e68c01ce5947432d9cdfbcb7a5;p=modules%2Fshaper.git diff --git a/src/Config/Config_WidgetAPI.h b/src/Config/Config_WidgetAPI.h index 4030ff257..ed58bb4f5 100644 --- a/src/Config/Config_WidgetAPI.h +++ b/src/Config/Config_WidgetAPI.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + /* * Config_WidgetAPI.h * @@ -8,7 +10,7 @@ #ifndef CONFIG_WIDGETAPI_H_ #define CONFIG_WIDGETAPI_H_ -#include +#include #include #include @@ -25,32 +27,44 @@ typedef xmlDoc *xmlDocPtr; struct _xmlDoc; //<< - class CONFIG_EXPORT Config_WidgetAPI { -public: - Config_WidgetAPI(std::string theRawXml); + public: virtual ~Config_WidgetAPI(); - bool toNextWidget(); - bool toChildWidget(); - bool toParentWidget(); + std::string widgetType() const; + bool isContainerWidget() const; + bool isPagedWidget() const; - std::string widgetType(); - bool isContainerWidget(); - bool isPagedWidget(); + std::string widgetId() const; + std::string widgetIcon() const; + std::string widgetLabel() const; + std::string widgetTooltip() const; - std::string widgetId(); - std::string widgetIcon(); - std::string widgetLabel(); - std::string widgetTooltip(); + std::string getProperty(const char* thePropName) const; - std::string getProperty(const char* thePropName); + /// Checks if the XML representation of widget has given attribute, + /// if yes - returns it's bool value, if no, or if the value can not + /// be converted to bool - returns theDefault. + /// \param theAttributeName attribute to check + /// \param theDefault default value on bad data + /// \return the boolean result + bool getBooleanAttribute(const char* theAttributeName, bool theDefault) const; + + bool isComputedDefault() const; + + protected: + /// These fields are accessible for ModuleBase_WidgetFactory only + Config_WidgetAPI(std::string theRawXml); + bool toNextWidget(); + bool toChildWidget(); + bool toParentWidget(); -private: + private: xmlDocPtr myDoc; xmlNodePtr myCurrentNode; + friend class ModuleBase_WidgetFactory; }; #endif /* CONFIG_WIDGETAPI_H_ */