Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_LanguageEvent.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_LanguageEvent.h
19  * @brief               This is the header file for _LanguageEvent class.
20  * @version             1.0
21  *
22  * This header file contains declaration of _LanguageEvent class.
23  */
24
25 #ifndef _FUI_CTRL_INTERNAL_LANGUAGE_EVENT_H_
26 #define _FUI_CTRL_INTERNAL_LANGUAGE_EVENT_H_
27
28 #include <FBaseResult.h>
29 #include <FBaseRt_Event.h>
30 #include <FOspConfig.h>
31 #include "FUiCtrl_ILanguageEventListener.h"
32
33 namespace Tizen { namespace Ui
34 {
35 class _Control;
36 }} // Tizen::Ui
37
38 namespace Tizen { namespace Ui { namespace Controls
39 {
40 /**
41  * @class       _FocusEvent
42  * @brief       This class handles a focus event. It is inherited from LowLevelEvent class.
43  *
44  * The Control class has an instance of the _LanguageEvent class as a member variable.
45  * _LanguageEvent notifies the listeners when a Keypad language is changed.
46  *
47  * @since       1.0
48  */
49 class _LanguageEvent
50         : public Tizen::Base::Runtime::_Event
51 {
52 // Lifecycle
53 public:
54         /**
55          * This is the class destructor.
56          */
57         virtual ~_LanguageEvent();
58
59         static _LanguageEvent* CreateInstanceN(const Tizen::Ui::_Control& source);
60
61 // Accessors
62         /**
63          * This method returns the owner of this event.
64          *
65          * @return              See the comment above.
66          */
67         const Tizen::Ui::_Control* GetSource(void) const;
68
69         static Tizen::Base::Runtime::IEventArg* CreateLanguageEventArgN(Tizen::Locales::LanguageCode prevLanguageCode, Tizen::Locales::LanguageCode currentLanguageCode);
70
71 protected:
72         /**
73          * This is the default class constructor. After creating an instance of this
74          * class, you must explicitly call one of construction methods to initialize
75          * the instance.
76          */
77         _LanguageEvent(const Tizen::Ui::_Control& source);
78
79         /**
80          * This method calls appropriate IKeyEventListener method.
81          *
82          * @param[in]   listener                The IKeyEventListener instance.
83          * @param[in]   arg                             The _FocusEventArg.
84          * @exception   E_SUCCESS               - The method is successful.
85          * @exception   E_INVALID_ARG   - The argument passed to a method contains an invalid value.
86          * @exception   E_INVALID_ARG   - @c pListener is @c null.
87          */
88         virtual void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
89
90 private:
91         const Tizen::Ui::_Control* __pSource;
92
93 }; // _LanguageEvent
94 }}}     // Tizen::Ui//Controls
95
96 #endif //_FUI_CTRL_INTERNAL_LANGUAGE_EVENT_H_