Fork for IVI: mesa fixing
[profile/ivi/uifw.git] / src / ui / inc / FUi_Dimensionf.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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                FUi_Dimensionf.h
20  * @brief               Header file of _Dimensionf class
21  *
22  * This file contains declarations _Dimensionf class.
23  */
24
25 #ifndef _FUI_ANIM_INTERNAL_DIMENSIONF_H_
26 #define _FUI_ANIM_INTERNAL_DIMENSIONF_H_
27
28 #include <FGrpDimension.h>
29
30 namespace Tizen { namespace Ui { namespace Animations
31 {
32
33 class _Dimensionf
34 {
35 public:
36         _Dimensionf(void)
37                 : __width(0.0f)
38                 , __height(0.0f) {}
39         _Dimensionf(float width, float height)
40                 : __width(width)
41                 , __height(height) {}
42         _Dimensionf(const _Dimensionf& dim)
43                 : __width(dim.__width)
44                 , __height(dim.__height) {}
45         virtual ~_Dimensionf(void) {}
46
47         _Dimensionf& SetSize(float width, float height) { __width = width;__height = height; return *this; }
48
49         float Width(void) const { return __width;}
50         float Height(void) const { return __height;}
51         float& Width(void) { return __width;}
52         float& Height(void) { return __height;}
53
54         bool operator !=(const _Dimensionf& dim) const
55         {
56                 // CHECKME: need float compare ???
57                 return (__width != dim.__width) || (__height != dim.__height);
58         }
59
60         bool operator ==(const _Dimensionf& dim) const
61         {
62                 // CHECKME: need float compare ???
63                 return (__width == dim.__width) && (__height == dim.__height);
64         }
65
66         _Dimensionf& operator =(const _Dimensionf& dim)
67         {
68                 if (&dim != this)
69                 {
70                         __width = dim.__width;
71                         __height = dim.__height;
72                 }
73
74                 return *this;
75         }
76
77 public:
78         float __width;
79         float __height;
80 };              // _Dimensionf
81
82 }}}             // Tizen::Ui::Animations
83
84 #endif  //_FUI_ANIM_INTERNAL_DIMENSIONF_H_