2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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.
20 * @brief This is the header file for the %Point class.
22 * This header file contains the declarations of the %Point class.
25 #ifndef _FGRP_POINT_H_
26 #define _FGRP_POINT_H_
28 #include <FBaseObject.h>
30 namespace Tizen { namespace Graphics
34 * @brief This class encapsulates a point in a two-dimensional coordinate system.
38 * @final This class is not intended for extension.
40 * The %Point class represents a location in a two-dimensional coordinate space specified with an integer precision.
42 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/graphics/shapes.htm">Shapes</a>.
44 class _OSP_EXPORT_ Point
45 : public Tizen::Base::Object
49 * This is the default constructor for this class. @n
50 * This initializes an instance of %Point with the values (0, 0).
57 * This is the copy constructor for the %Point class.
61 * @param[in] rhs An instance of %Point
63 Point(const Point& rhs);
66 * Initializes an instance of %Point with the specified location.
70 * @param[in] x The x-coordinate
71 * @param[in] y The y-coordinate
76 * This is the destructor for this class.
83 * Assigns the value of the specified instance to the current instance of %Point.
87 * @param[in] rhs An instance of %Point
89 Point& operator =(const Point& rhs);
92 * Checks whether the current instance and the specified instance of %Point are equal.
96 * @return @c true if the two instances of %Point are at the same location, @n
98 * @param[in] rhs An instance of %Point
100 bool operator ==(const Point& rhs) const;
103 * Checks whether the current instance and the specified instance of %Point are not equal.
107 * @return @c true if the two instances of %Point are at different locations, @n
109 * @param[in] rhs An instance of %Point
111 bool operator !=(const Point& rhs) const;
114 * Adds the value of the specified instance of %Point and the current instance.
118 * @return A new instance of %Point containing the resulting value of the operation
119 * @param[in] rhs An instance of %Point
121 Point operator +(const Point& rhs) const;
124 * Subtracts the value of the specified instance of %Point and the current instance.
128 * @return A new instance of %Point containing the resulting value of the operation
129 * @param[in] rhs An instance of %Point
131 Point operator -(const Point& rhs) const;
134 * Adds the value of the specified instance of %Point to the current instance.
138 * @param[in] point An instance of %Point
140 Point& operator +=(const Point& point);
143 * Subtracts the value of the specified instance of %Point from the current instance.
147 * @param[in] point An instance of %Point
149 Point& operator -=(const Point& point);
152 * Checks whether the value of the specified instance of %Point equals the value of the current instance.
156 * @return @c true if the value of the specified instance equals the value of the current instance, @n
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
163 virtual bool Equals(const Tizen::Base::Object& rhs) const;
166 * Gets the hash value of the current instance.
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.
174 virtual int GetHashCode(void) const;
177 * Sets the x and y coordinates for the current instance of %Point.
181 * @param[in] x The new x-coordinate
182 * @param[in] y The new y-coordinate
184 void SetPosition(int x, int y);
187 * Sets the current instance of %Point.
191 * @param[in] point An instance of %Point
193 void SetPosition(const Point& point);
196 * Translates this %Point to the indicated distance.
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
203 void Translate(int deltaX, int deltaY);
207 * The x-coordinate of the point.
214 * The y-coordinate of the point.
221 friend class _PointImpl;
224 // This variable is for internal use only.
225 // Using this variable can cause behavioral, security-related, and consistency-related issues in the application.
229 class _PointImpl * __pImpl;
233 }} // Tizen::Graphics
235 #endif // _FGRP_POINT_H_