1 /* 2 * Copyright (c) 2025 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 TEST_UNITTEST_INTERFACES_ACE_KIT_MOCK_MOCK_ACE_KIT_PATTERN_H 17 #define TEST_UNITTEST_INTERFACES_ACE_KIT_MOCK_MOCK_ACE_KIT_PATTERN_H 18 19 #include "test/unittest/interfaces/ace_kit/mock/mock_ace_kit_paint_method.h" 20 #include "ui/base/referenced.h" 21 #include "ui/view/frame_node.h" 22 #include "ui/view/layout/layout_algorithm.h" 23 #include "ui/view/pattern.h" 24 25 namespace OHOS::Ace::Kit { 26 class MockAceKitPattern : public Pattern { 27 DECLARE_ACE_TYPE(MockAceKitPattern, Pattern); 28 29 public: 30 RefPtr<LayoutAlgorithm> CreateLayoutAlgorithm() override; 31 RefPtr<NodePaintMethod> CreateNodePaintMethod() override; 32 bool IsAtomicNode() const override; 33 RefPtr<Property> CreateProperty() override; 34 bool OnDirtyLayoutrSwap(const Ace::NG::DirtySwapConfig& config) override; 35 void OnModifyDone() override; 36 37 private: 38 RefPtr<MockAceKitPaintMethod> paintMethod_; 39 }; 40 } // namespace OHOS::Ace::Kit 41 42 #endif 43