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 FLclCurrency.h
20 * @brief This is the header file for the %Currency class.
22 * This header file contains the declarations of the %Currency class.
25 #ifndef _FLCL_CURRENCY_H_
26 #define _FLCL_CURRENCY_H_
28 #include <FBaseString.h>
29 #include <FBaseColIList.h>
31 namespace Tizen {namespace Locales
34 // Forward declaration
39 * @brief This class represents currencies.
43 * The %Currency class represents currencies, and is used when the localized currency symbol is retrieved.
45 * 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>.
51 class _OSP_EXPORT_ Currency
52 : public Tizen::Base::Object
57 * This is the default constructor for this class. @n
58 * 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.
68 * This is the destructor for this class. @n
69 * This destructor overrides Tizen::Base::Object::~Object().
73 virtual ~Currency(void);
77 * Initializes this instance of %Currency with the specified @c locale.
80 * @brief <i> [Compatibility] </i>
84 * @compatibility This method has compatibility issues with OSP compatible applications. @n
85 * For more information, see @ref CompCurrencyConstructPage "here".
88 * @return An error code
89 * @param[in] locale The specified @c locale to get the currency symbol
90 * @exception E_SUCCESS The method is successful.
91 * @exception E_INVALID_ARG The specified @c locale is not supported.
93 result Construct(const Locale& locale);
97 * Initializes this instance of %Currency with the specified currency code. @n
98 * Currencies are enumerated as defined by ISO 4217. For example, if the locale is Korean (language) and Korea (country), the currency code is "KRW".
101 * @brief <i> [Compatibility] </i>
105 * @compatibility This method has compatibility issues with OSP compatible applications. @n
106 * For more information, see @ref CompCurrencyConstructPage "here".
109 * @return An error code
110 * @param[in] currencyCode The specified currency code to get the currency symbol
111 * @exception E_SUCCESS The method is successful.
112 * @exception E_INVALID_ARG The specified @c currencyCode is not supported.
113 * @exception E_OUT_OF_MEMORY The memory is insufficient.
115 result Construct(const Tizen::Base::String& currencyCode);
118 * @page CompCurrencyConstructPage Compatibility for Construct()
119 * @section CompCurrencyConstructIssueSection Issues
120 * Implementation of this method in OSP compatible applications has the following issue: @n
121 * -# The method returns E_UNSUPPORTED_OPERATION if the argument is invalid.
123 * @section CompCurrencyConstructSolutionSection Resolutions
124 * This issue has been resolved in Tizen.
125 * @par When working in Tizen:
126 * -# The method returns E_INVALID_ARG if the argument is invalid.
132 * Gets the ISO 4217 currency code for the specified currency.
136 * @return The currency code that is already set
139 Tizen::Base::String GetCurrencyCode(void) const;
143 * Gets the symbol of this currency. @n
144 * The symbol will be localized for the locale of the currency.
145 * For example, if the locale of this currency is kor_KR and the system locale is eng_US,
146 * the symbol will be the Korean won sign "₩ "; if the locale of this currency is eng_US and the system locale is kor_KR,
147 * the symbol will be "$".
151 * @return symbol The currency symbol string
153 Tizen::Base::String GetSymbol(void) const;
156 * Compares the value of the specified instance to that of the current instance.
160 * @return @c true if the value of the specified instance is equal to that of the current instance, @n
162 * @param[in] obj The object to compare with the current instance
164 virtual bool Equals(const Tizen::Base::Object& obj) const;
167 * Gets the hash value of the current instance.
171 * @return The hash value of the current instance
173 virtual int GetHashCode(void) const;
176 * Gets a list of all available currencies.
180 * @return A pointer to an array of %Currency objects, @n
181 * else a @c null pointer is returned if there is no currency available or there is some failure @n
182 * The array is a list of all the available currencies.
183 * @exception E_OUT_OF_MEMORY The memory is insufficient.
184 * @remarks The specific error code can be accessed using the GetLastResult() method.
186 static Tizen::Base::Collection::IList* GetAvailableCurrenciesN(void);
190 * The implementation of this copy constructor is intentionally blank and declared as private to
191 * prohibit copying of objects.
193 Currency(const Currency& currency);
196 * The implementation of this copy assignment operator is intentionally blank and declared as private
197 * to prohibit copying of objects.
199 Currency& operator =(const Currency& currency);
201 Tizen::Base::String __currencyCodeSymbol;
203 friend class _CurrencyImpl;
204 class _CurrencyImpl* __pCurrencyImpl;
209 #endif //_FLCL_CURRENCY_H_