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 FLclNumberSymbols.h
19 * @brief This is the header file for the %NumberSymbols class.
21 * This header file contains the declarations of the %NumberSymbols class.
24 #ifndef _FLCL_NUMBER_SYMBOLS_H_
25 #define _FLCL_NUMBER_SYMBOLS_H_
27 #include <FLclLocale.h>
30 namespace Tizen { namespace Locales
33 // Enums and Constants
37 * Defines the possible formats for number symbols. @n
39 * This enum represents the possible symbols for NumberFormatter.
45 NUMBER_SYMBOL_DECIMAL_SEPARATOR, /**< The decimal separator */
46 NUMBER_SYMBOL_GROUPING_SEPARATOR, /**< The grouping separator */
47 NUMBER_SYMBOL_PATTERN_SEPARATOR, /**< The pattern separator */
48 NUMBER_SYMBOL_PERCENT, /**< The percent symbol */
49 NUMBER_SYMBOL_ZERO_DIGIT, /**< The zero symbol*/
50 NUMBER_SYMBOL_DIGIT, /**< The character representing a digit in the pattern */
51 NUMBER_SYMBOL_CURRENCY, /**< The currency symbol */
52 NUMBER_SYMBOL_INTL_CURRENCY, /**< The international currency symbol */
53 NUMBER_SYMBOL_MONETARY_SEPARATOR, /**< The monetary separator */
54 NUMBER_SYMBOL_PER_MILL, /**< The per mil symbol */
55 NUMBER_SYMBOL_EXPONENTIAL, /**< The exponential symbol */
56 NUMBER_SYMBOL_PLUS_SIGN, /**< The plus sign */
57 NUMBER_SYMBOL_MINUS_SIGN, /**< The minus sign */
58 NUMBER_SYMBOL_COUNT /**< The number of symbol */
63 * @class NumberSymbols
64 * @brief This class provides methods that help in providing number symbols.
68 * The %NumberSymbols class represents the set of symbols (such as the decimal separator and the grouping separator) needed by NumberFormatter to format numbers.
69 * %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 * 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 class _OSP_EXPORT_ NumberSymbols
74 : public Tizen::Base::Object
78 * This is the default constructor for this class. @n
79 * 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.
88 * This is the destructor for this class. @n
89 * This destructor overrides Tizen::Base::Object::~Object().
93 virtual ~NumberSymbols(void);
97 * Initializes this instance of %NumberSymbols with the specified @c locale.
100 * @brief <i> [Compatibility] </i>
104 * @compatibility This method has compatibility issues with OSP compatible applications. @n
105 * For more information, see @ref CompNumberSymbolsConstructPage "here".
108 * @return An error code
109 * @param[in] locale An instance of Locale
110 * @exception E_SUCCESS The method is successful.
111 * @exception E_OUT_OF_MEMORY The memory is insufficient.
112 * @exception E_INVALID_ARG The specified @c locale is invalid.
114 result Construct(const Locale& locale);
118 * @page CompNumberSymbolsConstructPage Compatibility for Construct()
119 * @section CompNumberSymbolsConstructIssueSection Issues
120 * Implementation of this method in OSP compatible applications has the following issue: @n
121 * -# The method returns E_UNSUPPORTED_OPERATION if the @c locale is invalid.
123 * @section CompNumberSymbolsConstructSolutionSection Resolutions
124 * This issue has been resolved in Tizen.
125 * @par When working in Tizen:
126 * -# The method returns E_INVALID_ARG if the @c locale is invalid.
131 * Gets the character used for number format.
135 * @return The character used for number format, @n
136 * else an empty string if the @c symbol is invalid
137 * @param[in] symbol The number format symbol instance
138 * @see SetNumberSymbol()
140 Tizen::Base::String GetNumberSymbol(NumberSymbol symbol) const;
144 * Sets the character used for number format.
148 * @return An error code
149 * @param[in] symbol A symbol to set
150 * @param[in] str The new string for symbol
151 * @exception E_SUCCESS The method is successful.
152 * @see GetNumberSymbol()
154 result SetNumberSymbol(NumberSymbol symbol, const Tizen::Base::String& str);
158 * Gets the current locale.
162 * @return A pointer to the current instance of Locale, @n
163 * else @c null if this method fails
164 * @remarks The specific error code can be accessed using the GetLastResult() method.
166 const Locale* GetLocale(void) const;
171 * The implementation of this copy constructor is intentionally blank and declared as private to
172 * prohibit copying of objects.
174 NumberSymbols(const NumberSymbols& numberSymbols);
177 * The implementation of this copy assignment operator is intentionally blank and declared as private
178 * to prohibit copying of objects.
180 NumberSymbols& operator =(const NumberSymbols& numberSymbols);
183 friend class _NumberSymbolsImpl;
184 class _NumberSymbolsImpl* __pNumberSymbolsImpl;
190 #endif //_FLCL_NUMBER_SYMBOLS_H_