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 SetRect(const RectI& rectI) = 0; 35 virtual bool SetPath(const Path& path, const Region& clip) = 0; 36 virtual bool GetBoundaryPath(Path* path) const = 0; 37 virtual bool IsIntersects(const Region& other) const = 0; 38 virtual bool IsEmpty() const = 0; 39 virtual bool IsRect() const = 0; 40 virtual bool IsRegionContained(const Region& other) const = 0; 41 virtual bool Op(const Region& region, const RegionOp op) = 0; 42 virtual bool QuickReject(const RectI& rectI) const = 0; 43 virtual void Clone(const Region& other) = 0; 44 virtual std::shared_ptr<Data> Serialize() const = 0; 45 virtual bool Deserialize(std::shared_ptr<Data> data) = 0; 46 }; 47 } // namespace Drawing 48 } // namespace Rosen 49 } // namespace OHOS 50 #endif 51