aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/controls/text_box.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-03-19 19:11:04 +0800
committercrupest <crupest@outlook.com>2020-03-19 19:11:04 +0800
commitad29543fe081d2a0a5e6737f9073399e4e91383f (patch)
tree10f3a7519aa0f52fada56b10e226dc709972fd1d /include/cru/ui/controls/text_box.hpp
parente3eb653a856fe6793d3ddab371c3e71290fc7a9b (diff)
downloadcru-ad29543fe081d2a0a5e6737f9073399e4e91383f.tar.gz
cru-ad29543fe081d2a0a5e6737f9073399e4e91383f.tar.bz2
cru-ad29543fe081d2a0a5e6737f9073399e4e91383f.zip
...
Diffstat (limited to 'include/cru/ui/controls/text_box.hpp')
-rw-r--r--include/cru/ui/controls/text_box.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/cru/ui/controls/text_box.hpp b/include/cru/ui/controls/text_box.hpp
index 58179a57..4a4ed6e7 100644
--- a/include/cru/ui/controls/text_box.hpp
+++ b/include/cru/ui/controls/text_box.hpp
@@ -1,7 +1,11 @@
#pragma once
#include "../no_child_control.hpp"
+#include "base.hpp"
namespace cru::ui::controls {
+template <typename TControl>
+class TextControlService;
+
class TextBox : public NoChildControl {
public:
static constexpr std::string_view control_type = "TextBox";
@@ -17,11 +21,22 @@ class TextBox : public NoChildControl {
std::string_view GetControlType() const final { return control_type; }
+ render::TextRenderObject* GetTextRenderObject();
+ render::CanvasRenderObject* GetCaretRenderObject();
+ std::shared_ptr<platform::graph::IBrush> GetCaretBrush();
+
+ const TextBoxBorderStyle& GetBorderStyle();
+ void SetBorderStyle(TextBoxBorderStyle border_style);
+
private:
std::unique_ptr<render::BorderRenderObject> border_render_object_;
std::unique_ptr<render::StackLayoutRenderObject> stack_layout_render_object_;
std::unique_ptr<render::TextRenderObject> text_render_object_;
std::unique_ptr<render::CanvasRenderObject> caret_render_object_;
+ std::shared_ptr<platform::graph::IBrush> caret_brush_;
+ TextBoxBorderStyle border_style_;
+
+ std::unique_ptr<TextControlService<TextBox>> service_;
};
} // namespace cru::ui::controls