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_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_LAYOUT_INFO_INTERFACE_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_LAYOUT_INFO_INTERFACE_H 18 19 #include "core/components/common/properties/text_layout_info.h" 20 #include "core/components_ng/pattern/text/layout_info_interface.h" 21 #include "core/components_ng/render/paragraph.h" 22 23 namespace OHOS::Ace::NG { 24 class LayoutInfoInterface : public virtual AceType { 25 public: 26 LayoutInfoInterface() = default; 27 ~LayoutInfoInterface() = default; GetLayoutInfoInterface()28 virtual WeakPtr<OHOS::Ace::NG::LayoutInfoInterface> GetLayoutInfoInterface() 29 { 30 return WeakClaim(this); 31 } 32 GetLineCount()33 virtual size_t GetLineCount() const 34 { 35 return 0; 36 } 37 DidExceedMaxLines()38 virtual bool DidExceedMaxLines() const 39 { 40 return false; 41 } 42 GetLineMetrics(int32_t lineNumber)43 virtual TextLineMetrics GetLineMetrics(int32_t lineNumber) 44 { 45 return TextLineMetrics(); 46 } 47 GetGlyphPositionAtCoordinate(int32_t x,int32_t y)48 virtual PositionWithAffinity GetGlyphPositionAtCoordinate(int32_t x, int32_t y) 49 { 50 PositionWithAffinity finalResult(0, TextAffinity::UPSTREAM); 51 return finalResult; 52 } 53 }; 54 } // namespace OHOS::Ace::NG 55 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_RICH_EDITOR_RICH_EDITOR_MODEL_H