Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_PublicColorChangeEvent.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_PublicColorChangeEvent.h
19  * @brief       This is the header file for _PublicColorChangeEvent class.
20  *
21  * This header file contains declaration of _PublicColorChangeEvent class.
22  */
23 #ifndef _FUI_CTRL_INTERNAL_PUBLIC_COLOR_CHANGE_EVENT_H_
24 #define _FUI_CTRL_INTERNAL_PUBLIC_COLOR_CHANGE_EVENT_H_
25
26 #include <FBaseResult.h>
27 #include <FBaseRt_Event.h>
28
29 namespace Tizen { namespace Graphics
30 {
31 class Color;
32 }} // Tizen::Graphics
33
34 namespace Tizen { namespace Ui
35 {
36 class Control;
37 }} // Tizen::Ui
38
39 namespace Tizen { namespace Ui { namespace Controls
40 {
41 /**
42 * @class        _ColorChangeEvent
43 * @brief        This class handles a action event. It is inherited from Event class.
44 *
45 * The Window(root of all widgets) class has an instance of the ColorChangeEvent class as a member variable.
46 * Applications can register action event listeners through it. When a action event occurred,
47 * the ColorChangeEvent class finds listener and calls the appropriate listener's method.
48 *
49 */
50 class _PublicColorChangeEvent
51         : public Tizen::Base::Runtime::_Event
52 {
53 public:
54         //
55         // This is the default class constructor.
56         //
57         _PublicColorChangeEvent(void);
58
59         //
60         // This is the default class destructor.
61         //
62         virtual ~_PublicColorChangeEvent(void);
63
64         //
65         // This method initializes this instance. This method should be called
66         // after this instance is constructed.
67         //
68         // @return      The method returns error code.
69         // @param[in]   source          A pointer to the Object instance which contains this instance.
70         // @exception   E_SUCCESS       - This method is successful.
71         // @exception   E_ARG_NULL              - The input source is null.
72         //
73         static _PublicColorChangeEvent* CreateInstanceN(const Tizen::Ui::Control& source);
74
75         //
76         // This method returns the owner of this event.
77         //
78         // @return              See the comment above.
79         //
80         const Tizen::Ui::Control* GetSource(void) const;
81
82         static Tizen::Base::Runtime::IEventArg* CreateColorChangeEventArgN(const Tizen::Graphics::Color& color);
83
84 protected:
85         _PublicColorChangeEvent(const Tizen::Ui::Control& source);
86
87         //
88         // This method checks the arg and finds out the type of event. After that this method calls appropriate
89         // listener's method.
90         //
91         // @param[in]   pListener       It is a event listener related to this ColorChange event.
92         // @param[in]   arg                     It is an argument-like instance of ColorChange event retransmitted to the listener's method
93         //                                                      as an argument.
94         //
95         virtual void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
96
97 private:
98         const Tizen::Ui::Control* __pSource;
99 };      // _PublicColorChangeEvent
100
101 }}} // Tizen::Ui::Controls
102
103 #endif // _FUI_CTRL_INTERNAL_PUBLIC_COLOR_CHANGE_EVENT_H_