input: add getter/setter for controlling input device event
[platform/core/api/device.git] / include / input-internal.h
1 /*
2  * Copyright (c) 2022 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 #ifndef __TIZEN_SYSTEM_INPUT_INTERNAL_H__
18 #define __TIZEN_SYSTEM_INPUT_INTERNAL_H__
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 #include <stdint.h>
25
26 #include "device-error.h"
27
28 /**
29  * @brief Enumeration for the distinction of input device types.
30  * @since_tizen 7.0
31  */
32 typedef enum
33 {
34         DEVICE_INPUT_TYPE_UNKNOWN = 0, /**< Input device type which is not defined. */
35         DEVICE_INPUT_TYPE_ALL, /**< Input device type which is all kinds of input devices */
36         DEVICE_INPUT_TYPE_MOUSE, /**< Input device type which is mouse-type */
37         DEVICE_INPUT_TYPE_KEYBOARD, /**< Input device type which is keyboard-type */
38
39         DEVICE_INPUT_TYPE_CUSTOM_KNOB = 1000, /**< Input device type which is customed knob-type */
40 } device_input_type_e;
41
42 /**
43  * @brief Change input device event state by input device id.
44  * @since_tizen 7.0
45  * @remarks #DEVICE_ERROR_NOT_SUPPORTED is returned, when the trying to control DEVICE_INPUT_TYPE_KEYBOARD device
46  *          and following feature is not supported: %http://tizen.org/feature/input.keyboard \n
47  * @param[in] input_device_id The input id of the input device under the sys/class/input node \n
48  *                            This is for the distinction and control of input devices. \n
49  * @param[in] on The value to be set for the input device event state \n
50  * @return @c 0 on success,
51  *         otherwise a negative error value
52  * @retval #DEVICE_ERROR_NONE Successful
53  * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported in this device
54  * @retval #DEVICE_ERROR_OPERATION_FAILED Operation not permitted
55  */
56 int device_input_set_event_state(int input_device_id, bool on);
57
58 /**
59  * @brief Get input device event state by input device id.
60  * @since_tizen 7.0
61  * @remarks #DEVICE_ERROR_NOT_SUPPORTED is returned, when the trying to control DEVICE_INPUT_TYPE_KEYBOARD device
62  *          and following feature is not supported: %http://tizen.org/feature/input.keyboard \n
63  * @param[in] input_device_id The input id of the input device under the sys/class/input node \n
64  *                            This is for the distinction and control of input devices. \n
65  * @param[out] on The value to be get from the input device event state \n
66  * @return @c 0 on success,
67  *         otherwise a negative error value
68  * @retval #DEVICE_ERROR_NONE Successful
69  * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported in this device
70  * @retval #DEVICE_ERROR_OPERATION_FAILED Operation not permitted
71  */
72 int device_input_get_event_state(int input_device_id, bool *on);
73
74 #ifdef __cplusplus
75 }
76 #endif
77
78 #endif  /* __TIZEN_SYSTEM_INPUT_INTERNAL_H__ */