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