Add 'ExclusiveArch: armv7l' limit build to arm architecture
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / scrollable / scroll-view / scroll-view-effect-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 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
18 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h>
19
20 using namespace Dali;
21
22 namespace Dali
23 {
24
25 namespace Toolkit
26 {
27
28 namespace Internal
29 {
30
31 ScrollViewEffect::ScrollViewEffect()
32 : mScrollViewImpl(NULL)
33 {
34 }
35
36 ScrollViewEffect::~ScrollViewEffect()
37 {
38 }
39
40 void ScrollViewEffect::Attach(Toolkit::ScrollView& scrollView)
41 {
42   DALI_ASSERT_ALWAYS( (!mScrollViewImpl) && "Already attached to a ScrollView" );
43
44   mScrollViewImpl = &GetImpl(scrollView);
45
46   OnAttach(scrollView);
47 }
48
49 void ScrollViewEffect::Detach(Toolkit::ScrollView& scrollView)
50 {
51   DALI_ASSERT_ALWAYS( (mScrollViewImpl) && "Already detached from ScrollView" );
52   DALI_ASSERT_ALWAYS( (&GetImpl(scrollView) == mScrollViewImpl) && "Effect attached to a different ScrollView");
53
54   OnDetach(scrollView);
55
56   mScrollViewImpl = NULL;
57 }
58
59 Toolkit::ScrollView ScrollViewEffect::GetScrollView()
60 {
61   DALI_ASSERT_ALWAYS(mScrollViewImpl);
62
63   return DownCast<Toolkit::ScrollView>( mScrollViewImpl->Self() );
64 }
65
66 } // namespace Internal
67
68 } // namespace Toolkit
69
70 } // namespace Dali