aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/Window.hpp
blob: 0739e3dc8159da01fd4e802ebe882ef268665309 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once
#include "LayoutControl.hpp"

namespace cru::ui {
class Window final : public LayoutControl {
 public:
  static constexpr std::u16string_view control_type = u"Window";

 public:
  static Window* CreateOverlapped();

 private:
  Window();

 public:
  Window(const Window& other) = delete;
  Window(Window&& other) = delete;
  Window& operator=(const Window& other) = delete;
  Window& operator=(Window&& other) = delete;
  ~Window() override;

 public:
  std::u16string_view GetControlType() const final;

  render::RenderObject* GetRenderObject() const override;

 protected:
  void OnAddChild(Control* child, Index position) override;
  void OnRemoveChild(Control* child, Index position) override;

 private:
  std::unique_ptr<WindowHost> window_host_;

  std::unique_ptr<render::StackLayoutRenderObject> render_object_;
};
}  // namespace cru::ui