2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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.
19 * @file FUiCtrl_ScrollEventArg.cpp
20 * @brief This is the implementation for the _ScrollEventArg class.
23 #include <FBaseSysLog.h>
24 #include "FUiCtrl_ScrollEventArg.h"
26 using namespace Tizen::Base;
27 using namespace Tizen::Base::Runtime;
29 namespace Tizen { namespace Ui { namespace Controls
32 ////////////////////////////////////////////////////////////////////////////////
33 /// _ScrollEventArg class Lifecycle
35 _ScrollEventArg::_ScrollEventArg(_ScrollEventType eventType, const Control& source, int scrollPosition, ScrollEndEvent scrollType)
36 : __eventType(eventType)
37 , __pSource(const_cast <Control*>(&source))
38 , __scrollPosition(scrollPosition)
39 , __scrollType(scrollType)
44 _ScrollEventArg::~_ScrollEventArg(void)
50 _ScrollEventArg::GetScrollEventArgN(const Control& source)
52 _ScrollEventArg* pEventArg = new (std::nothrow) _ScrollEventArg(SCROLL_EVENT_ON_SCROLL_STOPPED, source);
53 SysTryReturn(NID_UI_CTRL, pEventArg != null, null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY));
59 _ScrollEventArg::GetScrollEventArgN(const Control& source, int scrollPosition)
61 _ScrollEventArg* pEventArg = new (std::nothrow) _ScrollEventArg(SCROLL_EVENT_ON_SCROLL_POSITION_CHANGED, source, scrollPosition);
62 SysTryReturn(NID_UI_CTRL, pEventArg != null, null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY));
68 _ScrollEventArg::GetScrollEventArgN(const Control& source, ScrollEndEvent scrollType)
70 _ScrollEventArg* pEventArg = new (std::nothrow) _ScrollEventArg(SCROLL_EVENT_ON_SCROLL_END_REACHED, source, -1, scrollType);
71 SysTryReturn(NID_UI_CTRL, pEventArg != null, null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY));
76 ////////////////////////////////////////////////////////////////////////////////
77 /// _ScrollEventArg class Access
80 _ScrollEventArg::GetEventType(void) const
86 _ScrollEventArg::GetSource(void) const
92 _ScrollEventArg::GetScrollPosition(void) const
94 return __scrollPosition;
98 _ScrollEventArg::GetScrollType(void) const
103 }}} // Tizen::Ui::Controls