Merge "Update deprecated libprivilege-control API functions." into tizen
[platform/framework/native/appfw.git] / inc / FLclCurrency.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                FLclCurrency.h
19  * @brief               This is the header file for the %Currency class.
20  *
21  * This header file contains the declarations of the %Currency class.
22  *
23  */
24 #ifndef _FLCL_CURRENCY_H_
25 #define _FLCL_CURRENCY_H_
26
27 #include <FBaseString.h>
28 #include <FBaseColIList.h>
29
30 namespace Tizen {namespace Locales
31 {
32
33 // Forward declaration
34 class Locale;
35
36 /**
37  * @class               Currency
38  * @brief               This class provides methods for currencies.
39  *
40  * @since               2.0
41  *
42  * The %Currency class represents currencies, and is used when the localized currency symbol is retrieved.
43  *
44  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/locales/num_symbols_currencies.htm">Number Symbols and Currencies</a>.
45  * @see Locale
46  * @see LanguageCode
47  * @see CountryCode
48  *
49  */
50 class _OSP_EXPORT_ Currency
51         : public Tizen::Base::Object
52 {
53 public:
54
55         /**
56          * This is the default constructor for this class. @n
57          * The object is not fully constructed after this constructor is called. For full construction, the Construct() method 
58          * must be called right after calling this constructor.
59          *
60          * @since               2.0
61          */
62         Currency(void);
63
64
65         /**
66          * This is the destructor for this class. @n
67          * This destructor overrides Tizen::Base::Object::~Object().
68          *
69          * @since               2.0
70          */
71         virtual ~Currency(void);
72
73
74         /**
75          * Initializes this instance of %Currency with the specified @c locale.
76          *
77          * @if OSPCOMPAT
78          * @brief <i> [Compatibility] </i>
79          * @endif
80          * @since                       2.0
81          * @if OSPCOMPAT
82          * @compatibility       This method has compatibility issues with OSP compatible applications. @n
83          *                                      For more information, see @ref CompCurrencyConstructPage "here".
84          * @endif
85          *
86          * @return                      An error code
87          * @param[in]           locale                          The specified @c locale to get the currency symbol
88          * @exception           E_SUCCESS                       The method is successful.
89          * @exception           E_INVALID_ARG           The specified @c locale is not supported.
90          */
91         result Construct(const Locale& locale);
92
93
94         /**
95          * Initializes this instance of %Currency with the specified currency code. @n
96          * The currencies are enumerated as defined by ISO 4217. For example, if the locale is Korean (language) and Korea (country), 
97          * the currency code is "KRW".
98          *
99          * @if OSPCOMPAT
100          * @brief <i> [Compatibility] </i>
101          * @endif
102          * @since                       2.0
103          * @if OSPCOMPAT
104          * @compatibility       This method has compatibility issues with OSP compatible applications. @n
105      *                                  For more information, see @ref CompCurrencyConstructPage "here".
106          * @endif
107          *
108          * @return                      An error code
109          * @param[in]           currencyCode            The specified currency code to get the currency symbol
110          * @exception           E_SUCCESS                       The method is successful.
111          * @exception           E_INVALID_ARG           The specified @c currencyCode is not supported.
112          * @exception           E_OUT_OF_MEMORY         The memory is insufficient.
113          */
114         result Construct(const Tizen::Base::String& currencyCode);
115         /**
116          * @if OSPCOMPAT
117          * @page                CompCurrencyConstructPage Compatibility for Construct()
118          * @section             CompCurrencyConstructIssueSection Issues
119          * Implementation of this method in OSP compatible applications has the following issue: @n
120          * -# The method returns E_UNSUPPORTED_OPERATION if the argument is invalid.
121          *
122          * @section             CompCurrencyConstructSolutionSection Resolutions
123          * This issue has been resolved in Tizen.
124          * @par When working in Tizen:
125          * -# The method returns E_INVALID_ARG if the argument is invalid.
126          * @endif
127          */
128
129
130         /**
131          * Gets the ISO 4217 currency code for the specified currency.
132          *
133          * @since                       2.0
134          *
135          * @return                      The currency code that is already set
136          * @see                         GetSymbol()
137          */
138         Tizen::Base::String GetCurrencyCode(void) const;
139
140
141         /**
142          * Gets the symbol of this currency. @n
143          * The symbol will be localized for the locale of the currency.
144          * For example, if the locale of this currency is kor_KR and the system locale is eng_US,
145          * the symbol will be the Korean won sign "₩ "; if the locale of this currency is eng_US and the system locale is kor_KR,
146          * the symbol will be "$".
147          *
148          * @since                       2.0
149          *
150          * @return                      symbol                                          The currency symbol string
151          */
152         Tizen::Base::String GetSymbol(void) const;
153
154         /**
155          * Compares the value of the specified instance to that of the current instance.
156          *
157          * @since                       2.0
158          *
159          * @return                      @c true if the value of the specified instance is equal to that of the current instance, @n
160          *                                      else @c false
161          * @param[in]           obj             The object to compare with the current instance
162          */
163         virtual bool Equals(const Tizen::Base::Object& obj) const;
164
165         /**
166         * Gets the hash value of the current instance.
167         *
168         * @since                        2.0
169         *
170         * @return                       The hash value of the current instance
171         */
172         virtual int GetHashCode(void) const;
173
174         /**
175          * Gets a list of all available currencies.
176          *
177          * @since                       2.0
178          *
179          * @return                      A pointer to an array of %Currency objects, @n
180          *                                      else a @c null pointer is returned if there is no currency available or there is some failure @n
181          *                                      The array is a list of all the available currencies.
182          * @exception           E_OUT_OF_MEMORY                         The memory is insufficient.
183          * @remarks                     The specific error code can be accessed using the GetLastResult() method.
184          */
185         static Tizen::Base::Collection::IList* GetAvailableCurrenciesN(void);
186
187 private:
188         /**
189          * The implementation of this copy constructor is intentionally blank and declared as private to
190          * prohibit copying of objects.
191          */
192         Currency(const Currency& currency);
193
194         /**
195          * The implementation of this copy assignment operator is intentionally blank and declared as private
196          * to prohibit copying of objects.
197          */
198         Currency& operator =(const Currency& currency);
199
200         Tizen::Base::String __currencyCodeSymbol;
201
202         friend class _CurrencyImpl;
203         class _CurrencyImpl* __pCurrencyImpl;
204 }; // Currency
205
206 }} // Tizen::Locales
207
208 #endif //_FLCL_CURRENCY_H_