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