mirror of
https://github.com/openharmony/interface_sdk_c.git
synced 2026-08-24 14:32:50 -04:00
Merge branch 'master' of https://gitee.com/zhangwuf/interface_sdk_c_1
This commit is contained in:
@@ -171,10 +171,6 @@
|
||||
"first_introduced": "11",
|
||||
"name": "OH_JSVM_CreateExternal"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_JSVM_CreateExternalArraybuffer"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_JSVM_CreateObject"
|
||||
@@ -495,10 +491,6 @@
|
||||
"first_introduced": "11",
|
||||
"name": "OH_JSVM_AddFinalizer"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_JSVM_PostFinalizer"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_JSVM_GetVersion"
|
||||
|
||||
@@ -23,6 +23,16 @@ if (!is_arkui_x) {
|
||||
]
|
||||
}
|
||||
|
||||
ohos_ndk_headers("arkui_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/arkui/"
|
||||
sources = [
|
||||
"native_event.h",
|
||||
"native_interface.h",
|
||||
"native_node.h",
|
||||
"native_type.h",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_ndk_library("libace_ndk") {
|
||||
ndk_description_file = "./libace.ndk.json"
|
||||
min_compact_version = "7"
|
||||
|
||||
@@ -90,5 +90,17 @@
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_NativeXComponent_UnregisterOnFrameCallback"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_NativeXComponent_AttachNativeRootNode"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_NativeXComponent_DetachNativeRootNode"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkUI_GetNativeAPI"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,224 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup ArkUI_NativeModule
|
||||
* @{
|
||||
*
|
||||
* @brief Provides the UI component capabilities of the ArkUI on the Native side, such as component creation and destruction, tree node operations, attribute setting, and event listening.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file native_event.h
|
||||
*
|
||||
* @brief Provides the event type definition set of the ArkUI on the Native side.
|
||||
*
|
||||
* @library libace_ndk.z.so
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @since 12
|
||||
*/
|
||||
|
||||
#ifndef ARKUI_NATIVE_EVENT
|
||||
#define ARKUI_NATIVE_EVENT
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Tool type definition of the Touch event.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** The tool type is not supported. */
|
||||
NODE_TOOL_TYPE_UNKNOWN = -1,
|
||||
|
||||
/** Finger */
|
||||
NODE_TOOL_TYPE_FINGER = 0,
|
||||
|
||||
/** Pen */
|
||||
NODE_TOOL_TYPE_STYLUS = 1,
|
||||
} ArkUI_NodeToolType;
|
||||
|
||||
/**
|
||||
* @brief Source type definition of the Touch event.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Unsupported source type */
|
||||
NODE_SOURCE_TYPE_UNKNOWN = -1,
|
||||
/** Touch screen */
|
||||
NODE_SOURCE_TYPE_TOUCH_SCREEN = 0,
|
||||
/** Stylus */
|
||||
NODE_SOURCE_TYPE_STYLUS = 1,
|
||||
/** Touchpad */
|
||||
NODE_SOURCE_TYPE_TOUCHPAD = 2,
|
||||
} ArkUI_NodeSourceType;
|
||||
|
||||
/**
|
||||
* @brief Defines the data structure of the touch point information of the Touch event.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct {
|
||||
/** Touch event ID. */
|
||||
int32_t id;
|
||||
|
||||
/** Timestamp when a finger is pressed, in microseconds (us). */
|
||||
int64_t pressedTime;
|
||||
|
||||
/** X coordinate of the screen to which the touch position belongs. */
|
||||
int32_t screenX;
|
||||
|
||||
/** Y coordinate of the screen to which the touch position belongs. */
|
||||
int32_t screenY;
|
||||
|
||||
/** X coordinate of the touch position in the window. */
|
||||
int32_t windowX;
|
||||
|
||||
/** Y coordinate of the touch position in the window. */
|
||||
int32_t windowY;
|
||||
|
||||
/** X coordinate of the touch position in the current trigger event component. */
|
||||
int32_t nodeX;
|
||||
|
||||
/** Y coordinate of the touch position in the current trigger event component. */
|
||||
int32_t nodeY;
|
||||
|
||||
/** Pressure value. The value range is [0.0, 1.0]. 0.0 indicates that the pressure is not supported. */
|
||||
double pressure;
|
||||
|
||||
/** Wideness of the touch area. */
|
||||
int32_t contactAreaWidth;
|
||||
|
||||
/** Height of the touch area. */
|
||||
int32_t contactAreaHeight;
|
||||
|
||||
/** Angle relative to the YZ plane. The value range is [-90, 90], where a positive value indicates the right slant. */
|
||||
double tiltX;
|
||||
|
||||
/** Angle relative to the XZ plane. The value range is [-90, 90]. A positive value indicates a downward tilt. */
|
||||
double tiltY;
|
||||
|
||||
/** X coordinate of the center point of the tool area. */
|
||||
int32_t toolX;
|
||||
|
||||
/** Y coordinate of the center point of the tool area. */
|
||||
int32_t toolY;
|
||||
|
||||
/** Width of the contact area of the tool. */
|
||||
int32_t toolWidth;
|
||||
|
||||
/** Height of the contact area of the tool. */
|
||||
int32_t toolHeight;
|
||||
|
||||
/** Enter the X coordinate of the device. */
|
||||
int32_t rawX;
|
||||
|
||||
/** Input the Y coordinate of the device. */
|
||||
int32_t rawY;
|
||||
|
||||
/** Tool type. */
|
||||
ArkUI_NodeToolType toolType;
|
||||
} ArkUI_NodeTouchPoint;
|
||||
|
||||
/**
|
||||
* @brief Defines the enumerated value of the touch event type.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Touch to cancel. */
|
||||
NODE_ACTION_CANCEL = 0,
|
||||
/** Touch and press. */
|
||||
NODE_ACTION_DOWN = 1,
|
||||
/** Touch to move. */
|
||||
NODE_ACTION_MOVE = 2,
|
||||
/** Touch to lift. */
|
||||
NODE_ACTION_UP = 3,
|
||||
} ArkUI_NodeTouchEventAction;
|
||||
|
||||
/**
|
||||
* @brief Defines the structure type of historical point information.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct {
|
||||
/** Screen touch event type. */
|
||||
ArkUI_NodeTouchEventAction action;
|
||||
/** Timestamp of historical touchscreen events, in microseconds (us). */
|
||||
int64_t timeStamp;
|
||||
/** Source type of historical touch events. */
|
||||
ArkUI_NodeTouchPoint actionTouch;
|
||||
/** Source type of historical touch events. */
|
||||
ArkUI_NodeSourceType sourceType;
|
||||
} ArkUI_NodeHistoricalTouchPoint;
|
||||
|
||||
/**
|
||||
* @brief Defines the structure type of the Touch event.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct {
|
||||
/** Type of the touch event. */
|
||||
ArkUI_NodeTouchEventAction action;
|
||||
|
||||
/** Timestamp of the touch event, in microseconds (us). */
|
||||
int64_t timeStamp;
|
||||
|
||||
/** Information about the touch point of the current touch event. */
|
||||
ArkUI_NodeTouchPoint actionTouch;
|
||||
|
||||
/**
|
||||
* @brief Return the information about all screen touch points when this event occurs.
|
||||
* @param points Pointer object used to receive data.
|
||||
* @return Number of screen contact points.
|
||||
* @note
|
||||
* When this function is invoked, the framework creates a heap memory object of the touch point information array and returns a pointer. Developers need to manually release the memory by calling delete[] after using the function.
|
||||
*/
|
||||
int32_t (*getTouches)(ArkUI_NodeTouchPoint** points);
|
||||
|
||||
/**
|
||||
* @brief Return the historical point information in the event. These are the motions that occur between this event and the previous event.
|
||||
* @param historicalPoints Pointer object used to receive data.
|
||||
* @return Number of historical points.
|
||||
* @note
|
||||
* When this function is invoked, the framework creates a heap memory object of the historical point data array and returns a pointer. After the function is invoked, you need to manually release the memory by calling delete[].
|
||||
*/
|
||||
int32_t (*getHistoricalPoints)(ArkUI_NodeHistoricalTouchPoint** historicalPoints);
|
||||
|
||||
/** Type of the triggering event source. */
|
||||
ArkUI_NodeSourceType sourceType;
|
||||
|
||||
/** Prohibit further pop-up processing of the event to the parent node. */
|
||||
bool stopPropagation;
|
||||
|
||||
/** Block the default event processing behavior of the current node and allow events to bubble up further. */
|
||||
bool preventDefault;
|
||||
} ArkUI_NodeTouchEvent;
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // ARKUI_NATIVE_EVENT
|
||||
/** @} */
|
||||
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup ArkUI_NativeModule
|
||||
* @{
|
||||
*
|
||||
* @brief Provide UI capabilities of the ArkUI on the Native side, such as creating and destroying UI components, operating tree nodes, setting attributes, and listening on events.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file native_interface.h
|
||||
*
|
||||
* @brief Provide the unified entry function of the NativeModule interface.
|
||||
*
|
||||
* @library libace_ndk.z.so
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @since 12
|
||||
*/
|
||||
|
||||
#ifndef ARKUI_NATIVE_INTERFACE_H
|
||||
#define ARKUI_NATIVE_INTERFACE_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Define the native interface type of any version.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* @brief Define the version information about the Native interface set.
|
||||
*
|
||||
* Different from the NDK version, the version field of the NativeNode interface indicates the version information of the structure.
|
||||
*/
|
||||
int32_t version;
|
||||
} ArkUI_AnyNativeAPI;
|
||||
|
||||
/**
|
||||
* @brief Define the native interface set type.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Indicates the type of the interface related to the UI component. */
|
||||
ARKUI_NATIVE_NODE,
|
||||
} ArkUI_NativeAPIVariantKind;
|
||||
|
||||
/**
|
||||
* @brief Obtain the Native interface set of a specified version.
|
||||
*
|
||||
* @param type indicates the class of the Native interface set provided by the ArkUI, for example, the UI component interface class ARKUI_NATIVE_NODE.
|
||||
* @param version Version of the native interface structure, which is obtained through the suffix defined by the structure, for example, ArkUI_NativeNodeAPI_1 of the UI component structure of version 1.
|
||||
* @return ArkUI_AnyNativeAPI* Return the abstract object of the Native interface that carries the version.
|
||||
* @code {.cpp}
|
||||
* #include<arkui/native_interface.h>
|
||||
* #include<arkui/native_node.h>
|
||||
*
|
||||
* auto anyNativeAPI = OH_ArkUI_GetNativeAPI(ARKUI_NATIVE_NODE, 1);
|
||||
* if (anyNativeAPI->version == 1) {
|
||||
* auto basicNodeApi = reinterpret_cast<ArkUI_NativeNodeAPI_1*>(anyNativeAPI);
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
ArkUI_AnyNativeAPI* OH_ArkUI_GetNativeAPI(ArkUI_NativeAPIVariantKind type, int32_t version);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // ARKUI_NATIVE_INTERFACE_H
|
||||
/** @} */
|
||||
@@ -42,6 +42,8 @@
|
||||
#include <vector>
|
||||
#endif
|
||||
|
||||
#include "arkui/native_type.h"
|
||||
|
||||
#include "native_xcomponent_key_event.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -624,6 +626,29 @@ int32_t OH_NativeXComponent_RegisterOnFrameCallback(OH_NativeXComponent* compone
|
||||
*/
|
||||
int32_t OH_NativeXComponent_UnregisterOnFrameCallback(OH_NativeXComponent* component);
|
||||
|
||||
/**
|
||||
* @brief Mount the UI component created by using the native interface of the ArkUI to the current XComponent.
|
||||
*
|
||||
* @param component indicates the pointer that points to the OH_NativeXComponent instance.
|
||||
* @param root Pointer that points to the component instance created by the Native interface.
|
||||
* @return 0 - Success.
|
||||
* 401: parameter exception.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_NativeXComponent_AttachNativeRootNode(OH_NativeXComponent* component, ArkUI_NodeHandle root);
|
||||
|
||||
/**
|
||||
* @brief Uninstall the native component of the ArkUI from the current XComponent.
|
||||
*
|
||||
* @param component indicates the pointer that points to the OH_NativeXComponent instance.
|
||||
* @param root Pointer that points to the component instance created by the Native interface.
|
||||
* @return 0 - Success.
|
||||
* 401: parameter error.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_NativeXComponent_DetachNativeRootNode(OH_NativeXComponent* component, ArkUI_NodeHandle root);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,689 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup ArkUI_NativeModule
|
||||
* @{
|
||||
*
|
||||
* @brief Provides the UI capabilities of the ArkUI on the Native side, such as UI component creation and destruction, tree node operation, attribute setting, and event listening.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file native_type.h
|
||||
*
|
||||
* @brief Provides the common type definition of the NativeModule.
|
||||
*
|
||||
* @library libace_ndk.z.so
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @since 12
|
||||
*/
|
||||
|
||||
#ifndef ARKUI_NATIVE_TYPE_H
|
||||
#define ARKUI_NATIVE_TYPE_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Provides the definition of the ArkUI native component instance object.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
struct ArkUI_Node;
|
||||
|
||||
/**
|
||||
* @brief Define the object pointer of the ArkUI native component instance.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct ArkUI_Node* ArkUI_NodeHandle;
|
||||
|
||||
/**
|
||||
* @brief ArkUI number type definition on the native side.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef union {
|
||||
/** Floating-point type.*/
|
||||
float f32;
|
||||
/** Signed integer.*/
|
||||
int32_t i32;
|
||||
/** Unsigned integer.*/
|
||||
uint32_t u32;
|
||||
} ArkUI_NumberValue;
|
||||
|
||||
/**
|
||||
* @brief Defines the layout alignment enumerated values.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Start from the top.*/
|
||||
ARKUI_ALIGNMENT_TOP_START = 0,
|
||||
/** Top centered.*/
|
||||
ARKUI_ALIGNMENT_TOP,
|
||||
/** Top and tail ends.*/
|
||||
ARKUI_ALIGNMENT_TOP_END,
|
||||
/** The start end is vertically centered.*/
|
||||
ARKUI_ALIGNMENT_START,
|
||||
/** Center horizontally and vertically.*/
|
||||
ARKUI_ALIGNMENT_CENTER,
|
||||
/** The tail end is centered vertically.*/
|
||||
ARKUI_ALIGNMENT_END,
|
||||
/** Start end at the bottom.*/
|
||||
ARKUI_ALIGNMENT_BOTTOM_START,
|
||||
/** The bottom is horizontally centered.*/
|
||||
ARKUI_ALIGNMENT_BOTTOM,
|
||||
/** Bottom end.*/
|
||||
ARKUI_ALIGNMENT_BOTTOM_END,
|
||||
} ArkUI_Alignment;
|
||||
|
||||
/**
|
||||
* @brief Defines the enumerated values for repeated image placement.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** The value must not be repeated.*/
|
||||
ARKUI_IMAGE_REPEAT_NONE = 0,
|
||||
/** Repeat in the X axis direction.*/
|
||||
ARKUI_IMAGE_REPEAT_X,
|
||||
/** Repeat on the Y axis.*/
|
||||
ARKUI_IMAGE_REPEAT_Y,
|
||||
/** Repeat on the X and Y axes.*/
|
||||
ARKUI_IMAGE_REPEAT_XY,
|
||||
} ArkUI_ImageRepeat;
|
||||
|
||||
/**
|
||||
* @brief Defines the enumerated values of the font style.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Standard font style.*/
|
||||
ARKUI_FONT_STYLE_NORMAL = 0,
|
||||
/** Italic font style.*/
|
||||
ARKUI_FONT_STYLE_ITALIC
|
||||
} ArkUI_FontStyle;
|
||||
|
||||
/**
|
||||
* @brief Defines the enumerated values of the font thickness and word weight.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** 100 */
|
||||
ARKUI_FONT_WEIGHT_W100 = 0,
|
||||
/** 200 */
|
||||
ARKUI_FONT_WEIGHT_W200,
|
||||
/** 300 */
|
||||
ARKUI_FONT_WEIGHT_W300,
|
||||
/** 400 */
|
||||
ARKUI_FONT_WEIGHT_W400,
|
||||
/** 500 */
|
||||
ARKUI_FONT_WEIGHT_W500,
|
||||
/** 600 */
|
||||
ARKUI_FONT_WEIGHT_W600,
|
||||
/** 700 */
|
||||
ARKUI_FONT_WEIGHT_W700,
|
||||
/** 800 */
|
||||
ARKUI_FONT_WEIGHT_W800,
|
||||
/** 900 */
|
||||
ARKUI_FONT_WEIGHT_W900,
|
||||
/** The font size is thick.*/
|
||||
ARKUI_FONT_WEIGHT_BOLD,
|
||||
/** The font thickness is normal.*/
|
||||
ARKUI_FONT_WEIGHT_NORMAL,
|
||||
/** The font is very thick.*/
|
||||
ARKUI_FONT_WEIGHT_BOLDER,
|
||||
/** The font size is fine.*/
|
||||
ARKUI_FONT_WEIGHT_LIGHTER,
|
||||
/** The font thickness is moderate.*/
|
||||
ARKUI_FONT_WEIGHT_MEDIUM,
|
||||
/** The font thickness is normal.*/
|
||||
ARKUI_FONT_WEIGHT_REGULAR,
|
||||
} ArkUI_FontWeight;
|
||||
|
||||
/**
|
||||
* @brief Defines the enumerated values of the horizontal alignment style of the font.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Align the header horizontally.*/
|
||||
ARKUI_TEXT_ALIGNMENT_START = 0,
|
||||
/** Align the center horizontally.*/
|
||||
ARKUI_TEXT_ALIGNMENT_CENTER,
|
||||
/** Align the tail horizontally.*/
|
||||
ARKUI_TEXT_ALIGNMENT_END,
|
||||
/** Align the two ends.*/
|
||||
ARKUI_TEXT_ALIGNMENT_JUSTIFY,
|
||||
} ArkUI_TextAlignment;
|
||||
|
||||
typedef enum {
|
||||
/** Do not use decorative lines.*/
|
||||
ARKUI_TEXT_DECORATION_TYPE_NONE = 0,
|
||||
/** Text underline decoration.*/
|
||||
ARKUI_TEXT_DECORATION_TYPE_UNDERLINE,
|
||||
/** The text is marked with a dash.*/
|
||||
ARKUI_TEXT_DECORATION_TYPE_OVERLINE,
|
||||
/** Decorative line that passes through the text.*/
|
||||
ARKUI_TEXT_DECORATION_TYPE_LINE_THROUGH,
|
||||
} ArkUI_TextDecorationType;
|
||||
|
||||
typedef enum {
|
||||
/** Retain the original case.*/
|
||||
ARKUI_TEXT_CASE_NORMAL = 0,
|
||||
/** The text is in lowercase.*/
|
||||
ARKUI_TEXT_CASE_LOWER,
|
||||
/** The text is in uppercase.*/
|
||||
ARKUI_TEXT_CASE_UPPER,
|
||||
} ArkUI_TextCase;
|
||||
|
||||
typedef enum {
|
||||
/** Replication is not supported.*/
|
||||
ARKUI_COPY_OPTIONS_NONE = 0,
|
||||
/** Intra-application replication is supported.*/
|
||||
ARKUI_COPY_OPTIONS_IN_APP,
|
||||
/** Intra-device replication is supported.*/
|
||||
ARKUI_COPY_OPTIONS_LOCAL_DEVICE,
|
||||
/** Cross-device replication is supported.*/
|
||||
ARKUI_COPY_OPTIONS_CROSS_DEVICE,
|
||||
} ArkUI_CopyOptions;
|
||||
|
||||
typedef enum {
|
||||
/** Color.*/
|
||||
ARKUI_SHADOW_TYPE_COLOR = 0,
|
||||
/** Blur.*/
|
||||
ARKUI_SHADOW_TYPE_BLUR
|
||||
} ArkUI_ShadowType;
|
||||
|
||||
/**
|
||||
* @brief Defines the enumerated values of the edge sliding effect.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Elastic physical dynamic effect. After sliding to the edge, you can continue to slide for a certain distance according to the initial speed or through touch events. After releasing your hand, you can bounce back.*/
|
||||
ARKUI_EDGE_EFFECT_SPRING = 0,
|
||||
/** Shadow effect. When the camera slides to the edge, a circular shadow is displayed.*/
|
||||
ARKUI_EDGE_EFFECT_FADE,
|
||||
/** No effect after sliding to the edge.*/
|
||||
ARKUI_EDGE_EFFECT_NONE,
|
||||
} ArkUI_EdgeEffect;
|
||||
|
||||
/**
|
||||
* @brief Defines the end alignment effect of list items.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** By default, there is no project scrolling alignment effect.*/
|
||||
ARKUI_SCROLL_SNAP_ALIGN_NONE = 0,
|
||||
/** The first item in the view is aligned at the beginning of the list.*/
|
||||
ARKUI_SCROLL_SNAP_ALIGN_START,
|
||||
/** Intermediate items in the view will be aligned in the center of the list.*/
|
||||
ARKUI_SCROLL_SNAP_ALIGN_CENTER,
|
||||
/** The last item in the view is aligned at the end of the list.*/
|
||||
ARKUI_SCROLL_SNAP_ALIGN_END,
|
||||
} ArkUI_ScrollSnapAlign;
|
||||
|
||||
/**
|
||||
* @brief Defines the enumerated values of the scroll bar status.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Not displayed.*/
|
||||
ARKUI_SCROLL_BAR_DISPLAY_MODE_OFF = 0,
|
||||
/** On-demand display (displayed when touched and disappears after 2s)*/
|
||||
ARKUI_SCROLL_BAR_DISPLAY_MODE_AUTO,
|
||||
/** Resident display.*/
|
||||
ARKUI_SCROLL_BAR_DISPLAY_MODE_ON,
|
||||
} ArkUI_ScrollBarDisplayMode;
|
||||
/**
|
||||
* @brief Defines the scrolling direction and list component arrangement direction.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Only vertical scrolling is supported.*/
|
||||
ARKUI_AXIS_VERTICAL = 0,
|
||||
/** Only horizontal scrolling is supported.*/
|
||||
ARKUI_AXIS_HORIZONTAL,
|
||||
} ArkUI_Axis;
|
||||
|
||||
/**
|
||||
* @brief Defines the enumerated values of whether the list is ceiling-mounted and bottom-mounted.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** The header of ListItemGroup does not absorb the top, and the footer does not absorb the bottom.*/
|
||||
ARKUI_STICKY_STYLE_NONE = 0,
|
||||
/** The header of the ListItemGroup is ceiling-mounted, and the footer is not bottom-mounted.*/
|
||||
ARKUI_STICKY_STYLE_HEADER,
|
||||
/** The footer of ListItemGroup is bottomed, and the header is not topped.*/
|
||||
ARKUI_STICKY_STYLE_FOOTER,
|
||||
/** The footer and header of ListItemGroup are installed at the bottom and the top.*/
|
||||
ARKUI_STICKY_STYLE_BOTH,
|
||||
} ArkUI_StickyStyle;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Enumerated value of the border line style.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Displayed as a solid line.*/
|
||||
ARKUI_BORDER_STYLE_SOLID = 0,
|
||||
/** Displayed as a series of short square dashed lines.*/
|
||||
ARKUI_BORDER_STYLE_DASHED,
|
||||
/** Displayed as a series of dots.*/
|
||||
ARKUI_BORDER_STYLE_DOTTED,
|
||||
} ArkUI_BorderStyle;
|
||||
|
||||
/**
|
||||
* @brief Touch test control enumerated value.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Default touch test effect.*/
|
||||
ARKUI_HIT_TEST_MODE_DEFAULT = 0,
|
||||
/** Self-response touch test.*/
|
||||
ARKUI_HIT_TEST_MODE_BLOCK,
|
||||
/** Both itself and child nodes respond to the touch test.*/
|
||||
ARKUI_HIT_TEST_MODE_TRANSPARENT,
|
||||
/** Does not respond to the touch test.*/
|
||||
ARKUI_HIT_TEST_MODE_NONE
|
||||
} ArkUI_HitTestMode;
|
||||
|
||||
/**
|
||||
* @brief Shadow effect enumerated value.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Super small shadow.*/
|
||||
ARKUI_SHADOW_STYLE_OUTER_DEFAULT_XS = 0,
|
||||
/** Small shadow.*/
|
||||
ARKUI_SHADOW_STYLE_OUTER_DEFAULT_SM,
|
||||
/** Medium shadow.*/
|
||||
ARKUI_SHADOW_STYLE_OUTER_DEFAULT_MD,
|
||||
/** Big shadow.*/
|
||||
ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG,
|
||||
/** Floating small shadow.*/
|
||||
ARKUI_SHADOW_STYLE_OUTER_FLOATING_SM,
|
||||
/** Floating medium shadow.*/
|
||||
ARKUI_SHADOW_STYLE_OUTER_FLOATING_MD,
|
||||
} ArkUI_ShadowStyle;
|
||||
|
||||
/**
|
||||
* @brief Enumerated value of the animation curve.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** The animation speed is the same from start to finish.*/
|
||||
ARKUI_CURVE_LINEAR = 0,
|
||||
/** The animation starts at a low speed, then speeds up, and slows down before ending.*/
|
||||
ARKUI_CURVE_EASE,
|
||||
/** The animation starts at low speed.*/
|
||||
ARKUI_CURVE_EASE_IN,
|
||||
/** The animation ends at low speed.*/
|
||||
ARKUI_CURVE_EASE_OUT,
|
||||
/** The animation starts and ends at a low speed.*/
|
||||
ARKUI_CURVE_EASE_IN_OUT,
|
||||
/** Animation standard curve.*/
|
||||
ARKUI_CURVE_FAST_OUT_SLOW_IN,
|
||||
/** Animate the deceleration curve.*/
|
||||
ARKUI_CURVE_LINEAR_OUT_SLOW_IN,
|
||||
/** Animation acceleration curve.*/
|
||||
ARKUI_CURVE_FAST_OUT_LINEAR_IN,
|
||||
/** Animate the sharp curve.*/
|
||||
ARKUI_CURVE_EXTREME_DECELERATION,
|
||||
/** Animate the sharp curve.*/
|
||||
ARKUI_CURVE_SHARP,
|
||||
/** Animated rhythm curve.*/
|
||||
ARKUI_CURVE_RHYTHM,
|
||||
/** Smooth the animation curve.*/
|
||||
ARKUI_CURVE_SMOOTH,
|
||||
/** Animated damping curve.*/
|
||||
ARKUI_CURVE_FRICTION,
|
||||
} ArkUI_AnimationCurve;
|
||||
|
||||
/**
|
||||
* @brief Defines whether text can be copied and pasted.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Replication is not supported.*/
|
||||
ARKUI_TEXT_COPY_OPTIONS_NONE = 0,
|
||||
/** Intra-application replication is supported.*/
|
||||
ARKUI_TEXT_COPY_OPTIONS_IN_APP,
|
||||
/** Intra-device replication is supported.*/
|
||||
ARKUI_TEXT_COPY_OPTIONS_LOCAL_DEVICE,
|
||||
/** Cross-device replication is supported.*/
|
||||
ARKUI_TEXT_COPY_OPTIONS_CROSS_DEVICE,
|
||||
} ArkUI_TextCopyOptions;
|
||||
|
||||
/**
|
||||
* @brief Defines the mode in which the text adapts to the height.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Set the text height adaptation mode to MaxLines first.*/
|
||||
ARKUI_TEXT_HEIGHT_ADAPTIVE_POLICY_MAX_LINES_FIRST = 0,
|
||||
/** Set the adaptive mode of the text height to zoom out the font first.*/
|
||||
ARKUI_TEXT_HEIGHT_ADAPTIVE_POLICY_MIN_FONT_SIZE_FIRST,
|
||||
/** Set the text height adaptation mode to layout constraint (height) first.*/
|
||||
ARKUI_TEXT_HEIGHT_ADAPTIVE_POLICY_LAYOUT_CONSTRAINT_FIRST,
|
||||
} ArkUI_TextHeightAdaptivePolicy;
|
||||
|
||||
/**
|
||||
* @brief Define nested scrolling options.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Only scrolls by itself and does not associate with the parent component.*/
|
||||
ARKUI_SCROLL_NESTED_MODE_SELF_ONLY = 0,
|
||||
/** Scroll itself first. After the parent component scrolls to the edge, the parent component scrolls. After the parent component scrolls to the edge
|
||||
If the parent component has the edge effect, the parent component triggers the edge effect. Otherwise, the child component triggers the edge effect.*/
|
||||
ARKUI_SCROLL_NESTED_MODE_SELF_FIRST,
|
||||
/** The parent component scrolls first. After the parent component scrolls to the edge, it scrolls itself.
|
||||
After the body scrolls to the edge, if the edge effect exists, the edge effect of the body is triggered. Otherwise, the edge effect of the parent component is triggered. */
|
||||
ARKUI_SCROLL_NESTED_MODE_PARENT_FIRST,
|
||||
/** Scrolling itself and parent components at the same time, after both themselves and parent components reach the edge
|
||||
If the component has the edge effect, the component triggers the edge effect. Otherwise, the parent component triggers the edge effect.*/
|
||||
ARKUI_SCROLL_NESTED_MODE_PARALLEL,
|
||||
} ArkUI_ScrollNestedMode;
|
||||
|
||||
/**
|
||||
* @brief Define the edge position to which the scrolling is performed.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Upside edge in the vertical direction.*/
|
||||
ARKUI_SCROLL_EDGE_TOP = 0,
|
||||
/** Vertical center position.*/
|
||||
ARKUI_SCROLL_EDGE_CENTER,
|
||||
/** Lower vertical edge.*/
|
||||
ARKUI_SCROLL_EDGE_BOTTOM,
|
||||
/** Baseline position of the text in the cross axis direction.*/
|
||||
ARKUI_SCROLL_EDGE_BASELINE,
|
||||
/** Start position in the horizontal direction.*/
|
||||
ARKUI_SCROLL_EDGE_START,
|
||||
/** Center the position in the horizontal direction.*/
|
||||
ARKUI_SCROLL_EDGE_MIDDLE,
|
||||
/** End position in the horizontal direction.*/
|
||||
ARKUI_SCROLL_EDGE_END,
|
||||
} ArkUI_ScrollEdge;
|
||||
|
||||
/**
|
||||
* @brief Enumerated value of the mixed mode.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Overwrite the upper-layer image with the lower-layer image without performing any blending operation.*/
|
||||
ARKUI_BLEND_MODE_NONE,
|
||||
/** Clear the target pixel covered by the source pixel to be completely transparent.*/
|
||||
ARKUI_BLEND_MODE_CLEAR,
|
||||
/** r = s. Only the source pixel is displayed.*/
|
||||
ARKUI_BLEND_MODE_SRC,
|
||||
/** r = d. Only the target pixel is displayed.*/
|
||||
ARKUI_BLEND_MODE_DST,
|
||||
/** r = s + (1 - sa) * d. Blend the source pixel based on the transparency and overwrite the target pixel.*/
|
||||
ARKUI_BLEND_MODE_SRC_OVER,
|
||||
/** r = d + (1 - da) * s. Blend the target pixel based on the transparency and overwrite the source pixel. */
|
||||
ARKUI_BLEND_MODE_DST_OVER,
|
||||
/** r = s * da. Only the part of the source pixel that overlaps the destination pixel is displayed. */
|
||||
ARKUI_BLEND_MODE_SRC_IN,
|
||||
/** r = d * sa. Only the part that overlaps the source pixel in the target pixel is displayed. */
|
||||
ARKUI_BLEND_MODE_DST_IN,
|
||||
/** r = s * (1 - da): Only the part that does not overlap the destination pixel in the source pixel is displayed. */
|
||||
ARKUI_BLEND_MODE_SRC_OUT,
|
||||
/** r = d * (1 - sa). Only the part that does not overlap the source pixel in the target pixel is displayed. */
|
||||
ARKUI_BLEND_MODE_DST_OUT,
|
||||
/** r = s * da + d * (1 - sa): Draw the source pixel where the source pixel overlaps the target pixel, and draw the target pixel where the source pixel does not overlap the target pixel.
|
||||
*/
|
||||
ARKUI_BLEND_MODE_SRC_ATOP,
|
||||
/** r = d * sa + s * (1 - da): Draw the target pixel where the source pixel and the target pixel overlap and draw the source pixel where the source pixel and the target pixel do not overlap.
|
||||
*/
|
||||
ARKUI_BLEND_MODE_DST_ATOP,
|
||||
/** r = s * (1 - da) + d * (1 - sa). Only the part that does not overlap the source pixel and the target pixel is displayed. */
|
||||
ARKUI_BLEND_MODE_XOR,
|
||||
/** r = min(s + d, 1). Add the source pixel value and the target pixel value and use the result as the new pixel value.*/
|
||||
ARKUI_BLEND_MODE_PLUS,
|
||||
/** r = s * d: Multiplies the source pixel by the target pixel and uses the result as the new pixel value.*/
|
||||
ARKUI_BLEND_MODE_MODULATE,
|
||||
/** r = s + d - s * d. Add the pixel values of two images and subtract their product to achieve blending. */
|
||||
ARKUI_BLEND_MODE_SCREEN,
|
||||
/** Determine whether the MULTIPLY or SCREEN blending mode is used based on the target pixel.*/
|
||||
ARKUI_BLEND_MODE_OVERLAY,
|
||||
/** rc = s + d - max(s * da, d * sa), ra = kSrcOver. When two colors overlap, the darker color overwrites the lighter color. */
|
||||
ARKUI_BLEND_MODE_DARKEN,
|
||||
/** rc = s + d - min(s * da, d * sa), ra =
|
||||
kSrcOver: Compares the pixels in the source image and the target image, and selects the brightest pixel as the final mixing result.*/
|
||||
ARKUI_BLEND_MODE_LIGHTEN,
|
||||
/** Make the target pixel brighter to reflect the source pixel.*/
|
||||
ARKUI_BLEND_MODE_COLOR_DODGE,
|
||||
/** Makes the target pixel darker to reflect the source pixel.*/
|
||||
ARKUI_BLEND_MODE_COLOR_BURN,
|
||||
/** Determine whether the target pixel becomes brighter or darker based on the value of the source pixel. The source pixel determines whether to use the MULTIPLY blending mode or DISCREEN blending mode.*/
|
||||
ARKUI_BLEND_MODE_HARD_LIGHT,
|
||||
/** Determine whether the LIGHTEN blending mode or DARKEN blending mode is used based on the source pixel.*/
|
||||
ARKUI_BLEND_MODE_SOFT_LIGHT,
|
||||
/** rc = s + d - 2 * (min(s * da, d * sa)), ra =
|
||||
kSrcOver: Compares the source pixel and target pixel, and subtracts the pixel with the lower brightness from the higher brightness to generate a high contrast effect.*/
|
||||
ARKUI_BLEND_MODE_DIFFERENCE,
|
||||
/** rc = s + d - two(s * d), ra = kSrcOver. Compare the source pixel with the target pixel, and subtract the lower pixel from the higher pixel to produce a soft effect.
|
||||
*/
|
||||
ARKUI_BLEND_MODE_EXCLUSION,
|
||||
/** r = s * (1 - da) + d * (1 - sa) + s * d. Multiplies the source image and the target image to obtain a new image.*/
|
||||
ARKUI_BLEND_MODE_MULTIPLY,
|
||||
/** Retains the brightness and saturation of the source image, but replaces the hue of the source image with the hue of the target image.*/
|
||||
ARKUI_BLEND_MODE_HUE,
|
||||
/** Retains the luminance and hue of the target pixel, but replaces the saturation of the target pixel with the saturation of the source pixel.*/
|
||||
ARKUI_BLEND_MODE_SATURATION,
|
||||
/** Retains the saturation and hue of the source pixel, but replaces the luminance of the source pixel with the luminance of the target pixel.*/
|
||||
ARKUI_BLEND_MODE_COLOR,
|
||||
/** The hue and saturation of the target pixel are retained, but the luminance of the target pixel is replaced by the luminance of the source pixel.*/
|
||||
ARKUI_BLEND_MODE_LUMINOSITY,
|
||||
} ArkUI_BlendMode;
|
||||
|
||||
/**
|
||||
* @brief Sets the layout enumeration value in the axis direction of the container element.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Layout elements from left to right.*/
|
||||
ARKUI_DIRECTION_LTR = 0,
|
||||
/** Layout elements from right to left.*/
|
||||
ARKUI_DIRECTION_RTL,
|
||||
/** Use the default layout direction.*/
|
||||
ARKUI_DIRECTION_AUTO = 3,
|
||||
} ArkUI_Direction;
|
||||
|
||||
/**
|
||||
* @brief Enumerated value of the foreground color.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** The foreground color is the inverted color of the control background color.*/
|
||||
ARKUI_COLOR_STRATEGY_INVERT = 0,
|
||||
/** The control background shadow color is the average color of the control background shadow area.*/
|
||||
ARKUI_COLOR_STRATEGY_AVERAGE,
|
||||
/** The background shadow color of the control is the main color of the background shadow area of the control.*/
|
||||
ARKUI_COLOR_STRATEGY_PRIMARY,
|
||||
} ArkUI_ColorStrategy;
|
||||
|
||||
/**
|
||||
* @brief Defines the horizontal alignment mode.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Align the start end according to the language direction.*/
|
||||
ARKUI_HORIZONTAL_ALIGNMENT_START = 0,
|
||||
/** Center alignment, which is the default alignment mode.*/
|
||||
ARKUI_HORIZONTAL_ALIGNMENT_CENTER,
|
||||
/** Align the end according to the language direction.*/
|
||||
ARKUI_HORIZONTAL_ALIGNMENT_END,
|
||||
} ArkUI_HorizontalAlignment;
|
||||
|
||||
/**
|
||||
* @brief Defines the animation playback mode.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** The animation is played in the forward direction.*/
|
||||
ARKUI_ANIMATION_PLAY_MODE_NORMAL = 0,
|
||||
/** Reversely play the animation.*/
|
||||
ARKUI_ANIMATION_PLAY_MODE_REVERSE,
|
||||
/** The animation is played backwards for odd times (1, 3, 5...) and forwards for even times (2, 4, 6...).*/
|
||||
ARKUI_ANIMATION_PLAY_MODE_ALTERNATE_REVERSE,
|
||||
} ArkUI_AnimationPlayMode;
|
||||
|
||||
/**
|
||||
* @brief Defines the image width and height.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Retain the scale of the original image.*/
|
||||
ARKUI_IMAGE_SIZE_AUTO = 0,
|
||||
/** Default value. Use the aspect ratio to zoom out or zoom in so that the two sides of the image are greater than or equal to the display boundary.*/
|
||||
ARKUI_IMAGE_SIZE_COVER,
|
||||
/** Retain the aspect ratio and zoom in or zoom out the image so that the image can be completely displayed within the display boundary.*/
|
||||
ARKUI_IMAGE_SIZE_CONTAIN,
|
||||
} ArkUI_ImageSize;
|
||||
|
||||
/**
|
||||
* @brief Defines the color obtaining mode.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Do not use the color blur.*/
|
||||
ARKUI_ADAPTIVE_COLOR_DEFAULT = 0,
|
||||
/** Use the color blur.*/
|
||||
ARKUI_ADAPTIVE_COLOR_AVERAGE,
|
||||
} ArkUI_AdaptiveColor;
|
||||
|
||||
/**
|
||||
* @brief Defines the dark and light color mode.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Follow the dark and light color mode of the system.*/
|
||||
ARKUI_COLOR_MODE_SYSTEM = 0,
|
||||
/** The light color mode is fixed.*/
|
||||
ARKUI_COLOR_MODE_LIGHT,
|
||||
/** The dark color mode is fixed.*/
|
||||
ARKUI_COLOR_MODE_DARK,
|
||||
} ArkUI_ColorMode;
|
||||
|
||||
/**
|
||||
* @brief Defines the background blur style.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Light and thin materials are blurred.*/
|
||||
ARKUI_BLUR_STYLE_THIN = 0,
|
||||
/** The common thickness material is blurred.*/
|
||||
ARKUI_BLUR_STYLE_REGULAR,
|
||||
/** Thick material blurs.*/
|
||||
ARKUI_BLUR_STYLE_THICK,
|
||||
/** The depth of field (DOF) is blurred at close distance.*/
|
||||
ARKUI_BLUR_STYLE_BACKGROUND_THIN,
|
||||
/** The mid-range depth of field is blurred.*/
|
||||
ARKUI_BLUR_STYLE_BACKGROUND_REGULAR,
|
||||
/** The far-range depth of field is blurred.*/
|
||||
ARKUI_BLUR_STYLE_BACKGROUND_THICK,
|
||||
/** DFO blurs at the ultra-far distance.*/
|
||||
ARKUI_BLUR_STYLE_BACKGROUND_ULTRA_THICK,
|
||||
/** Disable blurring.*/
|
||||
ARKUI_BLUR_STYLE_NONE,
|
||||
/** Component ultra-light and thin material blurs.*/
|
||||
ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THIN,
|
||||
/** The light and thin material of the component is blurred.*/
|
||||
ARKUI_BLUR_STYLE_COMPONENT_THIN,
|
||||
/** Common materials of the component are blurred.*/
|
||||
ARKUI_BLUR_STYLE_COMPONENT_REGULAR,
|
||||
/** The component thickness is blurred.*/
|
||||
ARKUI_BLUR_STYLE_COMPONENT_THICK,
|
||||
/** The super thick material of the component is blurred.*/
|
||||
ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THICK,
|
||||
} ArkUI_BlurStyle;
|
||||
|
||||
/**
|
||||
* @brief Defines the image filling effect.
|
||||
* ImageSpanAlignment
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Retain the aspect ratio and zoom in or zoom out the image so that the image can be completely displayed within the display boundary.*/
|
||||
ARKUI_OBJECT_FIT_CONTAIN = 0,
|
||||
/** Retain the aspect ratio and zoom in or zoom out the image so that both sides of the image are larger than or equal to the display boundary.*/
|
||||
ARKUI_OBJECT_FIT_COVER,
|
||||
/** Adaptive display.*/
|
||||
ARKUI_OBJECT_FIT_AUTO,
|
||||
/** The aspect ratio is not retained, so that the image is full of the display boundary.*/
|
||||
ARKUI_OBJECT_FIT_FILL,
|
||||
/** The aspect ratio is retained, and the image is zoomed out or retained.*/
|
||||
ARKUI_OBJECT_FIT_SCALE_DOWN,
|
||||
/** Retain the original size.*/
|
||||
ARKUI_OBJECT_FIT_NONE,
|
||||
} ArkUI_ObjectFit;
|
||||
|
||||
/**
|
||||
* @brief Defines the image interpolation effect.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** Do not use image interpolation.*/
|
||||
ARKUI_IMAGE_INTERPOLATION_NONE = 0,
|
||||
/** Low image interpolation.*/
|
||||
ARKUI_IMAGE_INTERPOLATION_LOW,
|
||||
/** Interpolate the image in.*/
|
||||
ARKUI_IMAGE_INTERPOLATION_MEDIUM,
|
||||
/** High image interpolation, with the highest interpolation quality.*/
|
||||
ARKUI_IMAGE_INTERPOLATION_HIGH,
|
||||
} ArkUI_ImageInterpolation;
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // ARKUI_NATIVE_TYPE_H
|
||||
/** @} */
|
||||
@@ -263,11 +263,7 @@ def ast_to_dict(cursor, current_file, gn_path=None, comment=None, key=0): # 解
|
||||
"comment": '',
|
||||
"syscap": ''
|
||||
}
|
||||
if cursor.raw_comment: # 是否有注释信息,有就取,没有过
|
||||
data["comment"] = cursor.raw_comment
|
||||
else:
|
||||
data["comment"] = 'none_comment'
|
||||
|
||||
get_comment(cursor, data)
|
||||
if key == 0:
|
||||
data["kind"] = CursorKind.TRANSLATION_UNIT.name
|
||||
if comment:
|
||||
@@ -281,13 +277,7 @@ def ast_to_dict(cursor, current_file, gn_path=None, comment=None, key=0): # 解
|
||||
data["kind"] = cursor.kind.name
|
||||
if cursor.kind.name == CursorKind.MACRO_DEFINITION.name:
|
||||
define_comment(cursor, current_file, data)
|
||||
|
||||
if 'none_comment' != data["comment"]:
|
||||
pattern = r'@([Ss]yscap).*?(?=\n)'
|
||||
matches = re.search(pattern, data['comment'])
|
||||
if matches:
|
||||
data["syscap"] = matches.group(0)
|
||||
|
||||
get_syscap_value(data)
|
||||
processing_special_node(cursor, data, key, gn_path) # 节点处理
|
||||
children = list(cursor.get_children()) # 判断是否有子节点,有就追加children,没有根据情况来
|
||||
if len(children) > 0:
|
||||
@@ -314,6 +304,21 @@ def ast_to_dict(cursor, current_file, gn_path=None, comment=None, key=0): # 解
|
||||
return data
|
||||
|
||||
|
||||
def get_syscap_value(data: dict):
|
||||
if 'none_comment' != data["comment"]:
|
||||
pattern = r'@([Ss]yscap).*?(?=\n)'
|
||||
matches = re.search(pattern, data['comment'])
|
||||
if matches:
|
||||
data["syscap"] = matches.group(0)
|
||||
|
||||
|
||||
def get_comment(cursor, data: dict):
|
||||
if cursor.raw_comment: # 是否有注释信息,有就取,没有过
|
||||
data["comment"] = cursor.raw_comment
|
||||
else:
|
||||
data["comment"] = 'none_comment'
|
||||
|
||||
|
||||
def processing_ast_node(child, current_file, data, name, gn_path):
|
||||
child_data = ast_to_dict(child, current_file, gn_path, key=1)
|
||||
if child.kind == CursorKind.TYPE_REF:
|
||||
|
||||
@@ -556,6 +556,89 @@ typedef enum Rdb_SubscribeType {
|
||||
RDB_SUBSCRIBE_TYPE_CLOUD_DETAILS,
|
||||
} Rdb_SubscribeType;
|
||||
|
||||
/**
|
||||
* @brief The callback function of cloud data change event.
|
||||
*
|
||||
* @param context Represents the context of data observer.
|
||||
* @param values Indicates the cloud accounts that changed.
|
||||
* @param count The count of changed cloud accounts.
|
||||
* @since 11
|
||||
*/
|
||||
typedef void (*Rdb_BriefObserver)(void *context, const char *values[], uint32_t count);
|
||||
|
||||
/**
|
||||
* @brief The callback function of cloud data change details event.
|
||||
*
|
||||
* @param context Represents the context of data observer.
|
||||
* @param changeInfo Indicates the {@link Rdb_ChangeInfo} of changed tables.
|
||||
* @param count The count of changed tables.
|
||||
* @see Rdb_ChangeInfo.
|
||||
* @since 11
|
||||
*/
|
||||
typedef void (*Rdb_DetailsObserver)(void *context, const Rdb_ChangeInfo **changeInfo, uint32_t count);
|
||||
|
||||
/**
|
||||
* @brief Indicates the callback functions.
|
||||
*
|
||||
* @since 11
|
||||
*/
|
||||
typedef union Rdb_SubscribeCallback {
|
||||
/**
|
||||
* The callback function of cloud data change details event.
|
||||
*/
|
||||
Rdb_DetailsObserver detailsObserver;
|
||||
|
||||
/**
|
||||
* The callback function of cloud data change event.
|
||||
*/
|
||||
Rdb_BriefObserver briefObserver;
|
||||
} Rdb_SubscribeCallback;
|
||||
|
||||
/**
|
||||
* @brief Indicates the observer of data.
|
||||
*
|
||||
* @since 11
|
||||
*/
|
||||
typedef struct Rdb_DataObserver {
|
||||
/**
|
||||
* The context of data observer.
|
||||
*/
|
||||
void *context;
|
||||
|
||||
/**
|
||||
* The callback of data observer.
|
||||
*/
|
||||
Rdb_SubscribeCallback callback;
|
||||
} Rdb_DataObserver;
|
||||
|
||||
/**
|
||||
* @brief Registers an observer for the database.
|
||||
* When data in the distributed database changes, the callback will be invoked.
|
||||
*
|
||||
* @param store Represents a pointer to an {@link OH_Rdb_Store} instance.
|
||||
* @param type Indicates the subscription type, which is defined in {@link Rdb_SubscribeType}.
|
||||
* @param observer The {@link Rdb_DataObserver} of change events in the database.
|
||||
* @return Returns the status code of the execution. See {@link OH_Rdb_ErrCode}.
|
||||
* @see OH_Rdb_Store.
|
||||
* @see Rdb_DataObserver.
|
||||
* @since 11
|
||||
*/
|
||||
int OH_Rdb_Subscribe(OH_Rdb_Store *store, Rdb_SubscribeType type, const Rdb_DataObserver *observer);
|
||||
|
||||
/**
|
||||
* @brief Remove specified observer of specified type from the database.
|
||||
*
|
||||
* @param store Represents a pointer to an {@link OH_Rdb_Store} instance.
|
||||
* @param type Indicates the subscription type, which is defined in {@link Rdb_SubscribeType}.
|
||||
* @param observer The {@link Rdb_DataObserver} of change events in the database.
|
||||
* If this is nullptr, remove all observers of the type.
|
||||
* @return Returns the status code of the execution. See {@link OH_Rdb_ErrCode}.
|
||||
* @see OH_Rdb_Store.
|
||||
* @see Rdb_DataObserver.
|
||||
* @since 11
|
||||
*/
|
||||
int OH_Rdb_Unsubscribe(OH_Rdb_Store *store, Rdb_SubscribeType type, const Rdb_DataObserver *observer);
|
||||
|
||||
/**
|
||||
* @brief Indicates the database synchronization mode.
|
||||
*
|
||||
@@ -737,6 +820,15 @@ typedef struct Rdb_ProgressDetails {
|
||||
*/
|
||||
Rdb_TableDetails *OH_Rdb_GetTableDetails(Rdb_ProgressDetails *progress, int32_t version);
|
||||
|
||||
/**
|
||||
* @brief The callback function of progress.
|
||||
*
|
||||
* @param progressDetails The details of the sync progress.
|
||||
* @see Rdb_ProgressDetails.
|
||||
* @since 11
|
||||
*/
|
||||
typedef void (*Rdb_ProgressCallback)(void *context, Rdb_ProgressDetails *progressDetails);
|
||||
|
||||
/**
|
||||
* @brief The callback function of sync.
|
||||
*
|
||||
@@ -746,6 +838,23 @@ Rdb_TableDetails *OH_Rdb_GetTableDetails(Rdb_ProgressDetails *progress, int32_t
|
||||
*/
|
||||
typedef void (*Rdb_SyncCallback)(Rdb_ProgressDetails *progressDetails);
|
||||
|
||||
/**
|
||||
* @brief The observer of progress.
|
||||
*
|
||||
* @since 11
|
||||
*/
|
||||
typedef struct Rdb_ProgressObserver {
|
||||
/**
|
||||
* The context of progress observer.
|
||||
*/
|
||||
void *context;
|
||||
|
||||
/**
|
||||
* The callback function of progress observer.
|
||||
*/
|
||||
Rdb_ProgressCallback callback;
|
||||
} Rdb_ProgressObserver;
|
||||
|
||||
/**
|
||||
* @brief Sync data to cloud.
|
||||
*
|
||||
@@ -753,14 +862,41 @@ typedef void (*Rdb_SyncCallback)(Rdb_ProgressDetails *progressDetails);
|
||||
* @param mode Represents the {@link Rdb_SyncMode} of sync progress.
|
||||
* @param tables Indicates the names of tables to sync.
|
||||
* @param count The count of tables to sync. If value equals 0, sync all tables of the store.
|
||||
* @param callback The {@link Rdb_SyncCallback} of cloud sync progress.
|
||||
* @param observer The {@link Rdb_ProgressObserver} of cloud sync progress.
|
||||
* @return Returns the status code of the execution. See {@link OH_Rdb_ErrCode}.
|
||||
* @see OH_Rdb_Store.
|
||||
* @see Rdb_SyncCallback.
|
||||
* @see Rdb_ProgressObserver.
|
||||
* @since 11
|
||||
*/
|
||||
int OH_Rdb_CloudSync(OH_Rdb_Store *store, Rdb_SyncMode mode, const char *tables[], uint32_t count,
|
||||
Rdb_SyncCallback *callback);
|
||||
const Rdb_ProgressObserver *observer);
|
||||
|
||||
/**
|
||||
* @brief Subscribes to the automatic synchronization progress of an RDB store.
|
||||
* A callback will be invoked when there is a notification of the automatic synchronization progress.
|
||||
*
|
||||
* @param store Indicates the pointer to the target {@Link OH_Rdb_Store} instance.
|
||||
* @param observer The {@link Rdb_ProgressObserver} for the automatic synchornizaiton progress.
|
||||
* Indicates the callback invoked to return the automatic synchronization progress.
|
||||
* @return Returns the status code of the execution. See {@link OH_Rdb_ErrCode}.
|
||||
* @see OH_Rdb_Store.
|
||||
* @see Rdb_ProgressObserver.
|
||||
* @since 11
|
||||
**/
|
||||
int OH_Rdb_SubscribeAutoSyncProgress(OH_Rdb_Store *store, const Rdb_ProgressObserver *observer);
|
||||
|
||||
/**
|
||||
* @brief Unsubscribes from the automatic synchronziation progress of an RDB store.
|
||||
*
|
||||
* @param store Indicates the pointer to the target {@Link OH_Rdb_Store} instance.
|
||||
* @param observer Indicates the {@link Rdb_ProgressObserver} callback for the automatic synchornizaiton progress.
|
||||
* If it is a null pointer, all callbacks for the automatic synchornizaiton progress will be unregistered.
|
||||
* @return Returns the status code of the execution. See {@link OH_Rdb_ErrCode}.
|
||||
* @see OH_Rdb_Store.
|
||||
* @see Rdb_ProgressObserver.
|
||||
* @since 11
|
||||
*/
|
||||
int OH_Rdb_UnsubscribeAutoSyncProgress(OH_Rdb_Store *store, const Rdb_ProgressObserver *observer);
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -41,5 +41,9 @@
|
||||
{"name":"OH_Data_Asset_CreateOne"},
|
||||
{"name":"OH_Data_Asset_DestroyOne"},
|
||||
{"name":"OH_Data_Asset_CreateMultiple"},
|
||||
{"name":"OH_Data_Asset_DestroyMultiple"}
|
||||
{"name":"OH_Data_Asset_DestroyMultiple"},
|
||||
{"name":"OH_Rdb_Subscribe"},
|
||||
{"name":"OH_Rdb_Unsubscribe"},
|
||||
{"name":"OH_Rdb_SubscribeAutoSyncProgress"},
|
||||
{"name":"OH_Rdb_UnsubscribeAutoSyncProgress"}
|
||||
]
|
||||
@@ -25,14 +25,18 @@ ohos_ndk_headers("native_drawing_header") {
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_filter.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_font.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_font_collection.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_image.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_mask_filter.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_matrix.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_memory_stream.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_path.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_path_effect.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_pen.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_point.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_rect.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_register_font.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_round_rect.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_sampling_options.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_shader_effect.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_blob.h",
|
||||
"//interface/sdk_c/graphic/graphic_2d/native_drawing/drawing_text_declaration.h",
|
||||
@@ -58,12 +62,16 @@ ohos_ndk_library("libnative_drawing_ndk") {
|
||||
"native_drawing/drawing_font_collection.h",
|
||||
"native_drawing/drawing_mask_filter.h",
|
||||
"native_drawing/drawing_matrix.h",
|
||||
"native_drawing/drawing_memory_stream.h",
|
||||
"native_drawing/drawing_path.h",
|
||||
"native_drawing/drawing_path_effect.h",
|
||||
"native_drawing/drawing_pen.h",
|
||||
"native_drawing/drawing_point.h",
|
||||
"native_drawing/drawing_rect.h",
|
||||
"native_drawing/drawing_register_font.h",
|
||||
"native_drawing/drawing_round_rect.h",
|
||||
"native_drawing/drawing_image.h",
|
||||
"native_drawing/drawing_sampling_options.h",
|
||||
"native_drawing/drawing_shader_effect.h",
|
||||
"native_drawing/drawing_text_blob.h",
|
||||
"native_drawing/drawing_text_declaration.h",
|
||||
|
||||
@@ -76,6 +76,20 @@ OH_Drawing_Bitmap* OH_Drawing_BitmapCreate(void);
|
||||
*/
|
||||
void OH_Drawing_BitmapDestroy(OH_Drawing_Bitmap*);
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_Bitmap</b> object with <b>OH_Drawing_Image_Info</b> object
|
||||
* and sets the mem address or pixel storage.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Image_Info Indicates the pointer to an <b>OH_Drawing_Image_Info</b> object.
|
||||
* @param pixels the pointer to memory address or pixel storage.
|
||||
* @param rowBytes size of pixel row or larger.
|
||||
* @return Returns the pointer to the <b>OH_Drawing_Bitmap</b> object created.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Bitmap* OH_Drawing_BitmapCreateFromPixels(OH_Drawing_Image_Info*, void* pixels, uint32_t rowBytes);
|
||||
|
||||
/**
|
||||
* @brief Initializes the width and height of an <b>OH_Drawing_Bitmap</b> object
|
||||
* and sets the pixel format for the bitmap.
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* @{
|
||||
*
|
||||
* @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
|
||||
*
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 8
|
||||
@@ -81,7 +81,7 @@ bool OH_Drawing_BrushIsAntiAlias(const OH_Drawing_Brush*);
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Brush Indicates the pointer to an <b>OH_Drawing_Brush</b> object.
|
||||
* @param bool Specifies whether to enable anti-aliasing. The value <b>true</b> means
|
||||
* @param bool Specifies whether to enable anti-aliasing. The value <b>true</b> means
|
||||
* to enable anti-aliasing, and <b>false</b> means the opposite.
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
@@ -154,6 +154,17 @@ void OH_Drawing_BrushSetShaderEffect(OH_Drawing_Brush*, OH_Drawing_ShaderEffect*
|
||||
*/
|
||||
void OH_Drawing_BrushSetFilter(OH_Drawing_Brush*, OH_Drawing_Filter*);
|
||||
|
||||
/**
|
||||
* @brief Sets a blender that implements the specified blendmode enum for a brush.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Brush</b> object.
|
||||
* @param OH_Drawing_BlendMode Indicates the blend mode.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_BrushSetBlendMode(OH_Drawing_Brush*, OH_Drawing_BlendMode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* @{
|
||||
*
|
||||
* @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
|
||||
*
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 8
|
||||
@@ -64,7 +64,7 @@ OH_Drawing_Canvas* OH_Drawing_CanvasCreate(void);
|
||||
void OH_Drawing_CanvasDestroy(OH_Drawing_Canvas*);
|
||||
|
||||
/**
|
||||
* @brief Binds a bitmap to a canvas so that the content drawn on the canvas
|
||||
* @brief Binds a bitmap to a canvas so that the content drawn on the canvas
|
||||
* is output to the bitmap (this process is called CPU rendering).
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
@@ -87,7 +87,7 @@ void OH_Drawing_CanvasBind(OH_Drawing_Canvas*, OH_Drawing_Bitmap*);
|
||||
void OH_Drawing_CanvasAttachPen(OH_Drawing_Canvas*, const OH_Drawing_Pen*);
|
||||
|
||||
/**
|
||||
* @brief Detaches the pen from a canvas so that the canvas will not use the style
|
||||
* @brief Detaches the pen from a canvas so that the canvas will not use the style
|
||||
* and color of the pen to outline a shape.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
@@ -129,6 +129,19 @@ void OH_Drawing_CanvasDetachBrush(OH_Drawing_Canvas*);
|
||||
*/
|
||||
void OH_Drawing_CanvasSave(OH_Drawing_Canvas*);
|
||||
|
||||
/**
|
||||
* @brief Saves matrix and clip, and allocates a bitmap for subsequent drawing.
|
||||
* Calling restore discards changes to matrix and clip, and draws the bitmap.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param OH_Drawing_Rect Indicates the pointer to an <b>OH_Drawing_Rect</b> object.
|
||||
* @param OH_Drawing_Brush Indicates the pointer to an <b>OH_Drawing_Brush</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasSaveLayer(OH_Drawing_Canvas*, const OH_Drawing_Rect*, const OH_Drawing_Brush*);
|
||||
|
||||
/**
|
||||
* @brief Restores the canvas status (canvas matrix) saved on the top of the stack.
|
||||
*
|
||||
@@ -199,6 +212,21 @@ void OH_Drawing_CanvasDrawPath(OH_Drawing_Canvas*, const OH_Drawing_Path*);
|
||||
*/
|
||||
void OH_Drawing_CanvasDrawBitmap(OH_Drawing_Canvas*, const OH_Drawing_Bitmap*, float left, float top);
|
||||
|
||||
/**
|
||||
* @brief Draw the specified area of the bitmap to the specified area of the canvas.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param OH_Drawing_Bitmap Indicates the pointer to an <b>OH_Drawing_Bitmap</b> object.
|
||||
* @param src the area of source bitmap, can be nullptr.
|
||||
* @param dst the area of destination canvas.
|
||||
* @param OH_Drawing_SamplingOptions the sampling mode.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasDrawBitmapRect(OH_Drawing_Canvas*, const OH_Drawing_Bitmap*, const OH_Drawing_Rect* src,
|
||||
const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions*);
|
||||
|
||||
/**
|
||||
* @brief Draws a rect.
|
||||
*
|
||||
@@ -272,7 +300,7 @@ void OH_Drawing_CanvasDrawTextBlob(OH_Drawing_Canvas*, const OH_Drawing_TextBlob
|
||||
|
||||
/**
|
||||
* @brief Enumerates clip op.
|
||||
*
|
||||
*
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
@@ -352,6 +380,105 @@ void OH_Drawing_CanvasTranslate(OH_Drawing_Canvas*, float dx, float dy);
|
||||
*/
|
||||
void OH_Drawing_CanvasScale(OH_Drawing_Canvas*, float sx, float sy);
|
||||
|
||||
/**
|
||||
* @brief Get the width of a canvas.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_Drawing_CanvasGetWidth(OH_Drawing_Canvas*);
|
||||
|
||||
/**
|
||||
* @brief Get the height of a canvas.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_Drawing_CanvasGetHeight(OH_Drawing_Canvas*);
|
||||
|
||||
/**
|
||||
* @brief Get the bounds of clip of a canvas.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param OH_Drawing_Rect Indicates the pointer to an <b>OH_Drawing_Rect</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasGetLocalClipBounds(OH_Drawing_Canvas*, OH_Drawing_Rect*);
|
||||
|
||||
/**
|
||||
* @brief Get a 3x3 matrix of the transform from local coordinates to 'device'.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasGetTotalMatrix(OH_Drawing_Canvas*, OH_Drawing_Matrix*);
|
||||
|
||||
/**
|
||||
* @brief Use the passed matrix to transforming the geometry, then use existing matrix.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object,
|
||||
* represents the matrix which is passed.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasConcatMatrix(OH_Drawing_Canvas*, OH_Drawing_Matrix*);
|
||||
|
||||
/**
|
||||
* @brief Enumerates of shadow flags.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum {
|
||||
/**
|
||||
* Use no shadow flags.
|
||||
*/
|
||||
SHADOW_FLAGS_NONE,
|
||||
/**
|
||||
* The occluding object is transparent.
|
||||
*/
|
||||
SHADOW_FLAGS_TRANSPARENT_OCCLUDER,
|
||||
/**
|
||||
* No need to analyze shadows.
|
||||
*/
|
||||
SHADOW_FLAGS_GEOMETRIC_ONLY,
|
||||
/**
|
||||
* Use all shadow falgs.
|
||||
*/
|
||||
SHADOW_FLAGS_ALL,
|
||||
} OH_Drawing_CanvasShadowFlags;
|
||||
|
||||
/**
|
||||
* @brief Use circular light to draw an offset spot shadow and outlining ambient shadow for the given path.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object, use to generate shadows.
|
||||
* @param planeParams Represents the value of the function which returns Z offset of the occluder from the
|
||||
* canvas based on x and y.
|
||||
* @param devLightPos Represents the position of the light relative to the canvas.
|
||||
* @param lightRadius The radius of the circular light.
|
||||
* @param ambientColor Ambient shadow's color.
|
||||
* @param spotColor Spot shadow's color.
|
||||
* @param flag Indicates the flag to control opaque occluder, shadow, and light position.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasDrawShadow(OH_Drawing_Canvas*, OH_Drawing_Path*, OH_Drawing_Point3D planeParams,
|
||||
OH_Drawing_Point3D devLightPos, float lightRadius, uint32_t ambientColor, uint32_t spotColor,
|
||||
OH_Drawing_CanvasShadowFlags flag);
|
||||
|
||||
/**
|
||||
* @brief Clears a canvas by using a specified color.
|
||||
*
|
||||
@@ -363,6 +490,63 @@ void OH_Drawing_CanvasScale(OH_Drawing_Canvas*, float sx, float sy);
|
||||
*/
|
||||
void OH_Drawing_CanvasClear(OH_Drawing_Canvas*, uint32_t color);
|
||||
|
||||
/**
|
||||
* @brief Sets matrix of canvas.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasSetMatrix(OH_Drawing_Canvas*, OH_Drawing_Matrix*);
|
||||
|
||||
/**
|
||||
* @brief Draws the specified source rectangle of the image onto the canvas,
|
||||
* scaled and translated to the destination rectangle.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param OH_Drawing_Image Indicates the pointer to an <b>OH_Drawing_Image</b> object.
|
||||
* @param OH_Drawing_Rect Indicates the pointer to an <b>OH_Drawing_Rect</b> object.
|
||||
* @param OH_Drawing_SamplingOptions Indicates the pointer to an <b>OH_Drawing_SamplingOptions</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_CanvasDrawImageRect(OH_Drawing_Canvas*, OH_Drawing_Image*,
|
||||
OH_Drawing_Rect* dst, OH_Drawing_SamplingOptions*);
|
||||
|
||||
/**
|
||||
* @brief Read pixels data from canvas.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param OH_Drawing_Image_Info width, height, colorType, and alphaType of dstPixels.
|
||||
* @param dstPixels destination pixel storage.
|
||||
* @param dstRowBytes size of one row of pixels.
|
||||
* @param srcX offset into canvas writable pixels on x-axis.
|
||||
* @param srcY offset into canvas writable pixels on y-axis.
|
||||
* @return true if pixels are copied to dstPixels.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
bool OH_Drawing_CanvasReadPixels(OH_Drawing_Canvas*, OH_Drawing_Image_Info*,
|
||||
void* dstPixels, uint32_t dstRowBytes, int32_t srcX, int32_t srcY);
|
||||
|
||||
/**
|
||||
* @brief Read pixels data to a bitmap from canvas.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
|
||||
* @param OH_Drawing_Bitmap Indicates the pointer to an <b>OH_Drawing_Bitmap</b> object.
|
||||
* @param srcX offset into canvas writable pixels on x-axis.
|
||||
* @param srcY offset into canvas writable pixels on y-axis.
|
||||
* @return true if pixels are copied to dstBitmap.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
bool OH_Drawing_CanvasReadPixelsToBitmap(OH_Drawing_Canvas*, OH_Drawing_Bitmap*, int32_t srcX, int32_t srcY);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -64,6 +64,17 @@ OH_Drawing_Font* OH_Drawing_FontCreate(void);
|
||||
*/
|
||||
void OH_Drawing_FontSetTypeface(OH_Drawing_Font*, OH_Drawing_Typeface*);
|
||||
|
||||
/**
|
||||
* @brief Gets an <b>OH_Drawing_Typeface</b> object from the <b>OH_Drawing_Typeface</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object.
|
||||
* @return OH_Drawing_Typeface Indicates the pointer to an <b>OH_Drawing_Typeface</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Typeface* OH_Drawing_FontGetTypeface(OH_Drawing_Font*);
|
||||
|
||||
/**
|
||||
* @brief Sets text size for an <b>OH_Drawing_Font</b> object.
|
||||
*
|
||||
@@ -75,6 +86,20 @@ void OH_Drawing_FontSetTypeface(OH_Drawing_Font*, OH_Drawing_Typeface*);
|
||||
*/
|
||||
void OH_Drawing_FontSetTextSize(OH_Drawing_Font*, float textSize);
|
||||
|
||||
/**
|
||||
* @brief Calculate number of glyphs represented by text.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object.
|
||||
* @param text Indicates the character storage encoded with text encoding.
|
||||
* @param byteLength Indicates the text length in bytes.
|
||||
* @param encoding Indicates the text encoding.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
int OH_Drawing_FontCountText(OH_Drawing_Font*, const void* text, size_t byteLength,
|
||||
OH_Drawing_TextEncoding encoding);
|
||||
|
||||
/**
|
||||
* @brief Enables or disables linearly scalable font for an <b>OH_Drawing_Font</b> object.
|
||||
*
|
||||
@@ -118,6 +143,37 @@ void OH_Drawing_FontSetFakeBoldText(OH_Drawing_Font*, bool isFakeBoldText);
|
||||
*/
|
||||
void OH_Drawing_FontDestroy(OH_Drawing_Font*);
|
||||
|
||||
/**
|
||||
* @brief Defines a run, supplies storage for the metrics of an SkFont.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct {
|
||||
/** storage for top in font metrics */
|
||||
float top;
|
||||
/** storage for ascent in font metrics */
|
||||
float ascent;
|
||||
/** storage for descent in font metrics */
|
||||
float descent;
|
||||
/** storage for bottom in font metrics */
|
||||
float bottom;
|
||||
/** storage for leading in font metrics */
|
||||
float leading;
|
||||
} OH_Drawing_Font_Metrics;
|
||||
|
||||
/**
|
||||
* @brief Obtains the metrics of a font.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object.
|
||||
* @param OH_Drawing_Font_Metrics Indicates the pointer to an <b>OH_Drawing_Font_Metrics</b> object.
|
||||
* @return Returns a float variable that recommended spacing between lines.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
float OH_Drawing_FontGetMetrics(OH_Drawing_Font*, OH_Drawing_Font_Metrics*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef C_INCLUDE_DRAWING_IMAGE_H
|
||||
#define C_INCLUDE_DRAWING_IMAGE_H
|
||||
|
||||
/**
|
||||
* @addtogroup Drawing
|
||||
* @{
|
||||
*
|
||||
* @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file drawing_image.h
|
||||
*
|
||||
* @brief Declares functions related to the <b>image</b> object in the drawing module.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include "drawing_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_Image</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @return Returns the pointer to the <b>OH_Drawing_Image</b> object created.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Image* OH_Drawing_ImageCreate(void);
|
||||
|
||||
/**
|
||||
* @brief Destroys an <b>OH_Drawing_Image</b> object and reclaims the memory occupied by the object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Image Indicates the pointer to an <b>OH_Drawing_Image</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_ImageDestroy(OH_Drawing_Image*);
|
||||
|
||||
/**
|
||||
* @brief Rebuilds an <b>OH_Drawing_Image</b> object, sharing or copying bitmap pixels.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Image Indicates the pointer to an <b>OH_Drawing_Image</b> object.
|
||||
* @param OH_Drawing_Bitmap Indicates the pointer to an <b>OH_Drawing_Bitmap</b> object.
|
||||
* @return Returns true if successed.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
bool OH_Drawing_ImageBuildFromBitmap(OH_Drawing_Image*, OH_Drawing_Bitmap*);
|
||||
|
||||
/**
|
||||
* @brief Gets pixel count in each row of image.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Image Indicates the pointer to an <b>OH_Drawing_Image</b> object.
|
||||
* @return Returns the width.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_Drawing_ImageGetWidth(OH_Drawing_Image*);
|
||||
|
||||
/**
|
||||
* @brief Gets pixel row count of image.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Image Indicates the pointer to an <b>OH_Drawing_Image</b> object.
|
||||
* @return Returns the height.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
int32_t OH_Drawing_ImageGetHeight(OH_Drawing_Image*);
|
||||
|
||||
/**
|
||||
* @brief Gets the image info.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Image Indicates the pointer to an <b>OH_Drawing_Image</b> object.
|
||||
* @param OH_Drawing_Image_Info Indicates the pointer to an <b>OH_Drawing_Image_Info</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_ImageGetImageInfo(OH_Drawing_Image*, OH_Drawing_Image_Info*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif
|
||||
@@ -53,6 +53,49 @@ extern "C" {
|
||||
*/
|
||||
OH_Drawing_Matrix* OH_Drawing_MatrixCreate(void);
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_Matrix</b> object with rotation. Sets matrix to
|
||||
* rotate by degrees about a pivot point at (px, py).
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @param deg angle of axes relative to upright axes
|
||||
* @param x pivot on x-axis.
|
||||
* @param y pivot on y-axis.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Matrix* OH_Drawing_MatrixCreateRotation(float deg, float x, float y);
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_Matrix</b> object with scale. Sets matrix to scale
|
||||
* by sx and sy, about a pivot point at (px, py).
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @param sx horizontal scale factor.
|
||||
* @param sy vertical scale factor.
|
||||
* @param px pivot on x-axis.
|
||||
* @param py pivot on y-axis.
|
||||
* @return Returns the pointer to the <b>OH_Drawing_Matrix</b> object created.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Matrix* OH_Drawing_MatrixCreateScale(float sx, float sy, float px, float py);
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_Matrix</b> object with translation.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @param dx horizontal translation.
|
||||
* @param dy vertical translation.
|
||||
* @return Returns the pointer to the <b>OH_Drawing_Matrix</b> object created.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Matrix* OH_Drawing_MatrixCreateTranslation(float dx, float dy);
|
||||
|
||||
/**
|
||||
* @brief Sets the params for a matrix.
|
||||
*
|
||||
@@ -73,6 +116,115 @@ OH_Drawing_Matrix* OH_Drawing_MatrixCreate(void);
|
||||
void OH_Drawing_MatrixSetMatrix(OH_Drawing_Matrix*, float scaleX, float skewX, float transX,
|
||||
float skewY, float scaleY, float transY, float persp0, float persp1, float persp2);
|
||||
|
||||
/**
|
||||
* @brief Sets matrix total to matrix a multiplied by matrix b.
|
||||
* Given:
|
||||
* | A B C | | J K L |
|
||||
* a = | D E F |, b = | M N O |
|
||||
* | G H I | | P Q R |
|
||||
* sets Matrix total to:
|
||||
* | A B C | | J K L | | AJ+BM+CP AK+BN+CQ AL+BO+CR |
|
||||
* total = a * b = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR |
|
||||
* | G H I | | P Q R | | GJ+HM+IP GK+HN+IQ GL+HO+IR |
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param total Indicates the pointer to an <b>OH_Drawing_Matrix</b> object that a * b.
|
||||
* @param a Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @param b Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_MatrixConcat(OH_Drawing_Matrix* total, const OH_Drawing_Matrix* a,
|
||||
const OH_Drawing_Matrix* b);
|
||||
|
||||
/**
|
||||
* @brief Get one matrix value. Index is between the range of 0-8.
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @param index one of 0-8.
|
||||
* @return Returns value corresponding to index.Returns 0 if out of range.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
float OH_Drawing_MatrixGetValue(OH_Drawing_Matrix*, int index);
|
||||
|
||||
/**
|
||||
* @brief Sets matrix to rotate by degrees about a pivot point at (px, py). The pivot point is unchanged
|
||||
* when mapped with matrix. Positive degrees rotates clockwise.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @param degree Indicates the angle of axes relative to upright axes.
|
||||
* @param px Indicates the pivot on x-axis.
|
||||
* @param py Indicates the pivot on y-axis.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_MatrixRotate(OH_Drawing_Matrix*, float degree, float px, float py);
|
||||
|
||||
/**
|
||||
* @brief Sets matrix to translate by (dx, dy)
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @param dx Indicates the horizontal translation.
|
||||
* @param dy Indicates the vertical translation.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_MatrixTranslate(OH_Drawing_Matrix*, float dx, float dy);
|
||||
|
||||
/**
|
||||
* @brief Sets matrix to scale by sx and sy, about a pivot point at (px, py).
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @param sx Indicates the horizontal scale factor.
|
||||
* @param sy Indicates the vertical scale factor.
|
||||
* @param px Indicates the pivot on x-axis.
|
||||
* @param py Indicates the pivot on y-axis.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_MatrixScale(OH_Drawing_Matrix*, float sx, float sy, float px, float py);
|
||||
|
||||
/**
|
||||
* @brief Sets inverse to reciprocal matrix, returning true if matrix can be inverted.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @param inverse Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @return Returns true if matrix can be inverted, or flase.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
bool OH_Drawing_MatrixInvert(OH_Drawing_Matrix*, OH_Drawing_Matrix* inverse);
|
||||
|
||||
/**
|
||||
* @brief Returns true if the first matrix equals the second matrix.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @param other Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @return Returns true if the two matrices are equal, or flase.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
bool OH_Drawing_MatrixIsEqual(OH_Drawing_Matrix*, OH_Drawing_Matrix* other);
|
||||
|
||||
/**
|
||||
* @brief Returns true if matrix is identity.
|
||||
* Identity matrix is : | 1 0 0 |
|
||||
* | 0 1 0 |
|
||||
* | 0 0 1 |
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @return Returns true if matrix is identity, or flase.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
bool OH_Drawing_MatrixIsIdentity(OH_Drawing_Matrix*);
|
||||
|
||||
/**
|
||||
* @brief Destroys an <b>OH_Drawing_Matrix</b> object and reclaims the memory occupied by the object.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef C_INCLUDE_DRAWING_MEMORY_STREAM_H
|
||||
#define C_INCLUDE_DRAWING_MEMORY_STREAM_H
|
||||
|
||||
/**
|
||||
* @addtogroup Drawing
|
||||
* @{
|
||||
*
|
||||
* @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file drawing_memory_stream.h
|
||||
*
|
||||
* @brief Declares functions related to the <b>memoryStream</b> object in the drawing module.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include "drawing_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Creates a <b>OH_Drawing_MemoryStream</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @return Returns the pointer to the <b>OH_Drawing_MemoryStream</b> object created.
|
||||
* @param data file path.
|
||||
* @param length Data length.
|
||||
* @param copyData Copy data or not.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_MemoryStream* OH_Drawing_MemoryStreamCreate(const void* data, size_t length, bool copyData);
|
||||
|
||||
/**
|
||||
* @brief Destroys an <b>OH_Drawing_MemoryStream</b> object and reclaims the memory occupied by the object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_MemoryStream Indicates the pointer to an <b>OH_Drawing_MemoryStream</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_MemoryStreamDestroy(OH_Drawing_MemoryStream*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif
|
||||
@@ -43,6 +43,36 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Direction for adding closed contours.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum {
|
||||
/** clockwise direction for adding closed contours */
|
||||
PATH_DIRECTION_CW,
|
||||
/** counter-clockwise direction for adding closed contours */
|
||||
PATH_DIRECTION_CCW,
|
||||
} OH_Drawing_PathDirection;
|
||||
|
||||
/**
|
||||
* @brief FillType of path
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum {
|
||||
/** Specifies that "inside" is computed by a non-zero sum of signed edge crossings */
|
||||
PATH_FILL_TYPE_WINDING,
|
||||
/** Specifies that "inside" is computed by an odd number of edge crossings */
|
||||
PATH_FILL_TYPE_EVEN_ODD,
|
||||
/** Same as Winding, but draws outside of the path, rather than inside */
|
||||
PATH_FILL_TYPE_INVERSE_WINDING,
|
||||
/** Same as EvenOdd, but draws outside of the path, rather than inside */
|
||||
PATH_FILL_TYPE_INVERSE_EVEN_ODD,
|
||||
} OH_Drawing_PathFillType;
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_Path</b> object.
|
||||
*
|
||||
@@ -53,6 +83,17 @@ extern "C" {
|
||||
*/
|
||||
OH_Drawing_Path* OH_Drawing_PathCreate(void);
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_Path</b> copy object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Rect</b> object.
|
||||
* @return Returns the pointer to the <b>OH_Drawing_Path</b> object created.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Path* OH_Drawing_PathCopy(OH_Drawing_Path*);
|
||||
|
||||
/**
|
||||
* @brief Destroys an <b>OH_Drawing_Path</b> object and reclaims the memory occupied by the object.
|
||||
*
|
||||
@@ -139,6 +180,99 @@ void OH_Drawing_PathQuadTo(OH_Drawing_Path*, float ctrlX, float ctrlY, float end
|
||||
void OH_Drawing_PathCubicTo(
|
||||
OH_Drawing_Path*, float ctrlX1, float ctrlY1, float ctrlX2, float ctrlY2, float endX, float endY);
|
||||
|
||||
/**
|
||||
* @brief Adds a new contour to the path, defined by the rect, and wound in the specified direction.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @param left Indicates the left coordinate of the upper left corner of the rectangle.
|
||||
* @param top Indicates the top coordinate of the upper top corner of the rectangle.
|
||||
* @param right Indicates the right coordinate of the lower right corner of the rectangle.
|
||||
* @param bottom Indicates the bottom coordinate of the lower bottom corner of the rectangle.
|
||||
* @param OH_Drawing_PathDirection Indicates the path direction.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PathAddRect(OH_Drawing_Path*, float left, float top, float right, float bottom, OH_Drawing_PathDirection);
|
||||
|
||||
/**
|
||||
* @brief Adds a new contour to the path, defined by the round rect, and wound in the specified direction.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @param OH_Drawing_RoundRect Indicates the pointer to an <b>OH_Drawing_RoundRect</b> object.
|
||||
* @param OH_Drawing_PathDirection Indicates the path direction.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PathAddRoundRect(OH_Drawing_Path*, const OH_Drawing_RoundRect* roundRect, OH_Drawing_PathDirection);
|
||||
|
||||
/**
|
||||
* @brief Appends arc to path, as the start of new contour.Arc added is part of ellipse bounded by oval,
|
||||
* from startAngle through sweepAngle. Both startAngle and sweepAngle are measured in degrees, where zero degrees
|
||||
* is aligned with the positive x-axis, and positive sweeps extends arc clockwise.If sweepAngle <= -360, or
|
||||
* sweepAngle >= 360; and startAngle modulo 90 is nearly zero, append oval instead of arc. Otherwise, sweepAngle
|
||||
* values are treated modulo 360, and arc may or may not draw depending on numeric rounding.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @param OH_Drawing_Rect Indicates the pointer to an <b>OH_Drawing_Rect</b> object.
|
||||
* @param startAngle Indicates the starting angle of arc in degrees.
|
||||
* @param sweepAngle Indicates the sweep, in degrees. Positive is clockwise.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PathAddArc(OH_Drawing_Path*, const OH_Drawing_Rect*, float startAngle, float sweepAngle);
|
||||
|
||||
/**
|
||||
* @brief Appends src path to path, transformed by matrix. Transformed curves may have different verbs,
|
||||
* point, and conic weights.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @param src Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @param OH_Drawing_Matrix Indicates the length of the <b>OH_Drawing_Matrix</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PathAddPath(OH_Drawing_Path*, const OH_Drawing_Path* src, const OH_Drawing_Matrix*);
|
||||
|
||||
/**
|
||||
* @brief Return the status that point (x, y) is contained by path.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @param x Indicates the x-axis value of containment test.
|
||||
* @param y Indicates the y-axis value of containment test.
|
||||
* @return Returns true if the point (x, y) is contained by path.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
bool OH_Drawing_PathContains(OH_Drawing_Path*, float x, float y);
|
||||
|
||||
/**
|
||||
* @brief Transforms verb array, point array, and weight by matrix. transform may change verbs
|
||||
* and increase their number. path is replaced by transformed data.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @param OH_Drawing_Matrix Indicates the pointer to an <b>OH_Drawing_Matrix</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PathTransform(OH_Drawing_Path*, const OH_Drawing_Matrix*);
|
||||
|
||||
/**
|
||||
* @brief Sets FillType, the rule used to fill path.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
|
||||
* @param OH_Drawing_PathFillType Indicates the add path's fill type.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PathSetFillType(OH_Drawing_Path*, OH_Drawing_PathFillType);
|
||||
|
||||
/**
|
||||
* @brief Closes a path. A line segment from the start point to the last point of the path is added.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef C_INCLUDE_DRAWING_PATH_EFFECT_H
|
||||
#define C_INCLUDE_DRAWING_PATH_EFFECT_H
|
||||
|
||||
/**
|
||||
* @addtogroup Drawing
|
||||
* @{
|
||||
*
|
||||
* @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file drawing_path_effect.h
|
||||
*
|
||||
* @brief Declares functions related to the <b>pathEffect</b> object in the drawing module.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include "drawing_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_PathEffect</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param intervals Indicates a array which contain an even number of entries.
|
||||
* @param count Indicates the number of elements of the intervals array.
|
||||
* @param phase Indicates the offset into intervals array.
|
||||
* @return Returns the pointer to the <b>OH_Drawing_PathEffect</b> object created.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_PathEffect* OH_Drawing_CreateDashPathEffect(float* intervals, int count, float phase);
|
||||
|
||||
/**
|
||||
* @brief Destroys an <b>OH_Drawing_PathEffect</b> object and reclaims the memory occupied by the object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_PathEffect Indicates the pointer to an <b>OH_Drawing_PathEffect</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PathEffectDestroy(OH_Drawing_PathEffect*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif
|
||||
@@ -21,7 +21,7 @@
|
||||
* @{
|
||||
*
|
||||
* @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
|
||||
*
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 8
|
||||
@@ -183,9 +183,9 @@ float OH_Drawing_PenGetMiterLimit(const OH_Drawing_Pen*);
|
||||
void OH_Drawing_PenSetMiterLimit(OH_Drawing_Pen*, float miter);
|
||||
|
||||
/**
|
||||
* @brief Enumerates line cap styles of a pen. The line cap style defines
|
||||
* @brief Enumerates line cap styles of a pen. The line cap style defines
|
||||
* the style of both ends of a line segment drawn by the pen.
|
||||
*
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
@@ -231,7 +231,7 @@ void OH_Drawing_PenSetCap(OH_Drawing_Pen*, OH_Drawing_PenLineCapStyle);
|
||||
/**
|
||||
* @brief Enumerates pen line join styles. The line join style defines
|
||||
* the shape of the joints of a polyline segment drawn by the pen.
|
||||
*
|
||||
*
|
||||
* @since 8
|
||||
* @version 1.0
|
||||
*/
|
||||
@@ -291,6 +291,17 @@ void OH_Drawing_PenSetShaderEffect(OH_Drawing_Pen*, OH_Drawing_ShaderEffect*);
|
||||
*/
|
||||
void OH_Drawing_PenSetFilter(OH_Drawing_Pen*, OH_Drawing_Filter*);
|
||||
|
||||
/**
|
||||
* @brief Sets a blender that implements the specified blendmode enum for a pen.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
|
||||
* @param OH_Drawing_BlendMode Indicates the blend mode.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_PenSetBlendMode(OH_Drawing_Pen*, OH_Drawing_BlendMode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef C_INCLUDE_DRAWING_SAMPLING_OPTIONS_H
|
||||
#define C_INCLUDE_DRAWING_SAMPLING_OPTIONS_H
|
||||
|
||||
/**
|
||||
* @addtogroup Drawing
|
||||
* @{
|
||||
*
|
||||
* @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file drawing_sampling_options.h
|
||||
*
|
||||
* @brief Declares functions related to the <b>sampling options</b> object in the drawing module.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#include "drawing_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enumerates storage filter mode.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum {
|
||||
/** single sample point (nearest neighbor) */
|
||||
FILTER_MODE_NEAREST,
|
||||
/** interporate between 2x2 sample points (bilinear interpolation) */
|
||||
FILTER_MODE_LINEAR,
|
||||
} OH_Drawing_FilterMode;
|
||||
|
||||
/**
|
||||
* @brief Enumerates storage formats mipmap mode.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum {
|
||||
/** ignore mipmap levels, sample from the "base" */
|
||||
MIPMAP_MODE_NONE,
|
||||
/** sample from the nearest level */
|
||||
MIPMAP_MODE_NEAREST,
|
||||
/** interpolate between the two nearest levels */
|
||||
MIPMAP_MODE_LINEAR,
|
||||
} OH_Drawing_MipmapMode;
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_SamplingOptions</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_FilterMode sampling filter mode.
|
||||
* @param OH_Drawing_MipmapMode sampling mipmap mode..
|
||||
* @return Returns the pointer to the <b>OH_Drawing_SamplingOptions</b> object created.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_SamplingOptions* OH_Drawing_SamplingOptionsCreate(OH_Drawing_FilterMode, OH_Drawing_MipmapMode);
|
||||
|
||||
/**
|
||||
* @brief Destroys an <b>OH_Drawing_SamplingOptions</b> object and reclaims the memory occupied by the object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_SamplingOptions Indicates the pointer to an <b>OH_Drawing_SamplingOptions</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_SamplingOptionsDestroy(OH_Drawing_SamplingOptions*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif
|
||||
@@ -53,6 +53,62 @@ extern "C" {
|
||||
*/
|
||||
OH_Drawing_TextBlobBuilder* OH_Drawing_TextBlobBuilderCreate(void);
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_TextBlob</b> object from text.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param text Indicates the the pointer to text.
|
||||
* @param byteLength Indicates the text length.
|
||||
* @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object.
|
||||
* @param OH_Drawing_TextEncoding Indicates the pointer to an <b>OH_Drawing_TextEncoding</b> object.
|
||||
* @return Returns the pointer to the <b>OH_Drawing_TextBlob</b> object created.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromText(const void* text, size_t byteLength,
|
||||
const OH_Drawing_Font*, OH_Drawing_TextEncoding);
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_TextBlob</b> object from pos text.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param text Indicates the the pointer to text.
|
||||
* @param byteLength Indicates the text length.
|
||||
* @param OH_Drawing_Point2D Indicates the pointer to an <b>OH_Drawing_Point2D</b> array object.
|
||||
* @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object.
|
||||
* @param OH_Drawing_TextEncoding Indicates the pointer to an <b>OH_Drawing_TextEncoding</b> object.
|
||||
* @return Returns the pointer to the <b>OH_Drawing_TextBlob</b> object created.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromPosText(const void* text, size_t byteLength,
|
||||
OH_Drawing_Point2D*, const OH_Drawing_Font*, OH_Drawing_TextEncoding);
|
||||
|
||||
/**
|
||||
* @brief Creates an <b>OH_Drawing_TextBlob</b> object from pos text.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param str Indicates the the pointer to text.
|
||||
* @param OH_Drawing_Font Indicates the pointer to an <b>OH_Drawing_Font</b> object.
|
||||
* @param OH_Drawing_TextEncoding Indicates the pointer to an <b>OH_Drawing_TextEncoding</b> object.
|
||||
* @return Returns the pointer to the <b>OH_Drawing_TextBlob</b> object created.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_TextBlob* OH_Drawing_TextBlobCreateFromString(const char* str,
|
||||
const OH_Drawing_Font*, OH_Drawing_TextEncoding);
|
||||
|
||||
/**
|
||||
* @brief Gets the bounds of textblob, assigned to the pointer to an <b>OH_Drawing_Rect</b> object.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_TextBlob Indicates the pointer to an <b>OH_Drawing_TextBlob</b> object.
|
||||
* @param OH_Drawing_Rect Indicates the pointer to an <b>OH_Drawing_Rect</b> object.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
void OH_Drawing_TextBlobGetBounds(OH_Drawing_TextBlob*, OH_Drawing_Rect*);
|
||||
|
||||
/**
|
||||
* @brief Defines a run, supplies storage for glyphs and positions.
|
||||
*
|
||||
|
||||
@@ -1001,6 +1001,19 @@ double OH_Drawing_TypographyGetLineHeight(OH_Drawing_Typography*, int);
|
||||
*/
|
||||
double OH_Drawing_TypographyGetLineWidth(OH_Drawing_Typography*, int);
|
||||
|
||||
/**
|
||||
* @brief get line text range.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_Typography Indicates the pointer to an <b>OH_Drawing_Typography</b> object.
|
||||
* @param int Indicates the line number.
|
||||
* @param bool Indicates whether spaces are contained.
|
||||
* @return Returns line text range.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Range* OH_Drawing_TypographyGetLineTextRange(OH_Drawing_Typography*, int, bool);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -53,6 +53,32 @@ extern "C" {
|
||||
*/
|
||||
OH_Drawing_Typeface* OH_Drawing_TypefaceCreateDefault(void);
|
||||
|
||||
/**
|
||||
* @brief Creates a <b>OH_Drawing_Typeface</b> object by file.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param path file path.
|
||||
* @param index file index.
|
||||
* @return Returns the pointer to the <b>OH_Drawing_Typeface</b> object created.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromFile(const char* path, int index);
|
||||
|
||||
/**
|
||||
* @brief Creates a <b>OH_Drawing_Typeface</b> object by given a stream. If the stream is not a valid
|
||||
* font file, returns nullptr. Ownership of the stream is transferred, so the caller must not reference
|
||||
* it or free it again.
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
* @param OH_Drawing_MemoryStream Indicates the pointer to an <b>OH_Drawing_MemoryStream</b> object.
|
||||
* @param index memory stream index.
|
||||
* @return Returns the pointer to the <b>OH_Drawing_Typeface</b> object created.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_Drawing_Typeface* OH_Drawing_TypefaceCreateFromStream(OH_Drawing_MemoryStream*, int32_t index);
|
||||
|
||||
/**
|
||||
* @brief Destroys an <b>OH_Drawing_Typeface</b> object and reclaims the memory occupied by the object.
|
||||
*
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* @{
|
||||
*
|
||||
* @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
|
||||
*
|
||||
*
|
||||
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
|
||||
*
|
||||
* @since 8
|
||||
@@ -38,6 +38,7 @@
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -92,6 +93,37 @@ typedef struct OH_Drawing_Bitmap OH_Drawing_Bitmap;
|
||||
*/
|
||||
typedef struct OH_Drawing_Point OH_Drawing_Point;
|
||||
|
||||
/**
|
||||
* @brief Defines a point of 2d.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct {
|
||||
float x;
|
||||
float y;
|
||||
} OH_Drawing_Point2D;
|
||||
|
||||
/**
|
||||
* @brief Defines a point of 3d, which is used to describe the coordinate point.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
} OH_Drawing_Point3D;
|
||||
|
||||
/**
|
||||
* @brief Defines a pathEffect, which is used to affects stroked paths.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct OH_Drawing_PathEffect OH_Drawing_PathEffect;
|
||||
|
||||
/**
|
||||
* @brief Defines a rect, which is used to describe the rectangle.
|
||||
*
|
||||
@@ -156,6 +188,14 @@ typedef struct OH_Drawing_ColorFilter OH_Drawing_ColorFilter;
|
||||
*/
|
||||
typedef struct OH_Drawing_Font OH_Drawing_Font;
|
||||
|
||||
/**
|
||||
* @brief Defines a memoryStream, which is used to describe the memory stream.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct OH_Drawing_MemoryStream OH_Drawing_MemoryStream;
|
||||
|
||||
/**
|
||||
* @brief Defines a typeface, which is used to describe the typeface.
|
||||
*
|
||||
@@ -173,6 +213,22 @@ typedef struct OH_Drawing_Typeface OH_Drawing_Typeface;
|
||||
*/
|
||||
typedef struct OH_Drawing_TextBlob OH_Drawing_TextBlob;
|
||||
|
||||
/**
|
||||
* @brief Defines a image, which is used to describe a two dimensional array of pixels to draw.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct OH_Drawing_Image OH_Drawing_Image;
|
||||
|
||||
/**
|
||||
* @brief Defines a sampling options, which is used to describe the sampling mode.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct OH_Drawing_SamplingOptions OH_Drawing_SamplingOptions;
|
||||
|
||||
/**
|
||||
* @brief Defines a textBlobBuilder, which is used to build the textBlob.
|
||||
*
|
||||
@@ -232,7 +288,7 @@ typedef enum {
|
||||
} OH_Drawing_AlphaFormat;
|
||||
|
||||
/**
|
||||
* @brief The blending operation generates a new color for the two colors (source, target).
|
||||
* @brief The blending operation generates a new color for the two colors (source, destination).
|
||||
* These operations are the same on the 4 color channels: red, green, blue, alpha.
|
||||
* For these, we use alpha channel as an example, rather than naming each channel individually.
|
||||
*
|
||||
@@ -311,6 +367,39 @@ typedef enum {
|
||||
BLEND_MODE_LUMINOSITY,
|
||||
} OH_Drawing_BlendMode;
|
||||
|
||||
/**
|
||||
* @brief Defines image info struct.
|
||||
*
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct {
|
||||
/** storage for width of image */
|
||||
int32_t width;
|
||||
/** storage for height of image */
|
||||
int32_t height;
|
||||
/** storage for color formats */
|
||||
OH_Drawing_ColorFormat colorType;
|
||||
/** storage for alpha formats */
|
||||
OH_Drawing_AlphaFormat alphaType;
|
||||
} OH_Drawing_Image_Info;
|
||||
|
||||
/**
|
||||
* @brief Enumerates text encoding types.
|
||||
* @since 12
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum {
|
||||
/** uses bytes to represent UTF-8 or ASCII */
|
||||
TEXT_ENCODING_UTF8,
|
||||
/** uses two byte words to represent most of Unicode */
|
||||
TEXT_ENCODING_UTF16,
|
||||
/** uses four byte words to represent all of Unicode */
|
||||
TEXT_ENCODING_UTF32,
|
||||
/** uses two byte words to represent glyph indices */
|
||||
TEXT_ENCODING_GLYPH_ID,
|
||||
} OH_Drawing_TextEncoding;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
{ "name": "OH_Drawing_BitmapCreate" },
|
||||
{ "name": "OH_Drawing_BitmapDestroy" },
|
||||
{ "name": "OH_Drawing_BitmapBuild" },
|
||||
{ "name": "OH_Drawing_BitmapCreateFromPixels" },
|
||||
{ "name": "OH_Drawing_BitmapGetWidth" },
|
||||
{ "name": "OH_Drawing_BitmapGetHeight" },
|
||||
{ "name": "OH_Drawing_BitmapGetPixels" },
|
||||
@@ -9,6 +10,7 @@
|
||||
{ "name": "OH_Drawing_BrushDestroy" },
|
||||
{ "name": "OH_Drawing_BrushGetAlpha" },
|
||||
{ "name": "OH_Drawing_BrushSetAlpha" },
|
||||
{ "name": "OH_Drawing_BrushSetBlendMode" },
|
||||
{ "name": "OH_Drawing_BrushIsAntiAlias" },
|
||||
{ "name": "OH_Drawing_BrushSetAntiAlias" },
|
||||
{ "name": "OH_Drawing_BrushGetColor" },
|
||||
@@ -23,11 +25,13 @@
|
||||
{ "name": "OH_Drawing_CanvasAttachBrush" },
|
||||
{ "name": "OH_Drawing_CanvasDetachBrush" },
|
||||
{ "name": "OH_Drawing_CanvasSave" },
|
||||
{ "name": "OH_Drawing_CanvasSaveLayer" },
|
||||
{ "name": "OH_Drawing_CanvasRestore" },
|
||||
{ "name": "OH_Drawing_CanvasGetSaveCount" },
|
||||
{ "name": "OH_Drawing_CanvasRestoreToCount" },
|
||||
{ "name": "OH_Drawing_CanvasDrawArc" },
|
||||
{ "name": "OH_Drawing_CanvasDrawBitmap" },
|
||||
{ "name": "OH_Drawing_CanvasDrawBitmapRect" },
|
||||
{ "name": "OH_Drawing_CanvasDrawCircle" },
|
||||
{ "name": "OH_Drawing_CanvasDrawLine" },
|
||||
{ "name": "OH_Drawing_CanvasDrawOval" },
|
||||
@@ -41,6 +45,18 @@
|
||||
{ "name": "OH_Drawing_CanvasTranslate" },
|
||||
{ "name": "OH_Drawing_CanvasScale" },
|
||||
{ "name": "OH_Drawing_CanvasClear" },
|
||||
{ "name": "OH_Drawing_CanvasSetMatrix" },
|
||||
{ "name": "OH_Drawing_CanvasDrawImageRect" },
|
||||
{ "name": "OH_Drawing_CanvasReadPixels" },
|
||||
{ "name": "OH_Drawing_CanvasReadPixelsToBitmap" },
|
||||
{ "name": "OH_Drawing_CanvasGetWidth" },
|
||||
{ "name": "OH_Drawing_CanvasGetHeight" },
|
||||
{ "name": "OH_Drawing_CanvasGetLocalClipBounds" },
|
||||
{ "name": "OH_Drawing_CanvasGetTotalMatrix" },
|
||||
{ "name": "OH_Drawing_CanvasConcatMatrix" },
|
||||
{ "name": "OH_Drawing_CanvasDrawShadow" },
|
||||
{ "name": "OH_Drawing_CreateDashPathEffect" },
|
||||
{ "name": "OH_Drawing_PathEffectDestroy" },
|
||||
{ "name": "OH_Drawing_ColorFilterCreateBlendMode" },
|
||||
{ "name": "OH_Drawing_ColorFilterCreateCompose" },
|
||||
{ "name": "OH_Drawing_ColorFilterCreateLinearToSrgbGamma" },
|
||||
@@ -57,26 +73,49 @@
|
||||
{ "name": "OH_Drawing_FontSetFakeBoldText" },
|
||||
{ "name": "OH_Drawing_FontSetLinearText" },
|
||||
{ "name": "OH_Drawing_FontSetTextSize" },
|
||||
{ "name": "OH_Drawing_FontCountText" },
|
||||
{ "name": "OH_Drawing_FontSetTextSkewX" },
|
||||
{ "name": "OH_Drawing_FontSetTypeface" },
|
||||
{ "name": "OH_Drawing_FontGetMetrics" },
|
||||
{ "name": "OH_Drawing_FontGetTypeface" },
|
||||
{ "name": "OH_Drawing_MaskFilterCreateBlur" },
|
||||
{ "name": "OH_Drawing_MaskFilterDestroy" },
|
||||
{ "name": "OH_Drawing_MatrixCreate" },
|
||||
{ "name": "OH_Drawing_MatrixCreateRotation" },
|
||||
{ "name": "OH_Drawing_MatrixCreateScale" },
|
||||
{ "name": "OH_Drawing_MatrixCreateTranslation" },
|
||||
{ "name": "OH_Drawing_MatrixSetMatrix" },
|
||||
{ "name": "OH_Drawing_MatrixConcat" },
|
||||
{ "name": "OH_Drawing_MatrixGetValue" },
|
||||
{ "name": "OH_Drawing_MatrixRotate" },
|
||||
{ "name": "OH_Drawing_MatrixTranslate" },
|
||||
{ "name": "OH_Drawing_MatrixScale" },
|
||||
{ "name": "OH_Drawing_MatrixInvert" },
|
||||
{ "name": "OH_Drawing_MatrixIsEqual" },
|
||||
{ "name": "OH_Drawing_MatrixIsIdentity" },
|
||||
{ "name": "OH_Drawing_MatrixDestroy" },
|
||||
{ "name": "OH_Drawing_PathCreate" },
|
||||
{ "name": "OH_Drawing_PathCopy" },
|
||||
{ "name": "OH_Drawing_PathDestroy" },
|
||||
{ "name": "OH_Drawing_PathMoveTo" },
|
||||
{ "name": "OH_Drawing_PathLineTo" },
|
||||
{ "name": "OH_Drawing_PathArcTo" },
|
||||
{ "name": "OH_Drawing_PathQuadTo" },
|
||||
{ "name": "OH_Drawing_PathCubicTo" },
|
||||
{ "name": "OH_Drawing_PathAddRect" },
|
||||
{ "name": "OH_Drawing_PathAddRoundRect" },
|
||||
{ "name": "OH_Drawing_PathAddArc" },
|
||||
{ "name": "OH_Drawing_PathAddPath" },
|
||||
{ "name": "OH_Drawing_PathContains" },
|
||||
{ "name": "OH_Drawing_PathTransform" },
|
||||
{ "name": "OH_Drawing_PathSetFillType" },
|
||||
{ "name": "OH_Drawing_PathClose" },
|
||||
{ "name": "OH_Drawing_PathReset" },
|
||||
{ "name": "OH_Drawing_PenCreate" },
|
||||
{ "name": "OH_Drawing_PenDestroy" },
|
||||
{ "name": "OH_Drawing_PenGetAlpha" },
|
||||
{ "name": "OH_Drawing_PenSetAlpha" },
|
||||
{ "name": "OH_Drawing_PenSetBlendMode" },
|
||||
{ "name": "OH_Drawing_PenIsAntiAlias" },
|
||||
{ "name": "OH_Drawing_PenSetAntiAlias" },
|
||||
{ "name": "OH_Drawing_PenGetColor" },
|
||||
@@ -121,12 +160,20 @@
|
||||
{ "name": "OH_Drawing_ShaderEffectCreateRadialGradient" },
|
||||
{ "name": "OH_Drawing_ShaderEffectCreateSweepGradient" },
|
||||
{ "name": "OH_Drawing_ShaderEffectDestroy" },
|
||||
{ "name": "OH_Drawing_TextBlobCreateFromText" },
|
||||
{ "name": "OH_Drawing_TextBlobCreateFromPosText" },
|
||||
{ "name": "OH_Drawing_TextBlobCreateFromString" },
|
||||
{ "name": "OH_Drawing_TextBlobGetBounds" },
|
||||
{ "name": "OH_Drawing_TextBlobBuilderAllocRunPos" },
|
||||
{ "name": "OH_Drawing_TextBlobBuilderCreate" },
|
||||
{ "name": "OH_Drawing_TextBlobBuilderDestroy" },
|
||||
{ "name": "OH_Drawing_TextBlobBuilderMake" },
|
||||
{ "name": "OH_Drawing_TextBlobDestroy" },
|
||||
{ "name": "OH_Drawing_MemoryStreamCreate" },
|
||||
{ "name": "OH_Drawing_MemoryStreamDestroy" },
|
||||
{ "name": "OH_Drawing_TypefaceCreateDefault" },
|
||||
{ "name": "OH_Drawing_TypefaceCreateFromFile" },
|
||||
{ "name": "OH_Drawing_TypefaceCreateFromStream" },
|
||||
{ "name": "OH_Drawing_TypefaceDestroy" },
|
||||
{ "name": "OH_Drawing_CreateTypographyHandler" },
|
||||
{ "name": "OH_Drawing_DestroyTypographyHandler" },
|
||||
@@ -144,6 +191,17 @@
|
||||
{ "name": "OH_Drawing_TypographyGetMaxIntrinsicWidth" },
|
||||
{ "name": "OH_Drawing_TypographyGetAlphabeticBaseline" },
|
||||
{ "name": "OH_Drawing_TypographyGetIdeographicBaseline" },
|
||||
{ "name": "OH_Drawing_ImageCreate" },
|
||||
{ "name": "OH_Drawing_ImageDestroy" },
|
||||
{ "name": "OH_Drawing_ImageBuildFromBitmap" },
|
||||
{ "name": "OH_Drawing_ImageGetWidth" },
|
||||
{ "name": "OH_Drawing_ImageGetHeight" },
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_Drawing_ImageGetImageInfo"
|
||||
},
|
||||
{ "name": "OH_Drawing_SamplingOptionsCreate" },
|
||||
{ "name": "OH_Drawing_SamplingOptionsDestroy" },
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_Drawing_TypographyHandlerAddPlaceholder"
|
||||
@@ -271,5 +329,9 @@
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_Drawing_RegisterFontBuffer"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_Drawing_TypographyGetLineTextRange"
|
||||
}
|
||||
]
|
||||
@@ -186,5 +186,13 @@
|
||||
{
|
||||
"first_introduced": "10",
|
||||
"name": "OH_AudioCapturer_GetFramesRead"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_AudioRenderer_GetSpeed"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_AudioRenderer_SetSpeed"
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -26,5 +26,13 @@
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_AVDemuxer_ReadSampleBuffer"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_AVDemuxer_SetMediaKeySystemInfoCallback"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_AVDemuxer_GetMediaKeySystemInfo"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct MediaKeySession MediaKeySession;
|
||||
|
||||
/**
|
||||
* @brief Creates a video decoder instance from the mime type, which is recommended in most cases.
|
||||
* @syscap SystemCapability.Multimedia.Media.VideoDecoder
|
||||
@@ -300,8 +302,23 @@ OH_AVErrCode OH_VideoDecoder_FreeOutputBuffer(OH_AVCodec *codec, uint32_t index)
|
||||
*/
|
||||
OH_AVErrCode OH_VideoDecoder_IsValid(OH_AVCodec *codec, bool *isValid);
|
||||
|
||||
/**
|
||||
* @brief Set decryption info.
|
||||
*
|
||||
* @syscap SystemCapability.Multimedia.Media.VideoDecoder
|
||||
* @param codec Pointer to an OH_AVCodec instance
|
||||
* @param mediaKeySession A media key session instance with decryption function.
|
||||
* @param secureVideoPath Require secure decoder or not.
|
||||
* @return Returns AV_ERR_OK if the execution is successful,
|
||||
* otherwise returns a specific error code, refer to {@link OH_AVErrCode}
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_AVErrCode OH_VideoDecoder_SetDecryptionConfig(OH_AVCodec *codec, MediaKeySession *mediaKeySession,
|
||||
bool secureVideoPath);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // NATIVE_AVCODEC_VIDEODECODER_H
|
||||
#endif // NATIVE_AVCODEC_VIDEODECODER_H
|
||||
|
||||
@@ -25,6 +25,8 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OH_AVDemuxer OH_AVDemuxer;
|
||||
typedef struct DRM_MediaKeySystemInfo DRM_MediaKeySystemInfo;
|
||||
typedef void (*DRM_MediaKeySystemInfoCallback)(DRM_MediaKeySystemInfo* mediaKeySystemInfo);
|
||||
|
||||
/**
|
||||
* @brief Creates an OH_AVDemuxer instance for getting samples from source.
|
||||
@@ -125,6 +127,32 @@ OH_AVErrCode OH_AVDemuxer_ReadSampleBuffer(OH_AVDemuxer *demuxer, uint32_t track
|
||||
*/
|
||||
OH_AVErrCode OH_AVDemuxer_SeekToTime(OH_AVDemuxer *demuxer, int64_t millisecond, OH_AVSeekMode mode);
|
||||
|
||||
/**
|
||||
* @brief Method to set player media key system info callback.
|
||||
* @syscap SystemCapability.Multimedia.Media.Spliter
|
||||
* @param demuxer Pointer to an OH_AVDemuxer instance
|
||||
* @param callback object pointer.
|
||||
* @return Returns {@link AV_ERR_OK} if the drm info callback is set; returns an error code defined
|
||||
* in {@link native_averrors.h} otherwise.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_AVErrCode OH_AVDemuxer_SetMediaKeySystemInfoCallback(OH_AVDemuxer *demuxer,
|
||||
DRM_MediaKeySystemInfoCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Obtains media key system info to create media key session.
|
||||
* @syscap SystemCapability.Multimedia.Media.Spliter
|
||||
* @param demuxer Pointer to an OH_AVDemuxer instance
|
||||
* @param mediaKeySystemInfo Indicates the media key system info which ram space allocated by callee and
|
||||
released by caller.
|
||||
* @return Returns {@link AV_ERR_OK} if the current position is get; returns an error code defined
|
||||
* in {@link native_averrors.h} otherwise.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
OH_AVErrCode OH_AVDemuxer_GetMediaKeySystemInfo(OH_AVDemuxer *demuxer, DRM_MediaKeySystemInfo *mediaKeySystemInfo);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -82,5 +82,10 @@
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_VideoDecoder_RenderOutputBuffer"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_VideoDecoder_SetDecryptionConfig"
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
@@ -31,10 +31,18 @@
|
||||
"first_introduced": "11",
|
||||
"name": "OH_CameraManager_GetSupportedCameras"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_CameraManager_DeleteSupportedCameras"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_CameraManager_GetSupportedCameraOutputCapability"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_CameraManager_DeleteSupportedCameraOutputCapability"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_CameraManager_IsCameraMuted"
|
||||
@@ -71,6 +79,10 @@
|
||||
"first_introduced": "11",
|
||||
"name": "OH_Camera_GetCameraManager"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_Camera_DeleteCameraManager"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_CaptureSession_RegisterCallback"
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
# Copyright (C) 2023 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//build/ohos/ndk/ndk.gni")
|
||||
ohos_ndk_headers("native_drm_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/multimedia/drm_framework"
|
||||
sources = [
|
||||
"./common/native_drm_common.h",
|
||||
"./common/native_drm_err.h",
|
||||
"./native_mediakeysession.h",
|
||||
"./native_mediakeysystem.h",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_ndk_library("libnative_drm") {
|
||||
ndk_description_file = "./libnative_drm.ndk.json"
|
||||
min_compact_version = "11"
|
||||
output_name = "native_drm"
|
||||
output_extension = "so"
|
||||
|
||||
system_capability = "SystemCapability.Multimedia.Drm.Core"
|
||||
system_capability_headers = [
|
||||
"multimedia/drm_framework/native_drm_common.h",
|
||||
"multimedia/drm_framework/native_drm_err.h",
|
||||
"multimedia/drm_framework/native_mediakeysession.h",
|
||||
"multimedia/drm_framework/native_mediakeysystem.h",
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,509 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup Drm
|
||||
* @{
|
||||
*
|
||||
* @brief Provides APIs of Drm.
|
||||
* @kit Drm.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file native_drm_common.h
|
||||
*
|
||||
* @brief Defines the Drm common struct.
|
||||
* @library libnative_drm.z.so
|
||||
* @syscap SystemCapability.Multimedia.Drm.Core
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#ifndef NATIVE_DRM_COMMON_H
|
||||
#define NATIVE_DRM_COMMON_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Enumerates event types of listener.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum DRM_EventType {
|
||||
/**
|
||||
* DRM event base.
|
||||
*/
|
||||
EVENT_DRM_BASE = 200,
|
||||
/**
|
||||
* Provision required event.
|
||||
*/
|
||||
EVENT_PROVISION_REQUIRED = 201,
|
||||
/**
|
||||
* Media key required event.
|
||||
*/
|
||||
EVENT_KEY_REQUIRED = 202,
|
||||
/**
|
||||
* Media key expired event.
|
||||
*/
|
||||
EVENT_KEY_EXPIRED = 203,
|
||||
/**
|
||||
* Vendor defined event.
|
||||
*/
|
||||
EVENT_VENDOR_DEFINED = 204,
|
||||
/**
|
||||
* Expiration update event.
|
||||
*/
|
||||
EVENT_EXPIRATION_UPDATE = 206,
|
||||
} DRM_EventType;
|
||||
|
||||
/**
|
||||
* @brief Content potection level.
|
||||
* @syscap SystemCapability.Multimedia.Drm.Core
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum DRM_ContentProtectionLevel {
|
||||
/**
|
||||
* Content potection level unknown.
|
||||
*/
|
||||
CONTENT_PROTECTION_LEVEL_UNKNOWN = 0,
|
||||
/**
|
||||
* Content potection level software crypto.
|
||||
*/
|
||||
CONTENT_PROTECTION_LEVEL_SW_CRYPTO,
|
||||
/**
|
||||
* Content potection level hardware crypto.
|
||||
*/
|
||||
CONTENT_PROTECTION_LEVEL_HW_CRYPTO,
|
||||
/**
|
||||
* Content potection level enhanced hardware crypto.
|
||||
*/
|
||||
CONTENT_PROTECTION_LEVEL_ENHANCED_HW_CRYPTO,
|
||||
/**
|
||||
* Content potection level max stub.
|
||||
*/
|
||||
CONTENT_PROTECTION_LEVEL_MAX,
|
||||
} DRM_ContentProtectionLevel;
|
||||
|
||||
/**
|
||||
* @brief Media key type.
|
||||
* @syscap SystemCapability.Multimedia.Drm.Core
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum DRM_MediaKeyType {
|
||||
/**
|
||||
* Media key type offline.
|
||||
*/
|
||||
MEDIA_KEY_TYPE_OFFLINE = 0,
|
||||
/**
|
||||
* Media key type online
|
||||
*/
|
||||
MEDIA_KEY_TYPE_ONLINE,
|
||||
} DRM_MediaKeyType;
|
||||
|
||||
/**
|
||||
* @brief Media key request type.
|
||||
* @syscap SystemCapability.Multimedia.Drm.Core
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum DRM_MediaKeyRequestType {
|
||||
/**
|
||||
* Media key request type unknown.
|
||||
*/
|
||||
MEDIA_KEY_REQUEST_TYPE_UNKNOWN = 0,
|
||||
/**
|
||||
* Media key request type initial.
|
||||
*/
|
||||
MEDIA_KEY_REQUEST_TYPE_INITIAL,
|
||||
/**
|
||||
* Media key request type renewal.
|
||||
*/
|
||||
MEDIA_KEY_REQUEST_TYPE_RENEWAL,
|
||||
/**
|
||||
* Media key request type release.
|
||||
*/
|
||||
MEDIA_KEY_REQUEST_TYPE_RELEASE,
|
||||
/**
|
||||
* Media key request type none.
|
||||
*/
|
||||
MEDIA_KEY_REQUEST_TYPE_NONE,
|
||||
/**
|
||||
* Media key request type update.
|
||||
*/
|
||||
MEDIA_KEY_REQUEST_TYPE_UPDATE,
|
||||
} DRM_MediaKeyRequestType;
|
||||
|
||||
/**
|
||||
* @brief Offline media key status.
|
||||
* @syscap SystemCapability.Multimedia.Drm.Core
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum DRM_OfflineMediaKeyStatus {
|
||||
/**
|
||||
* Offline media key status unknown.
|
||||
*/
|
||||
OFFLINE_MEDIA_KEY_STATUS_UNKNOWN = 0,
|
||||
/**
|
||||
* Offline media key status usable.
|
||||
*/
|
||||
OFFLINE_MEDIA_KEY_STATUS_USABLE,
|
||||
/**
|
||||
* Offline media key status inactive.
|
||||
*/
|
||||
OFFLINE_MEDIA_KEY_STATUS_INACTIVE,
|
||||
} DRM_OfflineMediaKeyStatus;
|
||||
|
||||
/**
|
||||
* @brief Certificate status.
|
||||
* @syscap SystemCapability.Multimedia.Drm.Core
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum DRM_CertificateStatus {
|
||||
/**
|
||||
* Device already provisioned.
|
||||
*/
|
||||
CERT_STATUS_PROVISIONED = 0,
|
||||
/**
|
||||
* Device not provisioned.
|
||||
*/
|
||||
CERT_STATUS_NOT_PROVISIONED,
|
||||
/**
|
||||
* Cert already expired.
|
||||
*/
|
||||
CERT_STATUS_EXPIRED,
|
||||
/**
|
||||
* Certs are invalid.
|
||||
*/
|
||||
CERT_STATUS_INVALID,
|
||||
/**
|
||||
* Get certs status failed.
|
||||
*/
|
||||
CERT_STATUS_UNAVAILABLE,
|
||||
} DRM_CertificateStatus;
|
||||
|
||||
/**
|
||||
* @brief Max count of media key request option.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_MEDIA_KEY_REQUEST_OPTION_COUNT 16
|
||||
/**
|
||||
* @brief Max len of media key request option name.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_MEDIA_KEY_REQUEST_OPTION_NAME_LEN 64
|
||||
/**
|
||||
* @brief Max len of media key request option data.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_MEDIA_KEY_REQUEST_OPTION_DATA_LEN 128
|
||||
/**
|
||||
* @brief Max len of media key request init data.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_INIT_DATA_LEN 2048
|
||||
/**
|
||||
* @brief Max len of media mimetype.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_MIMETYPE_LEN 64
|
||||
|
||||
/**
|
||||
* @brief Media key request info.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct DRM_MediaKeyRequestInfo {
|
||||
/**
|
||||
* Offline or online media key type.
|
||||
*/
|
||||
DRM_MediaKeyType type;
|
||||
/**
|
||||
* Initial data len.
|
||||
*/
|
||||
int32_t initDataLen;
|
||||
/**
|
||||
* Initial data format as PSSH after base64 encoding.
|
||||
*/
|
||||
uint8_t initData[MAX_INIT_DATA_LEN];
|
||||
/**
|
||||
* Media content mime type.
|
||||
*/
|
||||
char mimeType[MAX_MIMETYPE_LEN];
|
||||
/**
|
||||
* OptionsData count.
|
||||
*/
|
||||
uint32_t optionsCount;
|
||||
/**
|
||||
* Options name the application set to drm framework.
|
||||
*/
|
||||
char optionName[MAX_MEDIA_KEY_REQUEST_OPTION_COUNT][MAX_MEDIA_KEY_REQUEST_OPTION_NAME_LEN];
|
||||
/**
|
||||
* Options data the application set to drm framework.
|
||||
*/
|
||||
char optionData[MAX_MEDIA_KEY_REQUEST_OPTION_COUNT][MAX_MEDIA_KEY_REQUEST_OPTION_DATA_LEN];
|
||||
} DRM_MediaKeyRequestInfo;
|
||||
|
||||
/**
|
||||
* @brief Max len of media key request.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_MEDIA_KEY_REQUEST_DATA_LEN 8192
|
||||
/**
|
||||
* @brief Max len of URL.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_DEFAULT_URL_LEN 2048
|
||||
/**
|
||||
* @brief Media key request.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct DRM_MediaKeyRequest {
|
||||
/**
|
||||
* Media key request type.
|
||||
*/
|
||||
DRM_MediaKeyRequestType type;
|
||||
/**
|
||||
* Media key request data len.
|
||||
*/
|
||||
int32_t dataLen;
|
||||
/**
|
||||
* Media key request data sent to media key server.
|
||||
*/
|
||||
uint8_t data[MAX_MEDIA_KEY_REQUEST_DATA_LEN];
|
||||
/**
|
||||
* Media key server URL.
|
||||
*/
|
||||
char defaultUrl[MAX_DEFAULT_URL_LEN];
|
||||
} DRM_MediaKeyRequest;
|
||||
|
||||
/**
|
||||
* @brief Max count of statistics item.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_STATISTICS_COUNT 10
|
||||
/**
|
||||
* @brief Max len of statistics item name.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_STATISTICS_NAME_LEN 64
|
||||
/**
|
||||
* @brief Max len of statistics item buffer.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_STATISTICS_BUFFER_LEN 256
|
||||
|
||||
/**
|
||||
* @brief Statistics of MediaKeySystem.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct DRM_Statistics {
|
||||
/* Statistics count. */
|
||||
uint32_t statisticsCount;
|
||||
/* Statistics name. */
|
||||
char statisticsName[MAX_STATISTICS_COUNT][MAX_STATISTICS_NAME_LEN];
|
||||
/* Statistics description. */
|
||||
char statisticsDescription[MAX_STATISTICS_COUNT][MAX_STATISTICS_BUFFER_LEN];
|
||||
} DRM_Statistics;
|
||||
|
||||
/**
|
||||
* @brief Max count of offline media key id.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_OFFLINE_MEDIA_KEY_ID_COUNT 512
|
||||
/**
|
||||
* @brief Max len of offline media key id.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_OFFLINE_MEDIA_KEY_ID_LEN 64
|
||||
|
||||
/**
|
||||
* @brief Offline media key ids array.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct DRM_OfflineMediakeyIdArray {
|
||||
/* Ids count. */
|
||||
uint32_t idsCount;
|
||||
/* Ids len. */
|
||||
int32_t idsLen[MAX_OFFLINE_MEDIA_KEY_ID_COUNT];
|
||||
/* Ids. */
|
||||
uint8_t ids[MAX_OFFLINE_MEDIA_KEY_ID_COUNT][MAX_OFFLINE_MEDIA_KEY_ID_LEN];
|
||||
} DRM_OfflineMediakeyIdArray;
|
||||
|
||||
/**
|
||||
* @brief Max count of key info.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_KEY_INFO_COUNT 64
|
||||
/**
|
||||
* @brief Max len of key id.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_KEY_ID_LEN 16
|
||||
/**
|
||||
* @brief Max len of key status value.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_KEY_STATUS_VALUE_LEN 128
|
||||
|
||||
/**
|
||||
* @brief Media key info.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct DRM_KeysInfo {
|
||||
/* Keys count. */
|
||||
uint32_t keysInfoCount;
|
||||
/* Key id. */
|
||||
uint8_t keyId[MAX_KEY_INFO_COUNT][MAX_KEY_ID_LEN];
|
||||
/* Key status value. */
|
||||
char statusValue[MAX_KEY_INFO_COUNT][MAX_KEY_STATUS_VALUE_LEN];
|
||||
} DRM_KeysInfo;
|
||||
|
||||
/**
|
||||
* @brief Max count of media key status.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_MEDIA_KEY_STATUS_COUNT 64
|
||||
/**
|
||||
* @brief Max len of media key status name.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_MEDIA_KEY_STATUS_NAME_LEN 64
|
||||
/**
|
||||
* @brief Max len of media key status value.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_MEDIA_KEY_STATUS_VALUE_LEN 256
|
||||
|
||||
/**
|
||||
* @brief Media key status like pocily etc.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct DRM_MediaKeyStatus {
|
||||
/* Status count. */
|
||||
uint32_t statusCount;
|
||||
/* Status name. */
|
||||
char statusName[MAX_MEDIA_KEY_STATUS_COUNT][MAX_MEDIA_KEY_STATUS_NAME_LEN];
|
||||
/* Status value. */
|
||||
char statusValue[MAX_MEDIA_KEY_STATUS_COUNT][MAX_MEDIA_KEY_STATUS_VALUE_LEN];
|
||||
} DRM_MediaKeyStatus;
|
||||
|
||||
/**
|
||||
* @brief Drm system uuid len.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define DRM_UUID_LEN 16
|
||||
/**
|
||||
* @brief Max len of PSSH data.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_PSSH_DATA_LEN 2048
|
||||
|
||||
/**
|
||||
* @brief PSSH info by uuid.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct DRM_PsshInfo {
|
||||
/**
|
||||
* Uuid.
|
||||
*/
|
||||
uint8_t uuid[DRM_UUID_LEN];
|
||||
/**
|
||||
* PSSH data len.
|
||||
*/
|
||||
int32_t dataLen;
|
||||
/**
|
||||
* uint8_t PSSH data.
|
||||
*/
|
||||
uint8_t data[MAX_PSSH_DATA_LEN];
|
||||
} DRM_PsshInfo;
|
||||
|
||||
/**
|
||||
* @brief Max count of PSSH info.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
#define MAX_PSSH_INFO_COUNT 8
|
||||
|
||||
/**
|
||||
* @brief MediaKeySystemInfo used for player to get media key system info from media source.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct DRM_MediaKeySystemInfo {
|
||||
/* PSSH count. */
|
||||
uint32_t psshCount;
|
||||
/* PSSH info. */
|
||||
DRM_PsshInfo psshInfo[MAX_PSSH_INFO_COUNT];
|
||||
} DRM_MediaKeySystemInfo;
|
||||
|
||||
typedef void (*DRM_MediaKeySystemInfoCallback)(DRM_MediaKeySystemInfo *mediaKeySystemInfo);
|
||||
|
||||
/**
|
||||
* @brief Media key system struct.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct MediaKeySystem MediaKeySystem;
|
||||
|
||||
/**
|
||||
* @brief Media key session struct.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct MediaKeySession MediaKeySession;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // NATIVE_DRM_COMMON_H
|
||||
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup Drm
|
||||
* @{
|
||||
*
|
||||
* @brief Provides APIs of Drm.
|
||||
* @kit Drm.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file native_drm_err.h
|
||||
* @brief Defines the Drm errors.
|
||||
* @library libnative_drm.z.so
|
||||
* @syscap SystemCapability.Multimedia.Drm.Core
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#ifndef NATIVE_DRM_ERR_H
|
||||
#define NATIVE_DRM_ERR_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief DRM error code
|
||||
* @syscap SystemCapability.Multimedia.Drm.Core
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef enum Drm_ErrCode {
|
||||
/**
|
||||
* the operation completed successfully.
|
||||
*/
|
||||
DRM_ERR_OK = 0,
|
||||
/**
|
||||
* DRM CAPI ERROR BASE.
|
||||
*/
|
||||
DRM_CAPI_ERR_BASE = 24700500,
|
||||
/**
|
||||
* no memory.
|
||||
*/
|
||||
DRM_ERR_NO_MEMORY = DRM_CAPI_ERR_BASE + 1,
|
||||
/**
|
||||
* opertation not be permitted.
|
||||
*/
|
||||
DRM_ERR_OPERATION_NOT_PERMITTED = DRM_CAPI_ERR_BASE + 2,
|
||||
/**
|
||||
* invalid argument.
|
||||
*/
|
||||
DRM_ERR_INVALID_VAL = DRM_CAPI_ERR_BASE + 3,
|
||||
/**
|
||||
* IO error.
|
||||
*/
|
||||
DRM_ERR_IO = DRM_CAPI_ERR_BASE + 4,
|
||||
/**
|
||||
* network timeout.
|
||||
*/
|
||||
DRM_ERR_TIMEOUT = DRM_CAPI_ERR_BASE + 5,
|
||||
/**
|
||||
* unknown error.
|
||||
*/
|
||||
DRM_ERR_UNKNOWN = DRM_CAPI_ERR_BASE + 6,
|
||||
/**
|
||||
* drm service died.
|
||||
*/
|
||||
DRM_ERR_SERVICE_DIED = DRM_CAPI_ERR_BASE + 7,
|
||||
/**
|
||||
* not support this operation in this state.
|
||||
*/
|
||||
DRM_ERR_INVALID_STATE = DRM_CAPI_ERR_BASE + 8,
|
||||
/**
|
||||
* unsupport interface.
|
||||
*/
|
||||
DRM_ERR_UNSUPPORTED = DRM_CAPI_ERR_BASE + 9,
|
||||
/**
|
||||
* Meet max MediaKeySystem num limit.
|
||||
*/
|
||||
DRM_ERR_MAX_SYSTEM_NUM_REACHED = DRM_CAPI_ERR_BASE + 10,
|
||||
/**
|
||||
* Meet max MediaKeySession num limit.
|
||||
*/
|
||||
DRM_ERR_MAX_SESSION_NUM_REACHED = DRM_CAPI_ERR_BASE + 11,
|
||||
/**
|
||||
* extend err start.
|
||||
*/
|
||||
DRM_ERR_EXTEND_START = DRM_CAPI_ERR_BASE + 100,
|
||||
} Drm_ErrCode;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // NATIVE_DRM_ERR_H
|
||||
@@ -0,0 +1,122 @@
|
||||
[
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_IsSupported"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_IsSupported2"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_IsSupported3"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_Create"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_SetConfigurationString"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_GetConfigurationString"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_SetConfigurationByteArray"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_GetConfigurationByteArray"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_GetStatistics"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_GetMaxContentProtectionLevel"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_SetMediaKeySystemCallback"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_CreateMediaKeySession"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_GenerateKeySystemRequest"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_ProcessKeySystemResponse"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_GetOfflineMediaKeyIds"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_GetOfflineMediaKeyStatus"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_ClearOfflineMediaKeys"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_GetCertificateStatus"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySystem_Destroy"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySession_GenerateMediaKeyRequest"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySession_ProcessMediaKeyResponse"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySession_CheckMediaKeyStatus"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySession_ClearMediaKeys"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySession_GenerateOfflineReleaseRequest"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySession_ProcessOfflineReleaseResponse"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySession_RestoreOfflineMediaKeys"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySession_GetContentProtectionLevel"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySession_RequireSecureDecoderModule"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySession_SetMediaKeySessionCallback"
|
||||
},
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_MediaKeySession_Destroy"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,224 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup Drm
|
||||
* @{
|
||||
*
|
||||
* @brief Provides APIs of Drm.
|
||||
* @kit Drm.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file native_mediakeysession.h
|
||||
* @brief Defines the Drm MediaKeySession APIs. Provide following function:
|
||||
* generate media key request, process media key response, event listening,
|
||||
* get content protection level, check media key status, remove media key etc..
|
||||
* @library libnative_drm.z.so
|
||||
* @syscap SystemCapability.Multimedia.Drm.Core
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#ifndef OHOS_DRM_NATIVE_MEDIA_KEY_SESSION_H
|
||||
#define OHOS_DRM_NATIVE_MEDIA_KEY_SESSION_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include "native_drm_err.h"
|
||||
#include "native_drm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Call back will be invoked when event triggers.
|
||||
* @param eventType Event type.
|
||||
* @param info Event info gotten from media key session.
|
||||
* @param infoLen Event info len.
|
||||
* @param extra Extra info gotten from media key session.
|
||||
* @return Drm_ErrCode.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef Drm_ErrCode (*MediaKeySession_EventCallback)(DRM_EventType eventType, uint8_t *info,
|
||||
int32_t infoLen, char *extra);
|
||||
|
||||
/**
|
||||
* @brief Call back will be invoked when key changes.
|
||||
* @param keysInfo Key info gotten from media key system.
|
||||
* @param newKeysAvailable Whether new keys available.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef Drm_ErrCode (*MediaKeySession_KeyChangeCallback)(DRM_KeysInfo *keysInfo, bool newKeysAvailable);
|
||||
|
||||
/**
|
||||
* @brief MediaKeySession_Callback struct, used to listen event like key expired and key change etc..
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef struct MediaKeySession_Callback {
|
||||
/**
|
||||
* Normal event callback like key expired etc..
|
||||
*/
|
||||
MediaKeySession_EventCallback eventCallback;
|
||||
/**
|
||||
* Key change callback for keys change event.
|
||||
*/
|
||||
MediaKeySession_KeyChangeCallback keyChangeCallback;
|
||||
} MediaKeySession_Callback;
|
||||
|
||||
/**
|
||||
* @brief Generate media key request.
|
||||
* @param mediaKeySession Media key session instance.
|
||||
* @param info Media key request info.
|
||||
* @param mediaKeyRequest Media key request.
|
||||
* @return Drm_ErrCode.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySession_GenerateMediaKeyRequest(MediaKeySession *mediaKeySession,
|
||||
DRM_MediaKeyRequestInfo *info, DRM_MediaKeyRequest *mediaKeyRequest);
|
||||
|
||||
/**
|
||||
* @brief Process media key response.
|
||||
* @param mediaKeySession Media key session instance.
|
||||
* @param response Media Key resposne.
|
||||
* @param responseLen Media Key resposne len.
|
||||
* @param offlineMediaKeyId Offline media key identifier.
|
||||
* @param offlineMediaKeyIdLen Offline media key identifier len for in buffer and out data.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySession_ProcessMediaKeyResponse(MediaKeySession *mediaKeySession,
|
||||
uint8_t *response, int32_t responseLen, uint8_t *offlineMediaKeyId, int32_t *offlineMediaKeyIdLen);
|
||||
|
||||
/**
|
||||
* @brief Check media key status.
|
||||
* @param mediaKeySession Media key session instance.
|
||||
* @param mediaKeyStatus Media key status.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySession_CheckMediaKeyStatus(MediaKeySession *mediaKeySessoin,
|
||||
DRM_MediaKeyStatus *mediaKeyStatus);
|
||||
|
||||
/**
|
||||
* @brief Clear media keys of the current session .
|
||||
* @param mediaKeySession Media key session instance.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySession_ClearMediaKeys(MediaKeySession *mediaKeySessoin);
|
||||
|
||||
/**
|
||||
* @brief Generate offline media key release request.
|
||||
* @param mediaKeySession Media key session instance.
|
||||
* @param offlineMediaKeyId Offline media key identifier.
|
||||
* @param offlineMediaKeyIdLen Offline media key identifier len.
|
||||
* @param releaseRequest Media Key release request.
|
||||
* @param releaseRequestLen Media Key release request len for in buffer and out data.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySession_GenerateOfflineReleaseRequest(MediaKeySession *mediaKeySessoin,
|
||||
uint8_t *offlineMediaKeyId, int32_t offlineMediaKeyIdLen, uint8_t *releaseRequest,
|
||||
int32_t *releaseRequestLen);
|
||||
|
||||
/**
|
||||
* @brief Process offline media key release response.
|
||||
* @param mediaKeySession Media key session instance.
|
||||
* @param offlineMediaKeyId Offline media key identifier.
|
||||
* @param offlineMediaKeyIdLen Offline media key identifier len.
|
||||
* @param releaseReponse Media Key resposne.
|
||||
* @param releaseReponseLen Media Key resposne len.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySession_ProcessOfflineReleaseResponse(MediaKeySession *mediaKeySessoin,
|
||||
uint8_t *offlineMediaKeyId, int32_t offlineMediaKeyIdLen, uint8_t *releaseReponse,
|
||||
int32_t releaseReponseLen);
|
||||
|
||||
/**
|
||||
* @brief Restore offline media keys by ID.
|
||||
* @param mediaKeySession Media key session instance.
|
||||
* @param offlineMediaKeyId Offline media key identifier.
|
||||
* @param offlineMediaKeyIdLen Offline media key identifier len.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySession_RestoreOfflineMediaKeys(MediaKeySession *mediaKeySessoin,
|
||||
uint8_t *offlineMediaKeyId, int32_t offlineMediaKeyIdLen);
|
||||
|
||||
/**
|
||||
* @brief Get content protection level of the session.
|
||||
* @param mediaKeySession Media key session instance.
|
||||
* @param contentProtectionLevel Content protection level.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySession_GetContentProtectionLevel(MediaKeySession *mediaKeySessoin,
|
||||
DRM_ContentProtectionLevel *contentProtectionLevel);
|
||||
|
||||
/**
|
||||
* @brief Whether the encrypted content require a secure decoder or not.
|
||||
* @param mediaKeySession Media key session instance.
|
||||
* @param mimeType The media type.
|
||||
* @param status Whether secure decoder is required.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySession_RequireSecureDecoderModule(MediaKeySession *mediaKeySessoin,
|
||||
const char *mimeType, bool *status);
|
||||
|
||||
/**
|
||||
* @brief Set media key session event callback.
|
||||
* @param mediaKeySession Media key session instance.
|
||||
* @param callback Callback to be set to the media key session.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySession_SetMediaKeySessionCallback(MediaKeySession *mediaKeySessoin,
|
||||
MediaKeySession_Callback *callback);
|
||||
|
||||
/**
|
||||
* @brief Release the resource before the session gonna be unused.
|
||||
* @param mediaKeySession Media key session instance.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySession_Destroy(MediaKeySession *mediaKeySessoin);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // OHOS_DRM_NATIVE_MEDIA_KEY_SYSTEM_H
|
||||
@@ -0,0 +1,281 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup Drm
|
||||
* @{
|
||||
*
|
||||
* @brief Provides APIs of Drm.
|
||||
* @kit Drm.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file native_mediakeysystem.h
|
||||
* @brief Defines the Drm MediaKeySystem APIs. Provide following function:
|
||||
* query if specific drm supported or not, create media key session,
|
||||
* get and set configurations, get statistics, get content protection level,
|
||||
* generate provision request, process provision response, event listening,
|
||||
* get content protection level, manage offline media key etc..
|
||||
* @library libnative_drm.z.so
|
||||
* @syscap SystemCapability.Multimedia.Drm.Core
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
#ifndef OHOS_DRM_NATIVE_MEDIA_KEY_SYSTEM_H
|
||||
#define OHOS_DRM_NATIVE_MEDIA_KEY_SYSTEM_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include "native_drm_err.h"
|
||||
#include "native_drm_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Call back will be invoked when event triggers.
|
||||
* @param eventType Event type.
|
||||
* @param info Event info gotten from media key system.
|
||||
* @param infoLen Event info len.
|
||||
* @param extra Extra info gotten from media key system.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
typedef Drm_ErrCode (*MediaKeySystem_Callback)(DRM_EventType eventType, uint8_t *info,
|
||||
int32_t infoLen, char *extra);
|
||||
|
||||
/**
|
||||
* @brief Query if media key system is supported.
|
||||
* @param name Used to point a Digital Right Management solution.
|
||||
* @return Supported or not in boolean.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
bool OH_MediaKeySystem_IsSupported(const char *name);
|
||||
/**
|
||||
* @brief Query if media key system is supported.
|
||||
* @param name Used to point a Digital Right Management solution.
|
||||
* @param mimeType Used to specifies the media type.
|
||||
* @return Supported or not in boolean.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
bool OH_MediaKeySystem_IsSupported2(const char *name, const char *mimeType);
|
||||
/**
|
||||
* @brief Query if media key system is supported.
|
||||
* @param name Used to point a Digital Right Management solution.
|
||||
* @param mimeType Used to specifies the media type.
|
||||
* @param contentProtectionLevel Used to specifies the ContentProtectionLevel.
|
||||
* @return Supported or not in boolean.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
bool OH_MediaKeySystem_IsSupported3(const char *name, const char *mimeType,
|
||||
DRM_ContentProtectionLevel contentProtectionLevel);
|
||||
|
||||
/**
|
||||
* @brief Creates a media key system instance from the name.
|
||||
* @param name Secifies which drm system will be created by name.
|
||||
* @param mediaKeySystem Media key system instance.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully,
|
||||
* return DRM_ERR_MAX_SYSTEM_NUM_REACHED when max num media key system reached.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_Create(const char *name, MediaKeySystem **mediaKeySystem);
|
||||
/**
|
||||
* @brief Set media key system configuration value by name.
|
||||
* @param mediaKeySystem Media key system instance.
|
||||
* @param configName Configuration name string.
|
||||
* @param value Configuration vaule string to be set.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_SetConfigurationString(MediaKeySystem *mediaKeySystem,
|
||||
const char *configName, const char *value);
|
||||
/**
|
||||
* @brief Get media key system configuration value by name.
|
||||
* @param mediaKeySystem Media key system instance.
|
||||
* @param configName Configuration name string.
|
||||
* @param value Configuration vaule string to be get.
|
||||
* @param valueLen Configuration vaule string len for in buffer.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_GetConfigurationString(MediaKeySystem *mediaKeySystem,
|
||||
const char *configName, char *value, int32_t valueLen);
|
||||
/**
|
||||
* @brief Set media key system configuration value by name.
|
||||
* @param mediaKeySystem Media key system instance.
|
||||
* @param configName Configuration name string.
|
||||
* @param value Configuration vaule in byte array to be set.
|
||||
* @param valueLen Value array len.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_SetConfigurationByteArray(MediaKeySystem *mediaKeySystem,
|
||||
const char *configName, uint8_t *value, int32_t valueLen);
|
||||
/**
|
||||
* @brief Get media key system configuration value by name.
|
||||
* @param mediaKeySystem Media key system instance.
|
||||
* @param configName Configuration name string.
|
||||
* @param value Configuration vaule in byte array to be get.
|
||||
* @param valueLen Configuration vaule len for in buffer and out data.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_GetConfigurationByteArray(MediaKeySystem *mediaKeySystem,
|
||||
const char *configName, uint8_t *value, int32_t *valueLen);
|
||||
/**
|
||||
* @brief Get media key system statistics info.
|
||||
* @param mediaKeySystem Media key system instance.
|
||||
* @param statistics Statistic info gotten.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_GetStatistics(MediaKeySystem *mediaKeySystem, DRM_Statistics *statistics);
|
||||
/**
|
||||
* @brief Get the max content protection level media key system supported.
|
||||
* @param mediaKeySystem Media key system instance.
|
||||
* @param contentProtectionLevel Content protection level.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_GetMaxContentProtectionLevel(MediaKeySystem *mediaKeySystem,
|
||||
DRM_ContentProtectionLevel *contentProtectionLevel);
|
||||
/**
|
||||
* @brief Set media key system event callback.
|
||||
* @param mediaKeySystem Media key system instance.
|
||||
* @param callback Callback to be set to the media key system.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_SetMediaKeySystemCallback(MediaKeySystem *mediaKeySystem,
|
||||
MediaKeySystem_Callback callback);
|
||||
|
||||
/**
|
||||
* @brief Create a media key session instance.
|
||||
* @param mediaKeySystem Media key system instance which will create the media key session.
|
||||
* @param level Specifies the content protection level.
|
||||
* @param mediaKeySession Media key session instance.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully,
|
||||
* return DRM_ERR_MAX_SESSION_NUM_REACHED when max num media key system reached.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_CreateMediaKeySession(MediaKeySystem *mediaKeySystem,
|
||||
DRM_ContentProtectionLevel *level, MediaKeySession **mediaKeySession);
|
||||
|
||||
/**
|
||||
* @brief Generate a media key system provision request.
|
||||
* @param mediaKeySystem Media key system instance.
|
||||
* @param request Provision request data sent to provision server.
|
||||
* @param requestLen Provision request data len for in buffer and out data.
|
||||
* @param defaultUrl Provision server URL.
|
||||
* @param defaultUrlLen Provision server URL len for in buffer.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_GenerateKeySystemRequest(MediaKeySystem *mediaKeySystem, uint8_t *request,
|
||||
int32_t *requestLen, char *defaultUrl, int32_t defaultUrlLen);
|
||||
|
||||
/**
|
||||
* @brief Process a media key system provision response.
|
||||
* @param mediaKeySystem Media key system instance.
|
||||
* @param response The provision reponse will be processed.
|
||||
* @param responseLen The response len.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_ProcessKeySystemResponse(MediaKeySystem *mediaKeySystem,
|
||||
uint8_t *response, int32_t responseLen);
|
||||
|
||||
/**
|
||||
* @brief Get offline media key ids .
|
||||
* @param mediaKeySystem Media key system instance.
|
||||
* @param offlineMediaKeyIds Media key ids of all offline media keys.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_GetOfflineMediaKeyIds(MediaKeySystem *mediaKeySystem,
|
||||
DRM_OfflineMediakeyIdArray *offlineMediaKeyIds);
|
||||
|
||||
/**
|
||||
* @brief Get offline media key status.
|
||||
* @param mediaKeySystem Media key system instance.
|
||||
* @param offlineMediaKeyId Offline media key identifier.
|
||||
* @param offlineMediaKeyIdLen Offline media key identifier len.
|
||||
* @param status The media key status gotten.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_GetOfflineMediaKeyStatus(MediaKeySystem *mediaKeySystem,
|
||||
uint8_t *offlineMediaKeyId, int32_t offlineMediaKeyIdLen, DRM_OfflineMediaKeyStatus *status);
|
||||
|
||||
/**
|
||||
* @brief Clear an offline media key by id.
|
||||
* @param mediaKeySystem Media key system instance.
|
||||
* @param offlineMediaKeyId Offline media key identifier.
|
||||
* @param offlineMediaKeyIdLen Offline media key identifier len.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_ClearOfflineMediaKeys(MediaKeySystem *mediaKeySystem,
|
||||
uint8_t *offlineMediaKeyId, int32_t offlineMediaKeyIdLen);
|
||||
|
||||
/**
|
||||
* @brief Get certificate status of media key system.
|
||||
* @param mediaKeySystem Media key system instance.
|
||||
* @param certStatus Status will be gotten.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_GetCertificateStatus(MediaKeySystem *mediaKeySystem,
|
||||
DRM_CertificateStatus *certStatus);
|
||||
|
||||
/**
|
||||
* @brief Destroy a media key system instance.
|
||||
* @param mediaKeySystem Secifies which media key system instance will be destroyed.
|
||||
* @return DRM_ERR_INVALID_VAL when the params checked failure, return DRM_ERR_OK when function called successfully.
|
||||
* @since 11
|
||||
* @version 1.0
|
||||
*/
|
||||
Drm_ErrCode OH_MediaKeySystem_Destroy(MediaKeySystem *mediaKeySystem);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // OHOS_DRM_NATIVE_MEDIA_KEY_SYSTEM_H
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <stdio.h>
|
||||
#include "native_averrors.h"
|
||||
#include "avplayer_base.h"
|
||||
#include "native_window/external_window.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -42,7 +42,6 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OH_AVPlayer OH_AVPlayer;
|
||||
typedef struct NativeWindow OHNativeWindow;
|
||||
|
||||
/**
|
||||
* @brief Player States
|
||||
|
||||
@@ -39,8 +39,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
namespace OHOS {
|
||||
namespace Sensors {
|
||||
/**
|
||||
* @brief Controls the vibrator to vibrate continuously for a given duration.
|
||||
*
|
||||
@@ -80,10 +78,8 @@ int32_t OH_Vibrator_PlayVibrationCustom(Vibrator_FileDescription fileDescription
|
||||
* @since 11
|
||||
*/
|
||||
int32_t OH_Vibrator_Cancel();
|
||||
} // namespace Sensors
|
||||
} // namespace OHOS
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif // endif VIBRATOR_H
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifndef VIBRATOR_TYPE_H
|
||||
#define VIBRATOR_TYPE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -83,9 +83,8 @@ typedef struct Vibrator_FileDescription {
|
||||
/**< Total length of the custom vibration sequence. */
|
||||
int64_t length;
|
||||
} Vibrator_FileDescription;
|
||||
/** @} */
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // endif VIBRATOR_TYPE_H
|
||||
@@ -96,4 +96,5 @@ Sensor_Result OH_Sensor_Unsubscribe(const Sensor_SubscriptionId *id, const Senso
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif // OH_SENSOR_H
|
||||
@@ -34,7 +34,7 @@
|
||||
#ifndef OH_SENSOR_TYPE_H
|
||||
#define OH_SENSOR_TYPE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cstdint>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -493,4 +493,5 @@ int32_t OH_SensorSubscriber_GetCallback(Sensor_Subscriber* subscriber, Sensor_Ev
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/** @} */
|
||||
#endif // OH_SENSOR_TYPE_H
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
||||
"Name": "libuv",
|
||||
"License": "MIT License",
|
||||
"License File": "LICENSE",
|
||||
"Version Number": "v1.44.1",
|
||||
"Version Number": "v1.44.2",
|
||||
"Owner": "sunbingxin@huawei.com",
|
||||
"Upstream URL": "https://github.com/libuv/libuv",
|
||||
"Description": "libuv is a multi-platform support library with a focus on asynchronous I/O."
|
||||
|
||||
+3
-3
@@ -3,9 +3,9 @@
|
||||
"Name": "MindSpore",
|
||||
"License": "Apache License 2.0",
|
||||
"License File": "LICENSE.txt",
|
||||
"Version Number": "1.8.1",
|
||||
"Owner": "zhuguodong0001@163.com",
|
||||
"Upstream URL": "https://gitee.com/mindspore/mindspore/repository/archive/v1.8.1",
|
||||
"Version Number": "2.1.0",
|
||||
"Owner": "chengfeng27@huawei.com",
|
||||
"Upstream URL": "https://gitee.com/mindspore/mindspore/repository/archive/v2.1.0",
|
||||
"Description": "MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios."
|
||||
}
|
||||
]
|
||||
|
||||
Vendored
+1
-1
@@ -181,7 +181,7 @@ OH_AI_API OH_AI_TensorHandle OH_AI_ModelGetOutputByTensorName(const OH_AI_ModelH
|
||||
* @return TrainCfg object handle.
|
||||
* @since 11
|
||||
*/
|
||||
OH_AI_API OH_AI_TrainCfgHandle OH_AI_TrainCfgCreate(void);
|
||||
OH_AI_API OH_AI_TrainCfgHandle OH_AI_TrainCfgCreate();
|
||||
|
||||
/**
|
||||
* @brief Destroy the train_cfg object. Only valid for Lite Train.
|
||||
|
||||
Vendored
+3
-1
@@ -17,7 +17,9 @@ import("//third_party/musl/musl_config.gni")
|
||||
import("//third_party/musl/musl_src.gni")
|
||||
import("//third_party/musl/musl_template.gni")
|
||||
|
||||
toolchains_dir = "//prebuilts/clang/ohos"
|
||||
declare_args() {
|
||||
toolchains_dir = "//prebuilts/clang/ohos"
|
||||
}
|
||||
musl_target_out_dir = "${root_out_dir}/obj/third_party/musl"
|
||||
ndk_musl_include = "ndk_musl_include"
|
||||
interface_musl_dir = "//interface/sdk_c/third_party/musl"
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
||||
"Name": "node",
|
||||
"License": "ISC License,Public Domain,MIT License,Free Software Foundation - MIT License,Apache License V2.0,ICU License,zlib/libpng License,BSD 2-Clause License,BSD 3-Clause License",
|
||||
"License File": "LICENSE",
|
||||
"Version Number": "14.21.2",
|
||||
"Version Number": "18.18.2",
|
||||
"Owner": "sunbingxin@huawei.com",
|
||||
"Upstream URL": "http://www.nodejs.org/",
|
||||
"Description": "Node.js is an open-source, cross-platform, JavaScript runtime environment. It executes JavaScript code outside of a browser."
|
||||
|
||||
@@ -18,10 +18,20 @@ ohos_ndk_library("libohweb") {
|
||||
output_name = "ohweb"
|
||||
output_extension = "so"
|
||||
ndk_description_file = "./libohweb.ndk.json"
|
||||
system_capability = "SystemCapability.Web.Webview.Core"
|
||||
system_capability_headers = [
|
||||
"web/arkweb_net_error_list.h",
|
||||
"web/arkweb_scheme_handler.h",
|
||||
"web/native_interface_arkweb.h",
|
||||
]
|
||||
min_compact_version = "11"
|
||||
}
|
||||
|
||||
ohos_ndk_headers("web_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/web/"
|
||||
sources = [ "native_interface_arkweb.h" ]
|
||||
sources = [
|
||||
"arkweb_net_error_list.h",
|
||||
"arkweb_scheme_handler.h",
|
||||
"native_interface_arkweb.h",
|
||||
]
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,856 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup Web
|
||||
* @{
|
||||
*
|
||||
* @brief Provides APIs to intercept the request from ArkWeb.
|
||||
* @since 12
|
||||
*/
|
||||
/**
|
||||
* @file arkweb_scheme_handler.h
|
||||
*
|
||||
* @brief Declares the APIs to intercept the request from ArkWeb.
|
||||
* @library libohweb.so
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
#ifndef ARKWEB_SCHEME_HANDLER_H
|
||||
#define ARKWEB_SCHEME_HANDLER_H
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
#include "arkweb_net_error_list.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* @brief Configuration information for custom schemes.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum ArkWeb_CustomSchemeOption {
|
||||
OH_ARKWEB_SCHEME_OPTION_NONE = 0,
|
||||
|
||||
/*
|
||||
* @brief If ARKWEB_SCHEME_OPTION_STANDARD is set the scheme will be handled as a standard scheme. The standard
|
||||
* schemes needs to comply with the URL normalization and parsing rules defined in Section 3.1 of RFC 1738,
|
||||
* which can be found in the http://www.ietf.org/rfc/rfc1738.txt.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
ARKWEB_SCHEME_OPTION_STANDARD = 1 << 0,
|
||||
|
||||
/*
|
||||
* @brief If ARKWEB_SCHEME_OPTION_LOCAL is set, the same security rules as those applied to the "file" URL will be
|
||||
* used to handle the scheme.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
ARKWEB_SCHEME_OPTION_LOCAL = 1 << 1,
|
||||
|
||||
/*
|
||||
* @brief If ARKWEB_SCHEME_OPTION_DISPLAY_ISOLATED is set, then the scheme can only be displayed from other content
|
||||
* hosted using the same scheme.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
ARKWEB_SCHEME_OPTION_DISPLAY_ISOLATED = 1 << 2,
|
||||
|
||||
/*
|
||||
* @brief If ARKWEB_SCHEME_OPTION_SECURE is set, the same security rules as those applied to the "https" URL will be
|
||||
* used to handle the scheme.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
ARKWEB_SCHEME_OPTION_SECURE = 1 << 3,
|
||||
|
||||
/*
|
||||
* @brief If ARKWEB_SCHEME_OPTION_CORS_ENABLED is set, then the scheme can be sent CORS requests. In most case this
|
||||
* value should be set when ARKWEB_SCHEME_OPTION_STANDARD is set.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
ARKWEB_SCHEME_OPTION_CORS_ENABLED = 1 << 4,
|
||||
|
||||
/*
|
||||
* @brief If ARKWEB_SCHEME_OPTION_CSP_BYPASSING is set, then this scheme can bypass Content Security Policy (CSP)
|
||||
* checks. In most cases, this value should not be set when ARKWEB_SCHEME_OPTION_STANDARD is set.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
ARKWEB_SCHEME_OPTION_CSP_BYPASSING = 1 << 5,
|
||||
|
||||
/*
|
||||
* @brief If ARKWEB_SCHEME_OPTION_FETCH_ENABLED is set, then this scheme can perform FETCH API requests.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
ARKWEB_SCHEME_OPTION_FETCH_ENABLED = 1 << 6,
|
||||
} ArkWeb_CustomSchemeOption;
|
||||
|
||||
/*
|
||||
* @brief This class is used to intercept requests for a specified scheme.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct ArkWeb_SchemeHandler_ ArkWeb_SchemeHandler;
|
||||
|
||||
/*
|
||||
* @brief Used to intercept url requests. Response headers and body can be sent through ArkWeb_ResourceHandler.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct ArkWeb_ResourceHandler_ ArkWeb_ResourceHandler;
|
||||
|
||||
/*
|
||||
* @brief The response of the intercepted request.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct ArkWeb_Response_ ArkWeb_Response;
|
||||
|
||||
/*
|
||||
* @brief The info of the request. You can obtain the requested URL, method, post data, and other information through
|
||||
* OH_ArkWeb_ResourceRequest.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct ArkWeb_ResourceRequest_ ArkWeb_ResourceRequest;
|
||||
|
||||
/*
|
||||
* @brief The request headers of the request.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct ArkWeb_RequestHeaderList_ ArkWeb_RequestHeaderList;
|
||||
|
||||
/*
|
||||
* @brief The post data of the request. Use OH_ArkWebPostDataStream_* interface to read the body.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct ArkWeb_PostDataStream_ ArkWeb_PostDataStream;
|
||||
|
||||
|
||||
/*
|
||||
* @brief Callback for handling the request. This will called on the IO thread. should not use resourceHandler in the
|
||||
* function.
|
||||
* @param schemeHandler The ArkWeb_SchemeHandler.
|
||||
* @param resourceRequest Obtain request's information through this.
|
||||
* @param resourceHandler The ArkWeb_ResourceHandler for the request. It should not be used if intercept is set to
|
||||
* false.
|
||||
* @param intercept If true will intercept the request, if false otherwise.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
typedef void (*ArkWeb_OnRequestStart)(const ArkWeb_SchemeHandler* schemeHandler,
|
||||
ArkWeb_ResourceRequest* resourceRequest,
|
||||
const ArkWeb_ResourceHandler* resourceHandler,
|
||||
bool* intercept);
|
||||
|
||||
/*
|
||||
* @brief Callback when the request is completed. This will called on the IO thread.
|
||||
* @param schemeHandler The ArkWeb_SchemeHandler.
|
||||
* @param resourceRequest The ArkWeb_ResourceRequest.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
typedef void (*ArkWeb_OnRequestStop)(const ArkWeb_SchemeHandler* schemeHandler,
|
||||
const ArkWeb_ResourceRequest* resourceRequest);
|
||||
|
||||
/*
|
||||
* @brief Callback when the read operation done.
|
||||
* @param postDataStream The ArkWeb_PostDataStream.
|
||||
* @param buffer The buffer to receive data.
|
||||
* @param bytesRead Callback after OH_ArkWebPostDataStream_Read. bytesRead greater than 0 means that the buffer is
|
||||
* filled with data of bytesRead size. Caller can read from the buffer, and if
|
||||
* OH_ArkWebPostDataStream_IsEOF is false, caller can continue to read the remaining data.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
typedef void (*ArkWeb_PostDataReadCallback)(const ArkWeb_PostDataStream* postDataStream,
|
||||
uint8_t* buffer,
|
||||
int bytesRead);
|
||||
|
||||
/*
|
||||
* @brief Callback when the init operation done.
|
||||
* @param postDataStream The ArkWeb_PostDataStream.
|
||||
* @param result ARKWEB_NET_OK on success otherwise refer to ARKWEB_NET_ERROR.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
typedef void (*ArkWeb_PostDataStreamInitCallback)(const ArkWeb_PostDataStream* postDataStream, ArkWeb_NetError result);
|
||||
|
||||
/*
|
||||
* @brief The request header list.
|
||||
* @param requestHeaderList The created ArkWeb_RequestHeaderList.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWebRequestHeaderList_Create(const ArkWeb_ResourceRequest* resourceRequest,
|
||||
ArkWeb_RequestHeaderList** requestHeaderList);
|
||||
|
||||
/*
|
||||
* @brief Destroy the ArkWeb_RequestHeaderList.
|
||||
* @param requestHeaderList The ArkWeb_RequestHeaderList to be destroyed.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWebRequestHeaderList_Destroy(ArkWeb_RequestHeaderList* requestHeaderList);
|
||||
|
||||
/*
|
||||
* @brief Get the request headers size.
|
||||
* @param requestHeaderList The list of request header.
|
||||
* @return The size of request headers. -1 if requestHeaderList is invalid.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebRequestHeaderList_GetSize(const ArkWeb_RequestHeaderList* requestHeaderList);
|
||||
|
||||
/*
|
||||
* @brief Get the specified request header.
|
||||
* @param requestHeaderList The list of request header.
|
||||
* @param index The index of request header.
|
||||
* @param key The header key. Caller must release the string by OH_ArkWeb_ReleaseString.
|
||||
* @param value The header value. Caller must release the string by OH_ArkWeb_ReleaseString.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWebRequestHeaderList_GetHeader(const ArkWeb_RequestHeaderList* requestHeaderList,
|
||||
int32_t index,
|
||||
char** key,
|
||||
char** value);
|
||||
|
||||
/*
|
||||
* @brief Set a user data to ArkWeb_ResourceRequest.
|
||||
* @param resourceRequest The ArkWeb_ResourceRequest.
|
||||
* @param userData The user data to set.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebResourceRequest_SetUserData(ArkWeb_ResourceRequest* resourceRequest, void* userData);
|
||||
|
||||
/*
|
||||
* @brief Get the user data from ArkWeb_ResourceRequest.
|
||||
* @param resourceRequest The ArkWeb_ResourceRequest.
|
||||
* @return The set user data.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void* OH_ArkWebResourceRequest_GetUserData(const ArkWeb_ResourceRequest* resourceRequest);
|
||||
|
||||
/*
|
||||
* @brief Get the method of request.
|
||||
* @param resourceRequest The ArkWeb_ResourceRequest.
|
||||
* @param method The request's http method. This function will allocate memory for the method string and caller must
|
||||
* release the string by OH_ArkWeb_ReleaseString.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWebResourceRequest_GetMethod(const ArkWeb_ResourceRequest* resourceRequest, char** method);
|
||||
|
||||
/*
|
||||
* @brief Get the url of request.
|
||||
* @param resourceRequest The ArkWeb_ResourceRequest.
|
||||
* @param url The request's url. This function will allocate memory for the url string and caller must release the
|
||||
* string by OH_ArkWeb_ReleaseString.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWebResourceRequest_GetUrl(const ArkWeb_ResourceRequest* resourceRequest, char** url);
|
||||
|
||||
/*
|
||||
* @brief Create a ArkWeb_PostDataStream which used to read the post data.
|
||||
* @param resourceRequest The ArkWeb_ResourceRequest.
|
||||
* @param postDataStream The request's post data. This function will allocate memory for the post data stream and
|
||||
* caller must release the postDataStream by OH_ArkWebResourceRequest_DestroyPostData.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWebResourceRequest_GetPostData(const ArkWeb_ResourceRequest* resourceRequest,
|
||||
ArkWeb_PostDataStream** postDataStream);
|
||||
|
||||
/*
|
||||
* @brief Destroy the post data stream.
|
||||
* @param postDataStream The postDataStream to be destroyed.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWebResourceRequest_DestroyPostData(ArkWeb_PostDataStream* postDataStream);
|
||||
|
||||
/*
|
||||
* @brief Set a user data to ArkWeb_PostDataStream.
|
||||
* @param postDataStream The ArkWeb_PostDataStream.
|
||||
* @param userData The user data to set.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebPostDataStream_SetUserData(ArkWeb_PostDataStream* postDataStream, void* userData);
|
||||
|
||||
/*
|
||||
* @brief Get the user data from ArkWeb_PostDataStream.
|
||||
* @param postDataStream The ArkWeb_PostDataStream.
|
||||
* @return The set user data.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void* OH_ArkWebPostDataStream_GetUserData(const ArkWeb_PostDataStream* postDataStream);
|
||||
|
||||
/*
|
||||
* @brief Set the callback for OH_ArkWebPostDataStream_Read, the result of OH_ArkWebPostDataStream_Read will be
|
||||
* notified to caller through the readCallback. The callback will runs in the same thread as
|
||||
* OH_ArkWebPostDataStream_Read.
|
||||
* @param postDataStream The ArkWeb_PostDataStream.
|
||||
* @param readCallback The callback of read function.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebPostDataStream_SetReadCallback(ArkWeb_PostDataStream* postDataStream,
|
||||
ArkWeb_PostDataReadCallback readCallback);
|
||||
|
||||
/*
|
||||
* @brief Init the post data stream. This function must be called before calling any other functions.
|
||||
* @param postDataStream The ArkWeb_PostDataStream.
|
||||
* @param initCallback The callback of init.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebPostDataStream_Init(ArkWeb_PostDataStream* postDataStream,
|
||||
ArkWeb_PostDataStreamInitCallback initCallback);
|
||||
|
||||
/*
|
||||
* @brief Read the post data to the buffer. The buffer must be larger than the bufLen. We will be reading data from a
|
||||
* worker thread to the buffer, so should not use the buffer in other threads before the callback to avoid
|
||||
* concurrency issues.
|
||||
* @param postDataStream The ArkWeb_PostDataStream.
|
||||
* @param buffer The buffer to receive data.
|
||||
* @param bufLen The size of bytes to read.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWebPostDataStream_Read(const ArkWeb_PostDataStream* postDataStream, uint8_t* buffer, int bufLen);
|
||||
|
||||
/*
|
||||
* @brief Get the total size of the data stream. When data is chunked, always return zero.
|
||||
* @param postDataStream The ArkWeb_PostDataStream.
|
||||
* @return The size of data stream. -1 if postDataStream is invalid.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
uint64_t OH_ArkWebPostDataStream_GetSize(const ArkWeb_PostDataStream* postDataStream);
|
||||
|
||||
/*
|
||||
* @brief Get the current position of the data stream.
|
||||
* @param postDataStream The ArkWeb_PostDataStream.
|
||||
* @return The current position of data stream. -1 if postDataStream is invalid.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
uint64_t OH_ArkWebPostDataStream_GetPosition(const ArkWeb_PostDataStream* postDataStream);
|
||||
|
||||
/*
|
||||
* @brief Get if the data stream is chunked.
|
||||
* @param postDataStream The ArkWeb_PostDataStream.
|
||||
* @return True if is chunked; false otherwise.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
bool OH_ArkWebPostDataStream_IsChunked(const ArkWeb_PostDataStream* postDataStream);
|
||||
|
||||
|
||||
/*
|
||||
* @brief Returns true if all data has been consumed from this upload data stream. For chunked uploads, returns false
|
||||
* until the first read attempt.
|
||||
* @param postDataStream The ArkWeb_PostDataStream.
|
||||
* @return True if all data has been consumed; false otherwise.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
bool OH_ArkWebPostDataStream_IsEof(const ArkWeb_PostDataStream* postDataStream);
|
||||
|
||||
/*
|
||||
* @brief Returns true if the upload data in the stream is entirely in memory, and all read requests will succeed
|
||||
* synchronously. Expected to return false for chunked requests.
|
||||
* @param postDataStream The ArkWeb_PostDataStream.
|
||||
* @return True if the upload data is in memory; false otherwise.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
bool OH_ArkWebPostDataStream_IsInMemory(const ArkWeb_PostDataStream* postDataStream);
|
||||
|
||||
/*
|
||||
* @brief Get the referrer of request.
|
||||
* @param resourceRequest The ArkWeb_ResourceRequest.
|
||||
* @param referrer The request's referrer. This function will allocate memory for the post data string and caller
|
||||
* must release the string by OH_ArkWeb_ReleaseString.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWebResourceRequest_GetReferrer(const ArkWeb_ResourceRequest* resourceRequest, char** referrer);
|
||||
|
||||
/*
|
||||
* @brief Get the OH_ArkWeb_RequestHeaderList of the request.
|
||||
* @param resourceRequest The ArkWeb_ResourceRequest.
|
||||
* @param requestHeaderList The RequestHeaderList of request.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWebResourceRequest_GetRequestHeaders(const ArkWeb_ResourceRequest* resourceRequest,
|
||||
ArkWeb_RequestHeaderList** requestHeaderList);
|
||||
|
||||
/*
|
||||
* @brief Get if this is a redirect request.
|
||||
* @param resourceRequest The ArkWeb_ResourceRequest.
|
||||
* @return True if this is a redirect; false otherwise.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
bool OH_ArkWebResourceRequest_IsRedirect(const ArkWeb_ResourceRequest* resourceRequest);
|
||||
|
||||
/*
|
||||
* @brief Get if this is a request from main frame.
|
||||
* @param resourceRequest The ArkWeb_ResourceRequest.
|
||||
* @return True if this is from main frame; false otherwise.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
bool OH_ArkWebResourceRequest_IsMainFrame(const ArkWeb_ResourceRequest* resourceRequest);
|
||||
|
||||
/*
|
||||
* @brief Get if this is a request is triggered by user gesutre.
|
||||
* @param resourceRequest The ArkWeb_ResourceRequest.
|
||||
* @return True if this is triggered by user gesture; false otherwise.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
bool OH_ArkWebResourceRequest_HasGesture(const ArkWeb_ResourceRequest* resourceRequest);
|
||||
|
||||
/*
|
||||
* @brief Register custom scheme to the ArkWeb. Should not be called for built-in HTTP, HTTPS, FILE, FTP, ABOUT and
|
||||
* DATA schemes. This function should be called on main thread.
|
||||
* @param scheme The scheme to regist.
|
||||
* @param option The configuration of the scheme.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWeb_RegisterCustomSchemes(const char* scheme, int32_t option);
|
||||
|
||||
/*
|
||||
* @brief Set a ArkWeb_SchemeHandler for a specific scheme to intercept requests of that scheme type.
|
||||
* @param scheme Scheme that need to be intercepted.
|
||||
* @param schemeHandler The SchemeHandler for the scheme. Only requests triggered by ServiceWorker will be notified
|
||||
* through this handler.
|
||||
* @return Return true if set SchemeHandler for specific scheme successful, return false otherwise.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
bool OH_ArkWebServiceWorker_SetSchemeHandler(const char* scheme, ArkWeb_SchemeHandler* schemeHandler);
|
||||
|
||||
/*
|
||||
* @brief Set a ArkWeb_SchemeHandler for a specific scheme to intercept requests of that scheme type.
|
||||
* @param scheme Scheme that need to be intercepted.
|
||||
* @param webTag The name of the web component.
|
||||
* @param schemeHandler The SchemeHandler for the scheme. Only requests triggered from the specified web will be
|
||||
* notified through this handler.
|
||||
* @return Return true if set SchemeHandler for specific scheme successful, return false otherwise.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
bool OH_ArkWeb_SetSchemeHandler(const char* scheme, const char* webTag, ArkWeb_SchemeHandler* schemeHandler);
|
||||
|
||||
/*
|
||||
* @brief Clear the handler registered on the specified web for service worker.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebServiceWorker_ClearSchemeHandlers();
|
||||
|
||||
/*
|
||||
* @brief Clear the handler registered on the specified web.
|
||||
* @param webTag The name of the web component.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWeb_ClearSchemeHandlers(const char* webTag);
|
||||
|
||||
/*
|
||||
* @brief Create a SchemeHandler.
|
||||
* @param schemeHandler Return the created SchemeHandler. Use OH_ArkWeb_DestroySchemeHandler destroy it when donn't
|
||||
* need it.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWeb_CreateSchemeHandler(ArkWeb_SchemeHandler** schemeHandler);
|
||||
|
||||
/*
|
||||
* @brief Destroy a SchemeHandler.
|
||||
* @param The ArkWeb_SchemeHandler to be destroy.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWeb_DestroySchemeHandler(ArkWeb_SchemeHandler* schemeHandler);
|
||||
|
||||
/*
|
||||
* @brief Set a user data to ArkWeb_SchemeHandler.
|
||||
* @param schemeHandler The ArkWeb_SchemeHandler.
|
||||
* @param userData The user data to set.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebSchemeHandler_SetUserData(ArkWeb_SchemeHandler* schemeHandler, void* userData);
|
||||
|
||||
/*
|
||||
* @brief Get the user data from ArkWeb_SchemeHandler.
|
||||
* @param schemeHandler The ArkWeb_SchemeHandler.
|
||||
* @return The set user data.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void* OH_ArkWebSchemeHandler_GetUserData(const ArkWeb_SchemeHandler* schemeHandler);
|
||||
|
||||
/*
|
||||
* @brief Set the OnRequestStart callback for SchemeHandler.
|
||||
* @param schemeHandler The SchemeHandler for the scheme.
|
||||
* @param onRequestStart The OnRequestStart callback.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebSchemeHandler_SetOnRequestStart(ArkWeb_SchemeHandler* schemeHandler,
|
||||
ArkWeb_OnRequestStart onRequestStart);
|
||||
|
||||
/*
|
||||
* @brief Set the OnRequestStop callback for SchemeHandler.
|
||||
* @param schemeHandler The SchemeHandler for the scheme.
|
||||
* @param onRequestStop The OnRequestStop callback.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebSchemeHandler_SetOnRequestStop(ArkWeb_SchemeHandler* schemeHandler,
|
||||
ArkWeb_OnRequestStop onRequestStop);
|
||||
|
||||
/*
|
||||
* @brief Create a Response for a request.
|
||||
* @param Return the created Response. Use OH_ArkWeb_DestroyResponse to destroy when donn't need it.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWeb_CreateResponse(ArkWeb_Response** response);
|
||||
|
||||
/*
|
||||
* @brief Destroy the Reponse.
|
||||
* @param response The Response needs destroy.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWeb_DestroyResponse(ArkWeb_Response* response);
|
||||
|
||||
/*
|
||||
* @brief Set the resolved URL after redirects or changed as a result of HSTS.
|
||||
* @param response The ArkWeb_Response.
|
||||
* @param url The resolved URL.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebResponse_SetUrl(ArkWeb_Response* response, const char* url);
|
||||
|
||||
/*
|
||||
* @brief Get the resolved URL after redirects or changed as a result of HSTS.
|
||||
* @param response The ArkWeb_Response.
|
||||
* @param url The resolved URL.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWebResponse_GetUrl(const ArkWeb_Response* response, char** url);
|
||||
|
||||
/*
|
||||
* @brief Set a error code to ArkWeb_Response.
|
||||
* @param response The ArkWeb_Response.
|
||||
* @param errorCode The error code for the failed request.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebResponse_SetError(ArkWeb_Response* response, ArkWeb_NetError errorCode);
|
||||
|
||||
/*
|
||||
* @brief Get the response's error code.
|
||||
* @param response The ArkWeb_Response.
|
||||
* @return The response's error code.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
ArkWeb_NetError OH_ArkWebResponse_GetError(const ArkWeb_Response* response);
|
||||
|
||||
/*
|
||||
* @brief Set a status code to ArkWebResponse.
|
||||
* @param response The ArkWeb_Response.
|
||||
* @param status The http status code for the request.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebResponse_SetStatus(ArkWeb_Response* response, int status);
|
||||
|
||||
/*
|
||||
* @brief Get the response's status code.
|
||||
* @param response The ArkWeb_Response.
|
||||
* @return The response's http status code. -1 if response is invalid.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int OH_ArkWebResponse_GetStatus(const ArkWeb_Response* response);
|
||||
|
||||
/*
|
||||
* @brief Set a status text to ArkWebResponse.
|
||||
* @param response The ArkWeb_Response.
|
||||
* @param statusText The status text for the request.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebResponse_SetStatusText(ArkWeb_Response* response, const char* statusText);
|
||||
|
||||
/*
|
||||
* @brief Get the response's status text.
|
||||
* @param response The ArkWeb_Response.
|
||||
* @param statusText Return the response's statusText. This function will allocate memory for the statusText string and
|
||||
* caller must release the string by OH_ArkWeb_ReleaseString.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWebResponse_GetStatusText(const ArkWeb_Response* response, char** statusText);
|
||||
|
||||
/*
|
||||
* @brief Set mime type to ArkWebResponse.
|
||||
* @param response The ArkWeb_Response.
|
||||
* @param mimeType The mime type for the request.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebResponse_SetMimeType(ArkWeb_Response* response, const char* mimeType);
|
||||
|
||||
/*
|
||||
* @brief Get the response's mime type.
|
||||
* @param response The ArkWeb_Response.
|
||||
* @param mimeType Return the response's mime type. This function will allocate memory for the mime type string and
|
||||
* caller must release the string by OH_ArkWeb_ReleaseString.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWebResponse_GetMimeType(const ArkWeb_Response* response, char** mimeType);
|
||||
|
||||
/*
|
||||
* @brief Set charset to ArkWeb_Response.
|
||||
* @param response The ArkWeb_Response.
|
||||
* @param charset The charset for the request.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebResponse_SetCharset(ArkWeb_Response* response, const char* charset);
|
||||
|
||||
/*
|
||||
* @brief Get the response's charset.
|
||||
* @param response The ArkWeb_Response.
|
||||
* @param charset Return the response's charset. This function will allocate memory for the charset string and caller
|
||||
* must release the string by OH_ArkWeb_ReleaseString.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWebResponse_GetCharset(const ArkWeb_Response* response, char** charset);
|
||||
|
||||
/*
|
||||
* @brief Set a header to ArkWeb_Response.
|
||||
* @param response The ArkWeb_Response.
|
||||
* @param name The name of the header.
|
||||
* @param value The value of the header.
|
||||
* @bool overwirte If true will overwrite the exsits header, if false otherwise.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebResponse_SetHeaderByName(ArkWeb_Response* response,
|
||||
const char* name,
|
||||
const char* value,
|
||||
bool overwrite);
|
||||
|
||||
/*
|
||||
* @brief Get the header from the response.
|
||||
* @param response The ArkWeb_Response.
|
||||
* @param name The name of the header.
|
||||
* @param value Return the header's value. This function will allocate memory for the value string and caller must
|
||||
* release the string by OH_ArkWeb_ReleaseString.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWebResponse_GetHeaderByName(const ArkWeb_Response* response, const char* name, char** value);
|
||||
|
||||
/*
|
||||
* @brief Pass response headers to intercepted requests.
|
||||
* @param resourceHandler The ArkWeb_ResourceHandler for the request.
|
||||
* @param response The ArkWeb_Response for the intercepting requests.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebResourceHandler_DidReceiveResponse(const ArkWeb_ResourceHandler* resourceHandler,
|
||||
const ArkWeb_Response* response);
|
||||
|
||||
/*
|
||||
* @brief Pass response body data to intercepted requests.
|
||||
* @param resourceHandler The ArkWeb_ResourceHandler for the request.
|
||||
* @param buffer Buffer data to send.
|
||||
* @param bufLen The size of buffer.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebResourceHandler_DidReceiveData(const ArkWeb_ResourceHandler* resourceHandler,
|
||||
const uint8_t* buffer,
|
||||
int64_t bufLen);
|
||||
|
||||
/*
|
||||
* @brief Notify the ArkWeb that this request should be finished and there is no more data available.
|
||||
* @param resourceHandler The ArkWeb_ResourceHandler for the request.
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebResourceHandler_DidFinish(const ArkWeb_ResourceHandler* resourceHandler);
|
||||
|
||||
/*
|
||||
* @brief Notify the ArkWeb that this request should be failed.
|
||||
* @param resourceHandler The ArkWeb_ResourceHandler for the request.
|
||||
* @param errorCode The error code for this request. refer to arkweb_net_error_list.h
|
||||
* @return 0 if success; otherwise if fail. refer to arkweb_net_error_list.h.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
int32_t OH_ArkWebResourceHandler_DidFailWithError(const ArkWeb_ResourceHandler* resourceHandler,
|
||||
ArkWeb_NetError errorCode);
|
||||
|
||||
/*
|
||||
* @brief Release the string acquired by native function.
|
||||
* @param string The string to be released.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWeb_ReleaseString(char* string);
|
||||
|
||||
/*
|
||||
* @brief Release the byte array acquired by native function.
|
||||
* @param byteArray The byte array to be released.
|
||||
*
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
void OH_ArkWeb_ReleaseByteArray(uint8_t* byteArray);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif // ARKWEB_SCHEME_HANDLER_H
|
||||
@@ -34,5 +34,285 @@
|
||||
{
|
||||
"first_introduced": "11",
|
||||
"name": "OH_NativeArkWeb_GetWebInstanceByWebTag"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "ArkWeb_SchemeHandler"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "ArkWeb_ResourceHandler"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "ArkWeb_Response"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "ArkWeb_ResourceRequest"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "ArkWeb_RequestHeaderList"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "ArkWeb_RequestHeader"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "ArkWeb_PostDataStream"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebRequestHeaderList_Create"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebRequestHeaderList_Destroy"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebRequestHeaderList_GetSize"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebRequestHeaderList_GetHeader"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebRequestHeader_Create"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebRequestHeader_Destroy"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebRequestHeader_GetName"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebRequestHeader_GetValue"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResourceRequest_GetMethod"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResourceRequest_GetUrl"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResourceRequest_GetPostData"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebPostDataStream_SetReadCallback"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "ArkWeb_PostDataStreamInitCallback"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebPostDataStream_SetUserData"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebPostDataStream_GetUserData"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebPostDataStream_Init"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "ArkWeb_PostDataReadCallback"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebPostDataStream_Read"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebPostDataStream_GetSize"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebPostDataStream_GetPosition"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebPostDataStream_IsChunked"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebPostDataStream_IsEof"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebPostDataStream_IsInMemory"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResourceRequest_SetUserData"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResourceRequest_GetUserData"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResourceRequest_GetReferrer"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResourceRequest_GetRequestHeaders"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResourceRequest_IsRedirect"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResourceRequest_IsMainFrame"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResourceRequest_HasGesture"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWeb_RegisterCustomSchemes"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWeb_SetSchemeHandler"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebServiceWorker_SetSchemeHandler"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWeb_ClearSchemeHandlers"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebServiceWorker_ClearSchemeHandlers"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWeb_CreateSchemeHandler"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWeb_DestroySchemeHandler"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebSchemeHandler_SetUserData"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebSchemeHandler_GetUserData"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebSchemeHandler_SetOnRequestStart"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebSchemeHandler_SetOnRequestStop"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWeb_CreateResponse"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWeb_DestroyResponse"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResponse_SetUrl"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResponse_GetUrl"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResponse_SetError"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResponse_GetError"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResponse_SetStatus"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResponse_GetStatus"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResponse_SetStatusText"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResponse_GetStatusText"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResponse_SetMimeType"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResponse_GetMimeType"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResponse_SetCharset"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResponse_GetCharset"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResponse_SetHeaderByName"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResponse_GetHeaderByName"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResourceHandler_DidReceiveResponse"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResourceHandler_DidReceiveData"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResourceHandler_DidFinish"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWebResourceHandler_DidFailWithError"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWeb_ReleaseString"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_ArkWeb_ReleaseByteArray"
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user