1885b47fbSopenharmony_ci/* 2885b47fbSopenharmony_ci * Copyright (C) 2023 Huawei Device Co., Ltd. 3885b47fbSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4885b47fbSopenharmony_ci * you may not use this file except in compliance with the License. 5885b47fbSopenharmony_ci * You may obtain a copy of the License at 6885b47fbSopenharmony_ci * 7885b47fbSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8885b47fbSopenharmony_ci * 9885b47fbSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10885b47fbSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11885b47fbSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12885b47fbSopenharmony_ci * See the License for the specific language governing permissions and 13885b47fbSopenharmony_ci * limitations under the License. 14885b47fbSopenharmony_ci */ 15885b47fbSopenharmony_ci 16885b47fbSopenharmony_ci#ifndef ACCESSIBILITY_SETTINGS_H 17885b47fbSopenharmony_ci#define ACCESSIBILITY_SETTINGS_H 18885b47fbSopenharmony_ci 19885b47fbSopenharmony_ci#include <string> 20885b47fbSopenharmony_ci#include <vector> 21885b47fbSopenharmony_ci#include "event_handler.h" 22885b47fbSopenharmony_ci 23885b47fbSopenharmony_cinamespace OHOS { 24885b47fbSopenharmony_cinamespace Accessibility { 25885b47fbSopenharmony_ciclass AccessibilitySettings { 26885b47fbSopenharmony_cipublic: 27885b47fbSopenharmony_ci AccessibilitySettings() = default; 28885b47fbSopenharmony_ci ~AccessibilitySettings() = default; 29885b47fbSopenharmony_ci 30885b47fbSopenharmony_ci void RegisterSettingsHandler(const std::shared_ptr<AppExecFwk::EventHandler> &handler); 31885b47fbSopenharmony_ci 32885b47fbSopenharmony_ci RetError SetScreenMagnificationState(const bool state); 33885b47fbSopenharmony_ci RetError SetShortKeyState(const bool state); 34885b47fbSopenharmony_ci RetError SetMouseKeyState(const bool state); 35885b47fbSopenharmony_ci RetError SetMouseAutoClick(const int32_t time); 36885b47fbSopenharmony_ci RetError SetShortkeyTarget(const std::string &name); 37885b47fbSopenharmony_ci RetError SetShortkeyMultiTarget(const std::vector<std::string> &name); 38885b47fbSopenharmony_ci RetError SetHighContrastTextState(const bool state); 39885b47fbSopenharmony_ci RetError SetInvertColorState(const bool state); 40885b47fbSopenharmony_ci RetError SetAnimationOffState(const bool state); 41885b47fbSopenharmony_ci RetError SetAudioMonoState(const bool state); 42885b47fbSopenharmony_ci RetError SetDaltonizationState(const bool state); 43885b47fbSopenharmony_ci RetError SetDaltonizationColorFilter(const uint32_t filter); 44885b47fbSopenharmony_ci RetError SetContentTimeout(const uint32_t time); 45885b47fbSopenharmony_ci RetError SetBrightnessDiscount(const float discount); 46885b47fbSopenharmony_ci RetError SetAudioBalance(const float balance); 47885b47fbSopenharmony_ci RetError SetClickResponseTime(const uint32_t time); 48885b47fbSopenharmony_ci RetError SetIgnoreRepeatClickState(const bool state); 49885b47fbSopenharmony_ci RetError SetIgnoreRepeatClickTime(const uint32_t time); 50885b47fbSopenharmony_ci 51885b47fbSopenharmony_ci RetError GetScreenMagnificationState(bool &state); 52885b47fbSopenharmony_ci RetError GetShortKeyState(bool &state); 53885b47fbSopenharmony_ci RetError GetMouseKeyState(bool &state); 54885b47fbSopenharmony_ci RetError GetMouseAutoClick(int32_t &time); 55885b47fbSopenharmony_ci RetError GetShortkeyTarget(std::string &name); 56885b47fbSopenharmony_ci RetError GetShortkeyMultiTarget(std::vector<std::string> &name); 57885b47fbSopenharmony_ci RetError GetHighContrastTextState(bool &state); 58885b47fbSopenharmony_ci RetError GetInvertColorState(bool &state); 59885b47fbSopenharmony_ci RetError GetAnimationOffState(bool &state); 60885b47fbSopenharmony_ci RetError GetAudioMonoState(bool &state); 61885b47fbSopenharmony_ci RetError GetDaltonizationState(bool &state); 62885b47fbSopenharmony_ci RetError GetDaltonizationColorFilter(uint32_t &type); 63885b47fbSopenharmony_ci RetError GetContentTimeout(uint32_t &timer); 64885b47fbSopenharmony_ci RetError GetBrightnessDiscount(float &brightness); 65885b47fbSopenharmony_ci RetError GetAudioBalance(float &balance); 66885b47fbSopenharmony_ci RetError GetClickResponseTime(uint32_t &time); 67885b47fbSopenharmony_ci RetError GetIgnoreRepeatClickState(bool &state); 68885b47fbSopenharmony_ci RetError GetIgnoreRepeatClickTime(uint32_t &time); 69885b47fbSopenharmony_ci 70885b47fbSopenharmony_ci void UpdateConfigState(); 71885b47fbSopenharmony_ci void UpdateAudioBalance(); 72885b47fbSopenharmony_ci void UpdateBrightnessDiscount(); 73885b47fbSopenharmony_ci void UpdateContentTimeout(); 74885b47fbSopenharmony_ci void UpdateDaltonizationColorFilter(); 75885b47fbSopenharmony_ci void UpdateMouseAutoClick(); 76885b47fbSopenharmony_ci void UpdateShortkeyTarget(); 77885b47fbSopenharmony_ci void UpdateShortkeyMultiTarget(); 78885b47fbSopenharmony_ci void UpdateClickResponseTime(); 79885b47fbSopenharmony_ci void UpdateIgnoreRepeatClickTime(); 80885b47fbSopenharmony_ci void UpdateSettingsInAtoHos(); 81885b47fbSopenharmony_ci void UpdateSettingsInAtoHosStatePart(ConfigValueAtoHosUpdate &value); 82885b47fbSopenharmony_ci 83885b47fbSopenharmony_ci RetError GetCaptionProperty(AccessibilityConfig::CaptionProperty &caption); 84885b47fbSopenharmony_ci RetError SetCaptionProperty(const AccessibilityConfig::CaptionProperty &caption); 85885b47fbSopenharmony_ci RetError SetCaptionState(const bool state); 86885b47fbSopenharmony_ci RetError GetCaptionState(bool &state); 87885b47fbSopenharmony_ci 88885b47fbSopenharmony_ci void UpdateCaptionProperty(); 89885b47fbSopenharmony_ci void UpdateAllSetting(); 90885b47fbSopenharmony_ci 91885b47fbSopenharmony_ci std::shared_ptr<AppExecFwk::EventHandler> handler_ = nullptr; 92885b47fbSopenharmony_ci}; 93885b47fbSopenharmony_ci} // namespace Accessibility 94885b47fbSopenharmony_ci} // namespace OHOS 95885b47fbSopenharmony_ci#endif // ACCESSIBILITY_SETTINGS_H