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 #include "ohos_adapter/bridge/ark_clip_board_image_data_adapter_wrapper.h"
17 
18 #include "base/bridge/ark_web_bridge_macros.h"
19 
20 namespace OHOS::ArkWeb {
21 
ArkClipBoardImageDataAdapterWrapper(ArkWebRefPtr<ArkClipBoardImageDataAdapter> ref)22 ArkClipBoardImageDataAdapterWrapper::ArkClipBoardImageDataAdapterWrapper(ArkWebRefPtr<ArkClipBoardImageDataAdapter> ref)
23     : ctocpp_(ref)
24 {}
25 
GetColorType()26 NWeb::ClipBoardImageColorType ArkClipBoardImageDataAdapterWrapper::GetColorType()
27 {
28     return (NWeb::ClipBoardImageColorType)ctocpp_->GetColorType();
29 }
30 
GetAlphaType()31 NWeb::ClipBoardImageAlphaType ArkClipBoardImageDataAdapterWrapper::GetAlphaType()
32 {
33     return (NWeb::ClipBoardImageAlphaType)ctocpp_->GetAlphaType();
34 }
35 
GetData()36 uint32_t* ArkClipBoardImageDataAdapterWrapper::GetData()
37 {
38     return ctocpp_->GetData();
39 }
40 
GetDataSize()41 size_t ArkClipBoardImageDataAdapterWrapper::GetDataSize()
42 {
43     return ctocpp_->GetDataSize();
44 }
45 
GetRowBytes()46 size_t ArkClipBoardImageDataAdapterWrapper::GetRowBytes()
47 {
48     return ctocpp_->GetRowBytes();
49 }
50 
GetWidth()51 int32_t ArkClipBoardImageDataAdapterWrapper::GetWidth()
52 {
53     return ctocpp_->GetWidth();
54 }
55 
GetHeight()56 int32_t ArkClipBoardImageDataAdapterWrapper::GetHeight()
57 {
58     return ctocpp_->GetHeight();
59 }
60 
SetColorType(NWeb::ClipBoardImageColorType color)61 void ArkClipBoardImageDataAdapterWrapper::SetColorType(NWeb::ClipBoardImageColorType color)
62 {
63     ctocpp_->SetColorType((int32_t)color);
64 }
65 
SetAlphaType(NWeb::ClipBoardImageAlphaType alpha)66 void ArkClipBoardImageDataAdapterWrapper::SetAlphaType(NWeb::ClipBoardImageAlphaType alpha)
67 {
68     ctocpp_->SetAlphaType((int32_t)alpha);
69 }
70 
SetData(uint32_t * data)71 void ArkClipBoardImageDataAdapterWrapper::SetData(uint32_t* data)
72 {
73     ctocpp_->SetData(data);
74 }
75 
SetDataSize(size_t size)76 void ArkClipBoardImageDataAdapterWrapper::SetDataSize(size_t size)
77 {
78     ctocpp_->SetDataSize(size);
79 }
80 
SetRowBytes(size_t rowBytes)81 void ArkClipBoardImageDataAdapterWrapper::SetRowBytes(size_t rowBytes)
82 {
83     ctocpp_->SetRowBytes(rowBytes);
84 }
85 
SetWidth(int32_t width)86 void ArkClipBoardImageDataAdapterWrapper::SetWidth(int32_t width)
87 {
88     ctocpp_->SetWidth(width);
89 }
90 
SetHeight(int32_t height)91 void ArkClipBoardImageDataAdapterWrapper::SetHeight(int32_t height)
92 {
93     ctocpp_->SetHeight(height);
94 }
95 
96 } // namespace OHOS::ArkWeb
97