aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-22 00:30:08 +0800
committercrupest <crupest@outlook.com>2022-01-22 00:30:08 +0800
commitbc1f7cce2440310c2544bf3ea48b44dc4ff04eac (patch)
tree332737f28edd231bb0d74e262054ba80f8959709 /include/cru/ui
parent83eb8263b1c1970bac4f811fdd2e221df63145e1 (diff)
downloadcru-bc1f7cce2440310c2544bf3ea48b44dc4ff04eac.tar.gz
cru-bc1f7cce2440310c2544bf3ea48b44dc4ff04eac.tar.bz2
cru-bc1f7cce2440310c2544bf3ea48b44dc4ff04eac.zip
...
Diffstat (limited to 'include/cru/ui')
-rw-r--r--include/cru/ui/mapper/ColorMapper.hpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/cru/ui/mapper/ColorMapper.hpp b/include/cru/ui/mapper/ColorMapper.hpp
new file mode 100644
index 00000000..33333025
--- /dev/null
+++ b/include/cru/ui/mapper/ColorMapper.hpp
@@ -0,0 +1,19 @@
+#pragma once
+#include "Mapper.hpp"
+#include "cru/xml/XmlNode.hpp"
+
+namespace cru::ui::mapper {
+class ColorMapper : public BasicMapper<Color> {
+ public:
+ CRU_DEFAULT_CONSTRUCTOR_DESTRUCTOR(ColorMapper)
+
+ public:
+ bool SupportMapFromString() override { return true; }
+ bool SupportMapFromXml() override { return true; }
+ bool XmlElementIsOfThisType(xml::XmlElementNode* node) override;
+
+ protected:
+ std::unique_ptr<Color> DoMapFromString(String str) override;
+ std::unique_ptr<Color> DoMapFromXml(xml::XmlElementNode* node) override;
+};
+} // namespace cru::ui::mapper