diff --git a/zh-cn/application-dev/reference/native-apis/_o_h___native_x_component.md b/zh-cn/application-dev/reference/native-apis/_o_h___native_x_component.md index 2fd63c654e3cc00bde0dda042aa198597ba633d7..12a1d3c8a122951e596b286291fbec3f8d97c5ca 100644 --- a/zh-cn/application-dev/reference/native-apis/_o_h___native_x_component.md +++ b/zh-cn/application-dev/reference/native-apis/_o_h___native_x_component.md @@ -45,6 +45,8 @@ | ------------------------------------------------------------ | ------------------------------------ | | {OH_NATIVEXCOMPONENT_RESULT_SUCCESS = 0,
OH_NATIVEXCOMPONENT_RESULT_FAILED = -1,
OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER = -2 } | [枚举](#anonymous-enum)API访问状态。 | | [OH_NativeXComponent_TouchEventType](#oh_nativexcomponent_toucheventtype) {
OH_NATIVEXCOMPONENT_DOWN = 0,
OH_NATIVEXCOMPONENT_UP,
OH_NATIVEXCOMPONENT_MOVE,
OH_NATIVEXCOMPONENT_CANCEL,
OH_NATIVEXCOMPONENT_UNKNOWN } | 触摸事件类型。 | +| [OH_NativeXComponent_TouchPointToolType](#oh_nativexcomponent_touchpointtooltype) {
OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN = 0,
OH_NATIVEXCOMPONENT_TOOL_TYPE_FINGER,
OH_NATIVEXCOMPONENT_TOOL_TYPE_PEN,
OH_NATIVEXCOMPONENT_TOOL_TYPE_RUBBER,
OH_NATIVEXCOMPONENT_TOOL_TYPE_BRUSH,
OH_NATIVEXCOMPONENT_TOOL_TYPE_PENCIL,
OH_NATIVEXCOMPONENT_TOOL_TYPE_AIRBRUSH,
OH_NATIVEXCOMPONENT_TOOL_TYPE_MOUSE,
OH_NATIVEXCOMPONENT_TOOL_TYPE_LENS } | 触摸点工具类型。 | +| [OH_NativeXComponent_EventSourceType](#oh_nativexcomponent_eventsourcetype) {
OH_NATIVEXCOMPONENT_SOURCE_TYPE_UNKNOWN = 0,
OH_NATIVEXCOMPONENT_SOURCE_TYPE_MOUSE, OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHSCREEN,
OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHPAD,
OH_NATIVEXCOMPONENT_SOURCE_TYPE_JOYSTICK} | 触摸事件源类型。 | | [OH_NativeXComponent_MouseEventAction](#oh_nativexcomponent_mouseeventaction) {
OH_NATIVEXCOMPONENT_MOUSE_NONE = 0,
OH_NATIVEXCOMPONENT_MOUSE_PRESS,
OH_NATIVEXCOMPONENT_MOUSE_RELEASE,
OH_NATIVEXCOMPONENT_MOUSE_MOVE } | 鼠标事件动作。 | | [OH_NativeXComponent_MouseEventButton](#oh_nativexcomponent_mouseeventbutton) {
OH_NATIVEXCOMPONENT_NONE_BUTTON = 0,
OH_NATIVEXCOMPONENT_LEFT_BUTTON = 0x01,
OH_NATIVEXCOMPONENT_RIGHT_BUTTON = 0x02,
OH_NATIVEXCOMPONENT_MIDDLE_BUTTON = 0x04,
OH_NATIVEXCOMPONENT_BACK_BUTTON = 0x08,
OH_NATIVEXCOMPONENT_FORWARD_BUTTON = 0x10 } | 鼠标事件按键。 | @@ -57,6 +59,9 @@ | [OH_NativeXComponent_GetXComponentSize](#oh_nativexcomponent_getxcomponentsize) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, const void \*window, uint64_t \*width, uint64_t \*height) | 获取ArkUI XComponent持有的surface的大小。 | | [OH_NativeXComponent_GetXComponentOffset](#oh_nativexcomponent_getxcomponentoffset) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, const void \*window, double \*x, double \*y) | 获取ArkUI XComponent组件相对屏幕左上顶点的偏移量。 | | [OH_NativeXComponent_GetTouchEvent](#oh_nativexcomponent_gettouchevent) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, const void \*window, [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md) \*touchEvent) | 获取ArkUI XComponent调度的触摸事件。 | +| [OH_NativeXComponent_GetTouchPointToolType](#oh_nativexcomponent_gettouchpointtooltype) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, uint32_t pointIndex, [OH_NativeXComponent_TouchPointToolType](#oh_nativexcomponent_touchpointtooltype) \*toolType) | 获取ArkUI XComponent触摸点工具类型。 | +| [OH_NativeXComponent_GetTouchPointTiltX](#oh_nativexcomponent_gettouchpointtiltx) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, uint32_t pointIndex, float \*tiltX) | 获取ArkUI XComponent触摸点倾斜与X轴角度。 | +| [OH_NativeXComponent_GetTouchPointTiltY](#oh_nativexcomponent_gettouchpointtilty) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, uint32_t pointIndex, float \*tiltY) | 获取ArkUI XComponent触摸点倾斜与Y轴角度。 | | [OH_NativeXComponent_GetMouseEvent](#oh_nativexcomponent_getmouseevent) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, const void \*window, [OH_NativeXComponent_MouseEvent](_o_h___native_x_component___mouse_event.md) \*mouseEvent) | 获取ArkUI XComponent调度的鼠标事件 | | [OH_NativeXComponent_RegisterCallback](#oh_nativexcomponent_registercallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md) \*callback) | 为此OH_NativeXComponent实例注册回调。 | | [OH_NativeXComponent_RegisterMouseEventCallback](#oh_nativexcomponent_registermouseeventcallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, [OH_NativeXComponent_MouseEvent_Callback](_o_h___native_x_component___mouse_event___callback.md) \*callback) | 为此OH_NativeXComponent实例注册鼠标事件回调。 | @@ -183,6 +188,30 @@ anonymous enum 8 +### OH_NativeXComponent_EventSourceType + +OH_NativeXComponent_EventSourceType + + +``` +enum OH_NativeXComponent_EventSourceType +``` + +**描述:** + +触摸事件源类型。 + +| 枚举值 | 描述 | +| -------- | -------- | +| OH_NATIVEXCOMPONENT_SOURCE_TYPE_UNKNOWN | 未知的输入源类型。 | +| OH_NATIVEXCOMPONENT_SOURCE_TYPE_MOUSE | 表示输入源生成鼠标多点触摸事件。 | +| OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHSCREEN | 表示输入源生成一个触摸屏多点触摸事件。 | +| OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHPAD | 表示输入源生成一个触摸板多点触摸事件。 | +| OH_NATIVEXCOMPONENT_SOURCE_TYPE_JOYSTICK | 表示输入源生成一个操纵杆多点触摸事件。 | + +**起始版本:** + +9 ### OH_NativeXComponent_MouseEventAction @@ -255,6 +284,33 @@ enum OH_NativeXComponent_TouchEventType 8 +### OH_NativeXComponent_TouchPointToolType + + +``` +enum OH_NativeXComponent_TouchPointToolType +``` + +**描述:** + +触摸点工具类型 + +| 枚举值 | 描述 | +| -------- | -------- | +| OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN | 无效的工具类型。 | +| OH_NATIVEXCOMPONENT_TOOL_TYPE_FINGER | 表示用手指。 | +| OH_NATIVEXCOMPONENT_TOOL_TYPE_PEN | 表示用触笔。 | +| OH_NATIVEXCOMPONENT_TOOL_TYPE_RUBBER | 表示用橡皮擦。 | +| OH_NATIVEXCOMPONENT_TOOL_TYPE_BRUSH | 表示用画笔。 | +| OH_NATIVEXCOMPONENT_TOOL_TYPE_PENCIL | 表示用铅笔。 | +| OH_NATIVEXCOMPONENT_TOOL_TYPE_AIRBRUSH | 表示用气笔。 | +| OH_NATIVEXCOMPONENT_TOOL_TYPE_MOUSE | 表示用鼠标。 | +| OH_NATIVEXCOMPONENT_TOOL_TYPE_LENS | 表示用晶状体。 | + +**起始版本:** + +9 + ## 函数说明 @@ -314,6 +370,89 @@ int32_t OH_NativeXComponent_GetTouchEvent (OH_NativeXComponent * component, cons 8 +### OH_NativeXComponent_GetTouchPointTiltX() + + +``` +int32_t OH_NativeXComponent_GetTouchPointTiltX (OH_NativeXComponent * component, uint32_t pointIndex, float * tiltX ) +``` + +**描述:** + +获取ArkUI XComponent触摸点倾斜与X轴角度。 + +**参数:** + +| Name | 描述 | +| -------- | -------- | +| component | 表示指向OH_NativeXComponent实例的指针。 | +| pointIndex | 表示触摸点的指针索引。 | +| tiltX | 表示指向X倾斜度的指针。 | + +**返回:** + +返回执行的状态代码。 + +**起始版本:** + +9 + + +### OH_NativeXComponent_GetTouchPointTiltY() + + +``` +int32_t OH_NativeXComponent_GetTouchPointTiltX (OH_NativeXComponent * component, uint32_t pointIndex, float * tiltY ) +``` + +**描述:** + +获取ArkUI XComponent触摸点倾斜与Y轴角度。 + +**参数:** + +| Name | 描述 | +| -------- | -------- | +| component | 表示指向OH_NativeXComponent实例的指针。 | +| pointIndex | 表示触摸点的指针索引。 | +| tiltX | 表示指向Y倾斜度的指针。 | + +**返回:** + +返回执行的状态代码。 + +**起始版本:** + +9 + + +### OH_NativeXComponent_GetTouchPointToolType() + + +``` +int32_t OH_NativeXComponent_GetTouchPointToolType (OH_NativeXComponent * component, uint32_t pointIndex, OH_NativeXComponent_TouchPointToolType * toolType ) +``` + +**描述:** + +获取ArkUI XComponent触摸点工具类型。 + +**参数:** + +| Name | 描述 | +| -------- | -------- | +| component | 表示指向OH_NativeXComponent实例的指针。 | +| pointIndex | 表示触摸点的指针索引。 | +| toolType | 表示指向工具类型的指针。 | + +**返回:** + +返回执行的状态代码。 + +**起始版本:** + +9 + ### OH_NativeXComponent_GetXComponentId()