Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_FrameEvent.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  * @file                FUiCtrl_FrameEvent.h
19  * @brief               This is the header file for _FrameEvent class.
20  * @version             1.0
21  *
22  * This header file contains declaration of _FrameEvent class.
23  * The _FrameEvent class can call listener's method. So, when event occurred,
24  * application can handle it appropriately.
25  *
26  */
27 #ifndef _FUI_CTRL_INTERNAL_FRAME_EVENT_H_
28 #define _FUI_CTRL_INTERNAL_FRAME_EVENT_H_
29
30 #include <FOspConfig.h>
31 #include <FBaseResult.h>
32 #include "FBaseRt_Event.h"
33
34 namespace Tizen { namespace Ui { namespace Controls
35 {
36
37 enum _FrameStatus
38 {
39         _FRAME_STATUS_ACTIVATED = 0,
40         _FRAME_STATUS_DEACTIVATED
41 };
42
43 class _Frame;
44
45 /**
46  * @class       _FrameEvent
47  * @brief       This class handles a frame event. It is inherited from Event class.
48  *
49  * The _Frame class has an instance of the _FrameEvent class as a member variable.
50  * Applications can register frame event listeners through it. When a frame lifecycle event occurs,
51  * the _FrameEvent class finds listener and calls the appropriate listener's method.
52  */
53 class _FrameEvent
54         : public Tizen::Base::Runtime::_Event
55 {
56 public:
57 // Lifecycle
58         static _FrameEvent* CreateInstanceN(const _Frame& source);
59         static Tizen::Base::Runtime::IEventArg* CreateFrameEventArgN(const _Frame& source, int frameState);
60
61         /**
62          * This is the class destructor.
63          *
64          */
65         virtual ~_FrameEvent(void);
66
67 // Accessor
68         /**
69          * This method returns the owner of this event.
70          *
71          * @return              See the comment above.
72          */
73         const _Frame* GetSource(void) const;
74
75 protected:
76 // Operation
77         /**
78          * This method is Implemented to call the corresponding event listener's method.
79          *
80          * @return              The method returns the error code
81          * @param[in]   pListener       The eventListener instance which is currently processing
82          * @param[in]   arg                     The event argument that is fired
83          * @return              The method returns error code.
84          * @exception   E_SUCCESS               - This method is successful.
85          * @exception   E_INVALID_ARG   - The argument passed to a method contains an invalid value.
86          * @exception   E_ARG_NULL              - The pointer passed to a method contains a @c null reference.
87          * @exception   E_UNKNOWN               - An undetermined error has occurred during operation.
88          *
89          */
90         virtual void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
91
92 private:
93 // Lifecycle
94         /**
95          * This is the default class constructor.
96          *
97          * @remarks     After creating an instance of this class, you must explicitly call one of
98          *                              construction methods to initialize the instance.
99          *
100          */
101         _FrameEvent(const _Frame& source);
102
103 private:
104 // Attribute
105         const _Frame* __pSource;
106 }; // _FrameEvent
107
108 }}} // Tizen::Ui::Controls
109
110 #endif // _FUI_CTRL_INTERNAL_FRAME_EVENT_H_