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_CLIENT_STUB_H 17 #define ACCESSIBLE_ABILITY_CLIENT_STUB_H 18 19 #include <cstdint> 20 #include <map> 21 #include "accessible_ability_client_interface.h" 22 #include "accessibility_errorcode.h" 23 #include "iremote_stub.h" 24 #include "message_parcel.h" 25 #include "message_option.h" 26 #include "hilog_wrapper.h" 27 28 namespace OHOS { 29 namespace Accessibility { 30 class AccessibleAbilityClientStub : public IRemoteStub<IAccessibleAbilityClient> { 31 public: 32 AccessibleAbilityClientStub(); 33 virtual ~AccessibleAbilityClientStub(); 34 35 virtual int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, 36 MessageOption &option) override; 37 38 private: 39 ErrCode HandleInit(MessageParcel &data, MessageParcel &reply); 40 ErrCode HandleDisconnect(MessageParcel &data, MessageParcel &reply); 41 ErrCode HandleOnAccessibilityEvent(MessageParcel &data, MessageParcel &reply); 42 ErrCode HandleOnKeyPressEvent(MessageParcel &data, MessageParcel &reply); 43 ErrCode HandleOnDisplayResized(MessageParcel &data, MessageParcel &reply); 44 ErrCode HandleOnGestureSimulateResult(MessageParcel &data, MessageParcel &reply); 45 46 using AccessibleAbilityClientFunc = 47 ErrCode (AccessibleAbilityClientStub::*)(MessageParcel &data, MessageParcel &reply); 48 std::map<uint32_t, AccessibleAbilityClientFunc> memberFuncMap_; 49 50 DISALLOW_COPY_AND_MOVE(AccessibleAbilityClientStub); 51 }; 52 } // namespace Accessibility 53 } // namespace OHOS 54 #endif // ACCESSIBLE_ABILITY_CLIENT_STUB_H