1 #ifndef _ISF_REMOTE_CONTROL_H_
2 #define _ISF_REMOTE_CONTROL_H_
5 * @file isf_remote_control.h
6 * @brief This file contains remote control APIs for TV profile.
13 #endif /* __cplusplus */
16 * @brief Enumeration for remote control function error.
18 * @since_tizen @if TV 3.0 @endif
21 REMOTE_CONTROL_ERROR_NONE = 0, /**< Successful */
22 REMOTE_CONTROL_PERMISSION_DENIED, /**< Permission denied */
23 REMOTE_CONTROL_REPLY_TIMEOUT, /**< Reply timeout */
24 REMOTE_CONTROL_CONNECTION_LOST, /**< Connection to server lost */
25 REMOTE_CONTROL_INVALID_OPERATION, /**< Invalid operation */
26 REMOTE_CONTROL_INVALID_PARAMETER, /**< Invalid parameter */
27 } remote_control_error_e;
30 * @brief Enumeration for key types.
32 * @since_tizen @if TV 3.0 @endif
34 * @see remote_control_send_key_event()
37 REMOTE_CONTROL_KEY_ENTER = 0, /**< Enter key */
38 REMOTE_CONTROL_KEY_SPACE, /**< Space key */
39 REMOTE_CONTROL_KEY_BACKSPACE, /**< Backspace key */
40 REMOTE_CONTROL_KEY_ESC, /**< Escape key */
41 REMOTE_CONTROL_KEY_UP, /**< Up key */
42 REMOTE_CONTROL_KEY_DOWN, /**< Down key */
43 REMOTE_CONTROL_KEY_LEFT, /**< LEFT key */
44 REMOTE_CONTROL_KEY_RIGHT, /**< Right key */
45 REMOTE_CONTROL_KEY_PAGE_UP, /**< Page up key */
46 REMOTE_CONTROL_KEY_PAGE_DOWN, /**< Page down key */
47 REMOTE_CONTROL_KEY_SELECT, /**< Select key */
48 REMOTE_CONTROL_KEY_CANCEL, /**< Cancel key */
49 } remote_control_key_type_e;
52 * @brief Enumeration for input resources.
54 * @since_tizen @if TV 3.0 @endif
56 * @see remote_control_input_resource_changed_cb()
59 REMOTE_CONTROL_INPUT_RESOURCE_LOCAL, /**< Input event from TV IME, H/W keyboard */
60 REMOTE_CONTROL_INPUT_RESOURCE_REMOTE, /**< Input event from remote control API */
61 } remote_control_input_resource;
64 * @brief The structure type to contain the attributes of text field.
66 * @since_tizen @if TV 3.0 @endif
68 * @see remote_control_entry_metadata_cb
71 Ecore_IMF_Input_Hints hint; /**< The input hint information */
72 Ecore_IMF_Input_Panel_Layout layout; /**< The layout information */
73 int variation; /**< The layout variation information */
74 Ecore_IMF_Autocapital_Type autocapital_type; /**< The autocapital type information */
75 bool return_key_disabled; /**< The return key state information */
76 Ecore_IMF_Input_Panel_Return_Key_Type return_key_type; /**< The return key type information */
77 } remote_control_entry_metadata_s;
80 * @brief A structure type to contain the attributes for socket and callback function.
82 * @since_tizen @if TV 3.0 @endif
84 * @see remote_control_connect()
86 typedef struct _remote_control_client remote_control_client;
89 * @brief Creates a new remote control client.
91 * @details This function provides socket connection and register a fd_handler for the callback function.
93 * @since_tizen @if TV 3.0 @endif
97 * @privilege %http://tizen.org/privilege/imemanager
99 * @return The remote control client on success, otherwise NULL
101 * @see remote_control_disconnect()
103 remote_control_client * remote_control_connect(void);
106 * @brief Destroys a remote control client.
108 * @since_tizen @if TV 3.0 @endif
110 * @privlevel platform
112 * @privilege %http://tizen.org/privilege/imemanager
114 * @param[in] client The remote control client
116 * @return 0 on success, otherwise a negative error value
117 * @retval #REMOTE_CONTROL_ERROR_NONE No error
118 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
119 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
120 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
121 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
123 * @see remote_control_connect()
125 int remote_control_disconnect(remote_control_client *client);
128 * @brief Called when an associated text field has focus.
130 * @since_tizen @if TV 3.0 @endif
132 * @privlevel platform
134 * @privilege %http://tizen.org/privilege/imemanager
136 * @param[in] user_data User data to be passed from the callback registration function
138 * @pre The callback can be registered using remote_control_focus_in_callback_set() function.
140 * @see remote_control_focus_in_callback_set()
141 * @see remote_control_focus_in_callback_unset()
143 typedef void (*remote_control_focus_in_cb)(void *user_data);
146 * @brief Register a callback function to be called when an associated text field has focus.
148 * @since_tizen @if TV 3.0 @endif
150 * @privlevel platform
152 * @privilege %http://tizen.org/privilege/imemanager
154 * @param[in] client The remote control client
155 * @param[in] func focus_in event callback function
156 * @param[in] user_data User data to be passed to the callback function
158 * @return 0 on success, otherwise a negative error value
159 * @retval #REMOTE_CONTROL_ERROR_NONE No error
160 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
161 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
162 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
163 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
165 * @see remote_control_focus_in_cb()
166 * @see remote_control_focus_in_callback_unset()
168 int remote_control_focus_in_callback_set(remote_control_client *client, remote_control_focus_in_cb func, void *user_data);
171 * @brief Remove a remote_control_focus_in_cb() callback function.
173 * @since_tizen @if TV 3.0 @endif
175 * @privlevel platform
177 * @privilege %http://tizen.org/privilege/imemanager
179 * @param[in] client The remote control client
181 * @return 0 on success, otherwise a negative error value
182 * @retval #REMOTE_CONTROL_ERROR_NONE No error
183 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
184 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
185 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
186 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
188 * @see remote_control_focus_in_cb()
189 * @see remote_control_focus_in_callback_set()
191 int remote_control_focus_in_callback_unset(remote_control_client *client);
194 * @brief Called when an associated text field loses focus.
196 * @since_tizen @if TV 3.0 @endif
198 * @privlevel platform
200 * @privilege %http://tizen.org/privilege/imemanager
202 * @param[in] user_data User data to be passed from the callback registration function
204 * @pre The callback can be registered using remote_control_focus_out_callback_set() function.
206 * @see remote_control_focus_out_callback_set()
207 * @see remote_control_focus_out_callback_unset()
209 typedef void (*remote_control_focus_out_cb)(void *user_data);
212 * @brief Register a callback function to be called when an associated text field loses focus.
214 * @since_tizen @if TV 3.0 @endif
216 * @privlevel platform
218 * @privilege %http://tizen.org/privilege/imemanager
220 * @param[in] client The remote control client
221 * @param[in] func focus_out event callback function
222 * @param[in] user_data User data to be passed to the callback function
224 * @return 0 on success, otherwise a negative error value
225 * @retval #REMOTE_CONTROL_ERROR_NONE No error
226 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
227 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
228 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
229 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
231 * @see remote_control_focus_out_cb()
232 * @see remote_control_focus_out_callback_unset()
234 int remote_control_focus_out_callback_set(remote_control_client *client, remote_control_focus_out_cb func , void *user_data);
237 * @brief Remove a remote_control_focus_out_cb() callback function.
239 * @since_tizen @if TV 3.0 @endif
241 * @privlevel platform
243 * @privilege %http://tizen.org/privilege/imemanager
245 * @param[in] client The remote control client
247 * @return 0 on success, otherwise a negative error value
248 * @retval #REMOTE_CONTROL_ERROR_NONE No error
249 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
250 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
251 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
252 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
254 * @see remote_control_focus_out_cb()
255 * @see remote_control_focus_out_callback_set()
257 int remote_control_focus_out_callback_unset(remote_control_client *client);
260 * @brief Called when an associated text field requests the input panel to set its attributes.
262 * @since_tizen @if TV 3.0 @endif
264 * @privlevel platform
266 * @privilege %http://tizen.org/privilege/imemanager
268 * @remarks remote_control_entry_metadata_cb() will be called after focus_in event and it can be called again when the associated text field's attributes are changed
270 * @param[in] user_data User data to be passed from the callback registration function
271 * @param[in] data The structure pointer of text field attributes
273 * @pre The callback can be registered using remote_control_entry_metadata_callback_set() function.
275 * @see remote_control_entry_metadata_callback_set()
276 * @see remote_control_entry_metadata_callback_unset()
278 typedef void (*remote_control_entry_metadata_cb)(void *user_data, remote_control_entry_metadata_s *data);
281 * @brief Register a remote_control_entry_metadata_cb() callback function.
283 * @since_tizen @if TV 3.0 @endif
285 * @privlevel platform
287 * @privilege %http://tizen.org/privilege/imemanager
289 * @param[in] client The remote control client
290 * @param[in] func remote_control_entry_metadata_cb() callback function
291 * @param[in] user_data User data to be passed to the callback function
293 * @return 0 on success, otherwise a negative error value
294 * @retval #REMOTE_CONTROL_ERROR_NONE No error
295 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
296 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
297 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
298 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
300 * @see remote_control_entry_metadata_cb()
301 * @see remote_control_entry_metadata_callback_unset()
303 int remote_control_entry_metadata_callback_set(remote_control_client *client, remote_control_entry_metadata_cb func, void *user_data);
306 * @brief Remove a remote_control_entry_metadata_cb() callback function.
308 * @since_tizen @if TV 3.0 @endif
310 * @privlevel platform
312 * @privilege %http://tizen.org/privilege/imemanager
314 * @param[in] client The remote control client
316 * @return 0 on success, otherwise a negative error value
317 * @retval #REMOTE_CONTROL_ERROR_NONE No error
318 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
319 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
320 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
321 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
323 * @see remote_control_entry_metadata_cb()
324 * @see remote_control_entry_metadata_callback_set()
326 int remote_control_entry_metadata_callback_unset(remote_control_client *client);
329 * @brief Called when an associated text field responds to a request with the surrounding text.
331 * @since_tizen @if TV 3.0 @endif
333 * @privlevel platform
335 * @privilege %http://tizen.org/privilege/imemanager
337 * @remarks remote_control_text_updated_cb() will be called after remote_control_entry_metadata_cb() and it can be called again when the text or the cursor position in the associated text field is changed
339 * @param[in] user_data User data to be passed from the callback registration function
340 * @param[in] surrounding_text The UTF-8 string requested
341 * @param[in] cursor_pos The cursor position
343 * @pre The callback can be registered using remote_control_text_updated_callback_set() function.
345 * @see remote_control_text_updated_callback_set()
346 * @see remote_control_text_updated_callback_unset()
348 typedef void (*remote_control_text_updated_cb)(void *user_data, const char *surrounding_text, int cursor_pos);
351 * @brief Register a remote_control_text_updated_cb() callback function.
353 * @since_tizen @if TV 3.0 @endif
355 * @privlevel platform
357 * @privilege %http://tizen.org/privilege/imemanager
359 * @param[in] client The remote control client
360 * @param[in] func remote_control_text_updated_cb() callback function
361 * @param[in] user_data User data to be passed to the callback function
363 * @return 0 on success, otherwise a negative error value
364 * @retval #REMOTE_CONTROL_ERROR_NONE No error
365 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
366 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
367 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
368 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
370 * @see remote_control_text_updated_cb()
371 * @see remote_control_text_updated_callback_unset()
373 int remote_control_text_updated_callback_set(remote_control_client *client, remote_control_text_updated_cb func, void *user_data);
376 * @brief Remove a remote_control_text_updated_cb() callback function.
378 * @since_tizen @if TV 3.0 @endif
380 * @privlevel platform
382 * @privilege %http://tizen.org/privilege/imemanager
384 * @param[in] client The remote control client
386 * @return 0 on success, otherwise a negative error value
387 * @retval #REMOTE_CONTROL_ERROR_NONE No error
388 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
389 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
390 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
391 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
393 * @see remote_control_text_updated_cb()
394 * @see remote_control_text_updated_callback_set()
396 int remote_control_text_updated_callback_unset(remote_control_client *client);
399 * @brief Called when the input resource is changed.
401 * @since_tizen @if TV 3.0 @endif
403 * @privlevel platform
405 * @privilege %http://tizen.org/privilege/imemanager
407 * @param[in] user_data User data to be passed from the callback registration function
408 * @param[in] resource local input event callback function
410 * @pre The callback can be registered using remote_control_input_resource_changed_callback_set() function.
412 * @see remote_control_local_input_callback_set()
413 * @see remote_control_local_input_callback_unset()
415 typedef void (*remote_control_input_resource_changed_cb)(void *user_data, remote_control_input_resource resource);
418 * @brief Register a callback function to be called when the input resource is changed.
420 * @since_tizen @if TV 3.0 @endif
422 * @privlevel platform
424 * @privilege %http://tizen.org/privilege/imemanager
426 * @param[in] client The remote control client
427 * @param[in] func Input resource changed callback function
428 * @param[in] user_data User data to be passed to the callback function
430 * @return 0 on success, otherwise a negative error value
431 * @retval #REMOTE_CONTROL_ERROR_NONE No error
432 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
433 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
434 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
435 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
437 * @see remote_control_input_resource_changed_cb()
438 * @see remote_control_input_resource_changed_callback_unset()
440 int remote_control_input_resource_changed_callback_set(remote_control_client *client, remote_control_input_resource_changed_cb func , void *user_data);
443 * @brief Remove a remote_control_input_resource_changed_cb() callback function.
445 * @since_tizen @if TV 3.0 @endif
447 * @privlevel platform
449 * @privilege %http://tizen.org/privilege/imemanager
451 * @param[in] client The remote control client
453 * @return 0 on success, otherwise a negative error value
454 * @retval #REMOTE_CONTROL_ERROR_NONE No error
455 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
456 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
457 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
458 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
460 * @see remote_control_input_resource_changed_cb()
461 * @see remote_control_input_resource_changed_callback_set()
463 int remote_control_input_resource_changed_callback_unset(remote_control_client *client);
466 * @brief Sends the key event to the associated text field.
468 * @since_tizen @if TV 3.0 @endif
470 * @privlevel platform
472 * @privilege %http://tizen.org/privilege/imemanager
474 * @param[in] client The remote control client
475 * @param[in] key The remote_control_key_type_e information
477 * @return 0 on success, otherwise a negative error value
478 * @retval #REMOTE_CONTROL_ERROR_NONE No error
479 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
480 * @retval #REMOTE_CONTROL_INVALID_OPERATION Invalid operation
481 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
482 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
483 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
485 * @see remote_control_key_type_e
487 int remote_control_send_key_event(remote_control_client *client, remote_control_key_type_e key);
490 * @brief Sends the text to the associated text field.
492 * @since_tizen @if TV 3.0 @endif
494 * @privlevel platform
496 * @privilege %http://tizen.org/privilege/imemanager
498 * @param[in] client The remote control client
499 * @param[in] text The UTF-8 string to be committed
501 * @return 0 on success, otherwise a negative error value
502 * @retval #REMOTE_CONTROL_ERROR_NONE No error
503 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
504 * @retval #REMOTE_CONTROL_INVALID_OPERATION Invalid operation
505 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
506 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
507 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
509 * @see remote_control_update_preedit_string()
511 int remote_control_send_commit_string(remote_control_client *client, const char *text);
514 * @brief Updates a new preedit string to the associated text field.
516 * @since_tizen @if TV 3.0 @endif
518 * @privlevel platform
520 * @privilege %http://tizen.org/privilege/imemanager
522 * @param[in] client The remote control client
523 * @param[in] text The UTF-8 string to be updated in preedit
524 * @param[in] attrs An Eina_List of attributes
525 * @param[in] cursor_pos The cursor position; -1 means at the end of line
527 * @return 0 on success, otherwise a negative error value
528 * @retval #REMOTE_CONTROL_ERROR_NONE No error
529 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
530 * @retval #REMOTE_CONTROL_INVALID_OPERATION Invalid operation
531 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
532 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
533 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
535 * @see remote_control_send_commit_string()
537 int remote_control_update_preedit_string(remote_control_client *client, const char *text, Eina_List *attrs, int cursor_pos);
540 * @brief Requests to delete surrounding text.
542 * @since_tizen @if TV 3.0 @endif
544 * @privlevel platform
546 * @privilege %http://tizen.org/privilege/imemanager
548 * @param[in] client The remote control client
549 * @param[in] offset The offset value from the cursor position
550 * @param[in] len The length of the text to delete
552 * @return 0 on success, otherwise a negative error value
553 * @retval #REMOTE_CONTROL_ERROR_NONE No error
554 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
555 * @retval #REMOTE_CONTROL_INVALID_OPERATION Invalid operation
556 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
557 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
558 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
560 int remote_control_delete_surrounding_text(remote_control_client *client, int offset, int len);
564 #endif /* __cplusplus */