Merge "Fix Ime Rotation" into tizen_2.1
[platform/framework/native/uifw.git] / inc / FGrpPoint.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 /**
19  * @file        FGrpPoint.h
20  * @brief       This is the header file for the %Point class.
21  *
22  * This header file contains the declarations of the %Point class.
23  */
24
25 #ifndef _FGRP_POINT_H_
26 #define _FGRP_POINT_H_
27
28 #include <FBaseObject.h>
29
30 namespace Tizen { namespace Graphics
31 {
32 /**
33  * @class       Point
34  * @brief       This class encapsulates a point in a two-dimensional coordinate system.
35  *
36  * @since       2.0
37  *
38  * @final       This class is not intended for extension.
39  *
40  * The %Point class represents a location in a two-dimensional coordinate space specified with an integer precision.
41  *
42  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/graphics/shapes.htm">Shapes</a>.
43  */
44 class _OSP_EXPORT_ Point
45         : public Tizen::Base::Object
46 {
47 public:
48         /**
49          * This is the default constructor for this class. @n
50          * This initializes an instance of %Point with the values (0, 0).
51          *
52          * @since       2.0
53          */
54         Point(void);
55
56         /**
57         * This is the copy constructor for the %Point class.
58         *
59         * @since 2.0
60         *
61         * @param[in]    rhs             An instance of %Point
62         */
63         Point(const Point& rhs);
64
65         /**
66          * Initializes an instance of %Point with the specified location.
67          *
68          * @since                       2.0
69          *
70          * @param[in]   x  The x-coordinate
71          * @param[in]   y  The y-coordinate
72          */
73         Point(int x, int y);
74
75         /**
76          * This is the destructor for this class.
77          *
78          * @since       2.0
79          */
80         virtual ~Point(void);
81
82         /**
83         * Assigns the value of the specified instance to the current instance of %Point.
84         *
85         * @since 2.0
86         *
87         * @param[in]    rhs             An instance of %Point
88         */
89         Point& operator =(const Point& rhs);
90
91         /**
92          * Checks whether the current instance and the specified instance of %Point are equal.
93          *
94          * @since               2.0
95          *
96          * @return              @c true if the two instances of %Point are at the same location, @n
97          *                              else @c false
98          * @param[in]   rhs             An instance of %Point
99          */
100         bool operator ==(const Point& rhs) const;
101
102         /**
103          * Checks whether the current instance and the specified instance of %Point are not equal.
104          *
105          * @since               2.0
106          *
107          * @return              @c true if the two instances of %Point are at different locations, @n
108          *                              else @c false
109          * @param[in]   rhs             An instance of %Point
110          */
111         bool operator !=(const Point& rhs) const;
112
113         /**
114          * Adds the value of the specified instance of %Point and the current instance.
115          *
116          * @since               2.0
117          *
118          * @return              A new instance of %Point containing the resulting value of the operation
119          * @param[in]   rhs             An instance of %Point
120          */
121         Point operator +(const Point& rhs) const;
122
123         /**
124          * Subtracts the value of the specified instance of %Point and the current instance.
125          *
126          * @since               2.0
127          *
128          * @return              A new instance of %Point containing the resulting value of the operation
129          * @param[in]   rhs             An instance of %Point
130          */
131         Point operator -(const Point& rhs) const;
132
133         /**
134          * Adds the value of the specified instance of %Point to the current instance.
135          *
136          * @since               2.0
137          *
138          * @param[in]   point           An instance of %Point
139          */
140         Point& operator +=(const Point& point);
141
142         /**
143          * Subtracts the value of the specified instance of %Point from the current instance.
144          *
145          * @since               2.0
146          *
147          * @param[in]   point           An instance of %Point
148          */
149         Point& operator -=(const Point& point);
150
151         /**
152          * Checks whether the value of the specified instance of %Point equals the value of the current instance.
153          *
154          * @since               2.0
155          *
156          * @return              @c true if the value of the specified instance equals the value of the current instance, @n
157          *              else @c false
158          * @param[in]   rhs             An instance of %Point
159          * @remarks             The %Point class has a semantic value, which means that the
160          *                              Equals() method checks whether the two instances have the same
161          *                              location.
162          */
163         virtual bool Equals(const Tizen::Base::Object& rhs) const;
164
165         /**
166          * Gets the hash value of the current instance.
167          *
168          * @since               2.0
169          *
170          * @return              The hash value of the current instance
171          * @remarks             Two equal instances must return the same hash value. For better performance,
172          *                              the used hash function must generate a random distribution for all inputs.
173          */
174         virtual int GetHashCode(void) const;
175
176         /**
177          * Sets the x and y coordinates for the current instance of %Point.
178          *
179          * @since               2.0
180          *
181          * @param[in]   x       The new x-coordinate
182          * @param[in]   y       The new y-coordinate
183          */
184         void SetPosition(int x, int y);
185
186         /**
187          * Sets the current instance of %Point.
188          *
189          * @since               2.0
190          *
191          * @param[in]   point   An instance of %Point
192          */
193         void SetPosition(const Point& point);
194
195         /**
196          * Translates this %Point to the indicated distance.
197          *
198          * @since               2.0
199          *
200          * @param[in]   deltaX  The distance to move this point along the x-axis
201          * @param[in]   deltaY  The distance to move this point along the y-axis
202          */
203         void Translate(int deltaX, int deltaY);
204
205 public:
206         /**
207          *      The x-coordinate of the point.
208          *
209          *  @since      2.0
210          */
211         int x;
212
213         /**
214          *      The y-coordinate of the point.
215          *
216          *  @since      2.0
217          */
218         int y;
219
220 private:
221         friend class _PointImpl;
222
223         //
224         // This variable is for internal use only.
225         // Using this variable can cause behavioral, security-related, and consistency-related issues in the application.
226         //
227         // @since 2.0
228         //
229         class _PointImpl * __pImpl;
230
231 }; // Point
232
233 }} // Tizen::Graphics
234
235 #endif // _FGRP_POINT_H_