1 /* 2 * Copyright (c) 2022 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_LAYERS_HOLE_LAYER_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_LAYERS_HOLE_LAYER_H 18 19 #include "base/geometry/offset.h" 20 #include "base/geometry/size.h" 21 #include "core/pipeline/layers/container_layer.h" 22 #include "core/pipeline/layers/scene_builder.h" 23 24 namespace OHOS::Ace::Flutter { 25 26 class HoleLayer : public ContainerLayer { 27 DECLARE_ACE_TYPE(HoleLayer, ContainerLayer) 28 public: 29 HoleLayer(double width, double height); 30 ~HoleLayer() override = default; 31 32 void AddToScene(SceneBuilder& builder, double x, double y) override; 33 34 void Dump() override; 35 SetSize(double width,double height)36 void SetSize(double width, double height) 37 { 38 size_.SetWidth(width); 39 size_.SetHeight(height); 40 } 41 SetOffset(double x,double y)42 void SetOffset(double x, double y) 43 { 44 offset_.SetX(x); 45 offset_.SetY(y); 46 } 47 GetOffset()48 const Offset& GetOffset() const 49 { 50 return offset_; 51 } 52 53 private: 54 Offset offset_; 55 OHOS::Ace::Size size_; 56 int32_t holeId_; 57 }; 58 59 } // namespace OHOS::Ace::Flutter 60 61 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_LAYERS_HOLE_LAYER_H 62