1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef FOUNDATION_ACE_INTERFACES_INNER_API_ACE_KIT_SRC_VIEW_THEME_THEME_STYLE_IMPL_H 17 #define FOUNDATION_ACE_INTERFACES_INNER_API_ACE_KIT_SRC_VIEW_THEME_THEME_STYLE_IMPL_H 18 19 #include "core/components/theme/theme_constants.h" 20 21 #include "ui/view/theme/theme_style.h" 22 23 namespace OHOS::Ace::Kit { 24 using AceThemeStyle = Ace::ThemeStyle; 25 26 class ThemeStyleImpl : public ThemeStyle { 27 DECLARE_ACE_TYPE(ThemeStyleImpl, ThemeStyle); 28 29 public: 30 ThemeStyleImpl(const RefPtr<AceThemeStyle>& themeStyle); 31 ~ThemeStyleImpl(); 32 33 void GetColorAttr(const std::string& attr, const Ace::Color& errorVal, Ace::Color& retVal) override; 34 void GetDimensionAttr(const std::string& attr, const Ace::Dimension& errorVal, Ace::Dimension& retVal) override; 35 void GetIntAttr(const std::string& attr, const int32_t& errorVal, int32_t& retVal) override; 36 void GetUintAttr(const std::string& attr, const uint32_t& errorVal, uint32_t& retVal) override; 37 void GetDoubleAttr(const std::string& attr, const double& errorVal, double& retVal) override; 38 void GetStringAttr(const std::string& attr, const std::string& errorVal, std::string& retVal) override; 39 40 private: 41 RefPtr<AceThemeStyle> themeStyle_; 42 }; 43 44 } // namespace OHOS::Ace::Kit 45 46 #endif // FOUNDATION_ACE_INTERFACES_INNER_API_ACE_KIT_SRC_VIEW_THEME_THEME_STYLE_IMPL_H 47