Merge "Unchecked GetCharacter func when index is over string length" into tizen_2.2
[platform/framework/native/uifw.git] / inc / FGrpCoordinateSystem.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        FGrpCoordinateSystem.h
20  * @brief       This is the header file for the %CoordinateSystem class.
21  *
22  * This header file contains the declarations of the %CoordinateSystem class.
23  */
24
25 #ifndef _FGRP_COORDINATE_SYSTEM_H_
26 #define _FGRP_COORDINATE_SYSTEM_H_
27
28
29 #include <FGrpDimension.h>
30 #include <FGrpFloatPoint.h>
31 #include <FGrpFloatDimension.h>
32 #include <FGrpFloatRectangle.h>
33
34
35 namespace Tizen { namespace Graphics
36 {
37
38 /**
39  * @class       CoordinateSystem
40  * @brief       This class provides various utility methods for coordinate handling.
41  *
42  * @since 2.0
43  *
44  * The %CoordinateSystem class provides various utility methods for coordinate handling.
45  *
46  */
47 class _OSP_EXPORT_ CoordinateSystem
48 {
49 public:
50         /**
51          * Returns the screen resolution in logical coordinates.
52          *
53          * @since 2.0
54          *
55          * @return                      The screen resolution in logical coordinates
56          */
57         static Dimension GetLogicalResolution(void);
58
59         /**
60          * Returns the screen resolution in physical coordinates.
61          *
62          * @since 2.0
63          *
64          * @return                      The screen resolution in physical coordinates
65          */
66         static Dimension GetPhysicalResolution(void);
67
68         /**
69          * Converts the physical value along x-axis to the logical one.
70          *
71          * @since 2.0
72          *
73          * @return                      The converted logical value for the physical one
74          * @param[in]                   physicalX       An input physical value to convert
75          */
76         static int ConvertToLogicalX(int physicalX);
77
78         /**
79          * Converts the physical value along x-axis to the logical one.
80          *
81          * @since 2.1
82          *
83          * @return                      The converted logical value for the physical one
84          * @param[in]                   physicalX       An input physical value to convert
85          */
86         static float ConvertToLogicalX(float physicalX);
87
88         /**
89          * Converts the physical value along y-axis to the logical one.
90          *
91          * @since 2.0
92          *
93          * @return                      The converted logical value for the physical one
94          * @param[in]                   physicalY       An input physical value to convert
95          */
96         static int ConvertToLogicalY(int physicalY);
97
98         /**
99          * Converts the physical value along y-axis to the logical one.
100          *
101          * @since 2.1
102          *
103          * @return                      The converted logical value for the physical one
104          * @param[in]                   physicalY       An input physical value to convert
105          */
106         static float ConvertToLogicalY(float physicalY);
107
108         /**
109          * Converts the logical value along x-axis to the physical one.
110          *
111          * @since 2.0
112          *
113          * @return                      The converted physical X value
114          * @param[in]                   logicalX        An input logical value to convert
115          */
116         static int ConvertToPhysicalX(int logicalX);
117
118         /**
119          * Converts the logical value along x-axis to the physical one.
120          *
121          * @since 2.1
122          *
123          * @return                      The converted physical X value
124          * @param[in]                   logicalX        An input logical value to convert
125          */
126         static float ConvertToPhysicalX(float logicalX);
127
128         /**
129          * Converts the logical value along y-axis to the physical one.
130          *
131          * @since 2.0
132          *
133          * @return                      The converted physical Y value
134          * @param[in]                   logicalY        An input logical value to convert
135          */
136         static int ConvertToPhysicalY(int logicalY);
137
138         /**
139          * Converts the logical value along y-axis to the physical one.
140          *
141          * @since 2.1
142          *
143          * @return                      The converted physical Y value
144          * @param[in]                   logicalY        An input logical value to convert
145          */
146         static float ConvertToPhysicalY(float logicalY);
147
148         /**
149          * Returns the FloatPoint instance, which will be pixel-exact for the device coordinate system to display the best appearance.
150          *
151          * @since 2.1
152          *
153          * @return      Device aligned point
154          * @param[in]   point   The input point to align
155          */
156         static FloatPoint AlignToDevice(const FloatPoint& point);
157
158         /**
159          * Returns the FloatDimension instance, which will be pixel-exact for the device coordinate system to display the best appearance.
160          *
161          * @since 2.1
162          *
163          * @return      Device aligned dimension
164          * @param[in]   dimension       The input dimension to align
165          */
166         static FloatDimension AlignToDevice(const FloatDimension& dimension);
167
168         /**
169          * Returns the FloatRectangle instance, which will be pixel-exact for the device coordinate system to display the best appearance.
170          *
171          * @since 2.1
172          *
173          * @return      Device aligned rectangle
174          * @param[in]   rectangle       The input rectangle to align
175          */
176         static FloatRectangle AlignToDevice(const FloatRectangle& rectangle);
177
178 private:
179         //
180         // This default constructor is intentionally declared as private because this class cannot be constructed.
181         //
182         CoordinateSystem(void);
183
184         //
185         // This destructor is intentionally declared as private because this class cannot be constructed.
186         //
187         ~CoordinateSystem(void);
188
189 }; // CoordinateSystem
190
191 }} // Tizen::Graphics
192
193 #endif // _FGRP_COORDINATE_SYSTEM_H_
194