• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef _NATIVE_INTERFACE_XCOMPONENT_IMPL_
17 #define _NATIVE_INTERFACE_XCOMPONENT_IMPL_
18 
19 #include <functional>
20 #include <memory>
21 #include <string>
22 #include <unistd.h>
23 #include <vector>
24 
25 #include "interfaces/native/native_interface_accessibility.h"
26 #include "interfaces/native/native_interface_xcomponent.h"
27 #include "interfaces/native/ui_input_event.h"
28 
29 #include "base/memory/ace_type.h"
30 #include "base/utils/utils.h"
31 #include "core/accessibility/native_interface_accessibility_provider.h"
32 #include "core/components_ng/event/gesture_event_hub.h"
33 
34 using NativeXComponent_Surface_Callback = void (*)(OH_NativeXComponent*, void*);
35 
36 struct XComponentTouchPoint {
37     float tiltX = 0.0f;
38     float tiltY = 0.0f;
39     float windowX = 0.0f;
40     float windowY = 0.0f;
41     float displayX = 0.0f;
42     float displayY = 0.0f;
43     OH_NativeXComponent_TouchPointToolType sourceToolType =
44         OH_NativeXComponent_TouchPointToolType::OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN;
45 };
46 
47 struct OH_NativeXComponent_KeyEvent {
48     OH_NativeXComponent_KeyAction action = OH_NativeXComponent_KeyAction::OH_NATIVEXCOMPONENT_KEY_ACTION_UNKNOWN;
49     OH_NativeXComponent_KeyCode code = OH_NativeXComponent_KeyCode::KEY_UNKNOWN;
50     OH_NativeXComponent_EventSourceType sourceType =
51         OH_NativeXComponent_EventSourceType::OH_NATIVEXCOMPONENT_SOURCE_TYPE_UNKNOWN;
52     int64_t deviceId {};
53     int64_t timestamp {};
54     uint64_t modifierKeyStates = 0;
55     bool isNumLockOn = false;
56     bool isCapsLockOn = false;
57     bool isScrollLockOn = false;
58 };
59 
60 struct OH_NativeXComponent_ExtraMouseEventInfo {
61     uint64_t modifierKeyStates = 0;
62 };
63 
64 using OnTouchIntercept_Callback = HitTestMode (*)(OH_NativeXComponent*, ArkUI_UIInputEvent*);
65 
66 namespace OHOS::Ace {
67 class NativeXComponentImpl : public virtual AceType {
68     DECLARE_ACE_TYPE(NativeXComponentImpl, AceType);
69     using NativeXComponent_Callback = void (*)(OH_NativeXComponent*, void*);
70     using NativeXComponent_CallbackWithResult = bool (*)(OH_NativeXComponent*, void*);
71     using NativeXComponent_UIEventCallback = void (*)(
72         OH_NativeXComponent*, ArkUI_UIInputEvent*, ArkUI_UIInputEvent_Type);
73     using SetExpectedRateRangeEvent_Callback = std::function<void()>;
74     using SetOnFrameEvent_Callback = std::function<void()>;
75     using SetUnregisterOnFrameEvent_Callback = std::function<void()>;
76     using OnFrame_Callback = void (*)(OH_NativeXComponent*, uint64_t, uint64_t);
77     using NativeNode_Callback = void (*)(void*, void*);
78 
79 public:
NativeXComponentImpl()80     NativeXComponentImpl()
81     {
82         accessbilityProvider_ = std::make_shared<ArkUI_AccessibilityProvider>();
83     }
84 
~NativeXComponentImpl()85     ~NativeXComponentImpl() {}
86 
SetXComponentId(const std::string & id)87     void SetXComponentId(const std::string& id)
88     {
89         xcomponentId_ = id;
90     }
91 
GetXComponentId()92     const std::string& GetXComponentId() const
93     {
94         return xcomponentId_;
95     }
96 
SetXComponentWidth(const int width)97     void SetXComponentWidth(const int width)
98     {
99         width_ = width;
100     }
101 
GetXComponentWidth()102     int GetXComponentWidth() const
103     {
104         return width_;
105     }
106 
SetXComponentHeight(const int height)107     void SetXComponentHeight(const int height)
108     {
109         height_ = height;
110     }
111 
GetXComponentHeight()112     int GetXComponentHeight() const
113     {
114         return height_;
115     }
116 
SetXComponentOffsetX(const double x)117     void SetXComponentOffsetX(const double x)
118     {
119         x_ = x;
120     }
121 
GetXComponentOffsetX()122     double GetXComponentOffsetX() const
123     {
124         return x_;
125     }
126 
SetXComponentOffsetY(const double y)127     void SetXComponentOffsetY(const double y)
128     {
129         y_ = y;
130     }
131 
GetXComponentOffsetY()132     double GetXComponentOffsetY() const
133     {
134         return y_;
135     }
136 
SetSurface(void * window)137     void SetSurface(void* window)
138     {
139         window_ = window;
140     }
141 
GetSurface()142     const void* GetSurface() const
143     {
144         return window_;
145     }
146 
SetCallback(OH_NativeXComponent_Callback * callback)147     void SetCallback(OH_NativeXComponent_Callback* callback)
148     {
149         callback_ = callback;
150     }
151 
GetCallback()152     const OH_NativeXComponent_Callback* GetCallback() const
153     {
154         return callback_;
155     }
156 
SetMouseEventCallback(OH_NativeXComponent_MouseEvent_Callback * callback)157     void SetMouseEventCallback(OH_NativeXComponent_MouseEvent_Callback* callback)
158     {
159         mouseEventCallback_ = callback;
160     }
161 
GetMouseEventCallback()162     const OH_NativeXComponent_MouseEvent_Callback* GetMouseEventCallback()
163     {
164         return mouseEventCallback_;
165     }
166 
GetSurfaceShowCallback()167     NativeXComponent_Surface_Callback GetSurfaceShowCallback() const
168     {
169         return surfaceShowCallback_;
170     }
171 
SetSurfaceShowCallback(NativeXComponent_Surface_Callback callback)172     void SetSurfaceShowCallback(NativeXComponent_Surface_Callback callback)
173     {
174         surfaceShowCallback_ = callback;
175     }
176 
GetSurfaceHideCallback()177     NativeXComponent_Surface_Callback GetSurfaceHideCallback() const
178     {
179         return surfaceHideCallback_;
180     }
181 
SetSurfaceHideCallback(NativeXComponent_Surface_Callback callback)182     void SetSurfaceHideCallback(NativeXComponent_Surface_Callback callback)
183     {
184         surfaceHideCallback_ = callback;
185     }
186 
SetTouchEvent(const OH_NativeXComponent_TouchEvent touchEvent)187     void SetTouchEvent(const OH_NativeXComponent_TouchEvent touchEvent)
188     {
189         touchEvent_ = touchEvent;
190     }
191 
SetTouchPoint(const std::vector<XComponentTouchPoint> & xComponentTouchPoints)192     void SetTouchPoint(const std::vector<XComponentTouchPoint>& xComponentTouchPoints)
193     {
194         touchPoints_ = xComponentTouchPoints;
195     }
196 
SetHistoricalPoint(const std::vector<OH_NativeXComponent_HistoricalPoint> & historicalPoints)197     void SetHistoricalPoint(const std::vector<OH_NativeXComponent_HistoricalPoint>& historicalPoints)
198     {
199         historicalPoints_ = historicalPoints;
200     }
201 
SetKeyEvent(const OH_NativeXComponent_KeyEvent keyEvent)202     void SetKeyEvent(const OH_NativeXComponent_KeyEvent keyEvent)
203     {
204         keyEvent_ = keyEvent;
205     }
206 
SetMouseEvent(const OH_NativeXComponent_MouseEvent mouseEvent)207     void SetMouseEvent(const OH_NativeXComponent_MouseEvent mouseEvent)
208     {
209         mouseEvent_ = mouseEvent;
210     }
211 
GetTouchEvent()212     const OH_NativeXComponent_TouchEvent GetTouchEvent() const
213     {
214         return touchEvent_;
215     }
216 
GetHistoryPoints(int32_t * size,OH_NativeXComponent_HistoricalPoint ** historicalPoints)217     void GetHistoryPoints(int32_t* size, OH_NativeXComponent_HistoricalPoint** historicalPoints)
218     {
219         int32_t historicalPointsSize = (int32_t)(historicalPoints_.size());
220         *size = historicalPointsSize;
221         *historicalPoints = &(historicalPoints_[0]);
222     }
223 
GetHistoryPointsSize(int32_t * size)224     void GetHistoryPointsSize(int32_t* size) const
225     {
226         *size = (int32_t)(historicalPoints_.size());
227     }
228 
GetMouseEvent()229     const OH_NativeXComponent_MouseEvent GetMouseEvent() const
230     {
231         return mouseEvent_;
232     }
233 
SetToolType(size_t pointIndex,OH_NativeXComponent_TouchPointToolType toolType)234     void SetToolType(size_t pointIndex, OH_NativeXComponent_TouchPointToolType toolType)
235     {
236         if (pointIndex >= OH_MAX_TOUCH_POINTS_NUMBER || pointIndex >= touchPoints_.size()) {
237             return;
238         }
239         touchPoints_[pointIndex].sourceToolType = toolType;
240     }
241 
GetToolType(size_t pointIndex)242     OH_NativeXComponent_TouchPointToolType GetToolType(size_t pointIndex) const
243     {
244         if (pointIndex >= OH_MAX_TOUCH_POINTS_NUMBER || pointIndex >= touchPoints_.size()) {
245             return OH_NativeXComponent_TouchPointToolType::OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN;
246         }
247         return touchPoints_[pointIndex].sourceToolType;
248     }
249 
GetTiltX(size_t pointIndex)250     float GetTiltX(size_t pointIndex) const
251     {
252         if (pointIndex >= OH_MAX_TOUCH_POINTS_NUMBER || pointIndex >= touchPoints_.size()) {
253             return 0.0f;
254         }
255         return touchPoints_[pointIndex].tiltX;
256     }
257 
GetTiltY(size_t pointIndex)258     float GetTiltY(size_t pointIndex) const
259     {
260         if (pointIndex >= OH_MAX_TOUCH_POINTS_NUMBER || pointIndex >= touchPoints_.size()) {
261             return 0.0f;
262         }
263         return touchPoints_[pointIndex].tiltY;
264     }
265 
GetWindowX(size_t pointIndex)266     float GetWindowX(size_t pointIndex) const
267     {
268         if (pointIndex >= OH_MAX_TOUCH_POINTS_NUMBER || pointIndex >= touchPoints_.size()) {
269             return 0.0f;
270         }
271         return touchPoints_[pointIndex].windowX;
272     }
273 
GetWindowY(size_t pointIndex)274     float GetWindowY(size_t pointIndex) const
275     {
276         if (pointIndex >= OH_MAX_TOUCH_POINTS_NUMBER || pointIndex >= touchPoints_.size()) {
277             return 0.0f;
278         }
279         return touchPoints_[pointIndex].windowY;
280     }
281 
GetDisplayX(size_t pointIndex)282     float GetDisplayX(size_t pointIndex) const
283     {
284         if (pointIndex >= OH_MAX_TOUCH_POINTS_NUMBER || pointIndex >= touchPoints_.size()) {
285             return 0.0f;
286         }
287         return touchPoints_[pointIndex].displayX;
288     }
289 
GetDisplayY(size_t pointIndex)290     float GetDisplayY(size_t pointIndex) const
291     {
292         if (pointIndex >= OH_MAX_TOUCH_POINTS_NUMBER || pointIndex >= touchPoints_.size()) {
293             return 0.0f;
294         }
295         return touchPoints_[pointIndex].displayY;
296     }
297 
GetKeyEvent()298     OH_NativeXComponent_KeyEvent* GetKeyEvent()
299     {
300         return &keyEvent_;
301     }
302 
GetAccessbilityProvider()303     std::shared_ptr<ArkUI_AccessibilityProvider> GetAccessbilityProvider()
304     {
305         return accessbilityProvider_;
306     }
307 
GetFocusEventCallback()308     NativeXComponent_Callback GetFocusEventCallback() const
309     {
310         return focusEventCallback_;
311     }
312 
GetKeyEventCallback()313     NativeXComponent_Callback GetKeyEventCallback() const
314     {
315         return keyEventCallback_;
316     }
317 
GetKeyEventCallbackWithResult()318     NativeXComponent_CallbackWithResult GetKeyEventCallbackWithResult() const
319     {
320         return keyEventCallbackWithResult_;
321     }
322 
GetBlurEventCallback()323     NativeXComponent_Callback GetBlurEventCallback() const
324     {
325         return blurEventCallback_;
326     }
327 
SetOnTouchInterceptCallback(OnTouchIntercept_Callback callback)328     void SetOnTouchInterceptCallback(OnTouchIntercept_Callback callback)
329     {
330         onTouchInterceptCallback_ = callback;
331     }
332 
GetOnTouchInterceptCallback()333     OnTouchIntercept_Callback GetOnTouchInterceptCallback()
334     {
335         return onTouchInterceptCallback_;
336     }
337 
SetFocusEventCallback(NativeXComponent_Callback callback)338     void SetFocusEventCallback(NativeXComponent_Callback callback)
339     {
340         focusEventCallback_ = callback;
341     }
342 
SetKeyEventCallback(NativeXComponent_Callback callback)343     void SetKeyEventCallback(NativeXComponent_Callback callback)
344     {
345         keyEventCallback_ = callback;
346     }
347 
SetKeyEventCallbackWithResult(NativeXComponent_CallbackWithResult callback)348     void SetKeyEventCallbackWithResult(NativeXComponent_CallbackWithResult callback)
349     {
350         keyEventCallbackWithResult_ = callback;
351     }
352 
SetBlurEventCallback(NativeXComponent_Callback callback)353     void SetBlurEventCallback(NativeXComponent_Callback callback)
354     {
355         blurEventCallback_ = callback;
356     }
357 
SetUIAxisEventCallback(NativeXComponent_UIEventCallback callback)358     void SetUIAxisEventCallback(NativeXComponent_UIEventCallback callback)
359     {
360         uiAxisEventCallback_ = callback;
361     }
362 
GetUIAxisEventCallback()363     NativeXComponent_UIEventCallback GetUIAxisEventCallback() const
364     {
365         return uiAxisEventCallback_;
366     }
367 
SetOnFrameCallback(OnFrame_Callback callback)368     void SetOnFrameCallback(OnFrame_Callback callback)
369     {
370         onFrameCallback_ = callback;
371     }
372 
GetOnFrameCallback()373     OnFrame_Callback GetOnFrameCallback()
374     {
375         return onFrameCallback_;
376     }
377 
GetRateRange()378     OH_NativeXComponent_ExpectedRateRange* GetRateRange()
379     {
380         return rateRange_;
381     }
382 
SetRateRange(OH_NativeXComponent_ExpectedRateRange * rateRange)383     void SetRateRange(OH_NativeXComponent_ExpectedRateRange* rateRange)
384     {
385         rateRange_ = rateRange;
386     }
387 
SetExpectedRateRangeEventCallback(SetExpectedRateRangeEvent_Callback callback)388     void SetExpectedRateRangeEventCallback(SetExpectedRateRangeEvent_Callback callback)
389     {
390         setExpectedRateRangeCallback_ = callback;
391     }
392 
SetOnFrameEventCallback(SetOnFrameEvent_Callback callback)393     void SetOnFrameEventCallback(SetOnFrameEvent_Callback callback)
394     {
395         setOnFrameEventCallback_ = callback;
396     }
397 
SetUnregisterOnFrameEventCallback(SetUnregisterOnFrameEvent_Callback callback)398     void SetUnregisterOnFrameEventCallback(SetUnregisterOnFrameEvent_Callback callback)
399     {
400         setUnregisterOnFrameEventCallback_ = callback;
401     }
402 
403     SetExpectedRateRangeEvent_Callback setExpectedRateRangeCallback_;
404 
405     SetOnFrameEvent_Callback setOnFrameEventCallback_;
406 
407     SetUnregisterOnFrameEvent_Callback setUnregisterOnFrameEventCallback_;
408 
registerNativeNodeCallbacks(NativeNode_Callback attach,NativeNode_Callback detach)409     void registerNativeNodeCallbacks(NativeNode_Callback attach, NativeNode_Callback detach)
410     {
411         attachNativeNodeCallback_ = attach;
412         detachNativeNodeCallback_ = detach;
413     }
414 
registerContaner(void * container)415     void registerContaner(void* container)
416     {
417         container_ = container;
418     }
419 
AttachContainer(void * root)420     void AttachContainer(void* root)
421     {
422         CHECK_NULL_VOID(attachNativeNodeCallback_);
423         attachNativeNodeCallback_(container_, root);
424     }
425 
DetachContainer(void * root)426     void DetachContainer(void* root)
427     {
428         CHECK_NULL_VOID(detachNativeNodeCallback_);
429         detachNativeNodeCallback_(container_, root);
430     }
431 
SetNeedSoftKeyboard(bool needSoftKeyboard)432     void SetNeedSoftKeyboard(bool needSoftKeyboard)
433     {
434         needSoftKeyboard_ = needSoftKeyboard;
435     }
436 
IsNeedSoftKeyboard()437     bool IsNeedSoftKeyboard() const
438     {
439         return needSoftKeyboard_;
440     }
441 
SetCurrentSourceType(std::pair<int32_t,OH_NativeXComponent_EventSourceType> && curSourceType)442     void SetCurrentSourceType(std::pair<int32_t, OH_NativeXComponent_EventSourceType>&& curSourceType)
443     {
444         curSourceType_ = std::move(curSourceType);
445     }
446 
GetSourceType(int32_t pointId,OH_NativeXComponent_EventSourceType * sourceType)447     bool GetSourceType(int32_t pointId, OH_NativeXComponent_EventSourceType* sourceType) const
448     {
449         if (curSourceType_.first != pointId) {
450             return false;
451         }
452         (*sourceType) = curSourceType_.second;
453         return true;
454     }
455 
SetExtraMouseEventInfo(const OH_NativeXComponent_ExtraMouseEventInfo extraMouseEventInfo)456     void SetExtraMouseEventInfo(const OH_NativeXComponent_ExtraMouseEventInfo extraMouseEventInfo)
457     {
458         extraMouseEventInfo_ = extraMouseEventInfo;
459     }
460 
GetExtraMouseEventInfo()461     OH_NativeXComponent_ExtraMouseEventInfo* GetExtraMouseEventInfo()
462     {
463         return &extraMouseEventInfo_;
464     }
465 
466 private:
467     std::string xcomponentId_;
468     void* window_ = nullptr;
469     int width_ = 0;
470     int height_ = 0;
471     double x_ = 0.0;
472     double y_ = 0.0;
473     OH_NativeXComponent_TouchEvent touchEvent_ {};
474     OH_NativeXComponent_MouseEvent mouseEvent_ { .x = 0, .y = 0 };
475     OH_NativeXComponent_KeyEvent keyEvent_;
476     std::shared_ptr<ArkUI_AccessibilityProvider> accessbilityProvider_;
477     OH_NativeXComponent_Callback* callback_ = nullptr;
478     OH_NativeXComponent_MouseEvent_Callback* mouseEventCallback_ = nullptr;
479     NativeXComponent_Surface_Callback surfaceShowCallback_ = nullptr;
480     NativeXComponent_Surface_Callback surfaceHideCallback_ = nullptr;
481     NativeXComponent_Callback focusEventCallback_ = nullptr;
482     NativeXComponent_Callback keyEventCallback_ = nullptr;
483     NativeXComponent_CallbackWithResult keyEventCallbackWithResult_ = nullptr;
484     NativeXComponent_Callback blurEventCallback_ = nullptr;
485     NativeXComponent_UIEventCallback uiAxisEventCallback_ = nullptr;
486     std::vector<XComponentTouchPoint> touchPoints_;
487     std::vector<OH_NativeXComponent_HistoricalPoint> historicalPoints_;
488     OnFrame_Callback onFrameCallback_ = nullptr;
489     OH_NativeXComponent_ExpectedRateRange* rateRange_ = nullptr;
490     NativeNode_Callback attachNativeNodeCallback_ = nullptr;
491     NativeNode_Callback detachNativeNodeCallback_ = nullptr;
492     OnTouchIntercept_Callback onTouchInterceptCallback_ = nullptr;
493     void* container_ = nullptr;
494     bool needSoftKeyboard_ = false;
495     std::pair<int32_t, OH_NativeXComponent_EventSourceType> curSourceType_ { -1,
496         OH_NativeXComponent_EventSourceType::OH_NATIVEXCOMPONENT_SOURCE_TYPE_UNKNOWN };
497     OH_NativeXComponent_ExtraMouseEventInfo extraMouseEventInfo_;
498 };
499 } // namespace OHOS::Ace
500 
501 struct OH_NativeXComponent {
OH_NativeXComponentOH_NativeXComponent502     explicit OH_NativeXComponent(OHOS::Ace::NativeXComponentImpl* xComponentImpl) : xcomponentImpl_(xComponentImpl) {}
~OH_NativeXComponentOH_NativeXComponent503     ~OH_NativeXComponent() {}
504     int32_t GetXComponentId(char* id, uint64_t* size);
505     int32_t GetNativeWindow(void** window);
506     int32_t GetXComponentSize(const void* window, uint64_t* width, uint64_t* height);
507     int32_t GetXComponentOffset(const void* window, double* x, double* y);
508     int32_t GetTouchEvent(const void* window, OH_NativeXComponent_TouchEvent* touchEvent);
509     int32_t GetMouseEvent(const void* window, OH_NativeXComponent_MouseEvent* mouseEvent);
510     int32_t GetHistoryPoints(const void* window, int32_t* size, OH_NativeXComponent_HistoricalPoint** historicalPoints);
511     int32_t RegisterCallback(OH_NativeXComponent_Callback* callback);
512     int32_t RegisterMouseEventCallback(OH_NativeXComponent_MouseEvent_Callback* callback);
513     int32_t RegisterSurfaceShowCallback(NativeXComponent_Surface_Callback callback);
514     int32_t RegisterSurfaceHideCallback(NativeXComponent_Surface_Callback callback);
515     int32_t GetToolType(size_t pointIndex, OH_NativeXComponent_TouchPointToolType* toolType);
516     int32_t GetTiltX(size_t pointIndex, float* tiltX);
517     int32_t GetTiltY(size_t pointIndex, float* tiltY);
518     int32_t GetWindowX(size_t pointIndex, float* windowX);
519     int32_t GetWindowY(size_t pointIndex, float* windowY);
520     int32_t GetDisplayX(size_t pointIndex, float* displayX);
521     int32_t GetDisplayY(size_t pointIndex, float* displayY);
522     int32_t RegisterFocusEventCallback(void (*callback)(OH_NativeXComponent* component, void* window));
523     int32_t RegisterKeyEventCallback(void (*callback)(OH_NativeXComponent* component, void* window));
524     int32_t RegisterKeyEventCallbackWithResult(bool (*callback)(OH_NativeXComponent* component, void* window));
525     int32_t RegisterBlurEventCallback(void (*callback)(OH_NativeXComponent* component, void* window));
526     int32_t GetKeyEvent(OH_NativeXComponent_KeyEvent** keyEvent);
527     int32_t SetExpectedFrameRateRange(OH_NativeXComponent_ExpectedRateRange* range);
528     int32_t RegisterOnFrameCallback(
529         void (*callback)(OH_NativeXComponent* component, uint64_t timestamp, uint64_t targetTimestamp));
530     int32_t UnregisterOnFrameCallback();
531     int32_t AttachNativeRootNode(void* root);
532     int32_t DetachNativeRootNode(void* root);
533     int32_t RegisterUIAxisEventCallback(
534         void (*callback)(OH_NativeXComponent* component, ArkUI_UIInputEvent* event, ArkUI_UIInputEvent_Type type));
535     int32_t SetNeedSoftKeyboard(bool needSoftKeyboard);
536     int32_t RegisterOnTouchInterceptCallback(
537         HitTestMode (*callback)(OH_NativeXComponent* component, ArkUI_UIInputEvent* event));
538     int32_t GetSourceType(int32_t pointId, OH_NativeXComponent_EventSourceType* sourceType);
539     int32_t GetAccessibilityProvider(ArkUI_AccessibilityProvider** handle);
540     int32_t GetExtraMouseEventInfo(OH_NativeXComponent_ExtraMouseEventInfo** extraMouseEventInfo);
541     int32_t GetMouseEventModifierKetStates(
542         OH_NativeXComponent_ExtraMouseEventInfo* extraMouseEventInfo, uint64_t* keys);
543 
544 private:
545     OHOS::Ace::NativeXComponentImpl* xcomponentImpl_ = nullptr;
546 };
547 
548 #endif // _NATIVE_INTERFACE_XCOMPONENT_IMPL_
549