Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / controls / FUiCtrl_ScrollPanelModel.cpp
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        FUiCtrl_ScrollPanelModel.cpp
20  * @brief       This is the implementation file for the %_ScrollPanelModel class.
21  *
22  */
23
24 #include <FGrpPoint.h>
25 #include <FGrpDimension.h>
26 #include <FGrpRectangle.h>
27 #include "FUiCtrl_ScrollPanelModel.h"
28
29 using namespace Tizen::Graphics;
30
31 namespace Tizen { namespace Ui { namespace Controls
32 {
33
34 _ScrollPanelModel::_ScrollPanelModel(void)
35         : __currentScrollPosition(Point(0, 0))
36         , __scrollAreaBounds(Rectangle(0, 0, 0, 0))
37 {
38         // nothing
39 }
40
41 _ScrollPanelModel::~_ScrollPanelModel(void)
42 {
43         // nothing
44 }
45
46 void
47 _ScrollPanelModel::SetCurrentScrollPosition(int currentScrollHorizontalPosition, int currentScrollVerticalPosition)
48 {
49         SetCurrentHorizontalScrollPosition(currentScrollHorizontalPosition);
50         SetCurrentVerticalScrollPosition(currentScrollVerticalPosition);
51 }
52
53 void
54 _ScrollPanelModel::SetCurrentScrollPosition(Point& currentScrollPosition)
55 {
56         __currentScrollPosition = currentScrollPosition;
57 }
58
59 Point
60 _ScrollPanelModel::GetCurrentScrollPosition(void) const
61 {
62         return __currentScrollPosition;
63 }
64
65 void
66 _ScrollPanelModel::SetCurrentVerticalScrollPosition(int currentVerticalScrollPosition)
67 {
68         __currentScrollPosition.y = currentVerticalScrollPosition;
69 }
70
71 int
72 _ScrollPanelModel::GetCurrentVerticalScrollPosition(void) const
73 {
74         return __currentScrollPosition.y;
75 }
76
77 void
78 _ScrollPanelModel::SetCurrentHorizontalScrollPosition(int currentHorizontalScrollPosition)
79 {
80         __currentScrollPosition.x = currentHorizontalScrollPosition;
81 }
82
83 int
84 _ScrollPanelModel::GetCurrentHorizontalScrollPosition(void) const
85 {
86         return __currentScrollPosition.x;
87 }
88
89 void
90 _ScrollPanelModel::SetScrollAreaBounds(Rectangle& areaBounds)
91 {
92         __scrollAreaBounds = areaBounds;
93 }
94
95 Rectangle
96 _ScrollPanelModel::GetScrollAreaBounds(void) const
97 {
98         return __scrollAreaBounds;
99 }
100
101 }}} // Tizen::Ui::Controls
102