2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef HERE_GRAPHIC_POINT_H
18 #define HERE_GRAPHIC_POINT_H
20 #include "common/HereMaps_global.h"
21 #include "base/BaseObject.h"
23 TIZEN_MAPS_BEGIN_NAMESPACE
27 class EXPORT_API Point : public Object
31 * This is the default constructor for this class. @n
32 * This initializes an instance of %Point with the values (0, 0).
39 * This is the copy constructor for the %Point class.
43 * @param[in] rhs An instance of %Point
45 Point(const Point& rhs);
48 * Initializes an instance of %Point with the specified location.
52 * @param[in] x The x-coordinate
53 * @param[in] y The y-coordinate
58 * This is the destructor for this class.
65 * Assigns the value of the specified instance to the current instance of %Point.
69 * @param[in] rhs An instance of %Point
71 Point& operator =(const Point& rhs);
74 * Checks whether the current instance and the specified instance of %Point are equal.
78 * @return @c true if the two instances of %Point are at the same location, @n
80 * @param[in] rhs An instance of %Point
82 bool operator ==(const Point& rhs) const;
85 * Checks whether the current instance and the specified instance of %Point are not equal.
89 * @return @c true if the two instances of %Point are at different locations, @n
91 * @param[in] rhs An instance of %Point
93 bool operator !=(const Point& rhs) const;
96 * Adds the value of the specified instance of %Point and the current instance.
100 * @return A new instance of %Point containing the resulting value of the operation
101 * @param[in] rhs An instance of %Point
103 Point operator +(const Point& rhs) const;
106 * Subtracts the value of the specified instance of %Point from the current instance.
110 * @return A new instance of %Point containing the resulting value of the operation
111 * @param[in] rhs An instance of %Point
113 Point operator -(const Point& rhs) const;
116 * Adds the value of the specified instance of %Point to the current instance.
120 * @param[in] point An instance of %Point
122 Point& operator +=(const Point& point);
125 * Subtracts the value of the specified instance of %Point from the current instance.
129 * @param[in] point An instance of %Point
131 Point& operator -=(const Point& point);
134 * Checks whether the value of the specified instance of %Point equals the value of the current instance.
138 * @return @c true if the value of the specified instance equals the value of the current instance, @n
140 * @param[in] rhs An instance of %Point
141 * @remarks The %Point class has a semantic value, which means that the
142 * Equals() method checks whether the two instances have the same
145 virtual bool Equals(const Object& rhs) const;
148 * Gets the hash value of the current instance.
152 * @return The hash value of the current instance
153 * @remarks Two equal instances must return the same hash value. @n For better performance,
154 * the used hash function must generate a random distribution for all inputs.
156 virtual long GetHashCode(void) const;
159 * Sets the x and y coordinates for the current instance of %Point.
163 * @param[in] x The new x-coordinate
164 * @param[in] y The new y-coordinate
166 void SetPosition(int x, int y);
169 * Sets the current instance of %Point.
173 * @param[in] point An instance of %Point
175 void SetPosition(const Point& point);
178 * Translates this %Point to the indicated distance.
182 * @param[in] deltaX The distance to move this point along the x-axis
183 * @param[in] deltaY The distance to move this point along the y-axis
185 void Translate(int deltaX, int deltaY);
189 * The x-coordinate of the point.
196 * The y-coordinate of the point.
203 friend class _PointImpl;
206 // This variable is for internal use only.
207 // Using this variable can cause behavioral, security-related, and consistency-related issues in the application.
211 class _PointImpl * __pImpl;
215 TIZEN_MAPS_END_NAMESPACE
217 #endif /* HERE_GRAPHIC_POINT_H */