Merge "update doxygen comments" into tizen_2.1
[platform/framework/native/appfw.git] / inc / FLclNumberSymbols.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                FLclNumberSymbols.h
20  * @brief               This is the header file for the %NumberSymbols class.
21  *
22  * This header file contains the declarations of the %NumberSymbols class.
23  *
24  */
25 #ifndef _FLCL_NUMBER_SYMBOLS_H_
26 #define _FLCL_NUMBER_SYMBOLS_H_
27
28 #include <FLclLocale.h>
29
30
31 namespace Tizen { namespace Locales
32 {
33
34 // Enums and Constants
35 /**
36  * @enum        NumberSymbol
37  *
38  * Defines the possible formats for number symbols. @n
39  *
40  * This enum represents the possible symbols for NumberFormatter.
41  *
42  * @since               2.0
43  */
44 enum NumberSymbol
45 {
46         NUMBER_SYMBOL_DECIMAL_SEPARATOR,                        /**< The decimal separator */
47         NUMBER_SYMBOL_GROUPING_SEPARATOR,                       /**< The grouping separator */
48         NUMBER_SYMBOL_PATTERN_SEPARATOR,                        /**< The pattern separator */
49         NUMBER_SYMBOL_PERCENT,                                          /**< The percent symbol */
50         NUMBER_SYMBOL_ZERO_DIGIT,                                       /**< The zero symbol*/
51         NUMBER_SYMBOL_DIGIT,                                            /**< The character representing a digit in the pattern */
52         NUMBER_SYMBOL_CURRENCY,                                         /**< The currency symbol */
53         NUMBER_SYMBOL_INTL_CURRENCY,                            /**< The international currency symbol */
54         NUMBER_SYMBOL_MONETARY_SEPARATOR,                       /**< The monetary separator */
55         NUMBER_SYMBOL_PER_MILL,                                         /**< The per mil symbol */
56         NUMBER_SYMBOL_EXPONENTIAL,                                      /**< The exponential symbol */
57         NUMBER_SYMBOL_PLUS_SIGN,                                        /**< The plus sign */
58         NUMBER_SYMBOL_MINUS_SIGN,                                       /**< The minus sign */
59         NUMBER_SYMBOL_COUNT                                                     /**< The number of symbol */
60 };
61
62
63 /**
64  * @class               NumberSymbols
65  * @brief               This class provides methods that help in providing number symbols.
66  *
67  * @since               2.0
68  *
69  * The %NumberSymbols class represents the set of symbols (such as the decimal separator and the grouping separator) needed by NumberFormatter to format numbers.
70  * %NumberFormatter creates its own instance of %NumberSymbols from its locale data. %NumberSymbols can be adopted by a %NumberFormatter instance, or it can be specified when a %NumberFormatter is created. If you need to change any of these symbols, you can get the %NumberSymbols instance from your %NumberFormatter and then modify it.
71  *
72  * 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>.
73  */
74 class _OSP_EXPORT_ NumberSymbols
75         : public Tizen::Base::Object
76 {
77 public:
78         /**
79          * This is the default constructor for this class. @n
80          * 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.
81          *
82          * @since               2.0
83          *
84          * @see Construct()
85          */
86         NumberSymbols(void);
87
88         /**
89          * This is the destructor for this class. @n
90          * This destructor overrides Tizen::Base::Object::~Object().
91          *
92          * @since               2.0
93          */
94         virtual ~NumberSymbols(void);
95
96
97         /**
98          * Initializes this instance of %NumberSymbols with the specified @c locale.
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 compatible applications. @n
106         *                              For more information, see @ref CompNumberSymbolsConstructPage "here".
107          * @endif
108          *
109          * @return                              An error code
110          * @param[in]                   locale                                          An instance of Locale
111          * @exception                   E_SUCCESS                                       The method is successful.
112          * @exception                   E_OUT_OF_MEMORY                         The memory is insufficient.
113          * @exception                   E_INVALID_ARG           The specified @c locale is invalid. 
114          */
115         result Construct(const Locale& locale);
116
117         /**
118          * @if OSPCOMPAT
119          * @page                    CompNumberSymbolsConstructPage Compatibility for Construct()
120          * @section                   CompNumberSymbolsConstructIssueSection Issues
121          * Implementation of this method in OSP compatible applications has the following issue: @n
122          * -# The method returns E_UNSUPPORTED_OPERATION if the @c locale is invalid.
123          *
124          * @section                 CompNumberSymbolsConstructSolutionSection Resolutions
125          * This issue has been resolved in Tizen.
126          * @par When working in Tizen:
127          * -# The method returns E_INVALID_ARG if the @c locale is invalid.
128          * @endif
129          */
130
131         /**
132          * Gets the character used for number format.
133          *
134          * @since                               2.0
135          *
136          * @return                              The character used for number format, @n
137          *                                              else an empty string if the @c symbol is invalid
138          * @param[in]                   symbol                                          The number format symbol instance
139          * @see                                         SetNumberSymbol()
140          */
141         Tizen::Base::String GetNumberSymbol(NumberSymbol symbol) const;
142
143
144         /**
145          * Sets the character used for number format.
146          *
147          * @since                               2.0
148          *
149          * @return                              An error code
150          * @param[in]                   symbol                                          A symbol to set
151          * @param[in]                   str                                                     The new string for symbol
152          * @exception                   E_SUCCESS                                       The method is successful.
153          * @see                                         GetNumberSymbol()
154          */
155         result SetNumberSymbol(NumberSymbol symbol, const Tizen::Base::String& str);
156
157
158         /**
159          * Gets the current locale.
160          *
161          * @since                               2.0
162          *
163          * @return              A pointer to the current instance of Locale, @n
164          *                                              else @c null if this method fails
165          * @remarks                             The specific error code can be accessed using the GetLastResult() method.
166          */
167         const Locale* GetLocale(void) const;
168
169
170 private:
171         /**
172          * The implementation of this copy constructor is intentionally blank and declared as private to
173          * prohibit copying of objects.
174          */
175         NumberSymbols(const NumberSymbols& numberSymbols);
176
177         /**
178          * The implementation of this copy assignment operator is intentionally blank and declared as private
179          * to prohibit copying of objects.
180          */
181         NumberSymbols& operator =(const NumberSymbols& numberSymbols);
182
183
184         friend class _NumberSymbolsImpl;
185         class _NumberSymbolsImpl* __pNumberSymbolsImpl;
186
187 }; // NumberSymbols
188
189 }} // Tizen::Locales
190
191 #endif //_FLCL_NUMBER_SYMBOLS_H_
192