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 INTERFACE_ACCESSIBLE_ABILITY_CLIENT_H 17 #define INTERFACE_ACCESSIBLE_ABILITY_CLIENT_H 18 19 #include "accessibility_element_info.h" 20 #include "accessibility_event_info.h" 21 #include "i_accessible_ability_channel.h" 22 #include "iremote_broker.h" 23 #include "key_event.h" 24 25 namespace OHOS { 26 namespace Accessibility { 27 class IAccessibleAbilityClient : public IRemoteBroker { 28 public: 29 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.accessibility.IAccessibleAbilityClient"); 30 31 /** 32 * @brief Init accessible ability. 33 * @param channel The object of IAccessibleAbilityChannel. 34 * @param channelId The id of channel. 35 */ 36 virtual void Init(const sptr<IAccessibleAbilityChannel> &channel, const int32_t channelId) = 0; 37 38 /** 39 * @brief Disconnect accessible ability. 40 * @param channelId The id of channel. 41 */ 42 virtual void Disconnect(const int32_t channelId) = 0; 43 44 /** 45 * @brief Called when an accessibility event occurs. 46 * @param eventInfo The information of accessible event. 47 */ 48 virtual void OnAccessibilityEvent(const AccessibilityEventInfo &eventInfo) = 0; 49 50 /** 51 * @brief Called when a key event occurs. 52 * @param keyEvent Indicates the key event to send. 53 * @param sequence The sequence of the key event. 54 */ 55 virtual void OnKeyPressEvent(const MMI::KeyEvent &keyEvent, const int32_t sequence) = 0; 56 }; 57 } // namespace Accessibility 58 } // namespace OHOS 59 #endif // INTERFACE_ACCESSIBLE_ABILITY_CLIENT_H