show OverlayRegion when FormActivated
[platform/framework/native/uifw.git] / inc / FGrpFloatPoint.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //      http://www.apache.org/licenses/LICENSE-2.0/
10 //
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.
16 //
17
18 /**
19  * @file        FGrpFloatPoint.h
20  * @brief       This is the header file for the %FloatPoint class.
21  *
22  * This header file contains the declarations of the %FloatPoint class.
23  */
24
25 #ifndef _FGRP_FLOAT_POINT_H_
26 #define _FGRP_FLOAT_POINT_H_
27
28 #include <FBaseObject.h>
29
30 namespace Tizen { namespace Graphics {
31 /**
32  * @class       FloatPoint
33  * @brief       This class encapsulates a point in a two-dimensional coordinate system.
34  *
35  * @since 2.0
36  *
37  * The %FloatPoint class represents a location in a two-dimensional coordinate space specified with an single precision floating point.
38  *
39  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/graphics/shapes.htm">Shapes</a>.
40  */
41 class _OSP_EXPORT_ FloatPoint :
42         public Tizen::Base::Object
43 {
44 public:
45         /**
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).
48          *
49          * @since 2.0
50          */
51         FloatPoint(void);
52
53         /**
54          * This is the copy constructor for the %FloatPoint class.
55          *
56          * @since 2.0
57          *
58          * @param[in]     rhs                     An instance of %FloatPoint
59          */
60         FloatPoint(const FloatPoint& rhs);
61
62         /**
63          * Initializes an instance of %FloatPoint with the specified location.
64          *
65          * @since 2.0
66          *
67          * @param[in]   x  The x-coordinate
68          * @param[in]   y  The y-coordinate
69          */
70         FloatPoint(float x, float y);
71
72         /**
73          * This is the destructor for this class.
74          *
75          * @since 2.0
76          */
77         virtual ~FloatPoint(void);
78
79         /**
80          * This is the default assignment operator for this class.
81          *
82          * @since 2.0
83          *
84          * @param[in]     rhs                     An instance of %FloatPoint
85          */
86         FloatPoint& operator=(const FloatPoint& rhs);
87
88         /**
89          * Checks whether the current instance and the specified instance of %FloatPoint are equal.
90          *
91          * @since 2.0
92          *
93          * @return              @c true if the two instances of %FloatPoint are at the same location, @n
94          *                              else @c false
95          * @param[in]   rhs             An instance of %FloatPoint
96          */
97         bool operator==(const FloatPoint& rhs) const;
98
99         /**
100          * Checks whether the current instance and the specified instance of %FloatPoint are not equal.
101          *
102          * @since 2.0
103          *
104          * @return              @c true if the two instances of %FloatPoint are at different locations, @n
105          *                              else @c false
106          * @param[in]   rhs             An instance of %FloatPoint
107          */
108         bool operator!=(const FloatPoint& rhs) const;
109
110         /**
111          * Adds the value of the specified instance of %FloatPoint and the current instance.
112          *
113          * @since 2.0
114          *
115          * @return              A new instance of %FloatPoint containing the resulting value of the operation
116          * @param[in]   rhs             An instance of %FloatPoint
117          */
118         FloatPoint operator+(const FloatPoint& rhs) const;
119
120         /**
121          * Subtracts the value of the specified instance of %FloatPoint and the current instance.
122          *
123          * @since 2.0
124          *
125          * @return              A new instance of %FloatPoint containing the resulting value of the operation
126          * @param[in]   rhs             An instance of %FloatPoint
127          */
128         FloatPoint operator-(const FloatPoint& rhs) const;
129
130         /**
131          * Adds the value of the specified instance of %FloatPoint to the current instance.
132          *
133          * @since 2.0
134          *
135          * @param[in]   point           An instance of %FloatPoint
136          */
137         FloatPoint& operator+=(const FloatPoint& point);
138
139         /**
140          * Subtracts the value of the specified instance of %FloatPoint from the current instance.
141          *
142          * @since 2.0
143          *
144          * @param[in]   point           An instance of %FloatPoint
145          */
146         FloatPoint& operator-=(const FloatPoint& point);
147
148         /**
149          * Checks whether the value of the specified instance of %FloatPoint equals the value of the current instance.
150          *
151          * @since 2.0
152          *
153          * @return              @c true if the value of the specified instance equals the value of the current instance, @n
154          *                              else @c false
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
158          *                              location.
159          */
160         virtual bool Equals(const Tizen::Base::Object& rhs) const;
161
162         /**
163          * Gets the hash value of the current instance.
164          *
165          * @since 2.0
166          *
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.
170          */
171         virtual int GetHashCode(void) const;
172
173         /**
174          * Sets the x and y coordinates for the current instance of %FloatPoint.
175          *
176          * @since 2.0
177          *
178          * @param[in]   x       The new x-coordinate
179          * @param[in]   y       The new y-coordinate
180          */
181         void SetPosition(float x, float y);
182
183         /**
184          * Sets the current instance of %FloatPoint.
185          *
186          * @since 2.0
187          *
188          * @param[in]   point   An instance of %FloatPoint
189          */
190         void SetPosition(const FloatPoint& point);
191
192         /**
193          * Translates this %FloatPoint to the indicated distance.
194          *
195          * @since 2.0
196          *
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
199          */
200         void Translate(float deltaX, float deltaY);
201
202 public:
203         /**
204          *      The x-coordinate of the point.
205          *
206          *  @since 2.0
207          */
208         float x;
209
210         /**
211          *      The y-coordinate of the point.
212          *
213          *  @since 2.0
214          */
215         float y;
216
217 private:
218         friend class _FloatPointImpl;
219
220         //
221         // This variable is for internal use only.
222         // Using this variable can cause behavioral, security-related, and consistency-related issues in the application.
223         //
224         // @since 2.0
225         //
226         class _FloatPointImpl* __pImpl;
227
228 }; // FloatPoint
229
230 }} // Tizen::Graphics
231
232 #endif // _FGRP_FLOAT_POINT_H_