2 // Open Service Platform
3 // Copyright (c) 2012-2013 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 FGrpFloatPoint.h
20 * @brief This is the header file for the %FloatPoint class.
22 * This header file contains the declarations of the %FloatPoint class.
25 #ifndef _FGRP_FLOAT_POINT_H_
26 #define _FGRP_FLOAT_POINT_H_
28 #include <FBaseObject.h>
30 namespace Tizen { namespace Graphics {
33 * @brief This class encapsulates a point in a two-dimensional coordinate system.
37 * The %FloatPoint class represents a location in a two-dimensional coordinate space specified with an single precision floating point.
39 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/graphics/shapes.htm">Shapes</a>.
41 class _OSP_EXPORT_ FloatPoint :
42 public Tizen::Base::Object
46 * This is the default constructor for this class. @n
47 * This constructor initializes an instance of %FloatPoint with the values (0.f, 0.f).
54 * This is the copy constructor for the %FloatPoint class.
58 * @param[in] rhs An instance of %FloatPoint
60 FloatPoint(const FloatPoint& rhs);
63 * Initializes an instance of %FloatPoint with the specified location.
67 * @param[in] x The x-coordinate
68 * @param[in] y The y-coordinate
70 FloatPoint(float x, float y);
73 * This is the destructor for this class.
77 virtual ~FloatPoint(void);
80 * This is the default assignment operator for this class.
84 * @param[in] rhs An instance of %FloatPoint
86 FloatPoint& operator=(const FloatPoint& rhs);
89 * Checks whether the current instance and the specified instance of %FloatPoint are equal.
93 * @return @c true if the two instances of %FloatPoint are at the same location, @n
95 * @param[in] rhs An instance of %FloatPoint
97 bool operator==(const FloatPoint& rhs) const;
100 * Checks whether the current instance and the specified instance of %FloatPoint are not equal.
104 * @return @c true if the two instances of %FloatPoint are at different locations, @n
106 * @param[in] rhs An instance of %FloatPoint
108 bool operator!=(const FloatPoint& rhs) const;
111 * Adds the value of the specified instance of %FloatPoint and the current instance.
115 * @return A new instance of %FloatPoint containing the resulting value of the operation
116 * @param[in] rhs An instance of %FloatPoint
118 FloatPoint operator+(const FloatPoint& rhs) const;
121 * Subtracts the value of the specified instance of %FloatPoint and the current instance.
125 * @return A new instance of %FloatPoint containing the resulting value of the operation
126 * @param[in] rhs An instance of %FloatPoint
128 FloatPoint operator-(const FloatPoint& rhs) const;
131 * Adds the value of the specified instance of %FloatPoint to the current instance.
135 * @param[in] point An instance of %FloatPoint
137 FloatPoint& operator+=(const FloatPoint& point);
140 * Subtracts the value of the specified instance of %FloatPoint from the current instance.
144 * @param[in] point An instance of %FloatPoint
146 FloatPoint& operator-=(const FloatPoint& point);
149 * Checks whether the value of the specified instance of %FloatPoint equals the value of the current instance.
153 * @return @c true if the value of the specified instance equals the value of the current instance, @n
155 * @param[in] rhs An instance of %FloatPoint
156 * @remarks The %FloatPoint class has a semantic value, which means that the
157 * Equals() method checks whether the two instances have the same
160 virtual bool Equals(const Tizen::Base::Object& rhs) const;
163 * Gets the hash value of the current instance.
167 * @return The hash value of the current instance
168 * @remarks Two equal instances must return the same hash value. For better performance,
169 * the used hash function must generate a random distribution for all inputs.
171 virtual int GetHashCode(void) const;
174 * Sets the x and y coordinates for the current instance of %FloatPoint.
178 * @param[in] x The new x-coordinate
179 * @param[in] y The new y-coordinate
181 void SetPosition(float x, float y);
184 * Sets the current instance of %FloatPoint.
188 * @param[in] point An instance of %FloatPoint
190 void SetPosition(const FloatPoint& point);
193 * Translates this %FloatPoint to the indicated distance.
197 * @param[in] deltaX The distance to move this point along the x-axis
198 * @param[in] deltaY The distance to move this point along the y-axis
200 void Translate(float deltaX, float deltaY);
204 * The x-coordinate of the point.
211 * The y-coordinate of the point.
218 friend class _FloatPointImpl;
221 // This variable is for internal use only.
222 // Using this variable can cause behavioral, security-related, and consistency-related issues in the application.
226 class _FloatPointImpl* __pImpl;
230 }} // Tizen::Graphics
232 #endif // _FGRP_FLOAT_POINT_H_