Container.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/types.hpp>
9 #include <ewol/debug.hpp>
10 #include <ewol/widget/Widget.hpp>
11 
12 namespace ewol {
13  namespace widget {
14  class Container;
15  using ContainerShared = ememory::SharedPtr<ewol::widget::Container>;
16  using ContainerWeak = ememory::WeakPtr<ewol::widget::Container>;
21  class Container : public ewol::Widget {
22  protected:
23  ewol::WidgetShared m_subWidget;
24  protected:
28  Container();
29  public:
33  virtual ~Container();
34  public:
44  void setSubWidget(ewol::WidgetShared _newWidget);
50  virtual void subWidgetReplace(const ewol::WidgetShared& _oldWidget,
51  const ewol::WidgetShared& _newWidget);
55  void subWidgetRemove();
59  void subWidgetUnLink();
60  public:
61  void systemDraw(const ewol::DrawProperty& _displayProp) override;
62  void onRegenerateDisplay() override;
63  void onChangeSize() override;
64  void calculateMinMaxSize() override;
65  ewol::WidgetShared getWidgetAtPos(const vec2& _pos) override;
66  ewol::ObjectShared getSubObjectNamed(const std::string& _objectName) override;
67  bool loadXML(const exml::Element& _node) override;
68  void setOffset(const vec2& _newVal) override;
69  void requestDestroyFromChild(const ewol::ObjectShared& _child) override;
70  };
71  };
72 };
void requestDestroyFromChild(const ewol::ObjectShared &_child) override
Called by a whild that want to remove pointer of itself from the current list of his parrent...
Definition: DrawProperty.hpp:15
void subWidgetUnLink()
Unlink the subwidget Node.
void onChangeSize() override
Parent have set the size and the origin. the container need to update the subwidget property...
the Cotainer widget is a widget that have an only one subWidget
Definition: Container.hpp:21
virtual void subWidgetReplace(const ewol::WidgetShared &_oldWidget, const ewol::WidgetShared &_newWidget)
Replace a old subwidget with a new one.
void setSubWidget(ewol::WidgetShared _newWidget)
set the subWidget node widget.
ewol::WidgetShared getWidgetAtPos(const vec2 &_pos) override
get the widget at the specific windows absolute position
ewol::WidgetShared getSubWidget()
get the main node widget
void onRegenerateDisplay() override
Event generated when a redraw is needed.
Definition: Area.hpp:16
bool loadXML(const exml::Element &_node) override
load properties with an XML node.
Widget class is the main widget interface, it hase some generic properties: :** known his parent :** ...
Definition: Widget.hpp:73
virtual ~Container()
Destructor.
void subWidgetRemove()
remove the subWidget node (async).
void calculateMinMaxSize() override
calculate the minimum and maximum size (need to estimate expend properties of the widget) ...
void systemDraw(const ewol::DrawProperty &_displayProp) override
{SYSTEM} extern interface to request a draw ... (called by the drawing thread [Android, X11, ...]) This function generate a clipping with the viewport openGL system. Like this a widget draw can not draw over an other widget
void setOffset(const vec2 &_newVal) override
set the zoom property of the widget.
Container()
Constructor.
ewol::ObjectShared getSubObjectNamed(const std::string &_objectName) override
Retrive an object with his name (in the global list)