Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_ScrollPanelImpl.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        FUiCtrl_ScrollPanelImpl.h
20  * @brief       This is the header file for the _ScrollPanelImpl class.
21  *
22  * This header file contains the declarations of the _ScrollPanelImpl class.
23  */
24
25 #ifndef _FUI_CTRL_INTERNAL_SCROLL_PANEL_IMPL_H_
26 #define _FUI_CTRL_INTERNAL_SCROLL_PANEL_IMPL_H_
27
28 #include <FUiCtrlScrollPanel.h>
29 #include "FUiCtrl_IScrollEventListener.h"
30 #include "FUiCtrl_PanelImpl.h"
31 #include "FUiCtrl_ScrollPanel.h"
32
33 namespace Tizen { namespace Ui { namespace Controls
34 {
35
36 class _ScrollEvent;
37
38 class _ScrollPanelImpl
39         : public _PanelImpl
40         , public _IScrollEventListener
41         , virtual public Tizen::Base::Runtime::IEventListener
42 {
43 // Lifecycle
44 public:
45         virtual ~_ScrollPanelImpl(void);
46
47 // Operations
48 public:
49         static _ScrollPanelImpl* CreateScrollPanelImplN(ScrollPanel* pPublic, const Tizen::Graphics::Rectangle& rect, ScrollPanelScrollDirection scrollDirection, bool autoResizingEnable, Layout* pPublicPortraitLayout = null, Layout* pPublicLandscapeLayout = null);
50
51         // scroll operations
52         int GetScrollPosition(void) const;
53         void SetScrollPosition(int position, bool withAnimation);
54
55         void ScrollToBottom(void) const;
56         void ScrollToTop(void) const;
57
58         // scroll event listener
59         void AddScrollEventListener(IScrollEventListener& listener);
60         void RemoveScrollEventListener(IScrollEventListener& listener);
61
62         // scroll event listener
63         virtual void OnScrollEndReached(_Control& source, ScrollEndEvent type);
64         virtual void OnScrollPositionChanged(_Control& source, int scrollPosition);
65         virtual void OnScrollStopped(_Control& source);
66
67         Tizen::Graphics::Rectangle GetClientAreaBounds(void) const;
68         result SetClientAreaHeight(int height);
69         result SetClientAreaWidth(int width);
70
71         ScrollPanelScrollDirection GetScrollDirection(void) const;
72
73         bool IsScrollAreaAutoResizingEnabled(void) const;
74
75         void SetPageScrollEnabled(bool enable);
76         bool IsPageScrollEnabled(void) const;
77
78         void SetScrollBarVisible(bool visible);
79         bool IsScrollBarVisible(void) const;
80
81         void SetScrollInputMode(ScrollInputMode mode);
82         ScrollInputMode GetScrollInputMode(void) const;
83
84         // dirty function for OSP 2.0
85         result CloseOverlayWindow(void); // deprecate on Tizen 2.0
86
87 // Accessor
88 public:
89         static const _ScrollPanelImpl* GetInstance(const ScrollPanel& scrollPanel);
90         static _ScrollPanelImpl* GetInstance(ScrollPanel& scrollPanel);
91
92         virtual const char* GetPublicClassName(void) const;
93         virtual const ScrollPanel& GetPublic(void) const;
94         virtual ScrollPanel& GetPublic(void);
95         virtual const _ScrollPanel& GetCore(void) const;
96         virtual _ScrollPanel& GetCore(void);
97
98 // Lifecycle
99 protected:
100         _ScrollPanelImpl(Control* pPublic, _Control* pCore, Layout* pPublicPortraitLayout = null, Layout* pPublicLandscapeLayout = null);
101
102 private:
103         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
104         _ScrollPanelImpl(const _ScrollPanelImpl& rhs);
105
106         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
107         _ScrollPanelImpl& operator =(const _ScrollPanelImpl& rhs);
108
109 // scroll event
110 private:
111         _ScrollEvent* __pScrollEvent;
112
113 }; // _ScrollPanelImpl
114
115 }}} // Tizen::Ui::Controls
116
117 #endif //_FUI_CTRL_INTERNAL_SCROLL_PANEL_IMPL_H_
118