Revert "Corresponding to TizenIVI3.0 M14.3, GENIVI-LayerManagement was used instead...
[profile/ivi/ico-uxf-homescreen.git] / lib / system-controller / CicoSCWlInputMgrIF.h
1 /*
2  * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
3  *
4  * This program is licensed under the terms and conditions of the
5  * Apache License, version 2.0.  The full tWlExt of the Apache License is at
6  * http://www.apache.org/licenses/LICENSE-2.0
7  *
8  */
9
10 //==========================================================================
11 /**
12  *  @file   CicoSCWlInputMgrIF.cpp
13  *
14  *  @brief  This file is definition of CicoSCInputDevConf class
15  */
16 //==========================================================================
17 #ifndef __CICO_SC_WL_INPUT_MGR_IF_H__
18 #define __CICO_SC_WL_INPUT_MGR_IF_H__
19
20 #include <string>
21 #include <ico-uxf-weston-plugin/ico_input_mgr-client-protocol.h>
22 #include "CicoSCWaylandIF.h"
23
24 //--------------------------------------------------------------------------
25 /**
26  *  @brief  This class is wayland interface of multi input manager
27  */
28 //--------------------------------------------------------------------------
29 class CicoSCWlInputMgrIF : public CicoSCWaylandIF
30 {
31 public:
32     // initialize interface
33     void initInterface(void               *data,
34                        struct wl_registry *registry,
35                        uint32_t           name,
36                        const char         *interface,
37                        uint32_t           version);
38
39     // capabilities callback function
40     void capabilitiesCB(void               *data,
41                         struct ico_exinput *ico_exinput,
42                         const char         *device,
43                         int32_t            type,
44                         const char         *swname,
45                         int32_t            input,
46                         const char          *codename,
47                         int32_t            code);
48
49     // code callback function
50     void codeCB(void               *data,
51                 struct ico_exinput *ico_exinput,
52                 const char         *device,
53                 int32_t            input,
54                 const char         *codename,
55                 int32_t            code);
56
57     // input callback function
58     void inputCB(void               *data,
59                  struct ico_exinput *ico_exinput,
60                  uint32_t           time,
61                  const char         *device,
62                  int32_t            input,
63                  int32_t            code,
64                  int32_t            state);
65
66     // region callback function
67     void regionCB(void                        *data,
68                   struct ico_input_mgr_device *ico_input_mgr_device,
69                   struct wl_array             *region);
70
71 protected:
72     // default constructor
73     CicoSCWlInputMgrIF();
74
75     // destructor
76     virtual ~CicoSCWlInputMgrIF();
77
78     // assignment operator
79     CicoSCWlInputMgrIF& operator=(const CicoSCWlInputMgrIF &object);
80
81     // copy constructor
82     CicoSCWlInputMgrIF(const CicoSCWlInputMgrIF &object);
83
84     // wrapper function ico_input_mgr_control_add_input_app
85     void addInputApp(const std::string &appid,
86                      const std::string &device,
87                      int               input,
88                      int               fix,
89                      int               keycode);
90
91     // wrapper function ico_input_mgr_control_del_input_app
92     void delInputApp(const std::string &appid,
93                      const std::string &device,
94                      int               input);
95
96     // wrapper function ico_exinput_set_input_region
97     void setInputRegion(const std::string &target,
98                         int x,
99                         int y,
100                         int width,
101                         int height,
102                         int hotspot_x,
103                         int hotspot_y,
104                         int cursor_x,
105                         int cursor_y,
106                         int cursor_width,
107                         int cursor_height,
108                         int attr);
109
110     // wrapper function ico_exinput_unset_input_region
111     void unsetInputRegion(const std::string &target,
112                           int x,
113                           int y,
114                           int width,
115                           int height);
116
117 private:
118     // ico_input_mgr(Multi Input Manager) callback functions
119
120     // wayland capabilities callback function
121     static void wlCapabilitiesCB(void               *data,
122                                  struct ico_exinput *ico_exinput,
123                                  const char         *device,
124                                  int32_t            type,
125                                  const char         *swname,
126                                  int32_t            input,
127                                  const char         *codename,
128                                  int32_t            code);
129
130     // wayland code callback function
131     static void wlCodeCB(void               *data,
132                          struct ico_exinput *ico_exinput,
133                          const char         *device,
134                          int32_t            input,
135                          const char         *codename,
136                          int32_t            code);
137
138     // wayland input callback function
139     static void wlInputCB(void               *data,
140                           struct ico_exinput *ico_exinput,
141                           uint32_t           time,
142                           const char         *device,
143                           int32_t            input,
144                           int32_t            code,
145                           int32_t            state);
146
147     // wayland region callback function
148     static void wlRegionCB(void                        *data,
149                            struct ico_input_mgr_device *ico_input_mgr_device,
150                            struct wl_array             *region);
151
152 protected:
153     // input manager interface
154     struct ico_input_mgr_control *m_inputmgr;
155
156     // extra input event interface
157     struct ico_exinput *m_exinput;
158
159     // input manage device interface
160     struct ico_input_mgr_device *m_inputmgrdev;
161
162 private:
163     // exinput listener
164     struct ico_exinput_listener m_exInputListener;
165
166     // input manager device listener
167     struct ico_input_mgr_device_listener m_devListener;
168
169 };
170 #endif  // __CICO_SC_WL_INPUT_MGR_IF_H__
171 // vim:set expandtab ts=4 sw=4: