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 FLclCurrency.h
19 * @brief This is the header file for the %Currency class.
21 * This header file contains the declarations of the %Currency class.
24 #ifndef _FLCL_CURRENCY_H_
25 #define _FLCL_CURRENCY_H_
27 #include <FBaseString.h>
28 #include <FBaseColIList.h>
30 namespace Tizen {namespace Locales
33 // Forward declaration
38 * @brief This class represents currencies.
42 * The %Currency class represents currencies, and is used when the localized currency symbol is retrieved.
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>.
50 class _OSP_EXPORT_ Currency
51 : public Tizen::Base::Object
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 must be called right after calling this constructor.
67 * This is the destructor for this class. @n
68 * This destructor overrides Tizen::Base::Object::~Object().
72 virtual ~Currency(void);
76 * Initializes this instance of %Currency with the specified @c locale.
79 * @brief <i> [Compatibility] </i>
83 * @compatibility This method has compatibility issues with OSP compatible applications. @n
84 * For more information, see @ref CompCurrencyConstructPage "here".
87 * @return An error code
88 * @param[in] locale The specified @c locale to get the currency symbol
89 * @exception E_SUCCESS The method is successful.
90 * @exception E_INVALID_ARG The specified @c locale is not supported.
92 result Construct(const Locale& locale);
96 * Initializes this instance of %Currency with the specified currency code. @n
97 * Currencies are enumerated as defined by ISO 4217. For example, if the locale is Korean (language) and Korea (country), the currency code is "KRW".
100 * @brief <i> [Compatibility] </i>
104 * @compatibility This method has compatibility issues with OSP compatible applications. @n
105 * For more information, see @ref CompCurrencyConstructPage "here".
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.
114 result Construct(const Tizen::Base::String& currencyCode);
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.
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.
131 * Gets the ISO 4217 currency code for the specified currency.
135 * @return The currency code that is already set
138 Tizen::Base::String GetCurrencyCode(void) const;
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 "$".
150 * @return symbol The currency symbol string
152 Tizen::Base::String GetSymbol(void) const;
155 * Compares the value of the specified instance to that of the current instance.
159 * @return @c true if the value of the specified instance is equal to that of the current instance, @n
161 * @param[in] obj The object to compare with the current instance
163 virtual bool Equals(const Tizen::Base::Object& obj) const;
166 * Gets the hash value of the current instance.
170 * @return The hash value of the current instance
172 virtual int GetHashCode(void) const;
175 * Gets a list of all available currencies.
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.
185 static Tizen::Base::Collection::IList* GetAvailableCurrenciesN(void);
189 * The implementation of this copy constructor is intentionally blank and declared as private to
190 * prohibit copying of objects.
192 Currency(const Currency& currency);
195 * The implementation of this copy assignment operator is intentionally blank and declared as private
196 * to prohibit copying of objects.
198 Currency& operator =(const Currency& currency);
200 Tizen::Base::String __currencyCodeSymbol;
202 friend class _CurrencyImpl;
203 class _CurrencyImpl* __pCurrencyImpl;
208 #endif //_FLCL_CURRENCY_H_