2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FLcl_LocaleImpl.h
19 * @brief This is the header file for the _LocaleImpl class.
21 * This header file contains declarations of the _LocaleImpl class.
25 #ifndef _FLCL_INTERNAL_LOCALE_IMPL_H_
26 #define _FLCL_INTERNAL_LOCALE_IMPL_H_
28 #include <unicode/locid.h>
29 #include <FBaseObject.h>
31 using namespace Tizen::Base;
33 namespace Tizen { namespace Locales
39 : public Tizen::Base::Object
43 _LocaleImpl(const char* pLocaleCode);
44 _LocaleImpl(const char* pLanguage, const char* pCountry, const char* pVariant = null);
45 _LocaleImpl(const U_ICU_NAMESPACE::Locale& icuLocale);
47 _LocaleImpl* CloneN(void);
49 virtual ~_LocaleImpl(void);
51 bool operator ==(const _LocaleImpl& otherLocale) const;
52 bool operator !=(const _LocaleImpl& otherLocale) const;
53 virtual bool Equals(const Tizen::Base::Object& obj) const;
54 virtual int GetHashCode(void) const;
56 String GetLanguageCodeString(bool isTwoLetter);
58 result GetLanguageName(Tizen::Base::String& languageName) const;
59 result GetLanguageName(const _LocaleImpl& otherLocale, Tizen::Base::String& languageName) const;
61 const char* Get2LetterCountryCodeString(void) const;
62 const char* Get3LetterCountryCodeString(void) const;
63 result GetCountryName(Tizen::Base::String& countryName) const;
64 result GetCountryName(const _LocaleImpl& otherLocale, Tizen::Base::String& countryName) const;
66 const char* GetVariantCodeString(void) const;
67 void SetVariantCodeString(const char* pVariantCode = null);
69 const char* GetLocaleCodeString(void) const;
71 bool IsSupported(void) const;
73 U_ICU_NAMESPACE::Locale GetIcuLocale (void) const;
74 Locale GetOspLocale(void);
76 static bool IsSupported(const Locale& ospLocale);
77 static const _LocaleImpl* GetLocaleImpl(const Locale& ospLocale);
79 static String Get2LetterLanguageCodeString(const char* pLanguageCodeString);
80 static String Get3LetterLanguageCodeString(const char* pLanguageCodeString);
82 static const char* Get2LetterCountryCodeString(const char* pCountryCodeString);
83 static const char* Get3LetterCountryCodeString(const char* pCountryCodeString);
86 U_ICU_NAMESPACE::Locale __icuLocale;
91 #endif //_FLCL_INTERNAL_LOCALE_IMPL_H_