UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
uielement.h
Go to the documentation of this file.
1 #ifndef UGDK_UI_UIELEMENT_H_
2 #define UGDK_UI_UIELEMENT_H_
3 
4 #include <ugdk/structure.h>
5 #include <ugdk/ui.h>
6 
7 #include <memory>
8 
9 namespace ugdk {
10 namespace ui {
11 
12 class UIElement {
13  public:
14  virtual ~UIElement();
15 
16  void set_owner(Menu* owner) { owner_ = owner; }
17 
18  Menu* owner() const { return owner_; }
19  std::shared_ptr<Node> node() const { return node_; }
20 
21  virtual void Interact() const = 0;
22  virtual ugdk::structure::Box<2> GetBoundingBox() const = 0;
23 
24  protected:
25  UIElement();
26 
27  private:
28  Menu* owner_;
29  std::shared_ptr<Node> node_;
30 };
31 
32 } // namespace ugdk
33 } // namespace ugdk
34 
35 #endif // UGDK_UI_UIELEMENT_H_
std::shared_ptr< Node > node() const
Definition: uielement.h:19
void set_owner(Menu *owner)
Definition: uielement.h:16
Definition: animation.h:11
Definition: menu.h:27
Menu * owner() const
Definition: uielement.h:18
virtual void Interact() const =0
virtual ugdk::structure::Box< 2 > GetBoundingBox() const =0
Definition: uielement.h:12