1 /*
2 * Copyright (c) 2021-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 #include "frameworks/bridge/declarative_frontend/jsview/js_row_split.h"
17
18 #include "core/components_ng/pattern/linear_split/linear_split_model_ng.h"
19 #include "frameworks/bridge/declarative_frontend/view_stack_processor.h"
20
21 namespace OHOS::Ace::Framework {
22
Create()23 void JSRowSplit::Create()
24 {
25 LinearSplitModel::GetInstance()->Create(NG::SplitType::ROW_SPLIT);
26 }
27
JsResizeable(bool resizeable)28 void JSRowSplit::JsResizeable(bool resizeable)
29 {
30 LinearSplitModel::GetInstance()->SetResizeable(NG::SplitType::ROW_SPLIT, resizeable);
31 }
32
JSBind(BindingTarget globalObj)33 void JSRowSplit::JSBind(BindingTarget globalObj)
34 {
35 JSClass<JSRowSplit>::Declare("RowSplit");
36 JSClass<JSRowSplit>::StaticMethod("create", &JSRowSplit::Create, MethodOptions::NONE);
37 JSClass<JSRowSplit>::StaticMethod("resizeable", &JSRowSplit::JsResizeable, MethodOptions::NONE);
38 JSClass<JSRowSplit>::StaticMethod("onClick", &JSInteractableView::JsOnClick);
39 JSClass<JSRowSplit>::StaticMethod("onTouch", &JSInteractableView::JsOnTouch);
40 JSClass<JSRowSplit>::StaticMethod("onHover", &JSInteractableView::JsOnHover);
41 JSClass<JSRowSplit>::StaticMethod("onKeyEvent", &JSInteractableView::JsOnKey);
42 JSClass<JSRowSplit>::StaticMethod("onDeleteEvent", &JSInteractableView::JsOnDelete);
43 JSClass<JSRowSplit>::StaticMethod("onAppear", &JSInteractableView::JsOnAppear);
44 JSClass<JSRowSplit>::StaticMethod("onDisAppear", &JSInteractableView::JsOnDisAppear);
45 JSClass<JSRowSplit>::StaticMethod("remoteMessage", &JSInteractableView::JsCommonRemoteMessage);
46 JSClass<JSRowSplit>::Inherit<JSContainerBase>();
47 JSClass<JSRowSplit>::Inherit<JSViewAbstract>();
48 JSClass<JSRowSplit>::Bind<>(globalObj);
49 }
50
51 } // namespace OHOS::Ace::Framework
52