6823279fdf000b568114394bd9bbb3ec2d0104a6
[platform/core/uifw/libscl-ui-nui.git] / scl / scleventhandler.h
1 /*
2  * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 #include "sclgwes.h"
19 #include "sclutils.h"
20 #include "sclcontext.h"
21 #include "scleventcallback.h"
22
23 #ifndef __SCL_EVENT_HANDLER_H__
24 #define __SCL_EVENT_HANDLER_H__
25
26 //SCL_BEGIN_DECLS
27
28 namespace scl
29 {
30 /**
31  * @brief The default event handler class
32  *
33  */
34 class CSCLEventHandler : public ISCLUIEventCallback
35 {
36 private:
37     CSCLEventHandler();
38 public:
39     virtual ~CSCLEventHandler();
40
41     static CSCLEventHandler* get_instance();
42
43     sclboolean set_input_mode(const sclchar *input_mode);
44     void set_event_callback(ISCLUIEventCallback *callback, const sclchar *input_mode);
45
46     SCLEventReturnType on_event_key_clicked(SclUIEventDesc ui_event_desc);
47     SCLEventReturnType on_event_drag_state_changed(SclUIEventDesc ui_event_desc);
48     SCLEventReturnType on_event_notification(SCLUINotiType noti_type, SclNotiDesc *etc_info);
49
50     void pre_process_ui_event(SclUIEventDesc &ui_event_desc);
51
52 protected:
53     ISCLUIEventCallback* m_default_event_callback;
54     ISCLUIEventCallback* m_cur_input_mode_event_callback;
55
56     std::map<std::string, ISCLUIEventCallback*> m_input_mode_event_callbacks;
57 };
58
59 }
60
61 //SCL_END_DECLS
62
63 #endif //__SCL_EVENT_HANDLER_H__