Revert "Fix N_SE-46938 for tz list."
[platform/framework/native/appfw.git] / src / locales / FLcl_FieldPosition.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16
17 /**
18  * @file        FLcl_FieldPosition.h
19  * @brief       This is the header file for the FieldPosition class.
20  */
21
22 #ifndef _FLCL_INTERNAL_FIELD_POSITION_H_
23 #define _FLCL_INTERNAL_FIELD_POSITION_H_
24
25 // Includes
26 #include <FBaseObject.h>
27
28
29 namespace Tizen { namespace Locales
30 {
31
32
33 /**
34  * @class       _FieldPosition
35  * @brief       This class is for the @e Field position management.
36  *
37  * @since       1.0
38  *
39  * @final       This class is not intended for extension.
40  *
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.
44  *
45  * The example code below should be updated.
46  *  @code
47
48     #include "FBase.h"
49     #include "FLocales.h"
50
51     using Tizen::Base;
52     using Tizen::Locales;
53
54     void
55     main(void)
56     {
57         result r;
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);
63
64         String strBuf;
65         strBuf.Contruct();
66         r = pMyFormat->Format(doubleNum,  fp, strBuf);
67         if (IsFailed(r) ) goto CATCH;
68         return;
69
70     CATCH:
71      // Error handling code
72     }
73
74     @endcode
75  *
76  *
77  */
78 class _FieldPosition
79         : public Tizen::Base::Object
80 {
81 // Construct Operations
82 public:
83         /**
84          * Initializes an instance of FieldPosition with the specified field identifier.
85          *
86          * @param[in]   field           The field identifier
87          */
88         _FieldPosition(int field);
89
90
91         /**
92          * Initializes an instance of FieldPosition with the values same as that of the specified instance.
93          *
94          * @param[in]   fieldPosition   An instance of FieldPosition
95          */
96         _FieldPosition(const _FieldPosition& fieldPosition);
97
98
99         /**
100          * This is the destructor for this class.
101          */
102         virtual ~_FieldPosition(void);
103
104
105 // Operations
106 public:
107         /**
108          * Assigns the values of the member variables of the specified instance of FieldPosition
109          * to the member variables of the current instance.
110          *
111          * @return          An FieldPosition object with new values for the member variables
112          * @param[in]   fieldPosition       The other FieldPosition instance
113          */
114         _FieldPosition& operator =(const _FieldPosition& fieldPosition);
115
116
117         /**
118          * Gets the field identifier.
119          *
120          * @return      An integer value representing the field identifier
121          *
122          */
123         int GetField(void) const;
124
125
126         /**
127          * Gets the index of the first character in the requested field.
128          *
129          * @return      An integer value representing the begin index
130          *
131          * @see         SetBeginIndex
132          *
133          */
134         int GetBeginIndex(void) const;
135
136
137         /**
138          * Sets the begin index with the specified index value.
139          *
140          * @param[in]   beginIndex      The begin index of the field
141          *
142          * @see         GetBeginIndex
143          *
144          */
145         void SetBeginIndex(int beginIndex);
146
147
148         /**
149          * Gets the index of the character following the last character in the requested field.
150          *
151          * @return      An integer value representing the end index
152          *
153          * @see         SetEndIndex
154          *
155          */
156         int GetEndIndex(void) const;
157
158
159         /**
160          * Sets the end index with the specified index value.
161          *
162          * @param[in]   endIndex        The end index of the field
163          *
164          * @see         GetEndIndex
165          *
166          */
167         void SetEndIndex(int endIndex);
168
169
170 private:
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
174 }; // FieldPosition
175
176 }} // Tizen::Locales
177
178 #endif //_FLCL_INTERNAL_FIELD_POSITION_H_