17777dab0Sopenharmony_ci/* 27777dab0Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 37777dab0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 47777dab0Sopenharmony_ci * you may not use this file except in compliance with the License. 57777dab0Sopenharmony_ci * You may obtain a copy of the License at 67777dab0Sopenharmony_ci * 77777dab0Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 87777dab0Sopenharmony_ci * 97777dab0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 107777dab0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 117777dab0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 127777dab0Sopenharmony_ci * See the License for the specific language governing permissions and 137777dab0Sopenharmony_ci * limitations under the License. 147777dab0Sopenharmony_ci */ 157777dab0Sopenharmony_ci 167777dab0Sopenharmony_ci/** 177777dab0Sopenharmony_ci * @addtogroup Web 187777dab0Sopenharmony_ci * @{ 197777dab0Sopenharmony_ci * 207777dab0Sopenharmony_ci * @brief Provide the definition of the C interface for the native ArkWeb. 217777dab0Sopenharmony_ci * @since 12 227777dab0Sopenharmony_ci */ 237777dab0Sopenharmony_ci/** 247777dab0Sopenharmony_ci * @file arkweb_interface.h 257777dab0Sopenharmony_ci * 267777dab0Sopenharmony_ci * @brief Provides a unified entry for the native ArkWeb. 277777dab0Sopenharmony_ci * @kit ArkWeb 287777dab0Sopenharmony_ci * @library libohweb.so 297777dab0Sopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 307777dab0Sopenharmony_ci * @since 12 317777dab0Sopenharmony_ci */ 327777dab0Sopenharmony_ci 337777dab0Sopenharmony_ci#ifndef ARKWEB_INTERFACE_H 347777dab0Sopenharmony_ci#define ARKWEB_INTERFACE_H 357777dab0Sopenharmony_ci 367777dab0Sopenharmony_ci#include "arkweb_type.h" 377777dab0Sopenharmony_ci 387777dab0Sopenharmony_ci#ifdef __cplusplus 397777dab0Sopenharmony_ciextern "C" { 407777dab0Sopenharmony_ci#endif 417777dab0Sopenharmony_ci 427777dab0Sopenharmony_ci/** 437777dab0Sopenharmony_ci * @brief Defines the native API type of any size. 447777dab0Sopenharmony_ci * 457777dab0Sopenharmony_ci * @since 12 467777dab0Sopenharmony_ci */ 477777dab0Sopenharmony_citypedef struct { 487777dab0Sopenharmony_ci /** Defines the size information of the native API set. */ 497777dab0Sopenharmony_ci size_t size; 507777dab0Sopenharmony_ci} ArkWeb_AnyNativeAPI; 517777dab0Sopenharmony_ci 527777dab0Sopenharmony_ci/** 537777dab0Sopenharmony_ci * @brief Defines the native API set type. 547777dab0Sopenharmony_ci * 557777dab0Sopenharmony_ci * @since 12 567777dab0Sopenharmony_ci */ 577777dab0Sopenharmony_citypedef enum { 587777dab0Sopenharmony_ci /** API type related to ArkWeb component. */ 597777dab0Sopenharmony_ci ARKWEB_NATIVE_COMPONENT, 607777dab0Sopenharmony_ci /** API type related to ArkWeb controller. */ 617777dab0Sopenharmony_ci ARKWEB_NATIVE_CONTROLLER, 627777dab0Sopenharmony_ci /** API type related to ArkWeb WebMessagePort. */ 637777dab0Sopenharmony_ci ARKWEB_NATIVE_WEB_MESSAGE_PORT, 647777dab0Sopenharmony_ci /** API type related to ArkWeb WebMessage. */ 657777dab0Sopenharmony_ci ARKWEB_NATIVE_WEB_MESSAGE, 667777dab0Sopenharmony_ci /** API type related to ArkWeb cookie manager. */ 677777dab0Sopenharmony_ci ARKWEB_NATIVE_COOKIE_MANAGER, 687777dab0Sopenharmony_ci} ArkWeb_NativeAPIVariantKind; 697777dab0Sopenharmony_ci 707777dab0Sopenharmony_ci/* 717777dab0Sopenharmony_ci * @brief Obtains the native API set of a specified type. 727777dab0Sopenharmony_ci * @param type Indicates the type of the native API set provided by ArkWeb. 737777dab0Sopenharmony_ci * @return Return the pointer to the native API abstract object that carries the size. 747777dab0Sopenharmony_ci * If the type is incorrect, a null pointer is returned. 757777dab0Sopenharmony_ci * 767777dab0Sopenharmony_ci * @syscap SystemCapability.Web.Webview.Core 777777dab0Sopenharmony_ci * @since 12 787777dab0Sopenharmony_ci */ 797777dab0Sopenharmony_ciArkWeb_AnyNativeAPI* OH_ArkWeb_GetNativeAPI(ArkWeb_NativeAPIVariantKind type); 807777dab0Sopenharmony_ci 817777dab0Sopenharmony_ci#ifdef __cplusplus 827777dab0Sopenharmony_ci}; 837777dab0Sopenharmony_ci#endif 847777dab0Sopenharmony_ci#endif // ARKWEB_INTERFACE_H