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 #ifndef DASHING_H 16 #define DASHING_H 17 #include "test_base.h" 18 19 struct Dashings { 20 float finalX = (600); 21 float finalY = (0); 22 float phase = (0); 23 float startX = (0); 24 float startY = (0); 25 }; 26 27 class Dashing : public TestBase { 28 public: 29 Dashing(); 30 ~Dashing() override; 31 32 protected: 33 void OnTestFunction(OH_Drawing_Canvas *canvas) override; 34 }; 35 36 class Dashing2 : public TestBase { 37 public: 38 Dashing2(); 39 ~Dashing2() override; 40 41 protected: 42 void OnTestFunction(OH_Drawing_Canvas *canvas) override; 43 }; 44 45 class Dashing4 : public TestBase { 46 public: 47 Dashing4(); 48 ~Dashing4() override; 49 50 protected: 51 struct Intervals { 52 int fOnInterval; 53 int fOffInterval; 54 }; 55 void OnTestFunction(OH_Drawing_Canvas *canvas) override; 56 void DashingNum(OH_Drawing_Canvas *canvas, OH_Drawing_Pen *pen); 57 void DashingTow(OH_Drawing_Canvas *canvas, OH_Drawing_Pen *pen); 58 void DashingThree(OH_Drawing_Canvas *canvas, OH_Drawing_Pen *pen); 59 }; 60 #endif // DASHING_H