• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 REGION_IMPL_H
17 #define REGION_IMPL_H
18 
19 #include "base_impl.h"
20 #include "utils/rect.h"
21 #include "draw/path.h"
22 
23 namespace OHOS {
24 namespace Rosen {
25 namespace Drawing {
26 class Region;
27 enum class RegionOp;
28 
29 class RegionImpl : public BaseImpl {
30 public:
RegionImpl()31     RegionImpl() {}
~RegionImpl()32     ~RegionImpl() override {}
33     virtual bool Contains(int32_t x, int32_t y) const = 0;
34     virtual bool Equals(const Region& other) const = 0;
35     virtual void SetEmpty() = 0;
36     virtual bool SetRect(const RectI& rectI) = 0;
37     virtual bool SetRegion(const Region& region) = 0;
38     virtual bool SetPath(const Path& path, const Region& clip) = 0;
39     virtual bool GetBoundaryPath(Path* path) const = 0;
40     virtual RectI GetBounds() const = 0;
41     virtual bool IsComplex() const = 0;
42     virtual bool IsIntersects(const Region& other) const = 0;
43     virtual bool IsEmpty() const = 0;
44     virtual bool IsRect() const = 0;
45     virtual bool IsRegionContained(const Region& other) const = 0;
46     virtual bool Op(const Region& region, const RegionOp op) = 0;
47     virtual bool QuickReject(const RectI& rectI) const = 0;
48     virtual bool QuickReject(const Region& region) const = 0;
49     virtual void Translate(int32_t x, int32_t y) = 0;
50     virtual void Clone(const Region& other) = 0;
51     virtual std::shared_ptr<Data> Serialize() const = 0;
52     virtual bool Deserialize(std::shared_ptr<Data> data) = 0;
53 };
54 } // namespace Drawing
55 } // namespace Rosen
56 } // namespace OHOS
57 #endif
58