• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 ACCESSIBILITY_ELEMENT_OPERATOR_STUB_H
17 #define ACCESSIBILITY_ELEMENT_OPERATOR_STUB_H
18 
19 #include "i_accessibility_element_operator.h"
20 #include "iremote_stub.h"
21 
22 namespace OHOS {
23 namespace Accessibility {
24 /*
25 * The class define the interface for UI to implement.
26 * It is triggered by ABMS when AA to request the accessibility information.
27 */
28 class AccessibilityElementOperatorStub : public IRemoteStub<IAccessibilityElementOperator> {
29 public:
30     /**
31      * @brief construct function
32      * @param object The object of IPC
33      */
34     AccessibilityElementOperatorStub();
35 
36     /**
37      * @brief destruct function
38      */
39     virtual ~AccessibilityElementOperatorStub();
40 
41     /**
42      * @brief Receive the event from proxy by IPC mechanism.
43      * @param code The code is matched with the process function.
44      * @param data The data of process communication
45      * @param reply The response of IPC request
46      * @param option The option parameter of IPC,such as: async,sync
47      */
48     virtual int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
49         MessageOption &option) override;
50 
51 private:
52     /**
53      * @brief Handle the IPC request for the function:SetSearchElementInfoByAccessibilityIdResult.
54      * @param data The data of process communication
55      * @param reply The response of IPC request
56      * @return NO_ERROR: successful; otherwise is failed.
57      */
58     ErrCode HandleSearchElementInfoByAccessibilityId(MessageParcel &data, MessageParcel &reply);
59 
60     /**
61      * @brief Handle the IPC request for the function:SetSearchElementInfoByTextResult.
62      * @param data The data of process communication
63      * @param reply The response of IPC request
64      * @return NO_ERROR: successful; otherwise is failed.
65      */
66     ErrCode HandleSearchElementInfosByText(MessageParcel &data, MessageParcel &reply);
67 
68     /**
69      * @brief Handle the IPC request for the function:SetFindFocusedElementInfoResult.
70      * @param data The data of process communication
71      * @param reply The response of IPC request
72      * @return NO_ERROR: successful; otherwise is failed.
73      */
74     ErrCode HandleFindFocusedElementInfo(MessageParcel &data, MessageParcel &reply);
75 
76     /**
77      * @brief Handle the IPC request for the function:SetFocusMoveSearchResult.
78      * @param data The data of process communication
79      * @param reply The response of IPC request
80      * @return NO_ERROR: successful; otherwise is failed.
81      */
82     ErrCode HandleFocusFind(MessageParcel &data, MessageParcel &reply);
83 
84     /**
85      * @brief Handle the IPC request for the function:SetExecuteActionResult.
86      * @param data The data of process communication
87      * @param reply The response of IPC request
88      * @return NO_ERROR: successful; otherwise is failed.
89      */
90     ErrCode HandleExecuteAction(MessageParcel &data, MessageParcel &reply);
91 
92     /**
93      * @brief Handle the IPC request for the function:ClearFocus.
94      * @param data The data of process communication
95      * @param reply The response of IPC request
96      * @return NO_ERROR: successful; otherwise is failed.
97      */
98     ErrCode HandleClearFocus(MessageParcel &data, MessageParcel &reply);
99 
100     /**
101      * @brief Handle the IPC request for the function:OutsideTouch.
102      * @param data The data of process communication
103      * @param reply The response of IPC request
104      * @return NO_ERROR: successful; otherwise is failed.
105      */
106     ErrCode HandleOutsideTouch(MessageParcel &data, MessageParcel &reply);
107 
108     using AccessibilityElementOperatorFunc =
109         ErrCode (AccessibilityElementOperatorStub::*)(MessageParcel &data, MessageParcel &reply);
110     std::map<uint32_t, AccessibilityElementOperatorFunc> memberFuncMap_;
111 };
112 } // namespace Accessibility
113 } // namespace OHOS
114 #endif // ACCESSIBILITY_ELEMENT_OPERATOR_STUB_H