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_ABILITY_MANAGER_SERVICE_CLIENT_STUB_H 17 #define ACCESSIBILITY_ABILITY_MANAGER_SERVICE_CLIENT_STUB_H 18 19 #include <cstdint> 20 #include "accessibility_ability_info.h" 21 #include "accessible_ability_manager_service_state_interface.h" 22 #include "accessible_ability_manager_service_caption_property_interface.h" 23 #include "accessible_ability_manager_service_interface.h" 24 #include "accessibility_event_info.h" 25 #include "accessibility_errorcode.h" 26 #include "iremote_object.h" 27 #include "iremote_stub.h" 28 #include "nocopyable.h" 29 #include "element_name.h" 30 31 namespace OHOS { 32 namespace Accessibility { 33 /* 34 * The class define the interface to call ABMS API. 35 */ 36 class AccessibleAbilityManagerServiceClientStub : public IRemoteStub<IAccessibleAbilityManagerServiceClient> { 37 public: 38 /** 39 * @brief construct function 40 * @param object The object of IPC 41 * @return 42 */ 43 AccessibleAbilityManagerServiceClientStub(); 44 45 /** 46 * @brief destruct function 47 * @param 48 * @return 49 */ 50 virtual ~AccessibleAbilityManagerServiceClientStub(); 51 52 /** 53 * @brief Receive the event from proxy by IPC mechanism. 54 * @param code The code is matched with the process function. 55 * @param data The data of process communication 56 * @param reply The response of IPC request 57 * @param option The option parameter of IPC,such as: async,sync 58 * @return 59 */ 60 virtual int OnRemoteRequest( 61 uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) override; 62 private: 63 /** 64 * @brief Handle the IPC request for the function:HandleSendEvent. 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 HandleSendEvent(MessageParcel& data, MessageParcel& reply); 70 71 /** 72 * @brief Handle the IPC request for the function:HandleRegisterStateCallback. 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 HandleRegisterStateCallback(MessageParcel& data, MessageParcel& reply); 78 79 /** 80 * @brief Handle the IPC request for the function:HandleGetAbilityList. 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 HandleGetAbilityList(MessageParcel& data, MessageParcel& reply); 86 87 /** 88 * @brief Handle the IPC request for the function:HandleRegisterAccessibilityElementOperator. 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 HandleRegisterAccessibilityElementOperator(MessageParcel& data, MessageParcel& reply); 94 95 /** 96 * @brief Handle the IPC request for the function:HandleDeregisterAccessibilityElementOperator. 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 HandleDeregisterAccessibilityElementOperator(MessageParcel& data, MessageParcel& reply); 102 103 ErrCode HandleGetEnabledEventMask(MessageParcel& data, MessageParcel& reply); 104 ErrCode HandleGetCaptionProperty(MessageParcel& data, MessageParcel& reply); 105 ErrCode HandleSetCaptionProperty(MessageParcel& data, MessageParcel& reply); 106 ErrCode HandleSetCaptionState(MessageParcel& data, MessageParcel& reply); 107 ErrCode HandleSetEnabled(MessageParcel& data, MessageParcel& reply); 108 ErrCode HandleRegisterCaptionPropertyCallback(MessageParcel& data, MessageParcel& reply); 109 110 ErrCode HandleGetEnabled(MessageParcel& data, MessageParcel& reply); 111 ErrCode HandleGetCaptionState(MessageParcel& data, MessageParcel& reply); 112 ErrCode HandleGetTouchGuideState(MessageParcel& data, MessageParcel& reply); 113 ErrCode HandleGetGestureState(MessageParcel& data, MessageParcel& reply); 114 ErrCode HandleGetKeyEventObserverState(MessageParcel& data, MessageParcel& reply); 115 116 ErrCode HandleSetTouchGuideState(MessageParcel& data, MessageParcel& reply); 117 ErrCode HandleSetGestureState(MessageParcel& data, MessageParcel& reply); 118 ErrCode HandleSetKeyEventObserverState(MessageParcel& data, MessageParcel& reply); 119 120 ErrCode HandleSetEnabledObj(MessageParcel& data, MessageParcel& reply); 121 ErrCode HandleGetEnabledAbilities(MessageParcel& data, MessageParcel& reply); 122 ErrCode HandleGetInstalledAbilities(MessageParcel& data, MessageParcel& reply); 123 124 ErrCode HandleDisableAbilities(MessageParcel& data, MessageParcel& reply); 125 ErrCode HandleRegisterUITestAbilityConnectionClient(MessageParcel& data, MessageParcel& reply); 126 ErrCode HandleDeregisterUITestAbilityConnectionClient(MessageParcel& data, MessageParcel& reply); 127 ErrCode HandleGetActiveWindow(MessageParcel& data, MessageParcel& reply); 128 129 using AccessibilityAbilityManagerServiceFunc = ErrCode (AccessibleAbilityManagerServiceClientStub::*)( 130 MessageParcel& data, MessageParcel& reply); 131 std::map<uint32_t, AccessibilityAbilityManagerServiceFunc> memberFuncMap_; 132 133 DISALLOW_COPY_AND_MOVE(AccessibleAbilityManagerServiceClientStub); 134 }; 135 } // namespace Accessibility 136 } // namespace OHOS 137 #endif