2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FLcl_FieldPosition.h
20 * @brief This is the header file for the FieldPosition class.
23 #ifndef _FLCL_INTERNAL_FIELD_POSITION_H_
24 #define _FLCL_INTERNAL_FIELD_POSITION_H_
27 #include <FBaseObject.h>
30 namespace Tizen { namespace Locales
35 * @class _FieldPosition
36 * @brief This class is for the @e Field position management.
40 * @final This class is not intended for extension.
42 * FieldPosition is a simple class used by Format and its subclasses to identify fields in formatted output.
43 * FieldPosition keeps track of the position of the field within the formatted output with two indices:
44 * the index of the first character of the field and the index of the last character of the field.
46 * The example code below should be updated.
59 double num = 12345678.9
60 NumberFormat* pMyFormat;
61 pMyFormat = NumberFormat::CreateNumberFormat();
62 if (IsFailed(GetLastResult())) goto CATCH;
63 FieldPosition fp(NumberFormat::ALIGNMENT_FIELD_INTEGER);
67 r = pMyFormat->Format(doubleNum, fp, strBuf);
68 if (IsFailed(r) ) goto CATCH;
72 // Error handling code
80 : public Tizen::Base::Object
82 // Construct Operations
85 * Initializes an instance of FieldPosition with the specified field identifier.
87 * @param[in] field The field identifier
89 _FieldPosition(int field);
93 * Initializes an instance of FieldPosition with the values same as that of the specified instance.
95 * @param[in] fieldPosition An instance of FieldPosition
97 _FieldPosition(const _FieldPosition& fieldPosition);
101 * This is the destructor for this class.
103 virtual ~_FieldPosition(void);
109 * Assigns the values of the member variables of the specified instance of FieldPosition
110 * to the member variables of the current instance.
112 * @return An FieldPosition object with new values for the member variables
113 * @param[in] fieldPosition The other FieldPosition instance
115 _FieldPosition& operator =(const _FieldPosition& fieldPosition);
119 * Gets the field identifier.
121 * @return An integer value representing the field identifier
124 int GetField(void) const;
128 * Gets the index of the first character in the requested field.
130 * @return An integer value representing the begin index
135 int GetBeginIndex(void) const;
139 * Sets the begin index with the specified index value.
141 * @param[in] beginIndex The begin index of the field
146 void SetBeginIndex(int beginIndex);
150 * Gets the index of the character following the last character in the requested field.
152 * @return An integer value representing the end index
157 int GetEndIndex(void) const;
161 * Sets the end index with the specified index value.
163 * @param[in] endIndex The end index of the field
168 void SetEndIndex(int endIndex);
172 int __field; // field identifier of this field position
173 int __beginIndex; // begin index of this field position
174 int __endIndex; // end index of this field position
179 #endif //_FLCL_INTERNAL_FIELD_POSITION_H_