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
16#ifndef FOUNDATION_ACE_INTERFACE_INNERKITS_ACE_ARKUI_RECT_H
17#define FOUNDATION_ACE_INTERFACE_INNERKITS_ACE_ARKUI_RECT_H
18
19#include <iomanip>
20
21namespace OHOS::Ace {
22class RectF {
23public:
24    RectF() = default;
25    ~RectF() = default;
26
27    RectF(float x, float y, float width, float height)
28    {
29        SetRect(x, y, width, height);
30    }
31
32    void SetRect(float x, float y, float width, float height)
33    {
34        x_ = x;
35        y_ = y;
36        width_ = width;
37        height_ = height;
38    }
39
40    float GetX() const
41    {
42        return x_;
43    }
44
45    float GetY() const
46    {
47        return y_;
48    }
49
50    float Width() const
51    {
52        return width_;
53    }
54
55    float Height() const
56    {
57        return height_;
58    }
59
60private:
61    float x_ = 0.0f;
62    float y_ = 0.0f;
63    float width_ = 0.0f;
64    float height_ = 0.0f;
65};
66} // namespace OHOS::Ace
67#endif // FOUNDATION_ACE_INTERFACE_INNERKITS_ACE_ARKUI_RECT_H
68