From 01ab4511d3006e9f65ff96ae63b21de14b41bc48 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 4 Oct 2018 01:47:49 +0800 Subject: ... --- src/ui/border_property.h | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/ui/border_property.h (limited to 'src/ui/border_property.h') diff --git a/src/ui/border_property.h b/src/ui/border_property.h new file mode 100644 index 00000000..71ec0e7d --- /dev/null +++ b/src/ui/border_property.h @@ -0,0 +1,72 @@ +#pragma once + +#include "system_headers.h" + +#include "base.h" + + +namespace cru::ui +{ + class BorderProperty final : public PropertyChangedNotifyObject + { + public: + constexpr static auto brush_property_name = L"Brush"; + constexpr static auto width_property_name = L"StrokeWidth"; + constexpr static auto stroke_style_property_name = L"StrokeStyle"; + constexpr static auto radius_x_property_name = L"RadiusX"; + constexpr static auto radius_y_property_name = L"RadiusY"; + + using Ptr = std::shared_ptr; + + static Ptr Create() + { + return std::make_shared(); + } + + BorderProperty(); + BorderProperty(const BorderProperty& other) = delete; + BorderProperty(BorderProperty&& other) = delete; + BorderProperty& operator=(const BorderProperty& other) = delete; + BorderProperty& operator=(BorderProperty&& other) = delete; + ~BorderProperty() override = default; + + + Microsoft::WRL::ComPtr GetBrush() const + { + return brush_; + } + + float GetStrokeWidth() const + { + return stroke_width_; + } + + Microsoft::WRL::ComPtr GetStrokeStyle() const + { + return stroke_style_; + } + + float GetRadiusX() const + { + return radius_x_; + } + + float GetRadiusY() const + { + return radius_y_; + } + + void SetBrush(Microsoft::WRL::ComPtr brush); + void SetWidth(float width); + void SetStrokeStyle(Microsoft::WRL::ComPtr stroke_style); + void SetRadiusX(float radius_x); + void SetRadiusY(float radius_y); + + private: + Microsoft::WRL::ComPtr brush_ = nullptr; + float stroke_width_ = 1.0f; + Microsoft::WRL::ComPtr stroke_style_ = nullptr; + float radius_x_ = 0.0f; + float radius_y_ = 0.0f; + }; +} -- cgit v1.2.3