1 /* 2 * Copyright (c) 2021-2022 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_FRAMEWORKS_CORE_COMPONENTS_SCORING_SCORING_COMPONENT_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_SCORING_SCORING_COMPONENT_H 18 19 #include <string> 20 21 #include "base/utils/utils.h" 22 #include "core/pipeline/base/sole_child_component.h" 23 24 namespace OHOS::Ace { 25 class ACE_EXPORT ScoringComponent : public SoleChildComponent { 26 DECLARE_ACE_TYPE(ScoringComponent, SoleChildComponent); 27 28 public: ScoringComponent(const std::string & name,const std::string & pageName)29 explicit ScoringComponent(const std::string& name, const std::string& pageName) : name_(name), pageName_(pageName) 30 {} 31 ~ScoringComponent() override = default; 32 33 RefPtr<RenderNode> CreateRenderNode() override; 34 RefPtr<Element> CreateElement() override; 35 GetName()36 std::string GetName() const 37 { 38 return name_; 39 } 40 GetPageName()41 std::string GetPageName() const 42 { 43 return pageName_; 44 } 45 46 private: 47 std::string name_; 48 std::string pageName_; 49 }; 50 51 } // namespace OHOS::Ace 52 53 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_SCORING_SCORING_COMPONENT_H 54