Flair
Framework Libre Air
Widget.h
Go to the documentation of this file.
1 // %flair:license{
2 // This file is part of the Flair framework distributed under the
3 // CECILL-C License, Version 1.0.
4 // %flair:license}
13 #ifndef WIDGET_H
14 #define WIDGET_H
15 
16 #include <Object.h>
17 //#include <io_data.h>
18 #include <libxml/xpath.h>
19 
20 class Widget_impl;
21 class FrameworkManager_impl;
22 
23 namespace flair {
24 namespace gui {
25 
38 class Widget : public core::Object {
39  friend class core::FrameworkManager;
40  friend class ::Widget_impl;
41  friend class ::FrameworkManager_impl;
42 
43 public:
59  Widget(const Widget *parent, std::string name, std::string type);
60 
65  virtual ~Widget();
66 
76  void setEnabled(bool status);
77 
83  bool isEnabled(void) const;
84 
85 protected:
95  template <typename T> void SetPersistentXmlProp(std::string prop, T value);
96 
109  template <typename T> bool GetPersistentXmlProp(std::string prop, T &value);
110 
123  template <typename T>
124  void SetVolatileXmlProp(std::string prop, T value, xmlNodePtr node = NULL);
125 
134  void SendXml(void);
135 
143  virtual void XmlEvent(void){};
144 
152  void UnsetPersistentXmlProp(std::string prop);
153 
154 private:
155  class Widget_impl *pimpl_;
156 };
157 
158 } // end namespace gui
159 } // end namespace flair
160 
161 #endif // WIDGET_H
Base class for all Framework's classes.
Definition: Object.h:83
namespace of the flair Framework
Definition: Ahrs.h:19
virtual void XmlEvent(void)
Xml event.
Definition: Widget.h:143
bool GetPersistentXmlProp(std::string prop, T &value)
Get a persistent xml property.
void SetVolatileXmlProp(std::string prop, T value, xmlNodePtr node=NULL)
Set a volatile xml property.
void SetPersistentXmlProp(std::string prop, T value)
Set a persistent xml property.
void UnsetPersistentXmlProp(std::string prop)
Unset a persistent xml property.
virtual ~Widget()
Destructor.
void setEnabled(bool status)
Set enabled.
bool isEnabled(void) const
Is enabled?
Main class of the Framework library.
Definition: FrameworkManager.h:45
Widget(const Widget *parent, std::string name, std::string type)
Constructor.
Base class for all Framework's classes.
Abstract class for all Framework's widget classes.
Definition: Widget.h:38
void SendXml(void)
Send xml.