2 * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __TIZEN_SYSTEM_INPUT_INTERNAL_H__
18 #define __TIZEN_SYSTEM_INPUT_INTERNAL_H__
26 #include "device-error.h"
29 * @brief Enumeration for the distinction of input device types.
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 DEVICE_INPUT_TYPE_TOUCHSCREEN, /**< Input device type which is touchscreen-type */
40 DEVICE_INPUT_TYPE_CUSTOM_KNOB = 1000, /**< Input device type which is customed knob-type */
41 } device_input_type_e;
44 * @brief Get input default device id by input device type
46 * @remarks #DEVICE_ERROR_NOT_SUPPORTED is returned, when the trying to control DEVICE_INPUT_TYPE_KEYBOARD device
47 * and following feature is not supported: %http://tizen.org/feature/input.keyboard \n
48 * @param[in] input_device_type The type to get input device information \n
49 * @param[out] input_device_id The id value to be get from the input devices by input_device_type \n
50 * @return @c 0 on success,
51 * otherwise a negative error value
52 * @retval #DEVICE_ERROR_NONE Successful
53 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
54 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported in this device
55 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation not permitted
57 int device_input_get_default_device(device_input_type_e input_device_type, int *input_device_id);
60 * @brief Get input device id list by input device type.
62 * @remarks #DEVICE_ERROR_NOT_SUPPORTED is returned, when the trying to control DEVICE_INPUT_TYPE_KEYBOARD device
63 * and following feature is not supported: %http://tizen.org/feature/input.keyboard \n
64 * after using input_device_ids, it should be freed by caller \n
65 * @param[in] input_device_type The type to get input devices information \n
66 * @param[out] input_deivce_ids The id list value to be get from the input devices \n
67 * @param[out] num_input_device_ids The number of ids to be get from the input devices \n
68 * @return @c 0 on success,
69 * otherwise a negative error value
70 * @retval #DEVICE_ERROR_NONE Successful
71 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
72 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported in this device
73 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation not permitted
75 int device_input_get_devices(device_input_type_e input_device_type, int **input_deivce_ids, int *num_input_device_ids);
78 * @brief Change input device event state by input device id.
80 * @remarks #DEVICE_ERROR_NOT_SUPPORTED is returned, when the trying to control DEVICE_INPUT_TYPE_KEYBOARD device
81 * and following feature is not supported: %http://tizen.org/feature/input.keyboard \n
82 * @param[in] input_device_id The input id of the input device under the sys/class/input node \n
83 * This is for the distinction and control of input devices. \n
84 * @param[in] on The value to be set for the input device event state \n
85 * @return @c 0 on success,
86 * otherwise a negative error value
87 * @retval #DEVICE_ERROR_NONE Successful
88 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported in this device
89 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation not permitted
91 int device_input_set_event_state(int input_device_id, bool on);
94 * @brief Get input device event state by input device id.
96 * @remarks #DEVICE_ERROR_NOT_SUPPORTED is returned, when the trying to control DEVICE_INPUT_TYPE_KEYBOARD device
97 * and following feature is not supported: %http://tizen.org/feature/input.keyboard \n
98 * @param[in] input_device_id The input id of the input device under the sys/class/input node \n
99 * This is for the distinction and control of input devices. \n
100 * @param[out] on The value to be get from the input device event state \n
101 * @return @c 0 on success,
102 * otherwise a negative error value
103 * @retval #DEVICE_ERROR_NONE Successful
104 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported in this device
105 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation not permitted
107 int device_input_get_event_state(int input_device_id, bool *on);
110 * @brief Get input device name by input device id.
112 * @remarks #DEVICE_ERROR_NOT_SUPPORTED is returned, when the trying to control DEVICE_INPUT_TYPE_KEYBOARD device
113 * and following feature is not supported: %http://tizen.org/feature/input.keyboard \n
114 * after using input_device_name, it should be freed by caller \n
115 * @param[in] input_device_type The type to get input device information \n
116 * @param[out] input_device_name The name value to be get from the input devices by input_device_type \n
117 * @return @c 0 on success,
118 * otherwise a negative error value
119 * @retval #DEVICE_ERROR_NONE Successful
120 * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
121 * @retval #DEVICE_ERROR_NOT_SUPPORTED Not supported in this device
122 * @retval #DEVICE_ERROR_OPERATION_FAILED Operation not permitted
124 int device_input_get_device_name(int input_device_id, char **input_device_name);
130 #endif /* __TIZEN_SYSTEM_INPUT_INTERNAL_H__ */