1 /*
2  * Copyright (c) 2024 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 "ohos_nweb/bridge/ark_web_touch_handle_state_impl.h"
17 
18 #include "base/bridge/ark_web_bridge_macros.h"
19 
20 namespace OHOS::ArkWeb {
21 
22 using ArkWebTouchHandleType = OHOS::NWeb::NWebTouchHandleState::TouchHandleType;
23 
ArkWebTouchHandleStateImpl(std::shared_ptr<OHOS::NWeb::NWebTouchHandleState> nweb_touch_handle_state)24 ArkWebTouchHandleStateImpl::ArkWebTouchHandleStateImpl(
25     std::shared_ptr<OHOS::NWeb::NWebTouchHandleState> nweb_touch_handle_state)
26     : nweb_touch_handle_state_(nweb_touch_handle_state)
27 {}
28 
GetX()29 int32_t ArkWebTouchHandleStateImpl::GetX()
30 {
31     return nweb_touch_handle_state_->GetX();
32 }
33 
GetY()34 int32_t ArkWebTouchHandleStateImpl::GetY()
35 {
36     return nweb_touch_handle_state_->GetY();
37 }
38 
IsEnable()39 bool ArkWebTouchHandleStateImpl::IsEnable()
40 {
41     return nweb_touch_handle_state_->IsEnable();
42 }
43 
GetAlpha()44 float ArkWebTouchHandleStateImpl::GetAlpha()
45 {
46     return nweb_touch_handle_state_->GetAlpha();
47 }
48 
GetEdgeHeight()49 float ArkWebTouchHandleStateImpl::GetEdgeHeight()
50 {
51     return nweb_touch_handle_state_->GetEdgeHeight();
52 }
53 
GetViewPortX()54 int32_t ArkWebTouchHandleStateImpl::GetViewPortX()
55 {
56     return nweb_touch_handle_state_->GetViewPortX();
57 }
58 
GetViewPortY()59 int32_t ArkWebTouchHandleStateImpl::GetViewPortY()
60 {
61     return nweb_touch_handle_state_->GetViewPortY();
62 }
63 
GetTouchHandleId()64 int32_t ArkWebTouchHandleStateImpl::GetTouchHandleId()
65 {
66     return nweb_touch_handle_state_->GetTouchHandleId();
67 }
68 
GetTouchHandleType()69 int ArkWebTouchHandleStateImpl::GetTouchHandleType()
70 {
71     return static_cast<int>(nweb_touch_handle_state_->GetTouchHandleType());
72 }
73 
74 } // namespace OHOS::ArkWeb
75