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_POINT_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_MOCK_ROSEN_TEST_TESTING_POINT_H 18 19 namespace OHOS::Ace::Testing { 20 class TestingPoint { 21 public: 22 TestingPoint() = default; 23 virtual ~TestingPoint() = default; 24 TestingPoint(const TestingPoint & point)25 TestingPoint(const TestingPoint& point) : x_(point.x_), y_(point.y_) {} 26 TestingPoint(float xP,float yP)27 TestingPoint(float xP, float yP) : x_(xP), y_(yP) {} 28 GetX()29 virtual float GetX() const 30 { 31 return x_; 32 } 33 GetY()34 virtual float GetY() const 35 { 36 return y_; 37 } 38 SetX(float xP)39 virtual void SetX(float xP) 40 { 41 x_ = xP; 42 } 43 SetY(float yP)44 virtual void SetY(float yP) 45 { 46 y_ = yP; 47 } 48 49 virtual TestingPoint& operator+=(const TestingPoint& /* other */) 50 { 51 return *this; 52 } 53 54 virtual TestingPoint& operator-=(const TestingPoint& /* other */) 55 { 56 return *this; 57 } 58 59 virtual TestingPoint& operator*=(float /* scale */) 60 { 61 return *this; 62 } 63 64 virtual TestingPoint& operator/=(float /* divisor */) 65 { 66 return *this; 67 } 68 69 friend bool operator==(const TestingPoint& p1, const TestingPoint& p2) 70 { 71 return false; 72 } 73 74 private: 75 float x_; 76 float y_; 77 }; 78 } // namespace OHOS::Ace::Testing 79 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_MOCK_ROSEN_TEST_TESTING_POINT_H 80