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 #include "accessibility_settings_config.h" 17 #include "hilog_wrapper.h" 18 19 namespace OHOS { 20 namespace Accessibility { AccessibilitySettingsConfig(int32_t id)21AccessibilitySettingsConfig::AccessibilitySettingsConfig(int32_t id) 22 { 23 HILOG_DEBUG("start."); 24 accountId_ = id; 25 } 26 SetEnabled(const bool state)27bool AccessibilitySettingsConfig::SetEnabled(const bool state) 28 { 29 HILOG_DEBUG("start."); 30 enabled_ = state; 31 return true; 32 } 33 SetTouchGuideState(const bool state)34bool AccessibilitySettingsConfig::SetTouchGuideState(const bool state) 35 { 36 HILOG_DEBUG("start."); 37 eventTouchGuideState_ = state; 38 return true; 39 } 40 SetGestureState(const bool state)41bool AccessibilitySettingsConfig::SetGestureState(const bool state) 42 { 43 HILOG_DEBUG("start."); 44 gesturesSimulation_ = state; 45 return true; 46 } 47 SetKeyEventObserverState(const bool state)48bool AccessibilitySettingsConfig::SetKeyEventObserverState(const bool state) 49 { 50 HILOG_DEBUG("start."); 51 filteringKeyEvents_ = state; 52 return true; 53 } 54 55 SetCaptionState(const bool state)56RetError AccessibilitySettingsConfig::SetCaptionState(const bool state) 57 { 58 HILOG_DEBUG("start."); 59 isCaptionState_ = state; 60 return RET_OK; 61 } 62 SetScreenMagnificationState(const bool state)63RetError AccessibilitySettingsConfig::SetScreenMagnificationState(const bool state) 64 { 65 HILOG_DEBUG("start."); 66 isScreenMagnificationState_ = state; 67 return RET_OK; 68 } 69 SetShortKeyState(const bool state)70RetError AccessibilitySettingsConfig::SetShortKeyState(const bool state) 71 { 72 HILOG_DEBUG("start."); 73 isShortKeyState_ = state; 74 return RET_OK; 75 } 76 SetMouseKeyState(const bool state)77RetError AccessibilitySettingsConfig::SetMouseKeyState(const bool state) 78 { 79 HILOG_DEBUG("start."); 80 isMouseKeyState_ = state; 81 return RET_OK; 82 } 83 SetMouseAutoClick(const int32_t time)84RetError AccessibilitySettingsConfig::SetMouseAutoClick(const int32_t time) 85 { 86 HILOG_DEBUG("start."); 87 mouseAutoClick_ = time; 88 return RET_OK; 89 } 90 SetShortkeyTarget(const std::string & name)91RetError AccessibilitySettingsConfig::SetShortkeyTarget(const std::string &name) 92 { 93 HILOG_DEBUG("start."); 94 shortkeyTarget_ = name; 95 return RET_OK; 96 } 97 SetHighContrastTextState(const bool state)98RetError AccessibilitySettingsConfig::SetHighContrastTextState(const bool state) 99 { 100 HILOG_DEBUG("start."); 101 highContrastTextState_ = state; 102 return RET_OK; 103 } 104 SetInvertColorState(const bool state)105RetError AccessibilitySettingsConfig::SetInvertColorState(const bool state) 106 { 107 HILOG_DEBUG("start."); 108 invertColorState_ = state; 109 return RET_OK; 110 } 111 SetAnimationOffState(const bool state)112RetError AccessibilitySettingsConfig::SetAnimationOffState(const bool state) 113 { 114 HILOG_DEBUG("start."); 115 animationOffState_ = state; 116 return RET_OK; 117 } 118 SetAudioMonoState(const bool state)119RetError AccessibilitySettingsConfig::SetAudioMonoState(const bool state) 120 { 121 HILOG_DEBUG("start."); 122 audioMonoState_ = state; 123 return RET_OK; 124 } 125 SetDaltonizationColorFilter(const uint32_t filter)126RetError AccessibilitySettingsConfig::SetDaltonizationColorFilter(const uint32_t filter) 127 { 128 HILOG_DEBUG("start."); 129 daltonizationColorFilter_ = filter; 130 return RET_OK; 131 } 132 SetContentTimeout(const uint32_t time)133RetError AccessibilitySettingsConfig::SetContentTimeout(const uint32_t time) 134 { 135 HILOG_DEBUG("start."); 136 contentTimeout_ = time; 137 return RET_OK; 138 } 139 SetBrightnessDiscount(const float discount)140RetError AccessibilitySettingsConfig::SetBrightnessDiscount(const float discount) 141 { 142 HILOG_DEBUG("start."); 143 brightnessDiscount_ = discount; 144 return RET_OK; 145 } 146 SetAudioBalance(const float balance)147RetError AccessibilitySettingsConfig::SetAudioBalance(const float balance) 148 { 149 HILOG_DEBUG("start."); 150 audioBalance_ = balance; 151 return RET_OK; 152 } 153 SetCaptionProperty(const AccessibilityConfig::CaptionProperty & caption)154RetError AccessibilitySettingsConfig::SetCaptionProperty(const AccessibilityConfig::CaptionProperty& caption) 155 { 156 HILOG_DEBUG("start."); 157 captionProperty_ = caption; 158 return RET_OK; 159 } 160 SetStatePref(int32_t type)161bool AccessibilitySettingsConfig::SetStatePref(int32_t type) 162 { 163 HILOG_DEBUG("start."); 164 (void)type; 165 return true; 166 } 167 StateChange(bool state)168std::string AccessibilitySettingsConfig::StateChange(bool state) 169 { 170 HILOG_DEBUG("start."); 171 std::string STATE_TRUE = "on"; 172 return STATE_TRUE; 173 } 174 GetCaptionState() const175bool AccessibilitySettingsConfig::GetCaptionState() const 176 { 177 return isCaptionState_; 178 } 179 GetScreenMagnificationState() const180bool AccessibilitySettingsConfig::GetScreenMagnificationState() const 181 { 182 return isScreenMagnificationState_; 183 } 184 GetShortKeyState() const185bool AccessibilitySettingsConfig::GetShortKeyState() const 186 { 187 return isShortKeyState_; 188 } 189 GetMouseKeyState() const190bool AccessibilitySettingsConfig::GetMouseKeyState() const 191 { 192 return isMouseKeyState_; 193 } 194 GetMouseAutoClick() const195int32_t AccessibilitySettingsConfig::GetMouseAutoClick() const 196 { 197 return mouseAutoClick_; 198 } 199 GetShortkeyTarget() const200const std::string &AccessibilitySettingsConfig::GetShortkeyTarget() const 201 { 202 return shortkeyTarget_; 203 } 204 GetHighContrastTextState() const205bool AccessibilitySettingsConfig::GetHighContrastTextState() const 206 { 207 return highContrastTextState_; 208 } 209 GetInvertColorState() const210bool AccessibilitySettingsConfig::GetInvertColorState() const 211 { 212 return invertColorState_; 213 } 214 GetAnimationOffState() const215bool AccessibilitySettingsConfig::GetAnimationOffState() const 216 { 217 return animationOffState_; 218 } 219 GetAudioMonoState() const220bool AccessibilitySettingsConfig::GetAudioMonoState() const 221 { 222 return audioMonoState_; 223 } 224 GetDaltonizationColorFilter() const225uint32_t AccessibilitySettingsConfig::GetDaltonizationColorFilter() const 226 { 227 return daltonizationColorFilter_; 228 } 229 GetContentTimeout() const230uint32_t AccessibilitySettingsConfig::GetContentTimeout() const 231 { 232 return contentTimeout_; 233 } 234 GetBrightnessDiscount() const235float AccessibilitySettingsConfig::GetBrightnessDiscount() const 236 { 237 return brightnessDiscount_; 238 } 239 GetAudioBalance() const240float AccessibilitySettingsConfig::GetAudioBalance() const 241 { 242 return audioBalance_; 243 } 244 GetEnabledState() const245bool AccessibilitySettingsConfig::GetEnabledState() const 246 { 247 return enabled_; 248 } 249 GetTouchGuideState() const250bool AccessibilitySettingsConfig::GetTouchGuideState() const 251 { 252 return eventTouchGuideState_; 253 } 254 GetGestureState() const255bool AccessibilitySettingsConfig::GetGestureState() const 256 { 257 return gesturesSimulation_; 258 } 259 GetKeyEventObserverState() const260bool AccessibilitySettingsConfig::GetKeyEventObserverState() const 261 { 262 return filteringKeyEvents_; 263 } 264 GetCaptionProperty() const265const AccessibilityConfig::CaptionProperty &AccessibilitySettingsConfig::GetCaptionProperty() const 266 { 267 return captionProperty_; 268 }; 269 GetConfigState()270uint32_t AccessibilitySettingsConfig::GetConfigState() 271 { 272 HILOG_DEBUG("start."); 273 uint32_t state = 0; 274 275 return state; 276 } 277 InitCaption()278void AccessibilitySettingsConfig::InitCaption() 279 { 280 HILOG_DEBUG("start."); 281 } 282 InitSetting()283void AccessibilitySettingsConfig::InitSetting() 284 { 285 HILOG_DEBUG("start."); 286 } 287 InitCapability()288void AccessibilitySettingsConfig::InitCapability() 289 { 290 HILOG_DEBUG("start."); 291 } 292 InitEnabledList()293void AccessibilitySettingsConfig::InitEnabledList() 294 { 295 HILOG_DEBUG("start."); 296 } 297 Init()298void AccessibilitySettingsConfig::Init() 299 { 300 HILOG_DEBUG("start."); 301 } 302 VectorToString(const std::vector<std::string> & vectorVal,std::string & stringOut)303void AccessibilitySettingsConfig::VectorToString(const std::vector<std::string> &vectorVal, std::string &stringOut) 304 { 305 HILOG_DEBUG("start."); 306 } 307 StringToVector(const std::string & stringIn,std::vector<std::string> & vectorResult)308void AccessibilitySettingsConfig::StringToVector(const std::string &stringIn, std::vector<std::string> &vectorResult) 309 { 310 HILOG_DEBUG("start."); 311 } 312 GetEnabledAbilityInfos()313const std::vector<std::string> &AccessibilitySettingsConfig::GetEnabledAbilityInfos() 314 { 315 HILOG_DEBUG("start."); 316 return enabledAbilityInfos_; 317 } 318 UpdateEnabledAbilities(const std::vector<std::string> & vecvalue)319void AccessibilitySettingsConfig::UpdateEnabledAbilities(const std::vector<std::string> &vecvalue) 320 { 321 HILOG_DEBUG("start."); 322 enabledAbilityInfos_ = vecvalue; 323 } 324 ClearData()325void AccessibilitySettingsConfig::ClearData() 326 { 327 HILOG_DEBUG("start."); 328 } 329 } // namespace Accessibility 330 } // namespace OHOS