Revert "Corresponding to TizenIVI3.0 M14.3, GENIVI-LayerManagement was used instead...
[profile/ivi/ico-uxf-homescreen.git] / lib / system-controller / CicoSCInputController.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 text of the Apache License is at
6  * http://www.apache.org/licenses/LICENSE-2.0
7  *
8  */
9
10 //==========================================================================
11 /**
12  *  @file   CicoSCInputController.h
13  *
14  *  @brief  This file is definition of CicoSCInputController class
15  */
16 //==========================================================================
17 #ifndef __CICO_SC_INPUT_CONTROLLER_H__
18 #define __CICO_SC_INPUT_CONTROLLER_H__
19
20 #include <string>
21 #include <vector>
22
23 #include "CicoSCWlInputMgrIF.h"
24
25 //==========================================================================
26 //  Forward declaration
27 //==========================================================================
28 class CicoSCCommand;
29 class CicoSCInputDev;
30 class CicoSCSwitch;
31
32 //--------------------------------------------------------------------------
33 /**
34  *  @brief  This class is controller of input device
35  */
36 //--------------------------------------------------------------------------
37 class CicoSCInputController : public CicoSCWlInputMgrIF
38 {
39 public:
40     // default constructor
41     CicoSCInputController();
42
43     // destructor
44     ~CicoSCInputController();
45
46     // initialize input device information 
47     int initDB(void);
48
49     // executes an input control process corresponding to the command
50     void handleCommand(const CicoSCCommand *cmd);
51
52     // register input device control application
53     int addInputApp(const std::string &appid,
54                     const std::string &device,
55                     int               input,
56                     int               fix,
57                     int               keycode);
58
59     // unregister input device control application
60     int delInputApp(const std::string &appid,
61                     const std::string &device,
62                     int               input);
63
64     // set input region information
65     int setInputRegion(const std::string &appid,
66                        const std::string &winname,
67                        int x,
68                        int y,
69                        int width,
70                        int height,
71                        int hotspot_x,
72                        int hotspot_y,
73                        int cursor_x,
74                        int cursor_y,
75                        int cursor_width,
76                        int cursor_height,
77                        int attr);
78
79     // unset input region information
80     int unsetInputRegion(const std::string &appid,
81                          const std::string &winname,
82                          int x,
83                          int y,
84                          int width,
85                          int height);
86
87     // callback to application for input switch information
88     void capabilitiesCB(void               *data,
89                         struct ico_exinput *ico_exinput,
90                         const char         *device,
91                         int32_t            type,
92                         const char         *swname,
93                         int32_t            input,
94                         const char          *codename,
95                         int32_t            code);
96
97     // callback to application for input code information
98     void codeCB(void               *data,
99                 struct ico_exinput *ico_exinput,
100                 const char         *device,
101                 int32_t            input,
102                 const char         *codename,
103                 int32_t            code);
104
105     // callback to application for switch input 
106     void inputCB(void               *data,
107                  struct ico_exinput *ico_exinput,
108                  uint32_t           time,
109                  const char         *device,
110                  int32_t            input,
111                  int32_t            code,
112                  int32_t            state);
113
114     // callback to application for change input region
115     void regionCB(void                        *data,
116                   struct ico_input_mgr_device *ico_input_mgr_device,
117                   struct wl_array             *region);
118
119 protected:
120     // assignment operator
121     CicoSCInputController& operator=(const CicoSCInputController &object);
122
123     // copy constructor
124     CicoSCInputController(const CicoSCInputController &object);
125
126 private:
127     // find input device information
128     CicoSCInputDev* findInputDev(const char *device);
129
130     // find input device switch information
131     CicoSCSwitch* findInputSwitch(const char *device, int input);
132
133 private:
134     /// input device information list
135     std::vector<CicoSCInputDev*> m_inputDevList;
136 };
137 #endif  // __CICO_SC_INPUT_CONTROLLER_H__
138 // vim:set expandtab ts=4 sw=4: