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_UiScrollEventArg.cpp
20 * @brief This is the implementation for the _UiScrollEventArg class.
23 #include <FBaseSysLog.h>
24 #include "FUiCtrl_UiScrollEventArg.h"
26 using namespace Tizen::Base;
27 using namespace Tizen::Base::Runtime;
29 namespace Tizen { namespace Ui { namespace Controls
32 ////////////////////////////////////////////////////////////////////////////////
33 /// _UiScrollEventArg class Lifecycle
35 _UiScrollEventArg::_UiScrollEventArg(_ScrollEventType eventType, const _Control& source, float scrollPosition, ScrollEndEvent scrollType)
36 : __eventType(eventType)
37 , __pSource(const_cast <_Control*>(&source))
38 , __scrollPosition(scrollPosition)
39 , __scrollType(scrollType)
44 _UiScrollEventArg::~_UiScrollEventArg(void)
50 _UiScrollEventArg::GetScrollEventArgN(const _Control& source)
52 _UiScrollEventArg* pEventArg = new (std::nothrow) _UiScrollEventArg(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 _UiScrollEventArg::GetScrollJumpToTopEventArgN(const _Control& source)
61 _UiScrollEventArg* pEventArg = new (std::nothrow) _UiScrollEventArg(SCROLL_EVENT_ON_SCROLL_JUMP_TO_TOP, source);
62 SysTryReturn(NID_UI_CTRL, pEventArg != null, null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY));
68 _UiScrollEventArg::GetScrollEventArgN(const _Control& source, float scrollPosition)
70 _UiScrollEventArg* pEventArg = new (std::nothrow) _UiScrollEventArg(SCROLL_EVENT_ON_SCROLL_POSITION_CHANGED, source, scrollPosition);
71 SysTryReturn(NID_UI_CTRL, pEventArg != null, null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY));
77 _UiScrollEventArg::GetScrollEventArgN(const _Control& source, ScrollEndEvent scrollType)
79 _UiScrollEventArg* pEventArg = new (std::nothrow) _UiScrollEventArg(SCROLL_EVENT_ON_SCROLL_END_REACHED, source, -1.0f, scrollType);
80 SysTryReturn(NID_UI_CTRL, pEventArg != null, null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY));
85 ////////////////////////////////////////////////////////////////////////////////
86 /// _UiScrollEventArg class Access
88 _UiScrollEventArg::GetEventType(void) const
95 _UiScrollEventArg::GetSource(void) const
102 _UiScrollEventArg::GetScrollType(void) const
109 _UiScrollEventArg::GetScrollPosition(void) const
112 return __scrollPosition;
115 }}} // Tizen::Ui::Controls