Modified an api call flow
[platform/framework/native/appfw.git] / src / locales / FLclLocaleManager.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.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
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file            FLclLocaleManager.cpp
20  * @brief           This is the implementation file for LocaleManager class.
21  */
22
23 // Includes
24 #include <unique_ptr.h>
25 #include <FBaseSysLog.h>
26 #include <FLclLocaleManager.h>
27 #include "FLcl_LocaleManagerImpl.h"
28
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Collection;
31 using namespace Tizen::Base::Utility;
32
33 namespace Tizen { namespace Locales
34 {
35
36 LocaleManager::LocaleManager(void)
37         : __pLocaleManagerImpl(null)
38 {
39 }
40
41
42 LocaleManager::~LocaleManager(void)
43 {
44 }
45
46
47 result
48 LocaleManager::Construct(void)
49 {
50         return E_SUCCESS;
51 }
52
53
54 Locale
55 LocaleManager::GetSystemLocale(void) const
56 {
57         ClearLastResult();
58         return _LocaleManagerImpl::GetSystemLocale();
59 }
60
61
62 IList*
63 LocaleManager::GetAvailableLocalesN(void) const
64 {
65         ClearLastResult();
66         return _LocaleManagerImpl::GetAvailableLocalesN();
67 }
68
69
70 String
71 LocaleManager::GetSelectedLanguage(void) const
72 {
73         ClearLastResult();
74         return _LocaleManagerImpl::GetSelectedLanguage();
75 }
76
77
78 IList*
79 LocaleManager::GetAvailableLanguagesN(void) const
80 {
81         ClearLastResult();
82         
83         return _LocaleManagerImpl::GetAvailableLanguagesN();
84 }
85
86
87 IList*
88 LocaleManager::GetAvailableTimeZonesN(void) const
89 {
90         ClearLastResult();
91         IMap* pTimeZoneMap = _LocaleManagerImpl::GetAvailableTimeZonesN();
92         IList* pTimeZoneList = pTimeZoneMap->GetKeysN();
93         pTimeZoneMap->RemoveAll();
94         delete pTimeZoneMap;    
95         return pTimeZoneList;
96 }
97
98
99 IList*
100 LocaleManager::GetAvailableTimeZonesN(int rawOffset) const
101 {
102         ClearLastResult();
103         IMap* pTimeZoneMap =_LocaleManagerImpl::GetAvailableTimeZonesN(rawOffset);
104         IList* pTimeZoneList = pTimeZoneMap->GetKeysN();    
105         pTimeZoneMap->RemoveAll();
106         delete pTimeZoneMap;
107         return pTimeZoneList;
108 }
109
110 TimeZone
111 LocaleManager::GetSystemTimeZone(void) const
112 {
113         ClearLastResult();
114         return _LocaleManagerImpl::GetSystemTimeZone();
115 }
116
117 result
118 LocaleManager::IsSupportedLocale(const Locale& locale, bool& isSupportedLocale)
119 {
120         ClearLastResult();
121         return _LocaleManagerImpl::IsSupportedLocale(locale, isSupportedLocale);
122 }
123
124
125 };
126 };      // Tizen::Locales