Merge "remove unnecessary implementations" into tizen_2.1
[platform/framework/native/appfw.git] / inc / FLclCurrency.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file                FLclCurrency.h
20  * @brief               This is the header file for the %Currency class.
21  *
22  * This header file contains the declarations of the %Currency class.
23  *
24  */
25 #ifndef _FLCL_CURRENCY_H_
26 #define _FLCL_CURRENCY_H_
27
28 #include <FBaseString.h>
29 #include <FBaseColIList.h>
30
31 namespace Tizen {namespace Locales
32 {
33
34 // Forward declaration
35 class Locale;
36
37 /**
38  * @class               Currency
39  * @brief               This class represents currencies.
40  *
41  * @since               2.0
42  *
43  * The %Currency class represents currencies, and is used when the localized currency symbol is retrieved.
44  *
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>.
46  * @see Locale
47  * @see LanguageCode
48  * @see CountryCode
49  *
50  */
51 class _OSP_EXPORT_ Currency
52         : public Tizen::Base::Object
53 {
54 public:
55
56         /**
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.
59          *
60          * @since               2.0
61          *
62          * @see                         Construct()
63          */
64         Currency(void);
65
66
67         /**
68          * This is the destructor for this class. @n
69          * This destructor overrides Tizen::Base::Object::~Object().
70          *
71          * @since               2.0
72          */
73         virtual ~Currency(void);
74
75
76         /**
77          * Initializes this instance of %Currency with the specified @c locale.
78          *
79          * @if OSPCOMPAT
80          * @brief <i> [Compatibility] </i>
81          * @endif
82          * @since                       2.0
83          * @if OSPCOMPAT
84          * @compatibility     This method has compatibility issues with OSP compatibile applications. @n
85          *                              For more information, see @ref CompCurrencyConstructPage "here".
86          * @endif
87          *
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.
92          */
93         result Construct(const Locale& locale);
94
95
96         /**
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".
99          *
100          * @if OSPCOMPAT
101          * @brief <i> [Compatibility] </i>
102          * @endif
103          * @since                       2.0
104          * @if OSPCOMPAT
105          * @compatibility     This method has compatibility issues with OSP compatibile applications. @n
106          *                              For more information, see @ref CompCurrencyConstructPage "here".
107          * @endif
108          *
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.
114          */
115         result Construct(const Tizen::Base::String& currencyCode);
116         /**
117          * @if OSPCOMPAT
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.
122          *
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.
127          * @endif
128          */
129
130
131         /**
132          * Gets the ISO 4217 currency code for the specified currency.
133          *
134          * @since                       2.0
135          *
136          * @return                      The currency code that is already set
137          * @see                         GetSymbol()
138          */
139         Tizen::Base::String GetCurrencyCode(void) const;
140
141
142         /**
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 "$".
148          *
149          * @since                       2.0
150          *
151          * @return                      symbol                                          The currency symbol string
152          */
153         Tizen::Base::String GetSymbol(void) const;
154
155         /**
156          * Compares the value of the specified instance to that of the current instance.
157          *
158          * @since                       2.0
159          *
160          * @return                      @c true if the value of the specified instance is equal to that of the current instance, @n
161          *                                      else @c false
162          * @param[in]           obj The object to compare with the current instance
163          */
164         virtual bool Equals(const Tizen::Base::Object& obj) const;
165
166         /**
167         * Gets the hash value of the current instance.
168         *
169         * @since                        2.0
170         *
171         * @return                       The hash value of the current instance
172         */
173         virtual int GetHashCode(void) const;
174
175         /**
176          * Gets a list of all available currencies.
177          *
178          * @since                       2.0
179          *
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.
185          */
186         static Tizen::Base::Collection::IList* GetAvailableCurrenciesN(void);
187
188 private:
189         /**
190          * The implementation of this copy constructor is intentionally blank and declared as private to
191          * prohibit copying of objects.
192          */
193         Currency(const Currency& currency);
194
195         /**
196          * The implementation of this copy assignment operator is intentionally blank and declared as private
197          * to prohibit copying of objects.
198          */
199         Currency& operator =(const Currency& currency);
200
201         Tizen::Base::String __currencyCodeSymbol;
202
203         friend class _CurrencyImpl;
204         class _CurrencyImpl* __pCurrencyImpl;
205 }; // Currency
206
207 }} // Tizen::Locales
208
209 #endif //_FLCL_CURRENCY_H_