Split dali-toolkit into Base & Optional
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / public-api / controls / scrollable / scroll-component-impl.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 // CLASS HEADER
18 #include <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h>
19
20 namespace Dali
21 {
22
23 namespace Toolkit
24 {
25
26 namespace // unnamed namespace
27 {
28
29 BaseHandle Create()
30 {
31   // empty handle as we cannot create ScrollComponent
32   return BaseHandle();
33 }
34
35 TypeRegistration mType( typeid(Toolkit::ScrollComponent), typeid(Toolkit::Control), Create );
36
37 } // unnamed namespace
38
39 void ScrollComponentImpl::SetScrollConnector( Toolkit::ScrollConnector connector )
40 {
41   if( mScrollConnector != connector )
42   {
43     Toolkit::ScrollConnector oldConnector = mScrollConnector;
44     mScrollConnector = connector;
45
46     // Notify derived classes
47     OnScrollConnectorSet( oldConnector );
48   }
49 }
50
51 Toolkit::ScrollConnector ScrollComponentImpl::GetScrollConnector() const
52 {
53   return mScrollConnector;
54 }
55
56 ScrollComponentImpl::ScrollComponentImpl()
57 : ControlImpl(true/*requires touch*/)
58 {
59 }
60
61 ScrollComponentImpl::~ScrollComponentImpl()
62 {
63 }
64
65 void ScrollComponentImpl::OnScrollConnectorSet( Toolkit::ScrollConnector connector )
66 {
67   // Do nothing (override in derived classes)
68 }
69
70 } // namespace Toolkit
71
72 } // namespace Dali