Enable build with iniparser v 3.1
[platform/framework/native/appfw.git] / src / locales / FLcl_LocaleImpl.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16
17 /**
18  * @file        FLcl_LocaleImpl.h
19  * @brief       This is the header file for the _LocaleImpl class.
20  *
21  * This header file contains declarations of the _LocaleImpl class.
22  *
23  */
24
25 #ifndef _FLCL_INTERNAL_LOCALE_IMPL_H_
26 #define _FLCL_INTERNAL_LOCALE_IMPL_H_
27
28 #include <unicode/locid.h>
29 #include <FBaseObject.h>
30
31 using namespace Tizen::Base;
32
33 namespace Tizen { namespace Locales
34 {
35
36 class Locale;
37
38 class _LocaleImpl
39         : public Tizen::Base::Object
40 {
41 public:
42         _LocaleImpl(void);
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);
46
47         _LocaleImpl* CloneN(void);
48
49         virtual ~_LocaleImpl(void);
50
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;
55
56         String GetLanguageCodeString(bool isTwoLetter);
57
58         result GetLanguageName(Tizen::Base::String& languageName) const;
59         result GetLanguageName(const _LocaleImpl& otherLocale, Tizen::Base::String& languageName) const;
60
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;
65
66         const char* GetVariantCodeString(void) const;
67         void SetVariantCodeString(const char* pVariantCode = null);
68
69         const char* GetLocaleCodeString(void) const;
70
71         bool IsSupported(void) const;
72
73         U_ICU_NAMESPACE::Locale GetIcuLocale (void) const;
74         Locale GetOspLocale(void);
75
76         static bool IsSupported(const Locale& ospLocale);
77         static const _LocaleImpl* GetLocaleImpl(const Locale& ospLocale);
78
79         static String Get2LetterLanguageCodeString(const char* pLanguageCodeString);
80         static String Get3LetterLanguageCodeString(const char* pLanguageCodeString);
81
82         static const char* Get2LetterCountryCodeString(const char* pCountryCodeString);
83         static const char* Get3LetterCountryCodeString(const char* pCountryCodeString);
84
85 private:
86         U_ICU_NAMESPACE::Locale __icuLocale;
87 }; // _LocaleImpl
88
89 }} // Tizen::Locales
90
91 #endif //_FLCL_INTERNAL_LOCALE_IMPL_H_