1 /*
2  * Copyright (C) 2022 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 ACCESSIBLE_ABILITY_CHANNEL_STUB_H
17 #define ACCESSIBLE_ABILITY_CHANNEL_STUB_H
18 
19 #include "i_accessible_ability_channel.h"
20 #include "iremote_stub.h"
21 
22 namespace OHOS {
23 namespace Accessibility {
24 class AccessibleAbilityChannelStub : public IRemoteStub<IAccessibleAbilityChannel> {
25 public:
26     /**
27      * @brief construct function
28      * @param object The object of IPC
29      */
30     AccessibleAbilityChannelStub();
31 
32     /**
33      * @brief destruct function
34      */
35     virtual ~AccessibleAbilityChannelStub();
36 
37     /**
38      * @brief Receive the event from proxy by IPC mechanism.
39      * @param code The code is matched with the process function.
40      * @param data The data of process communication
41      * @param reply The response of IPC request
42      * @param option The option parameter of IPC,such as: async,sync
43      */
44     virtual int OnRemoteRequest(uint32_t code, MessageParcel &data,
45         MessageParcel &reply, MessageOption &option) override;
46 private:
47     /**
48      * @brief Handle the IPC request for the function:HandleSearchElementInfoByAccessibilityId.
49      * @param data The data of process communication
50      * @param reply The response of IPC request
51      * @return NO_ERROR: successful; otherwise is failed.
52      */
53     ErrCode HandleSearchElementInfoByAccessibilityId(MessageParcel &data, MessageParcel &reply);
54 
55     /**
56      * @brief Handle the IPC request for the function:HandleSearchElementInfosByText.
57      * @param data The data of process communication
58      * @param reply The response of IPC request
59      * @return NO_ERROR: successful; otherwise is failed.
60      */
61     ErrCode HandleSearchElementInfosByText(MessageParcel &data, MessageParcel &reply);
62 
63     /**
64      * @brief Handle the IPC request for the function:HandleFindFocusedElementInfo.
65      * @param data The data of process communication
66      * @param reply The response of IPC request
67      * @return NO_ERROR: successful; otherwise is failed.
68      */
69     ErrCode HandleFindFocusedElementInfo(MessageParcel &data, MessageParcel &reply);
70 
71     /**
72      * @brief Handle the IPC request for the function:HandleFocusMoveSearch.
73      * @param data The data of process communication
74      * @param reply The response of IPC request
75      * @return NO_ERROR: successful; otherwise is failed.
76      */
77     ErrCode HandleFocusMoveSearch(MessageParcel &data, MessageParcel &reply);
78 
79     /**
80      * @brief Handle the IPC request for the function:HandleExecuteAction.
81      * @param data The data of process communication
82      * @param reply The response of IPC request
83      * @return NO_ERROR: successful; otherwise is failed.
84      */
85     ErrCode HandleExecuteAction(MessageParcel &data, MessageParcel &reply);
86 
87     /**
88      * @brief Handle the IPC request for the function:HandleEnableScreenCurtain.
89      * @param data The data of process communication
90      * @param reply The response of IPC request
91      * @return NO_ERROR: successful; otherwise is failed.
92      */
93     ErrCode HandleEnableScreenCurtain(MessageParcel &data, MessageParcel &reply);
94 
95     /**
96      * @brief Handle the IPC request for the function:HandleGetWindow.
97      * @param data The data of process communication
98      * @param reply The response of IPC request
99      * @return NO_ERROR: successful; otherwise is failed.
100      */
101     ErrCode HandleGetWindow(MessageParcel &data, MessageParcel &reply);
102 
103     /**
104      * @brief Handle the IPC request for the function:HandleGetWindows.
105      * @param data The data of process communication
106      * @param reply The response of IPC request
107      * @return NO_ERROR: successful; otherwise is failed.
108      */
109     ErrCode HandleGetWindows(MessageParcel &data, MessageParcel &reply);
110 
111     /**
112      * @brief Handle the IPC request for the function:HandleGetWindows.
113      * @param data The data of process communication
114      * @param reply The response of IPC request
115      * @return NO_ERROR: successful; otherwise is failed.
116      */
117     ErrCode HandleGetWindowsByDisplayId(MessageParcel &data, MessageParcel &reply);
118 
119     /**
120      * @brief Handle the IPC request for the function:HandleSetOnKeyPressEventResult.
121      * @param data The data of process communication
122      * @param reply The response of IPC request
123      * @return NO_ERROR: successful; otherwise is failed.
124      */
125     ErrCode HandleSetOnKeyPressEventResult(MessageParcel &data, MessageParcel &reply);
126 
127     /**
128      * @brief Handle the IPC request for the function:HandleSendSimulateGesturePath.
129      * @param data The data of process communication
130      * @param reply The response of IPC request
131      * @return NO_ERROR: successful; otherwise is failed.
132      */
133     ErrCode HandleSendSimulateGesturePath(MessageParcel &data, MessageParcel &reply);
134 
135     /**
136      * @brief Handle the IPC request for the function:HandleSetTargetBundleName.
137      * @param data The data of process communication
138      * @param reply The response of IPC request
139      * @return NO_ERROR: successful; otherwise is failed.
140      */
141     ErrCode HandleSetTargetBundleName(MessageParcel &data, MessageParcel &reply);
142 
143     /**
144      * @brief Handle the IPC request for the function:HandleGetCursorPosition.
145      * @param data The data of process communication
146      * @param reply The response of IPC request
147      * @return NO_ERROR: successful; otherwise is failed.
148      */
149     ErrCode HandleGetCursorPosition(MessageParcel &data, MessageParcel &reply);
150 
151     using AccessibleAbilityConnectionFunc =
152         ErrCode (AccessibleAbilityChannelStub::*)(MessageParcel &data, MessageParcel &reply);
153 };
154 } // namespace Accessibility
155 } // namespace OHOS
156 #endif // ACCESSIBLE_ABILITY_CHANNEL_STUB_H