2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FLcl_LocaleImpl.h
20 * @brief This is the header file for the _LocaleImpl class.
22 * This header file contains declarations of the _LocaleImpl class.
26 #ifndef _FLCL_INTERNAL_LOCALE_IMPL_H_
27 #define _FLCL_INTERNAL_LOCALE_IMPL_H_
29 #include <unicode/locid.h>
30 #include <FBaseObject.h>
32 using namespace Tizen::Base;
34 namespace Tizen { namespace Locales
40 : public Tizen::Base::Object
44 _LocaleImpl(const char* pLocaleCode);
45 _LocaleImpl(const char* pLanguage, const char* pCountry, const char* pVariant = null);
46 _LocaleImpl(const U_ICU_NAMESPACE::Locale& icuLocale);
48 _LocaleImpl* CloneN(void);
50 virtual ~_LocaleImpl(void);
52 bool operator ==(const _LocaleImpl& otherLocale) const;
53 bool operator !=(const _LocaleImpl& otherLocale) const;
54 virtual bool Equals(const Tizen::Base::Object& obj) const;
55 virtual int GetHashCode(void) const;
57 String GetLanguageCodeString(bool isTwoLetter);
59 result GetLanguageName(Tizen::Base::String& languageName) const;
60 result GetLanguageName(const _LocaleImpl& otherLocale, Tizen::Base::String& languageName) const;
62 const char* Get2LetterCountryCodeString(void) const;
63 const char* Get3LetterCountryCodeString(void) const;
64 result GetCountryName(Tizen::Base::String& countryName) const;
65 result GetCountryName(const _LocaleImpl& otherLocale, Tizen::Base::String& countryName) const;
67 const char* GetVariantCodeString(void) const;
68 void SetVariantCodeString(const char* pVariantCode = null);
70 const char* GetLocaleCodeString(void) const;
72 bool IsSupported(void) const;
74 U_ICU_NAMESPACE::Locale GetIcuLocale (void) const;
75 Locale GetOspLocale(void);
77 static bool IsSupported(const Locale& ospLocale);
78 static const _LocaleImpl* GetLocaleImpl(const Locale& ospLocale);
80 static String Get2LetterLanguageCodeString(const char* pLanguageCodeString);
81 static String Get3LetterLanguageCodeString(const char* pLanguageCodeString);
83 static const char* Get2LetterCountryCodeString(const char* pCountryCodeString);
84 static const char* Get3LetterCountryCodeString(const char* pCountryCodeString);
87 U_ICU_NAMESPACE::Locale __icuLocale;
92 #endif //_FLCL_INTERNAL_LOCALE_IMPL_H_