0d005315f20e55c168bb1ee4e8308b818b60d809
[platform/core/location/maps-plugin-here.git] / inc / engine / graphic / Point.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 #ifndef HERE_GRAPHIC_POINT_H
18 #define HERE_GRAPHIC_POINT_H
19
20 #include "common/HereMaps_global.h"
21 #include "base/BaseObject.h"
22
23 TIZEN_MAPS_BEGIN_NAMESPACE
24
25 class Point;
26
27 class EXPORT_API Point : public Object
28 {
29 public:
30         /**
31          * This is the default constructor for this class. @n
32          * This initializes an instance of %Point with the values (0, 0).
33          *
34          * @since       2.0
35          */
36         Point(void);
37
38         /**
39         * This is the copy constructor for the %Point class.
40         *
41         * @since 2.0
42         *
43         * @param[in]    rhs             An instance of %Point
44         */
45         Point(const Point& rhs);
46
47         /**
48          * Initializes an instance of %Point with the specified location.
49          *
50          * @since                       2.0
51          *
52          * @param[in]   x  The x-coordinate
53          * @param[in]   y  The y-coordinate
54          */
55         Point(int x, int y);
56
57         /**
58          * This is the destructor for this class.
59          *
60          * @since       2.0
61          */
62         virtual ~Point(void);
63
64         /**
65         * Assigns the value of the specified instance to the current instance of %Point.
66         *
67         * @since 2.0
68         *
69         * @param[in]    rhs             An instance of %Point
70         */
71         Point& operator =(const Point& rhs);
72
73         /**
74          * Checks whether the current instance and the specified instance of %Point are equal.
75          *
76          * @since               2.0
77          *
78          * @return              @c true if the two instances of %Point are at the same location, @n
79          *                              else @c false
80          * @param[in]   rhs             An instance of %Point
81          */
82         bool operator ==(const Point& rhs) const;
83
84         /**
85          * Checks whether the current instance and the specified instance of %Point are not equal.
86          *
87          * @since               2.0
88          *
89          * @return              @c true if the two instances of %Point are at different locations, @n
90          *                              else @c false
91          * @param[in]   rhs             An instance of %Point
92          */
93         bool operator !=(const Point& rhs) const;
94
95         /**
96          * Adds the value of the specified instance of %Point and the current instance.
97          *
98          * @since               2.0
99          *
100          * @return              A new instance of %Point containing the resulting value of the operation
101          * @param[in]   rhs             An instance of %Point
102          */
103         Point operator +(const Point& rhs) const;
104
105         /**
106          * Subtracts the value of the specified instance of %Point from the current instance.
107          *
108          * @since               2.0
109          *
110          * @return              A new instance of %Point containing the resulting value of the operation
111          * @param[in]   rhs             An instance of %Point
112          */
113         Point operator -(const Point& rhs) const;
114
115         /**
116          * Adds the value of the specified instance of %Point to the current instance.
117          *
118          * @since               2.0
119          *
120          * @param[in]   point           An instance of %Point
121          */
122         Point& operator +=(const Point& point);
123
124         /**
125          * Subtracts the value of the specified instance of %Point from the current instance.
126          *
127          * @since               2.0
128          *
129          * @param[in]   point           An instance of %Point
130          */
131         Point& operator -=(const Point& point);
132
133         /**
134          * Checks whether the value of the specified instance of %Point equals the value of the current instance.
135          *
136          * @since               2.0
137          *
138          * @return              @c true if the value of the specified instance equals the value of the current instance, @n
139          *              else @c false
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
143          *                              location.
144          */
145         virtual bool Equals(const Object& rhs) const;
146
147         /**
148          * Gets the hash value of the current instance.
149          *
150          * @since               2.0
151          *
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.
155          */
156         virtual long GetHashCode(void) const;
157
158         /**
159          * Sets the x and y coordinates for the current instance of %Point.
160          *
161          * @since               2.0
162          *
163          * @param[in]   x       The new x-coordinate
164          * @param[in]   y       The new y-coordinate
165          */
166         void SetPosition(int x, int y);
167
168         /**
169          * Sets the current instance of %Point.
170          *
171          * @since               2.0
172          *
173          * @param[in]   point   An instance of %Point
174          */
175         void SetPosition(const Point& point);
176
177         /**
178          * Translates this %Point to the indicated distance.
179          *
180          * @since               2.0
181          *
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
184          */
185         void Translate(int deltaX, int deltaY);
186
187 public:
188         /**
189          *      The x-coordinate of the point.
190          *
191          *  @since      2.0
192          */
193         int x;
194
195         /**
196          *      The y-coordinate of the point.
197          *
198          *  @since      2.0
199          */
200         int y;
201
202 private:
203         friend class _PointImpl;
204
205         //
206         // This variable is for internal use only.
207         // Using this variable can cause behavioral, security-related, and consistency-related issues in the application.
208         //
209         // @since 2.0
210         //
211         class _PointImpl * __pImpl;
212
213 }; // Point
214
215 TIZEN_MAPS_END_NAMESPACE
216
217 #endif /* HERE_GRAPHIC_POINT_H */