aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/mapper/style/PreferredSizeStylerMapper.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-24 15:40:46 +0800
committercrupest <crupest@outlook.com>2022-02-24 15:40:46 +0800
commitd9a3b8c14b9ab1bc591ca7c373daaf7141d2d098 (patch)
treee80308c57f9c81441954161fbb5804565bb158ad /include/cru/ui/mapper/style/PreferredSizeStylerMapper.h
parent9a3a9f487b24a7b1afff5e6f07e88096dc5755be (diff)
downloadcru-d9a3b8c14b9ab1bc591ca7c373daaf7141d2d098.tar.gz
cru-d9a3b8c14b9ab1bc591ca7c373daaf7141d2d098.tar.bz2
cru-d9a3b8c14b9ab1bc591ca7c373daaf7141d2d098.zip
...
Diffstat (limited to 'include/cru/ui/mapper/style/PreferredSizeStylerMapper.h')
-rw-r--r--include/cru/ui/mapper/style/PreferredSizeStylerMapper.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/cru/ui/mapper/style/PreferredSizeStylerMapper.h b/include/cru/ui/mapper/style/PreferredSizeStylerMapper.h
new file mode 100644
index 00000000..ac52240d
--- /dev/null
+++ b/include/cru/ui/mapper/style/PreferredSizeStylerMapper.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 PreferredSizeStylerMapper
+ : public BasicPtrMapper<ui::style::PreferredSizeStyler>,
+ public virtual IStylerMapper {
+ public:
+ CRU_DEFAULT_CONSTRUCTOR_DESTRUCTOR(PreferredSizeStylerMapper)
+
+ public:
+ bool SupportMapFromXml() override { return true; }
+ bool XmlElementIsOfThisType(xml::XmlElementNode* node) override;
+
+ ClonablePtr<ui::style::Styler> MapStylerFromXml(
+ xml::XmlElementNode* node) override {
+ return MapFromXml(node);
+ }
+
+ protected:
+ ClonablePtr<ui::style::PreferredSizeStyler> DoMapFromXml(
+ xml::XmlElementNode* node) override;
+};
+} // namespace cru::ui::mapper::style