Merge "fix klocwork issue" into tizen_2.2
[platform/framework/native/uifw.git] / inc / FUiKeyEventInfo.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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 FUiKeyEventInfo.h
20  * @brief          This is the header file for the %KeyEventInfo class.
21  *
22  * This header file contains the declarations of the %KeyEventInfo class.
23  *
24  */
25
26 #ifndef _FUI_KEY_EVENT_INFO_H_
27 #define _FUI_KEY_EVENT_INFO_H_
28
29 #include <FBaseObject.h>
30 #include <FUiKeyTypes.h>
31
32 namespace Tizen { namespace Ui
33 {
34
35 class Control;
36 class _KeyEventInfoImpl;
37
38 /**
39  * @class          KeyEventInfo
40  * @brief                     This class stores the information of each key events.
41  *
42  * @since         2.1
43  *
44  * The %KeyEventInfo class provides the key event information: key code and key modifiers.
45  * @see     IPropagatedKeyEventListener::OnKeyPressed()
46  * @see   IPropagatedKeyEventListener::OnKeyReleased()
47  * @see   IPropagatedKeyEventListener::TranslateKeyEventInfo()
48  *
49  */
50 class _OSP_EXPORT_ KeyEventInfo
51            : public Tizen::Base::Object
52 {
53 public:
54         /**
55          * Initializes this instance of %KeyEventInfo.
56          *
57          * @since       2.1
58          *
59          * @param[in]   keyCode                                The key code that represents the key of interest
60          * @param[in]   keyModifiers                                The key modifier that modifies the normal action of the key
61          * @see Tizen::Ui::KeyCode
62          * @see Tizen::Ui::KeyModifier
63          */
64         KeyEventInfo(KeyCode keyCode, int keyModifiers);
65
66         /**
67          * This destructor overrides Tizen::Base::Object::~Object().
68          *
69          * @since              2.1
70          */
71         virtual ~KeyEventInfo(void);
72
73         /**
74          * Sets the key code.
75          *
76          * @since                               2.1
77          *
78          * @param[in]    keyCode         The key code
79          * @see         GetKeyCode()
80          *
81          */
82         void SetKeyCode(KeyCode keyCode);
83
84         /**
85          * Gets the key code.
86          *
87          * @since         2.1
88          *
89          * @return  The key code
90          * @see         SetKeyCode()
91          */
92         KeyCode GetKeyCode(void) const;
93
94         /**
95          * Sets the bitwise ORed key modifiers of the keyboard such as Control, Shift, Numeric lock, and so on.
96          *
97          * @since                               2.1
98          *
99          * @param[in]    keyModifiers         The key modifiers that can be combined using the bitwise OR operator
100          * @see         GetKeyModifier()
101          * @see Tizen::Ui::KeyModifier
102          *
103          */
104         void SetKeyModifier(int keyModifiers);
105
106         /**
107          * Gets the key modifiers of the keyboard such as Control, Shift, Numeric lock, and so on.
108          *
109          * @since         2.1
110          *
111          * @return  The bitwise ORing key modifiers
112          * @see         SetKeyModifier()
113          * @see Tizen::Ui::KeyModifier
114          */
115         int GetKeyModifier(void) const;
116
117 private:
118         /*
119          * This is the default constructor for this class.
120          *
121          * @since              2.1
122          */
123         KeyEventInfo(void);
124
125         /*
126          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
127          *
128          * @since              2.1
129          */
130         KeyEventInfo(const KeyEventInfo& rhs);
131
132         /*
133          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
134          *
135          * @since              2.1
136          */
137         KeyEventInfo& operator =(const KeyEventInfo& rhs);
138
139 private:
140         _KeyEventInfoImpl* __pKeyEventInfoImpl;
141
142 }; // KeyEventInfo
143
144 } } // Tizen::Ui
145
146 #endif // _FUI_KEY_EVENT_INFO_H_