aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/mapper/style
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-26 20:12:54 +0800
committercrupest <crupest@outlook.com>2022-02-26 20:12:54 +0800
commit673f1939beb1b477a23d9641a07a2e05fff903b4 (patch)
tree048ba6b4eab749266d8e2ec05df182bedcf3499f /include/cru/ui/mapper/style
parent65e288c40a593965b41378755f7111c56e123295 (diff)
downloadcru-673f1939beb1b477a23d9641a07a2e05fff903b4.tar.gz
cru-673f1939beb1b477a23d9641a07a2e05fff903b4.tar.bz2
cru-673f1939beb1b477a23d9641a07a2e05fff903b4.zip
...
Diffstat (limited to 'include/cru/ui/mapper/style')
-rw-r--r--include/cru/ui/mapper/style/MarginStylerMapper.h26
-rw-r--r--include/cru/ui/mapper/style/PaddingStylerMapper.h26
2 files changed, 52 insertions, 0 deletions
diff --git a/include/cru/ui/mapper/style/MarginStylerMapper.h b/include/cru/ui/mapper/style/MarginStylerMapper.h
new file mode 100644
index 00000000..99e292b2
--- /dev/null
+++ b/include/cru/ui/mapper/style/MarginStylerMapper.h
@@ -0,0 +1,26 @@
+#pragma once
+#include "../Mapper.h"
+#include "cru/ui/mapper/style/IStylerMapper.h"
+#include "cru/ui/style/Styler.h"
+
+namespace cru::ui::mapper::style {
+class CRU_UI_API MarginStylerMapper
+ : public BasicPtrMapper<ui::style::MarginStyler>,
+ public virtual IStylerMapper {
+ public:
+ MarginStylerMapper();
+ ~MarginStylerMapper();
+
+ public:
+ bool SupportMapFromXml() override { return true; }
+
+ ClonablePtr<ui::style::Styler> MapStylerFromXml(
+ xml::XmlElementNode* node) override {
+ return MapFromXml(node);
+ }
+
+ protected:
+ ClonablePtr<ui::style::MarginStyler> DoMapFromXml(
+ xml::XmlElementNode* node) override;
+};
+} // namespace cru::ui::mapper::style
diff --git a/include/cru/ui/mapper/style/PaddingStylerMapper.h b/include/cru/ui/mapper/style/PaddingStylerMapper.h
new file mode 100644
index 00000000..2c0b4340
--- /dev/null
+++ b/include/cru/ui/mapper/style/PaddingStylerMapper.h
@@ -0,0 +1,26 @@
+#pragma once
+#include "../Mapper.h"
+#include "cru/ui/mapper/style/IStylerMapper.h"
+#include "cru/ui/style/Styler.h"
+
+namespace cru::ui::mapper::style {
+class CRU_UI_API PaddingStylerMapper
+ : public BasicPtrMapper<ui::style::PaddingStyler>,
+ public virtual IStylerMapper {
+ public:
+ PaddingStylerMapper();
+ ~PaddingStylerMapper();
+
+ public:
+ bool SupportMapFromXml() override { return true; }
+
+ ClonablePtr<ui::style::Styler> MapStylerFromXml(
+ xml::XmlElementNode* node) override {
+ return MapFromXml(node);
+ }
+
+ protected:
+ ClonablePtr<ui::style::PaddingStyler> DoMapFromXml(
+ xml::XmlElementNode* node) override;
+};
+} // namespace cru::ui::mapper::style