1 /* 2 * Copyright (c) 2022-2023 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_MOCK_ROSEN_TEST_TESTING_PEN_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_MOCK_ROSEN_TEST_TESTING_PEN_H 18 19 #include <memory> 20 21 #include "testing_color.h" 22 #include "testing_filter.h" 23 #include "testing_path_effect.h" 24 #include "testing_shader_effect.h" 25 26 namespace OHOS::Ace::Testing { 27 class TestingPen { 28 public: 29 enum class CapStyle { 30 FLAT_CAP, 31 SQUARE_CAP, 32 ROUND_CAP, 33 }; 34 35 enum class JoinStyle { 36 MITER_JOIN, 37 ROUND_JOIN, 38 BEVEL_JOIN, 39 }; 40 41 TestingPen() = default; 42 ~TestingPen() = default; 43 SetAntiAlias(bool aa)44 virtual void SetAntiAlias(bool aa) {} SetBlendMode(BlendMode mode)45 virtual void SetBlendMode(BlendMode mode) {} SetWidth(float width)46 virtual void SetWidth(float width) {} SetCapStyle(CapStyle cap)47 virtual void SetCapStyle(CapStyle cap) {} SetColor(const TestingColor & color)48 virtual void SetColor(const TestingColor& color) {} SetColor(int color)49 virtual void SetColor(int color) {} SetFilter(const TestingFilter & filter)50 virtual void SetFilter(const TestingFilter& filter) {} SetShaderEffect(std::shared_ptr<TestingShaderEffect>)51 virtual void SetShaderEffect(std::shared_ptr<TestingShaderEffect> /* effect */) {} SetPathEffect(std::shared_ptr<TestingPathEffect>)52 virtual void SetPathEffect(std::shared_ptr<TestingPathEffect> /* effect */) {} SetJoinStyle(JoinStyle js)53 virtual void SetJoinStyle(JoinStyle js) {} SetMiterLimit(float limit)54 virtual void SetMiterLimit(float limit) {} SetAlpha(uint32_t alpha)55 virtual void SetAlpha(uint32_t alpha) {} SetAlphaF(float alpha)56 virtual void SetAlphaF(float alpha) {} GetShaderEffect()57 virtual std::shared_ptr<TestingShaderEffect> GetShaderEffect() 58 { 59 return std::make_shared<TestingShaderEffect>(); 60 } 61 GetWidth()62 virtual float GetWidth() 63 { 64 return .0f; 65 } 66 }; 67 } // namespace OHOS::Ace::Testing 68 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_MOCK_ROSEN_TEST_TESTING_PEN_H 69