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 for number symbols.
68 * The %NumberSymbols class represents the set of symbols (such as the decimal separator and the grouping separator) needed by
69 * NumberFormatter to format numbers. %NumberFormatter creates its own instance of %NumberSymbols from its locale data.
70 * %NumberSymbols can be adapted by a %NumberFormatter instance, or it can be specified when a %NumberFormatter is created.
71 * If you need to change any of these symbols, you can get the %NumberSymbols instance from your %NumberFormatter and then modify it.
73 * 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>.
75 class _OSP_EXPORT_ NumberSymbols
76 : public Tizen::Base::Object
80 * This is the default constructor for this class. @n
81 * The object is not fully constructed after this constructor is called. For full construction, the Construct()
82 * method must be called right after calling this constructor.
89 * This is the destructor for this class. @n
90 * This destructor overrides Tizen::Base::Object::~Object().
94 virtual ~NumberSymbols(void);
98 * Initializes this instance of %NumberSymbols with the specified @c locale.
101 * @brief <i> [Compatibility] </i>
105 * @compatibility This method has compatibility issues with OSP compatible applications. @n
106 * For more information, see @ref CompNumberSymbolsConstructPage "here".
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.
115 result Construct(const Locale& locale);
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 @c E_UNSUPPORTED_OPERATION if the @c locale is invalid.
124 * @section CompNumberSymbolsConstructSolutionSection Resolutions
125 * This issue has been resolved in Tizen.
126 * @par When working in Tizen:
127 * -# The method returns @c E_INVALID_ARG if the @c locale is invalid.
132 * Gets the character used for number format.
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()
141 Tizen::Base::String GetNumberSymbol(NumberSymbol symbol) const;
145 * Sets the character used for number format.
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()
155 result SetNumberSymbol(NumberSymbol symbol, const Tizen::Base::String& str);
159 * Gets the current locale.
163 * @return A pointer to the current instance of Locale, @n
164 * else @c null if it fails
165 * @remarks The specific error code can be accessed using the GetLastResult() method.
167 const Locale* GetLocale(void) const;
172 * The implementation of this copy constructor is intentionally blank and declared as private to
173 * prohibit copying of objects.
175 NumberSymbols(const NumberSymbols& numberSymbols);
178 * The implementation of this copy assignment operator is intentionally blank and declared as private
179 * to prohibit copying of objects.
181 NumberSymbols& operator =(const NumberSymbols& numberSymbols);
184 friend class _NumberSymbolsImpl;
185 class _NumberSymbolsImpl* __pNumberSymbolsImpl;
191 #endif //_FLCL_NUMBER_SYMBOLS_H_