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