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 23 namespace OHOS { 24 namespace Accessibility { 25 /* 26 * The class define the interface for UI to implement. 27 * It triggered by ABMS when AA to request the accessibility information. 28 */ 29 class AccessibilityElementOperatorCallbackStub : public IRemoteStub<IAccessibilityElementOperatorCallback> { 30 public: 31 /** 32 * @brief construct function 33 * @param object The object of IPC 34 */ 35 AccessibilityElementOperatorCallbackStub(); 36 37 /** 38 * @brief destruct function 39 */ 40 virtual ~AccessibilityElementOperatorCallbackStub(); 41 42 /** 43 * @brief Receive the event from proxy by IPC mechanism. 44 * @param code The code is matched with the process function. 45 * @param data The data of process communication 46 * @param reply The response of IPC request 47 * @param option The option parameter of IPC,such as: async,sync 48 */ 49 virtual int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, 50 MessageOption &option) override; 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 HandleSetSearchElementInfoByAccessibilityIdResult(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 HandleSetSearchElementInfoByTextResult(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 HandleSetFindFocusedElementInfoResult(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 HandleSetFocusMoveSearchResult(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 HandleSetExecuteActionResult(MessageParcel &data, MessageParcel &reply); 91 92 using AccessibilityElementOperatorCallbackFunc = 93 ErrCode (AccessibilityElementOperatorCallbackStub::*)(MessageParcel &data, MessageParcel &reply); 94 std::map<uint32_t, AccessibilityElementOperatorCallbackFunc> memberFuncMap_; 95 }; 96 } // namespace Accessibility 97 } // namespace OHOS 98 #endif // ACCESSIBILITY_ELEMENT_OPERATOR_CALLBACK_STUB_H