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 FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERN_FORM_FORM_MODEL_NG_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERN_FORM_FORM_MODEL_NG_H
18 
19 #include "core/components_ng/pattern/overlay/overlay_manager.h"
20 #include "core/components_ng/pattern/view_context/view_context_model.h"
21 
22 namespace OHOS::Ace::NG {
23 class ACE_EXPORT ViewContextModelNG : public OHOS::Ace::ViewContextModel {
24 public:
25     void closeAnimation(const AnimationOption& option, bool needFlush) override;
26     void openAnimation(const AnimationOption& option) override;
27     int32_t OpenBindSheet(const RefPtr<NG::FrameNode>& sheetContentNode,
28          std::function<void()>&& titleBuildFunc, NG::SheetStyle& sheetStyle,
29         std::function<void()>&& onAppear, std::function<void()>&& onDisappear, std::function<void()>&& shouldDismiss,
30         std::function<void(const int32_t info)>&& onWillDismiss, std::function<void()>&& onWillAppear,
31         std::function<void()>&& onWillDisappear, std::function<void(const float)>&& onHeightDidChange,
32         std::function<void(const float)>&& onDetentsDidChange, std::function<void(const float)>&& onWidthDidChange,
33         std::function<void(const float)>&& onTypeDidChange, std::function<void()>&& sheetSpringBack,
34         int32_t currentInstanceId, int32_t targetId) override;
35     int32_t UpdateBindSheet(
36         const RefPtr<NG::FrameNode>& sheetContentNode, NG::SheetStyle& sheetStyle, bool isPartialUpdate,
37         int32_t currentInstanceId) override;
38     int32_t CloseBindSheet(const RefPtr<NG::FrameNode>& sheetContentNode, int32_t currentInstanceId) override;
39 };
40 } // namespace OHOS::Ace::NG
41 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERN_FORM_FORM_MODEL_NG_H
42