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