harmony 鸿蒙drag_and_drop.h
drag_and_drop.h
Overview
Declares the APIs of NativeDrag.
Library: libace_ndk.z.so
File to include:
System capability: SystemCapability.ArkUI.ArkUI.Full
Since: 12
Related module: ArkUI_NativeModule
Summary
Types
Name | Description |
---|---|
typedef struct ArkUI_NodeEvent ArkUI_NodeEvent | Defines a struct for a component event. |
typedef struct ArkUI_Context ArkUI_Context | Defines a struct for a UI context object. |
typedef struct ArkUI_Context * ArkUI_ContextHandle | Defines the handle to the native UI context. |
typedef struct ArkUI_DragEvent ArkUI_DragEvent | Defines a struct for a drag event. |
typedef struct ArkUI_DragPreviewOption ArkUI_DragPreviewOption | Defines a struct for custom drag preview options. |
typedef struct ArkUI_DragAction ArkUI_DragAction | Defines a struct for a drag action. |
typedef struct ArkUI_DragAndDropInfo ArkUI_DragAndDropInfo | Defines a struct for drag and drop information returned through a drag status listener. |
typedef struct OH_UdmfData OH_UdmfData | Defines a struct for UDMF unified data. |
typedef struct OH_PixelmapNative OH_PixelmapNative | Defines the Pixelmap struct, which is used to perform operations related to a pixel map. |
typedef struct OH_UdmfGetDataParams OH_UdmfGetDataParams | Parameters for obtaining data from UDMF. |
Enums
Functions
Name | Description |
---|---|
ArkUI_DragEvent * OH_ArkUI_NodeEvent_GetDragEvent (ArkUI_NodeEvent *nodeEvent) | Obtains a DragEvent object from the specified NodeEvent object. |
ArkUI_PreDragStatus OH_ArkUI_NodeEvent_GetPreDragStatus (ArkUI_NodeEvent *nodeEvent) | Obtains the state prior to a drop and drop operation. |
int32_t OH_ArkUI_DragEvent_DisableDefaultDropAnimation (ArkUI_DragEvent *event, bool disable) | Sets whether to disable the default drop animation, which is enabled by default. Use this API to apply a custom drop animation. |
int32_t OH_ArkUI_DragEvent_SetSuggestedDropOperation (ArkUI_DragEvent *event, ArkUI_DropOperation dropOperation) | Sets the data processing mode. |
int32_t OH_ArkUI_DragEvent_SetDragResult (ArkUI_DragEvent *event, ArkUI_DragResult result) | Sets the result for a drag event. |
int32_t OH_ArkUI_DragEvent_SetData (ArkUI_DragEvent *event, OH_UdmfData *data) | Set drag data for a drag event. |
int32_t OH_ArkUI_DragEvent_GetUdmfData (ArkUI_DragEvent *event, OH_UdmfData *data) | Obtains the default drag data from a drag event. |
int32_t OH_ArkUI_DragEvent_GetDataTypeCount (ArkUI_DragEvent *event, int32_t *count) | Obtains the number of drag data types from a drag event. |
int32_t OH_ArkUI_DragEvent_GetDataTypes (ArkUI_DragEvent *event, char *eventTypeArray[], int32_t length, int32_t maxStrLen) | Obtains the type list of drag data types from a drag event. |
int32_t OH_ArkUI_DragEvent_GetDragResult (ArkUI_DragEvent *event, ArkUI_DragResult *result) | Obtains the drag and drop result from the drag event. |
int32_t OH_ArkUI_DragEvent_GetDropOperation (ArkUI_DragEvent *event, ArkUI_DropOperation *operation) | Obtains the data handling method from the drag event. |
float OH_ArkUI_DragEvent_GetPreviewTouchPointX (ArkUI_DragEvent *event) | Obtains the X coordinate of the touch point for a drag preview from a drag event. |
float OH_ArkUI_DragEvent_GetPreviewTouchPointY (ArkUI_DragEvent *event) | Obtains the Y coordinate of the touch point on the preview image from a drag event. |
float OH_ArkUI_DragEvent_GetPreviewRectWidth (ArkUI_DragEvent *event) | Obtains the width of a drag preview from a drag event. |
float OH_ArkUI_DragEvent_GetPreviewRectHeight (ArkUI_DragEvent *event) | Obtains the height of a drag preview from a drag event. |
float OH_ArkUI_DragEvent_GetTouchPointXToWindow (ArkUI_DragEvent *event) | Obtains the X coordinate of the touch point relative to the window from a drag event. |
float OH_ArkUI_DragEvent_GetTouchPointYToWindow (ArkUI_DragEvent *event) | Obtains the Y coordinate of the touch point relative to the window from a drag event. |
float OH_ArkUI_DragEvent_GetTouchPointXToDisplay (ArkUI_DragEvent *event) | Obtains the X coordinate of the touch point relative to the display from a drag event. |
float OH_ArkUI_DragEvent_GetTouchPointYToDisplay (ArkUI_DragEvent *event) | Obtains the Y coordinate of the touch point relative to the display from a drag event. |
float OH_ArkUI_DragEvent_GetVelocityX (ArkUI_DragEvent *event) | Obtains the dragging velocity along the x-axis. |
float OH_ArkUI_DragEvent_GetVelocityY (ArkUI_DragEvent *event) | Obtains the dragging velocity along the y-axis. |
float OH_ArkUI_DragEvent_GetVelocity (ArkUI_DragEvent *event) | Obtains the dragging velocity along the main axis. |
int32_t OH_ArkUI_DragEvent_GetModifierKeyStates (ArkUI_DragEvent *event, uint64_t *keys) | Obtains the pressed status of modifier keys. |
int32_t OH_ArkUI_SetDragEventStrictReportWithNode (ArkUI_NodeHandle node, bool enabled) | Sets whether to enable strict reporting on drag events. This feature is disabled by default, and you are advised to enable it. If this feature is disabled, the parent component is not notified when an item in it is dragged over its child component. If this feature is enabled, the component is notified of the dragged item’s leaving, and the child component to which the dragged item is dropped is notified of the item’s entering. This configuration is related to a specific UI instance. You can pass in a specific component node on the current UI instance for association. |
int32_t OH_ArkUI_SetDragEventStrictReportWithContext (ArkUI_ContextHandle uiContext, bool enabled) | Sets whether to enable strict reporting on drag events. This feature is disabled by default, and you are advised to enable it. If this feature is disabled, the parent component is not notified when an item in it is dragged over its child component. If this feature is enabled, the component is notified of the dragged item’s leaving, and the child component to which the dragged item is dropped is notified of the item’s entering. This configuration is related to a specific UI instance. You can pass in a specific UI instance for association. |
int32_t OH_ArkUI_SetNodeAllowedDropDataTypes (ArkUI_NodeHandle node, const char *typesArray[], int32_t count) | Sets the types of data that can be dropped to the specified component. This API resets the settings configured through OH_ArkUI_DisallowNodeAnyDropDataTypes or OH_ArkUI_AllowNodeAllDropDataTypes. |
int32_t OH_ArkUI_DisallowNodeAnyDropDataTypes (ArkUI_NodeHandle node) | Configures the specified component to disallow any data types. This API resets the settings configured through OH_ArkUI_SetNodeAllowedDropDataTypes. |
int32_t OH_ArkUI_AllowNodeAllDropDataTypes (ArkUI_NodeHandle node) | Configures the specified component to allow any data types. This API resets the settings configured through OH_ArkUI_SetNodeAllowedDropDataTypes. |
int32_t OH_ArkUI_SetNodeDraggable (ArkUI_NodeHandle node, bool enabled) | Sets whether the component is draggable. |
int32_t OH_ArkUI_SetNodeDragPreview (ArkUI_NodeHandle node, OH_PixelmapNative *preview) | Sets a custom drag preview for the specified component. |
ArkUI_DragPreviewOption * OH_ArkUI_CreateDragPreviewOption (void) | Creates an ArkUI_DragPreviewOption object. |
void OH_ArkUI_DragPreviewOption_Dispose (ArkUI_DragPreviewOption *option) | Disposes of an ArkUI_DragPreviewOption object. |
int32_t OH_ArkUI_DragPreviewOption_SetScaleMode (ArkUI_DragPreviewOption *option, ArkUI_DragPreviewScaleMode scaleMode) | Sets the scale mode for an ArkUI_DragPreviewOption object. |
int32_t OH_ArkUI_DragPreviewOption_SetDefaultShadowEnabled (ArkUI_DragPreviewOption *option, bool enabled) | Sets whether to enable the shadow effect for an ArkUI_DragPreviewOption object. The shadow effect is enabled by default. |
int32_t OH_ArkUI_DragPreviewOption_SetDefaultRadiusEnabled (ArkUI_DragPreviewOption *option, bool enabled) | Sets whether to enable the rounded corner effect for an ArkUI_DragPreviewOption object. The rounded corner effect is enabled by default. |
int32_t OH_ArkUI_DragPreviewOption_SetNumberBadgeEnabled (ArkUI_DragPreviewOption *option, bool enabled) | Sets whether to enable the badge for an ArkUI_DragPreviewOption object. If this feature is enabled, a badge that contains the number of dragged items is displayed. |
int32_t OH_ArkUI_DragPreviewOption_SetBadgeNumber (ArkUI_DragPreviewOption *option, uint32_t forcedNumber) | Sets the count on the badge. The settings will overwrite the value in the SetDragPreviewNumberBadgeEnabled API. |
int32_t OH_ArkUI_DragPreviewOption_SetDefaultAnimationBeforeLiftingEnabled (ArkUI_DragPreviewOption *option, bool enabled) | Sets whether to enable the default animation on a click or touch. |
int32_t OH_ArkUI_SetNodeDragPreviewOption (ArkUI_NodeHandle node, ArkUI_DragPreviewOption *option) | Sets an ArkUI_DragPreviewOption object for the specified component. |
ArkUI_DragAction * OH_ArkUI_CreateDragActionWithNode (ArkUI_NodeHandle node) | Creates a drag action object. The object needs to be associated with a UI instance, which can be specified by passing in a component node of the current UI instance. |
ArkUI_DragAction * OH_ArkUI_CreateDragActionWithContext (ArkUI_ContextHandle uiContext) | Creates a drag action object for the specified UI instance. |
void OH_ArkUI_DragAction_Dispose (ArkUI_DragAction *dragAction) | Disposes of an ArkUI_DragAction object. |
int32_t OH_ArkUI_DragAction_SetPointerId (ArkUI_DragAction *dragAction, int32_t pointer) | Sets the pointer ID. If only one finger is operating on the screen, the pointer ID is 0. In general cases, you can set the pointer ID to 0. |
int32_t OH_ArkUI_DragAction_SetPixelMaps (ArkUI_DragAction *dragAction, OH_PixelmapNative *pixelmapArray[], int32_t size) | Sets the drag previews for a drag action. |
int32_t OH_ArkUI_DragAction_SetTouchPointX (ArkUI_DragAction *dragAction, float x) | Sets the touch point relative to the upper left corner of the first drag preview (pixel map). |
int32_t OH_ArkUI_DragAction_SetTouchPointY (ArkUI_DragAction *dragAction, float y) | Sets the touch point relative to the upper left corner of the first drag preview (pixel map). |
int32_t OH_ArkUI_DragAction_SetData (ArkUI_DragAction *dragAction, OH_UdmfData *data) | Sets the drag data. |
int32_t OH_ArkUI_DragAction_SetDragPreviewOption (ArkUI_DragAction *dragAction, ArkUI_DragPreviewOption *option) | Sets an ArkUI_DragPreviewOption object for the specified drag action object. |
int32_t OH_ArkUI_DragAction_RegisterStatusListener (ArkUI_DragAction *dragAction, void *userData, void(*listener)(ArkUI_DragAndDropInfo *dragAndDropInfo, void *userData)) | Registers a drag status listener. This listener can be used to check whether the data is successfully received and processed. |
void OH_ArkUI_DragAction_UnregisterStatusListener (ArkUI_DragAction *dragAction) | Unregisters a drag status listener. |
ArkUI_DragStatus OH_ArkUI_DragAndDropInfo_GetDragStatus (ArkUI_DragAndDropInfo *dragAndDropInfo) | Obtains the drag status of a drag action. |
ArkUI_DragEvent * OH_ArkUI_DragAndDropInfo_GetDragEvent (ArkUI_DragAndDropInfo *dragAndDropInfo) | Obtains a drag event based on the specified drag and drop information. The drag event can then be used to obtain the drag result. |
int32_t OH_ArkUI_StartDrag (ArkUI_DragAction *dragAction) | Initiates a drag action through the specified DragAction object. |
int32_t OH_ArkUI_DragEvent_StartDataLoading (ArkUI_DragEvent* event, OH_UdmfGetDataParams* options, char* key, unsigned int keyLen) | Sets whether to enable data prefetching for drag and drop operations on a specified node. |
int32_t OH_ArkUI_CancelDataLoading (ArkUI_Context uiContext, const char* key) | Cancels the asynchronous obtaining of drag data. |
int32_t OH_ArkUI_DisableDropDataPrefetchOnNode (ArkUI_NodeHandle node, bool disable) | Sets whether to enable data prefetching for drag and drop operations on a specified node. The value true means to disable data prefetching, and false means to enable data prefetching. The default value is false. |
int32_t OH_ArkUI_DragEvent_RequestDragEndPending(ArkUI_DragEvent* event, int32_t* requestIdentify) | Requests a delayed execution of the end of the drag and drop operation. |
int32_t OH_ArkUI_NotifyDragResult(int32_t requestIdentify, ArkUI_DragResult * result) | Notifies the system of the drag result. |
int32_t OH_ArkUI_NotifyDragEndPendingDone(int32_t requestIdentify) | Notifies that the drag delay execution is complete. |
你可能感兴趣的鸿蒙文章
harmony 鸿蒙ARKUI_TextPickerCascadeRangeContent
harmony 鸿蒙ARKUI_TextPickerRangeContent
harmony 鸿蒙ArkUI_AnimateCompleteCallback
harmony 鸿蒙ArkUI_ContextCallback
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦