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 HILOG_DEBUG("start."); 178 return isCaptionState_; 179 } 180 GetScreenMagnificationState() const181bool AccessibilitySettingsConfig::GetScreenMagnificationState() const 182 { 183 HILOG_DEBUG("start."); 184 return isScreenMagnificationState_; 185 } 186 GetShortKeyState() const187bool AccessibilitySettingsConfig::GetShortKeyState() const 188 { 189 HILOG_DEBUG("start."); 190 return isShortKeyState_; 191 } 192 GetMouseKeyState() const193bool AccessibilitySettingsConfig::GetMouseKeyState() const 194 { 195 HILOG_DEBUG("start."); 196 return isMouseKeyState_; 197 } 198 GetMouseAutoClick() const199int32_t AccessibilitySettingsConfig::GetMouseAutoClick() const 200 { 201 HILOG_DEBUG("start."); 202 return mouseAutoClick_; 203 } 204 GetShortkeyTarget() const205const std::string &AccessibilitySettingsConfig::GetShortkeyTarget() const 206 { 207 HILOG_DEBUG("start."); 208 return shortkeyTarget_; 209 } 210 GetHighContrastTextState() const211bool AccessibilitySettingsConfig::GetHighContrastTextState() const 212 { 213 HILOG_DEBUG("start."); 214 return highContrastTextState_; 215 } 216 GetInvertColorState() const217bool AccessibilitySettingsConfig::GetInvertColorState() const 218 { 219 HILOG_DEBUG("start."); 220 return invertColorState_; 221 } 222 GetAnimationOffState() const223bool AccessibilitySettingsConfig::GetAnimationOffState() const 224 { 225 HILOG_DEBUG("start."); 226 return animationOffState_; 227 } 228 GetAudioMonoState() const229bool AccessibilitySettingsConfig::GetAudioMonoState() const 230 { 231 HILOG_DEBUG("start."); 232 return audioMonoState_; 233 } 234 GetDaltonizationColorFilter() const235uint32_t AccessibilitySettingsConfig::GetDaltonizationColorFilter() const 236 { 237 HILOG_DEBUG("start."); 238 return daltonizationColorFilter_; 239 } 240 GetContentTimeout() const241uint32_t AccessibilitySettingsConfig::GetContentTimeout() const 242 { 243 HILOG_DEBUG("start."); 244 return contentTimeout_; 245 } 246 GetBrightnessDiscount() const247float AccessibilitySettingsConfig::GetBrightnessDiscount() const 248 { 249 HILOG_DEBUG("start."); 250 return brightnessDiscount_; 251 } 252 GetAudioBalance() const253float AccessibilitySettingsConfig::GetAudioBalance() const 254 { 255 HILOG_DEBUG("start."); 256 return audioBalance_; 257 } 258 GetEnabledState() const259bool AccessibilitySettingsConfig::GetEnabledState() const 260 { 261 HILOG_DEBUG("start."); 262 return enabled_; 263 } 264 GetTouchGuideState() const265bool AccessibilitySettingsConfig::GetTouchGuideState() const 266 { 267 HILOG_DEBUG("start."); 268 return eventTouchGuideState_; 269 } 270 GetGestureState() const271bool AccessibilitySettingsConfig::GetGestureState() const 272 { 273 HILOG_DEBUG("start."); 274 return gesturesSimulation_; 275 } 276 GetKeyEventObserverState() const277bool AccessibilitySettingsConfig::GetKeyEventObserverState() const 278 { 279 HILOG_DEBUG("start."); 280 return filteringKeyEvents_; 281 } 282 GetCaptionProperty() const283const AccessibilityConfig::CaptionProperty &AccessibilitySettingsConfig::GetCaptionProperty() const 284 { 285 HILOG_DEBUG("start."); 286 return captionProperty_; 287 }; 288 GetConfigState()289uint32_t AccessibilitySettingsConfig::GetConfigState() 290 { 291 HILOG_DEBUG("start."); 292 uint32_t state = 0; 293 294 return state; 295 } 296 InitCaption()297void AccessibilitySettingsConfig::InitCaption() 298 { 299 HILOG_DEBUG("start."); 300 } 301 InitSetting()302void AccessibilitySettingsConfig::InitSetting() 303 { 304 HILOG_DEBUG("start."); 305 } 306 InitCapability()307void AccessibilitySettingsConfig::InitCapability() 308 { 309 HILOG_DEBUG("start."); 310 } 311 InitEnabledList()312void AccessibilitySettingsConfig::InitEnabledList() 313 { 314 HILOG_DEBUG("start."); 315 } 316 Init()317void AccessibilitySettingsConfig::Init() 318 { 319 HILOG_DEBUG("start."); 320 } 321 VectorToString(const std::vector<std::string> & vectorVal,std::string & stringOut)322void AccessibilitySettingsConfig::VectorToString(const std::vector<std::string> &vectorVal, std::string &stringOut) 323 { 324 HILOG_DEBUG("start."); 325 } 326 StringToVector(const std::string & stringIn,std::vector<std::string> & vectorResult)327void AccessibilitySettingsConfig::StringToVector(const std::string &stringIn, std::vector<std::string> &vectorResult) 328 { 329 HILOG_DEBUG("start."); 330 } 331 GetEnabledAbilityInfos()332const std::vector<std::string> &AccessibilitySettingsConfig::GetEnabledAbilityInfos() 333 { 334 HILOG_DEBUG("start."); 335 return enabledAbilityInfos_; 336 } 337 UpdateEnabledAbilities(const std::vector<std::string> & vecvalue)338void AccessibilitySettingsConfig::UpdateEnabledAbilities(const std::vector<std::string> &vecvalue) 339 { 340 HILOG_DEBUG("start."); 341 enabledAbilityInfos_ = vecvalue; 342 } 343 ClearData()344void AccessibilitySettingsConfig::ClearData() 345 { 346 HILOG_DEBUG("start."); 347 } 348 } // namespace Accessibility 349 } // namespace OHOS