Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_UiScrollEventArg.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_UiScrollEventArg.h
20  * @brief               This is the header file for _UiScrollEventArg class.
21  *
22  * This header file contains declaration of _UiScrollEventArg class.
23  *
24  */
25
26 #ifndef _FUI_CTRL_INTERNAL_SCROLL_EVENT_ARG_H_
27 #define _FUI_CTRL_INTERNAL_SCROLL_EVENT_ARG_H_
28
29 #include <FUiCtrlScrollEventTypes.h>
30 #include <FOspConfig.h>
31 #include <FBaseObject.h>
32 #include <FBaseRtIEventArg.h>
33 #include "FUiCtrl_IScrollEventListener.h"
34 #include "FUiCtrl_ScrollEventTypes.h"
35
36 namespace Tizen { namespace Ui { namespace Controls
37 {
38
39 /**
40  * @class       _UiScrollEventArg
41  * @brief       This class is used as the argument to item event listener.
42  *
43  * From this class, one can find out, the (event) source object, index and Scroll event type.
44  */
45 class _UiScrollEventArg
46         : public Tizen::Base::Runtime::IEventArg
47         , public Tizen::Base::Object
48 {
49 // Lifecycle
50 public:
51         /**
52          * This is the class destructor.
53          *
54          */
55         virtual ~_UiScrollEventArg(void);
56
57         /**
58          * General getter for %_ScrollEventArg class object when fire OnScrollStopped event
59          *
60          * @param[in]   source          A pointer to the Object instance which contains this instance
61          */
62         static _UiScrollEventArg* GetScrollEventArgN(const _Control& source);
63
64         /**
65          * General getter for %_ScrollEventArg class object when fire OnScrollPositionChanged event
66          *
67          * @param[in]   source          A pointer to the Object instance which contains this instance
68          * @param[in]   scrollPosition  A scroll position of the scroll
69          */
70         static _UiScrollEventArg* GetScrollEventArgN(const _Control& source, int scrollPosition);
71
72         /**
73          * General getter for %_ScrollEventArg class object when fire OnScrollEndReached event
74          *
75          * @param[in]   source          A pointer to the Object instance which contains this instance
76          * @param[in]   scrollType              A direction of the scroll
77          */
78         static _UiScrollEventArg* GetScrollEventArgN(const _Control& source, ScrollEndEvent scrollType);
79
80 // Access
81 public:
82         /**
83          * This method returns the type of firing event
84          *
85          * @return      See the comment above.
86          */
87         _ScrollEventType GetEventType(void) const;
88
89         /**
90         * This method returns the object which the event initially occurred.
91         *
92         * @return       The object  which the event initially occurred.
93         */
94         _Control* GetSource(void) const;
95
96         /**
97          * This method returns the ItemStatus
98          *
99          * @return      See the comment above.
100          */
101         ScrollEndEvent GetScrollType(void) const;
102
103         /**
104          * This method returns the scroll position
105          *
106          * @return      See the comment above.
107          */
108         int GetScrollPosition(void) const;
109
110 // Attribute
111 private:
112         /**
113          * This is the default class constructor.
114          *
115          * @param[in]   source          A pointer to the Object instance which contains this instance
116          * @param[in]   eventType       A type of firing event
117          * @param[in]   scrollPosition  A scroll position of the scroll
118          * @param[in]   scrollType              A direction of the scroll
119          */
120         _UiScrollEventArg(_ScrollEventType eventType, const _Control& source, int scrollPosition = -1, ScrollEndEvent scrollType = SCROLL_END_EVENT_END_TOP);
121
122         /**
123         * Event source.
124         */
125         _ScrollEventType __eventType;
126         _Control* __pSource;
127         int __scrollPosition;
128         ScrollEndEvent __scrollType;
129 };      // _UiScrollEvent
130
131 }}}      //Tizen::Ui::Controls
132
133 #endif // _FUI_CTRL_INTERNAL_SCROLL_EVENT_ARG_H_