diff options
| author | crupest <crupest@outlook.com> | 2022-02-08 16:53:51 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2022-02-08 16:53:51 +0800 |
| commit | 74bb9cd27242b9320f99ff4d2b50c3051576cc14 (patch) | |
| tree | 744bac5799c593d1d6f81e7b09581bea626f2cde /include/cru/ui/style/StyleRule.hpp | |
| parent | b90c398de829d1ba5329651d75bae82f5e4085fe (diff) | |
| download | cru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.tar.gz cru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.tar.bz2 cru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.zip | |
...
Diffstat (limited to 'include/cru/ui/style/StyleRule.hpp')
| -rw-r--r-- | include/cru/ui/style/StyleRule.hpp | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/include/cru/ui/style/StyleRule.hpp b/include/cru/ui/style/StyleRule.hpp deleted file mode 100644 index 743aa759..00000000 --- a/include/cru/ui/style/StyleRule.hpp +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once -#include "../Base.hpp" -#include "Condition.hpp" -#include "Styler.hpp" -#include "cru/common/ClonablePtr.hpp" - -#include <memory> -#include <vector> - -namespace cru::ui::style { -class StyleRule : public Object { - public: - static ClonablePtr<StyleRule> Create(ClonablePtr<Condition> condition, - ClonablePtr<Styler> styler, - String name = {}) { - return ClonablePtr<StyleRule>(new StyleRule( - std::move(condition), std::move(styler), std::move(name))); - } - - StyleRule(ClonablePtr<Condition> condition, ClonablePtr<Styler> styler, - String name = {}); - - CRU_DEFAULT_COPY(StyleRule) - CRU_DEFAULT_MOVE(StyleRule) - - ~StyleRule() override = default; - - public: - String GetName() const { return name_; } - Condition* GetCondition() const { return condition_.get(); } - Styler* GetStyler() const { return styler_.get(); } - - StyleRule WithNewCondition(ClonablePtr<Condition> condition, - String name = {}) const { - return StyleRule{std::move(condition), styler_, std::move(name)}; - } - - StyleRule WithNewStyler(ClonablePtr<Styler> styler, String name = {}) const { - return StyleRule{condition_, std::move(styler), std::move(name)}; - } - - bool CheckAndApply(controls::Control* control) const; - - private: - ClonablePtr<Condition> condition_; - ClonablePtr<Styler> styler_; - String name_; -}; -} // namespace cru::ui::style |
