mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2025-04-01 14:02:13 +00:00
update new interface defines
Signed-off-by: yan-shuifeng <yanshuifeng@huawei.com> Change-Id: I032522906e2e6ef153f729480fe610e83d1eaae8
This commit is contained in:
parent
10207463cc
commit
13d1c8f4de
@ -44,6 +44,9 @@ BreakStringLiterals: true
|
||||
BreakAfterJavaFieldAnnotations: true
|
||||
ColumnLimit: 120
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
QualifierAlignment: Leave
|
||||
ReflowComments: false
|
||||
PenaltyBreakComment: 1000000
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
|
@ -14,10 +14,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup ArkUI_NativeNode
|
||||
* @addtogroup ArkUI_NativeModule
|
||||
* @{
|
||||
*
|
||||
* @brief 提供ArkUI在Native侧的UI组件能力,如组件创建销毁、树节点操作,属性设置,事件监听等。
|
||||
* @brief 提供ArkUI在Native侧的UI能力,如UI组件创建销毁、树节点操作,属性设置,事件监听等。
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
@ -48,13 +48,13 @@ extern "C" {
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** 不支持的工具类型 */
|
||||
/** 不支持的工具类型。 */
|
||||
NODE_TOOL_TYPE_UNKNOWN = -1,
|
||||
|
||||
/** 手指 */
|
||||
/** 手指。 */
|
||||
NODE_TOOL_TYPE_FINGER = 0,
|
||||
|
||||
/** 笔 */
|
||||
/** 笔。 */
|
||||
NODE_TOOL_TYPE_PEN = 1,
|
||||
} ArkUI_NodeToolType;
|
||||
|
||||
@ -64,13 +64,13 @@ typedef enum {
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** 不支持的来源类型 */
|
||||
/** 不支持的来源类型。 */
|
||||
NODE_SOURCE_TYPE_UNKNOWN = -1,
|
||||
/** 触摸屏 */
|
||||
/** 触摸屏。 */
|
||||
NODE_SOURCE_TYPE_TOUCH_SCREEN = 0,
|
||||
/** 手写笔 */
|
||||
/** 手写笔。 */
|
||||
NODE_SOURCE_TYPE_PEN = 1,
|
||||
/** 触控板 */
|
||||
/** 触控板。 */
|
||||
NODE_SOURCE_TYPE_TOUCH_PAD = 2,
|
||||
} ArkUI_NodeSourceType;
|
||||
|
||||
@ -189,18 +189,18 @@ typedef struct {
|
||||
ArkUI_NodeTouchPoint actionTouch;
|
||||
|
||||
/**
|
||||
* @brief 返回此事件发生时所有屏幕接触点信息.
|
||||
* @param points 用来接受数据的指针对象.
|
||||
* @return 屏幕接触点数量.
|
||||
* @brief 返回此事件发生时所有屏幕接触点信息。
|
||||
* @param points 用来接受数据的指针对象。
|
||||
* @return 屏幕接触点数据数组元素数量。
|
||||
* @note
|
||||
* 框架会在该函数调用时创建触控点信息数组的堆内存对象并返回指针,开发者需要在使用完成后调用delete[]手动释放内存。
|
||||
* ArkUI会在该函数调用时创建触控点信息数组的堆内存对象并返回指针,开发者需要在使用完成后调用delete[]手动释放内存。
|
||||
*/
|
||||
int32_t (*getTouches)(ArkUI_NodeTouchPoint** points);
|
||||
|
||||
/**
|
||||
* @brief 返回此事件中的历史点信息。这些是在此事件和上一个事件之间发生的运动.
|
||||
* @param points 用来接受数据的指针对象.
|
||||
* @return 历史点数量.
|
||||
* @brief 返回此事件中的历史点信息。这些是在此事件和上一个事件之间发生的运动。
|
||||
* @param points 用来接受数据的指针对象。
|
||||
* @return 历史点数据数组元素数量。
|
||||
* @note
|
||||
* 框架会在该函数调用时创建历史点数据数组的堆内存对象并返回指针,开发者需要在使用完成后调用delete[]手动释放内存。
|
||||
*/
|
||||
|
93
interfaces/native/native_interface.h
Normal file
93
interfaces/native/native_interface.h
Normal file
@ -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 提供ArkUI在Native侧的UI能力,如UI组件创建销毁、树节点操作,属性设置,事件监听等。
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file native_interface.h
|
||||
*
|
||||
* @brief 提供NativeModule接口的统一入口函数。
|
||||
*
|
||||
* @library libace_ndk.z.so
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @since 12
|
||||
*/
|
||||
|
||||
#ifndef ARKUI_NATIVE_INTERFACE
|
||||
#define ARKUI_NATIVE_INTERFACE
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief 定义任意版本的Native接口类型。
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* @brief 定义Native接口集合的版本信息。
|
||||
*
|
||||
* 不同于NDK版本,NativeNode接口的version字段标识自身结构体的版本信息。
|
||||
*/
|
||||
int32_t version;
|
||||
} ArkUI_AnyNativeAPI;
|
||||
|
||||
/**
|
||||
* @brief 定义Native接口集合类型。
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** UI组件相关接口类型。*/
|
||||
ARKUI_NATIVE_NODE,
|
||||
} ArkUI_NativeAPIVariantKind;
|
||||
|
||||
/**
|
||||
* @brief 获取指定版本的Native接口集合。
|
||||
*
|
||||
* @param type ArkUI提供的Native接口集合大类,例如UI组件接口类:ARKUI_NATIVE_NODE。
|
||||
* @param version native接口结构体的版本信息,通过结构体定义的后缀获得,如版本1的UI组件结构体:ArkUI_NativeNodeAPI_1。
|
||||
* @return ArkUI_AnyNativeAPI* 返回携带版本的Native接口抽象对象。
|
||||
* @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
|
||||
/** @} */
|
1755
interfaces/native/native_node.h
Normal file
1755
interfaces/native/native_node.h
Normal file
File diff suppressed because it is too large
Load Diff
133
interfaces/native/native_type.h
Normal file
133
interfaces/native/native_type.h
Normal file
@ -0,0 +1,133 @@
|
||||
/*
|
||||
* 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 提供ArkUI在Native侧的UI能力,如UI组件创建销毁、树节点操作,属性设置,事件监听等。
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file native_type.h
|
||||
*
|
||||
* @brief 提供NativeModule公共的类型定义。
|
||||
*
|
||||
* @library libace_ndk.z.so
|
||||
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
||||
* @since 12
|
||||
*/
|
||||
|
||||
#ifndef ARKUI_NATIVE_TYPE
|
||||
#define ARKUI_NATIVE_TYPE
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief 提供ArkUI native组件实例对象定义。
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
struct ArkUI_Node;
|
||||
|
||||
/**
|
||||
* @brief 定义ArkUI native组件实例对象指针定义。
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef struct ArkUI_Node* ArkUI_NodeHandle;
|
||||
|
||||
/**
|
||||
* @brief ArkUI在native侧的数字类型定义。
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef union {
|
||||
/** 浮点类型。*/
|
||||
float f32;
|
||||
/** 有符号整型。*/
|
||||
int32_t i32;
|
||||
/** 无符号整型。*/
|
||||
uint32_t u32;
|
||||
} ArkUI_NumberValue;
|
||||
|
||||
/**
|
||||
* @brief 长度类型单位。
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** VP单位。*/
|
||||
ARKUI_UNIT_VP = 0,
|
||||
/** PX单位。*/
|
||||
ARKUI_UNIT_PX,
|
||||
/** 百分比单位。*/
|
||||
ARKUI_UNIT_PERCENT
|
||||
} ArkUI_DimensionUnit;
|
||||
|
||||
/**
|
||||
* @brief 定义布局对齐枚举值。
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** 顶部起始。 */
|
||||
ARKUI_ALIGNMENT_TOP_START = 0,
|
||||
/** 顶部居中。*/
|
||||
ARKUI_ALIGNMENT_TOP,
|
||||
/** 顶部尾端。*/
|
||||
ARKUI_ALIGNMENT_TOP_END,
|
||||
/** 起始端纵向居中。*/
|
||||
ARKUI_ALIGNMENT_START,
|
||||
/** 横向和纵向居中。*/
|
||||
ARKUI_ALIGNMENT_CENTER,
|
||||
/** 尾端纵向居中。*/
|
||||
ARKUI_ALIGNMENT_END,
|
||||
/** 底部起始端。*/
|
||||
ARKUI_ALIGNMENT_BOTTOM_START,
|
||||
/** 底部横向居中。*/
|
||||
ARKUI_ALIGNMENT_BOTTOM,
|
||||
/** 底部尾端。*/
|
||||
ARKUI_ALIGNMENT_BOTTOM_END,
|
||||
} ArkUI_Alignment;
|
||||
|
||||
/**
|
||||
* @brief 定义Native接口的错误码。
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
typedef enum {
|
||||
/** 接口调用成功。*/
|
||||
ARKUI_RESULT_SUCCESS = 0,
|
||||
/** 接口调用失败。*/
|
||||
ARKUI_RESULT_FAIL = -1,
|
||||
/** 参数解析异常。*/
|
||||
ARKUI_RESULT_BAD_PARAMETER = -2,
|
||||
/** 不支持该类型参数。*/
|
||||
ARKUI_RESULT_UNSUPPORTED = -3,
|
||||
} ArkUI_ErrorCode;
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // ARKUI_NATIVE_TYPE
|
||||
/** @} */
|
Loading…
x
Reference in New Issue
Block a user