changed attributes of header files
[platform/core/location/maps-plugin-here.git] / inc / engine / graphic / FloatRectangle.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_FLOATRECTANGLE_H
18 #define HERE_GRAPHIC_FLOATRECTANGLE_H
19
20 #include "common/HereMaps_global.h"
21 #include "base/BaseObject.h"
22 #include "graphic/FloatDimension.h"
23 #include "graphic/FloatPoint.h"
24
25 TIZEN_MAPS_BEGIN_NAMESPACE
26
27 class FloatRectangle;
28
29 class EXPORT_API FloatRectangle : public Object
30 {
31 public:
32         /**
33          * This is the default constructor for this class. @n
34          * It initializes an instance of %FloatRectangle with all its attributes set to @c 0.f.
35          *
36          * @since 2.0
37          *
38          * @remarks             The attribute value is @c 0 when initialized.
39          */
40         FloatRectangle(void);
41
42         /**
43          * This is the copy constructor for the %FloatRectangle class.
44          *
45          * @since 2.0
46          *
47          * @param[in]     rhs                     An instance of %FloatRectangle
48          */
49         FloatRectangle(const FloatRectangle& rhs);
50
51         /**
52          * Initializes an instance of %FloatRectangle with the specified location and dimension.
53          *
54          * @since 2.0
55          *
56          * @param[in]   x               The x-coordinate of the top-left corner of the rectangle
57          * @param[in]   y               The y-coordinate of the top-left corner of the rectangle
58          * @param[in]   width   The width of the rectangle
59          * @param[in]   height  The height of the rectangle
60          *
61          */
62         FloatRectangle(float x, float y, float width, float height);
63
64         /**
65          * Initializes an instance of %FloatRectangle at the location specified by @c point and
66          * with dimension specified by @c dim.
67          *
68          * @since 2.0
69          *
70          * @param[in]   point           The location of the top-left corner of the rectangle
71          * @param[in]   dim                     The width and height of the rectangle
72          */
73         FloatRectangle(const FloatPoint& point, const FloatDimension& dim);
74
75         /**
76          * This is the destructor for this class.
77          *
78          * @since 2.0
79          */
80         virtual ~FloatRectangle(void);
81
82         /**
83          * This is the default assignment operator for this class.
84          *
85          * @since 2.0
86          *
87          * @param[in]     rhs                     An instance of %FloatRectangle
88          */
89         FloatRectangle& operator=(const FloatRectangle& rhs);
90
91         /**
92          * Checks whether the location and dimension of the current instance of %FloatRectangle match those of the
93          * specified instance of %FloatRectangle.
94          *
95          * @since 2.0
96          *
97          * @return              @c true if the location and dimension of the current instance match those of the specified instance, @n
98          *                              else @c false
99          * @param[in]   rhs             An instance of %FloatRectangle
100          */
101         bool operator==(const FloatRectangle& rhs) const;
102
103         /**
104          * Checks whether the location and dimension of the current instance of %FloatRectangle do not match those of the
105          * specified instance of %FloatRectangle.
106          *
107          * @since 2.0
108          *
109          * @return              @c true if the location and dimension of the current instance do not match those of the specified instance, @n
110          *                              else @c false
111          * @param[in]   rhs             An instance of %FloatRectangle
112          */
113         bool operator!=(const FloatRectangle& rhs) const;
114
115         /**
116          * Checks whether the specified point lies inside the current instance of %FloatRectangle.
117          *
118          * @since 2.0
119          *
120          * @return              @c true if the location represented by @c point lies inside the current instance of %FloatRectangle, @n
121          *                              else @c false
122          * @param[in]   point   An instance of FloatPoint
123          */
124         bool Contains(const FloatPoint& point) const;
125
126         /**
127          * Checks whether the value of the current instance of %FloatRectangle equals the value of the specified instance of
128          * %FloatRectangle.
129          *
130          * @since 2.0
131          *
132          * @return              @c true if the value of the current instance of %FloatRectangle equals the value of the specified instance of %FloatRectangle, @n
133          *                              else @c false
134          * @param[in]   rhs             An instance of %FloatRectangle
135          * @remarks             The %FloatRectangle class has a semantic value, which means that the Equals() method checks whether the
136          *                              two instances have the same location and size.
137          */
138         virtual bool Equals(const Object& rhs) const;
139
140         /**
141          * Gets the hash value of the current instance.
142          *
143          * @since 2.0
144          *
145          * @return              The hash value of the current instance
146          * @remarks             Two equal instances must return the same hash value. For better performance,
147          *                              the used hash function must generate a random distribution for all inputs.
148          */
149         virtual long GetHashCode(void) const;
150
151         /**
152          * Gets the intersection of the current instance and the specified instance of %FloatRectangle. @n
153          * If the two instances of %FloatRectangle do not intersect, empty instance is returned.
154          *
155          * @since 2.0
156          *
157          * @param[in]   rect    An instance of %FloatRectangle
158          */
159         FloatRectangle GetIntersection(const FloatRectangle& rect) const;
160
161         /**
162          * Checks whether the current instance of %FloatRectangle intersects with the specified instance of %FloatRectangle.
163          *
164          * @since 2.0
165          *
166          * @return              @c true if the current instance of %FloatRectangle intersects with the specified instance of %FloatRectangle, @n
167          *                              else @c false
168          * @param[in]   rect    An instance of %FloatRectangle
169          *
170          */
171         bool IsIntersected(const FloatRectangle& rect) const;
172
173         /**
174          * Gets the union of the current instance and the specified instance of %FloatRectangle.
175          *
176          * @since 2.0
177          *
178          * @return              An instance of %FloatRectangle containing the union of the two rectangles
179          * @param[in]   rect    An instance of %FloatRectangle
180          */
181         FloatRectangle GetUnion(const FloatRectangle& rect) const;
182
183         /**
184          * Gets the coordinates of the point at the bottom-right corner of the rectangle.
185          *
186          * @since 2.0
187          *
188          * @return              The coordinates of the point at the bottom-right corner of the rectangle
189          */
190         FloatPoint GetBottomRight(void) const;
191
192         /**
193          * Gets the coordinates of the point at the top-left corner of the rectangle.
194          *
195          * @since 2.0
196          *
197          * @return              The coordinates of the point at the top-left corner of the rectangle
198          */
199         FloatPoint GetTopLeft(void) const;
200
201         /**
202          * Checks whether this %FloatRectangle is empty. @n
203          * A %FloatRectangle is empty if its width or its height is less than or equal to @c 0.
204          *
205          * @since 2.0
206          *
207          * @return              @c true if this rectangle is empty,     @n
208          *                              else @c false
209          */
210         bool IsEmpty(void) const;
211
212         /**
213          * Sets the size of this %FloatRectangle to match the specified FloatDimension.
214          *
215          * @since 2.0
216          *
217          * @param[in]   dim             The new size for FloatDimension
218          */
219         void SetSize(const FloatDimension& dim);
220
221         /**
222          * Sets the size of this %FloatRectangle to match the specified dimension.
223          *
224          * @since 2.0
225          *
226          * @param[in]   width   The new width
227          * @param[in]   height  The new height
228          */
229         void SetSize(float width, float height);
230
231         /**
232          * Sets the position of this %FloatRectangle to the specified point.
233          *
234          * @since 2.0
235          *
236          * @param[in]   point   The new position
237          */
238         void SetPosition(const FloatPoint& point);
239
240         /**
241          * Sets the location of the current instance of %FloatRectangle with the specified values of the
242          * x and y coordinates of the top-left corner point.
243          *
244          * @since 2.0
245          *
246          * @param[in]   x               The new x-coordinate
247          * @param[in]   y               The new y-coordinate
248          */
249         void SetPosition(float x, float y);
250
251         /**
252          * Sets the location and the dimensions of the current instance of %FloatRectangle with the specified x and y
253          * coordinates of the top-left corner point and the specified dimensions.
254          *
255          * @since 2.0
256          *
257          * @param[in]   x               The new x-coordinate
258          * @param[in]   y               The new y-coordinate
259          * @param[in]   width   The new width
260          * @param[in]   height  The new height
261          */
262         void SetBounds(float x, float y, float width, float height);
263
264         /**
265          * Sets the location and the dimensions of the current instance of %FloatRectangle with the specified location and
266          * dimension.
267          *
268          * @since 2.0
269          *
270          * @param[in]   point   An instance of FloatPoint
271          * @param[in]   dim             An instance of FloatDimension
272          */
273         void SetBounds(const FloatPoint& point, const FloatDimension& dim);
274
275         /**
276          * Translates this %FloatRectangle to the new point by the specified distance along the x-axis and y-axis.
277          *
278          * @since 2.0
279          *
280          * @param[in]   deltaX  The distance to move this %FloatRectangle along the x-axis
281          * @param[in]   deltaY  The distance to move this %FloatRectangle along the y-axis
282          */
283         void Translate(float deltaX, float deltaY);
284
285 public:
286         /**
287          * The x-coordinate of the top-left corner of the rectangle.
288          *
289          * @since 2.0
290          */
291         float x;
292
293         /**
294          * The y-coordinate of the top-left corner of the rectangle.
295          *
296          * @since 2.0
297          */
298         float y;
299
300         /**
301          * The width of this rectangle.
302          *
303          * @since 2.0
304          */
305         float width;
306
307         /**
308          * The height of this rectangle.
309          *
310          * @since 2.0
311          */
312         float height;
313
314 private:
315         friend class _FloatRectangleImpl;
316
317         //
318         // This variable is for internal use only.
319         // Using this variable can cause behavioral, security-related, and consistency-related issues in the application.
320         //
321         // @since 2.0
322         //
323         class _FloatRectangleImpl* __pImpl;
324
325 }; // FloatRectangle
326
327 TIZEN_MAPS_END_NAMESPACE
328
329 #endif /* HERE_GRAPHIC_FLOATRECTANGLE_H */