2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #include <FBaseString.h>
19 #include <FBaseSysLog.h>
20 #include <FLclLocaleManager.h>
21 #include <FSys_SettingInfoImpl.h>
22 #include "FUi_AccessibilitySystemSettingLoader.h"
23 #include "FUi_AccessibilityManager.h"
24 #include "FUi_EcoreEvasMgr.h"
25 #include "FUi_EcoreEvas.h"
27 using namespace Tizen::Base;
28 using namespace Tizen::Locales;
29 using namespace Tizen::System;
31 namespace Tizen { namespace Ui {
33 bool _activated = false;
34 bool _screenReaderActivated = false;
36 _AccessibilitySystemSettingLoader::_AccessibilitySystemSettingLoader(_AccessibilityManager& manager)
37 : __pManager(&manager)
39 _screenReaderActivated = IsScreenReaderActivated();
40 _activated = _screenReaderActivated;
41 _SettingInfoImpl::AddSettingEventListenerForInternal(*this);
43 _AccessibilitySystemSettingLoader::~_AccessibilitySystemSettingLoader(void)
45 _SettingInfoImpl::RemoveSettingEventListenerForInternal(*this);
48 _AccessibilitySystemSettingLoader::OnSettingChanged(String& key)
50 if (key == L"http://tizen.org/setting/locale.country" || key == L"http://tizen.org/setting/locale.language")
52 __pManager->OnChangedLocale();
54 else if (key == L"http://tizen.org/setting/speech.tts.screen")
56 _AccessibilityManager::GetInstance()->OnAccessibilityScreenReaderIsActivated(IsScreenReaderActivated());
61 _AccessibilitySystemSettingLoader::IsAccessibilityActivated(void)
67 _AccessibilitySystemSettingLoader::IsScreenReaderActivated(void)
69 return GetEcoreEvasMgr()->GetEcoreEvas()->IsAccessibilityScreenReaderActivated();
73 _AccessibilitySystemSettingLoader::GetLargeFontSize(void)
79 _AccessibilitySystemSettingLoader::GetLocale(void)
81 Locale locale(LANGUAGE_INVALID, COUNTRY_INVALID);
82 LocaleManager localeMgr;
83 localeMgr.Construct();
84 locale = localeMgr.GetSystemLocale();
89 _AccessibilitySystemSettingLoader::SetSystemSetting(const Tizen::Base::String key, bool value)
91 if (key == L"AccessibilityActivationStatus")
95 else if (key == L"ScreenReaderActivationStatus")
97 _screenReaderActivated = value;
98 _AccessibilityManager::GetInstance()->OnAccessibilityScreenReaderIsActivated(value);