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 MOCK_ACCESSIBILITY_ABILITY_MANAGER_SERVICE_CLIENT_STUB_H 17 #define MOCK_ACCESSIBILITY_ABILITY_MANAGER_SERVICE_CLIENT_STUB_H 18 19 #include "accessible_ability_manager_service_stub.h" 20 21 namespace OHOS { 22 namespace Accessibility { 23 /* 24 * The class define the interface to call ABMS API. 25 */ 26 class MockAccessibleAbilityManagerServiceStub : public AccessibleAbilityManagerServiceClientStub { 27 public: MockAccessibleAbilityManagerServiceStub()28 MockAccessibleAbilityManagerServiceStub() {} ~MockAccessibleAbilityManagerServiceStub()29 ~MockAccessibleAbilityManagerServiceStub() {} 30 SendEvent(const AccessibilityEventInfo & uiEvent,const int accountId)31 void SendEvent(const AccessibilityEventInfo &uiEvent, const int accountId) {} 32 RegisterStateCallback(const sptr<IAccessibleAbilityManagerServiceState> & callback,const int accountId)33 uint32_t RegisterStateCallback(const sptr<IAccessibleAbilityManagerServiceState> &callback, const int accountId) 34 { 35 return 1; 36 } 37 GetAbilityList(const uint32_t abilityTypes,const int32_t stateType)38 std::vector<AccessibilityAbilityInfo> GetAbilityList(const uint32_t abilityTypes, const int32_t stateType) 39 { 40 std::vector<AccessibilityAbilityInfo> infos; 41 return infos; 42 } 43 RegisterElementOperator(const int windowId,const sptr<IAccessibilityElementOperator> & operation,const int accountId)44 void RegisterElementOperator(const int windowId, 45 const sptr<IAccessibilityElementOperator> &operation, const int accountId) {} 46 DeregisterElementOperator(const int windowId)47 void DeregisterElementOperator(const int windowId) {} 48 RegisterCaptionPropertyCallback(const sptr<IAccessibleAbilityManagerServiceCaptionProperty> & callback,const int accountId)49 uint32_t RegisterCaptionPropertyCallback(const sptr<IAccessibleAbilityManagerServiceCaptionProperty>& callback, 50 const int accountId) 51 { 52 return 0; 53 } 54 GetCaptionProperty()55 CaptionProperty GetCaptionProperty() 56 { 57 CaptionProperty cap; 58 return cap; 59 } 60 GetEnabledState()61 bool GetEnabledState() 62 { 63 return true; 64 } GetCaptionState()65 bool GetCaptionState() 66 { 67 return true; 68 } GetTouchGuideState()69 bool GetTouchGuideState() 70 { 71 return true; 72 } GetGestureState()73 bool GetGestureState() 74 { 75 return true; 76 } GetKeyEventObserverState()77 bool GetKeyEventObserverState() 78 { 79 return true; 80 } SetCaptionProperty(const CaptionProperty & caption)81 bool SetCaptionProperty(const CaptionProperty& caption) 82 { 83 return true; 84 } SetCaptionState(const bool state)85 bool SetCaptionState(const bool state) 86 { 87 return true; 88 } SetEnabled(const bool state)89 bool SetEnabled(const bool state) 90 { 91 return true; 92 } SetTouchGuideState(const bool state)93 bool SetTouchGuideState(const bool state) 94 { 95 return true; 96 } SetGestureState(const bool state)97 bool SetGestureState(const bool state) 98 { 99 return true; 100 } SetKeyEventObserverState(const bool state)101 bool SetKeyEventObserverState(const bool state) 102 { 103 return true; 104 } SetEnabledObj(std::map<std::string,AppExecFwk::ElementName> it)105 bool SetEnabledObj(std::map<std::string, AppExecFwk::ElementName> it) 106 { 107 return true; 108 } GetEnabledAbilities()109 std::map<std::string, AppExecFwk::ElementName> GetEnabledAbilities() 110 { 111 std::map<std::string, AppExecFwk::ElementName> test; 112 return test; 113 } GetInstalledAbilities()114 std::vector<AccessibilityAbilityInfo> GetInstalledAbilities() 115 { 116 std::vector<AccessibilityAbilityInfo> test; 117 return test; 118 } DisableAbilities(std::map<std::string,AppExecFwk::ElementName> it)119 bool DisableAbilities(std::map<std::string, AppExecFwk::ElementName> it) 120 { 121 return true; 122 } RegisterUITestAbilityConnectionClient(const sptr<IRemoteObject> & obj)123 bool RegisterUITestAbilityConnectionClient(const sptr<IRemoteObject>& obj) 124 { 125 return true; 126 } DeregisterUITestAbilityConnectionClient()127 bool DeregisterUITestAbilityConnectionClient() 128 { 129 return true; 130 } GetActiveWindow()131 int GetActiveWindow() 132 { 133 return 0; 134 } 135 private: 136 DISALLOW_COPY_AND_MOVE(MockAccessibleAbilityManagerServiceStub); 137 }; 138 } // namespace Accessibility 139 } // namespace OHOS 140 #endif