Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom into Dev_0.6.1
[modules/shaper.git] / src / Config / Config_WidgetAPI.h
index ad084049f76e147a9b0e468684e9a7694fceccaf..ed58bb4f50b6ff05a0d8df052359280d4e979634 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 /*
  * Config_WidgetAPI.h
  *
@@ -28,14 +30,8 @@ struct _xmlDoc;
 class CONFIG_EXPORT Config_WidgetAPI
 {
  public:
-  Config_WidgetAPI(std::string theRawXml);
   virtual ~Config_WidgetAPI();
 
-  //TODO(sbh): Make these fields protected, accessible only for WidgetFactory
-  bool toNextWidget();
-  bool toChildWidget();
-  bool toParentWidget();
-
   std::string widgetType() const;
   bool isContainerWidget() const;
   bool isPagedWidget() const;
@@ -47,10 +43,28 @@ class CONFIG_EXPORT Config_WidgetAPI
 
   std::string getProperty(const char* thePropName) const;
 
+  /// 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:
   xmlDocPtr myDoc;
   xmlNodePtr myCurrentNode;
 
+  friend class ModuleBase_WidgetFactory;
 };
 
 #endif /* CONFIG_WIDGETAPI_H_ */