tizen beta release
[framework/web/wrt-plugins-common.git] / src / Commons / Dimension.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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  * @author       Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
18  */
19
20 #ifndef WRTDEVICEAPIS_COMMONS_DIMENSION_H_
21 #define WRTDEVICEAPIS_COMMONS_DIMENSION_H_
22
23 namespace WrtDeviceApis {
24 namespace Commons {
25
26 /**
27  * Encapsulates width and height of a component.
28  */
29 class Dimension
30 {
31   public:
32     /**
33      * Type of dimension's values.
34      */
35     typedef unsigned int ValueType;
36
37   public:
38     /**
39      * Creates an instance of Dimension with specified width and height.
40      * @param width Specified width.
41      * @param height Specified height.
42      */
43     Dimension(ValueType width,
44             ValueType height) :
45         m_width(width),
46         m_height(height)
47     {
48     }
49
50     ValueType getWidth() const
51     {
52         return m_width;
53     }
54
55     ValueType getHeight() const
56     {
57         return m_height;
58     }
59
60     void setSize(ValueType width,
61             ValueType height)
62     {
63         m_width = width;
64         m_height = height;
65     }
66
67   private:
68     ValueType m_width;
69     ValueType m_height;
70 };
71
72 }
73 } // WrtDeviceApisCommon
74
75 #endif // WRTDEVICEAPIS_COMMONS_DIMENSION_H_