update new interface defines

Signed-off-by: yan-shuifeng <yanshuifeng@huawei.com>
Change-Id: I032522906e2e6ef153f729480fe610e83d1eaae8
This commit is contained in:
yan-shuifeng 2024-01-22 15:47:38 +08:00
parent 10207463cc
commit 13d1c8f4de
5 changed files with 2000 additions and 16 deletions

View File

@ -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

View File

@ -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[]
*/

View 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接口结构体的版本信息1UI组件结构体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
/** @} */

File diff suppressed because it is too large Load Diff

View 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
/** @} */