Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUi_UiEvent.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        FUi_UiEvent.h
19  * @brief       This is the header file for the _UiEvent class.
20  *
21  * This header file contains the declarations of the %_UiEvent class.
22  */
23
24 #ifndef _FUI_INTERNAL_UI_EVENT_H_
25 #define _FUI_INTERNAL_UI_EVENT_H_
26
27 #include <FBaseTypes.h>
28 #include <FBaseObject.h>
29 #include <FBase_HandleT.h>
30 #include "FUi_UiEventTypes.h"
31 #include "FUi_IUiEventListener.h"
32 #include "FUi_IUiEventPreviewer.h"
33
34 namespace Tizen { namespace Base { namespace Collection
35 {
36 class IList;
37 } } }
38
39 namespace Tizen {namespace Ui
40 {
41
42 class _Control;
43 typedef Tizen::Base::_HandleT <Tizen::Ui::_Control> _UiObjectHandle;
44
45 /**
46 * This is internal. If used in an application, the application can get rejected during the certification process.
47 * @class        _UiEvent
48 * @brief        This class impliments _UiEvent and
49 * fire the Window Event object of a Ui Control.
50 */
51 class _OSP_EXPORT_ _UiEvent
52         : public Tizen::Base::Object
53 {
54 // Lifecycle
55 public:
56         /**
57         * This is the default class constructor.
58         *
59         */
60         _UiEvent(const _UiObjectHandle& destination, const _UiObjectHandle& source, _UiEventRouteType routeType);
61         _UiEvent(const _UiEvent& rhs);
62
63         /**
64          * This is the default class destructor.
65          *
66          */
67         virtual ~_UiEvent(void);
68
69 public:
70         _UiEvent& operator =(const _UiEvent& rhs);
71
72 public:
73         _UiObjectHandle GetDestination(void) const;
74         _UiObjectHandle GetSource(void) const;
75         void SetRouteType(_UiEventRouteType routeType);
76         _UiEventRouteType GetRouteType(void) const;
77         void SetOriginalDestination(const _Control& control);
78         _UiObjectHandle GetOriginalDestination(void) const;
79         result ProcessPreviewEvent(const _Control& control, bool& isFiltered);
80         result ProcessEvent(const _Control& control, bool& isFiltered);
81         result ProcessListener(const _IUiEventListener& listener, bool& isFiltered);
82
83 public:
84         virtual _UiEvent* CloneN(void) const = 0;
85         virtual _UiEventType GetEventType(void) const = 0;
86         const _Control* GetControl(const _UiObjectHandle& handle) const;
87         void SetAccessibilityEvent(bool set);
88         bool GetAccessibilityEvent(void) const;
89
90 private:
91         virtual bool IsEventReceivable(const _Control& control) const;
92         virtual result OnPreviewEventProcessing(const _Control& control, bool& isFiltered) = 0;
93         virtual result OnEventProcessing(const _Control& control, bool& isFiltered) = 0;
94         virtual result OnListenerProcessing(const _IUiEventListener& listener, bool& isFiltered) = 0;
95         virtual result OnEventHandled(const _Control& control);
96
97 private:
98         _UiObjectHandle __destination;
99         _UiObjectHandle __source;
100         _UiObjectHandle __originalDestination;
101
102         _UiEventRouteType __routeType;
103         bool __accessibilityEvent;
104 };
105
106 }} // Tizen::Ui
107
108 #endif //_FUI_INTERNAL_UI_EVENT_H_