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 FLcl_FieldPosition.h
19 * @brief This is the header file for the FieldPosition class.
22 #ifndef _FLCL_INTERNAL_FIELD_POSITION_H_
23 #define _FLCL_INTERNAL_FIELD_POSITION_H_
26 #include <FBaseObject.h>
29 namespace Tizen { namespace Locales
34 * @class _FieldPosition
35 * @brief This class is for the @e Field position management.
39 * @final This class is not intended for extension.
41 * FieldPosition is a simple class used by Format and its subclasses to identify fields in formatted output.
42 * FieldPosition keeps track of the position of the field within the formatted output with two indices:
43 * the index of the first character of the field and the index of the last character of the field.
45 * The example code below should be updated.
58 double num = 12345678.9
59 NumberFormat* pMyFormat;
60 pMyFormat = NumberFormat::CreateNumberFormat();
61 if (IsFailed(GetLastResult())) goto CATCH;
62 FieldPosition fp(NumberFormat::ALIGNMENT_FIELD_INTEGER);
66 r = pMyFormat->Format(doubleNum, fp, strBuf);
67 if (IsFailed(r) ) goto CATCH;
71 // Error handling code
79 : public Tizen::Base::Object
81 // Construct Operations
84 * Initializes an instance of FieldPosition with the specified field identifier.
86 * @param[in] field The field identifier
88 _FieldPosition(int field);
92 * Initializes an instance of FieldPosition with the values same as that of the specified instance.
94 * @param[in] fieldPosition An instance of FieldPosition
96 _FieldPosition(const _FieldPosition& fieldPosition);
100 * This is the destructor for this class.
102 virtual ~_FieldPosition(void);
108 * Assigns the values of the member variables of the specified instance of FieldPosition
109 * to the member variables of the current instance.
111 * @return An FieldPosition object with new values for the member variables
112 * @param[in] fieldPosition The other FieldPosition instance
114 _FieldPosition& operator =(const _FieldPosition& fieldPosition);
118 * Gets the field identifier.
120 * @return An integer value representing the field identifier
123 int GetField(void) const;
127 * Gets the index of the first character in the requested field.
129 * @return An integer value representing the begin index
134 int GetBeginIndex(void) const;
138 * Sets the begin index with the specified index value.
140 * @param[in] beginIndex The begin index of the field
145 void SetBeginIndex(int beginIndex);
149 * Gets the index of the character following the last character in the requested field.
151 * @return An integer value representing the end index
156 int GetEndIndex(void) const;
160 * Sets the end index with the specified index value.
162 * @param[in] endIndex The end index of the field
167 void SetEndIndex(int endIndex);
171 int __field; // field identifier of this field position
172 int __beginIndex; // begin index of this field position
173 int __endIndex; // end index of this field position
178 #endif //_FLCL_INTERNAL_FIELD_POSITION_H_