• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 ARK_WEB_MOUSE_EVENT_H_
17 #define ARK_WEB_MOUSE_EVENT_H_
18 #pragma once
19 
20 #include "base/include/ark_web_base_ref_counted.h"
21 
22 #include "base/include/ark_web_types.h"
23 
24 namespace OHOS::ArkWeb {
25 
26 /*--ark web(source=webview)--*/
27 class ArkWebMouseEvent : public virtual ArkWebBaseRefCounted {
28 public:
29     /**
30      * @Description: Get mouse x coordinate.
31      * @Return: return x coordinate.
32      * @Since: 12005
33      */
34     /*--ark web()--*/
35     virtual int32_t GetX() = 0;
36 
37     /**
38      * @Description: Get mouse y coordinate.
39      * @Return: return y coordinate.
40      * @Since: 12005
41      */
42     /*--ark web()--*/
43     virtual int32_t GetY() = 0;
44 
45     /**
46      * @Description: Get mouse button type.
47      * @Return: return button type.
48      * @Since: 12005
49      */
50     /*--ark web()--*/
51     virtual int32_t GetButton() = 0;
52 
53     /**
54      * @Description: Get mouse action.
55      * @Return: return action type.
56      * @Since: 12005
57      */
58     /*--ark web()--*/
59     virtual int32_t GetAction() = 0;
60 
61     /**
62      * @Description: Get mouse click num.
63      * @Return: return click num.
64      * @Since: 12005
65      */
66     /*--ark web()--*/
67     virtual int32_t GetClickNum() = 0;
68 
69     /**
70      * @Description: Get current pressed keyCode.
71      * @Return: return press key codes.
72      * @Since: 12005
73      */
74     /*--ark web()--*/
75     virtual ArkWebInt32Vector GetPressKeyCodes() = 0;
76 
77     /**
78      * @Description: Get raw mouse x coordinate.
79      * @Return: return raw x coordinate.
80      */
81     /*--ark web()--*/
82     virtual int32_t GetRawX() = 0;
83 
84     /**
85      * @Description: Get raw mouse y coordinate.
86      * @Return: return raw y coordinate.
87      */
88     /*--ark web()--*/
89     virtual int32_t GetRawY() = 0;
90 };
91 
92 } // namespace OHOS::ArkWeb
93 
94 #endif // ARK_WEB_MOUSE_EVENT_H_
95