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.
10 #include <scim_visibility.h>
14 #endif /* __cplusplus */
17 * @brief Enumeration for remote control function error.
19 * @since_tizen @if TV 3.0 @endif
22 REMOTE_CONTROL_ERROR_NONE = 0, /**< Successful */
23 REMOTE_CONTROL_PERMISSION_DENIED, /**< Permission denied */
24 REMOTE_CONTROL_REPLY_TIMEOUT, /**< Reply timeout */
25 REMOTE_CONTROL_CONNECTION_LOST, /**< Connection to server lost */
26 REMOTE_CONTROL_INVALID_OPERATION, /**< Invalid operation */
27 REMOTE_CONTROL_INVALID_PARAMETER, /**< Invalid parameter */
28 } remote_control_error_e;
31 * @brief Enumeration for key types.
33 * @since_tizen @if TV 3.0 @endif
35 * @see remote_control_send_key_event()
38 REMOTE_CONTROL_KEY_ENTER = 0, /**< Enter key */
39 REMOTE_CONTROL_KEY_SPACE, /**< Space key */
40 REMOTE_CONTROL_KEY_BACKSPACE, /**< Backspace key */
41 REMOTE_CONTROL_KEY_ESC, /**< Escape key */
42 REMOTE_CONTROL_KEY_UP, /**< Up key */
43 REMOTE_CONTROL_KEY_DOWN, /**< Down key */
44 REMOTE_CONTROL_KEY_LEFT, /**< LEFT key */
45 REMOTE_CONTROL_KEY_RIGHT, /**< Right key */
46 REMOTE_CONTROL_KEY_PAGE_UP, /**< Page up key */
47 REMOTE_CONTROL_KEY_PAGE_DOWN, /**< Page down key */
48 REMOTE_CONTROL_KEY_SELECT, /**< Select key */
49 REMOTE_CONTROL_KEY_CANCEL, /**< Cancel key */
50 } remote_control_key_type_e;
53 * @brief Enumeration for input resources.
55 * @since_tizen @if TV 3.0 @endif
57 * @see remote_control_input_resource_changed_cb()
60 REMOTE_CONTROL_INPUT_RESOURCE_LOCAL, /**< Input event from TV IME, H/W keyboard */
61 REMOTE_CONTROL_INPUT_RESOURCE_REMOTE, /**< Input event from remote control API */
62 } remote_control_input_resource;
65 * @brief The structure type to contain the attributes of text field.
67 * @since_tizen @if TV 3.0 @endif
69 * @see remote_control_entry_metadata_cb
72 Ecore_IMF_Input_Hints hint; /**< The input hint information */
73 Ecore_IMF_Input_Panel_Layout layout; /**< The layout information */
74 int variation; /**< The layout variation information */
75 Ecore_IMF_Autocapital_Type autocapital_type; /**< The autocapital type information */
76 bool return_key_disabled; /**< The return key state information */
77 Ecore_IMF_Input_Panel_Return_Key_Type return_key_type; /**< The return key type information */
78 } remote_control_entry_metadata_s;
81 * @brief A structure type to contain the attributes for socket and callback function.
83 * @since_tizen @if TV 3.0 @endif
85 * @see remote_control_connect()
87 typedef struct _remote_control_client remote_control_client;
90 * @brief Creates a new remote control client.
92 * @details This function provides socket connection and register a fd_handler for the callback function.
94 * @since_tizen @if TV 3.0 @endif
98 * @privilege %http://tizen.org/privilege/imemanager
100 * @return The remote control client on success, otherwise NULL
102 * @see remote_control_disconnect()
104 remote_control_client * remote_control_connect(void);
107 * @brief Destroys a remote control client.
109 * @since_tizen @if TV 3.0 @endif
111 * @privlevel platform
113 * @privilege %http://tizen.org/privilege/imemanager
115 * @param[in] client The remote control client
117 * @return 0 on success, otherwise a negative error value
118 * @retval #REMOTE_CONTROL_ERROR_NONE No error
119 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
120 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
121 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
122 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
124 * @see remote_control_connect()
126 int remote_control_disconnect(remote_control_client *client);
129 * @brief Called when an associated text field has focus.
131 * @since_tizen @if TV 3.0 @endif
133 * @privlevel platform
135 * @privilege %http://tizen.org/privilege/imemanager
137 * @param[in] user_data User data to be passed from the callback registration function
139 * @pre The callback can be registered using remote_control_focus_in_callback_set() function.
141 * @see remote_control_focus_in_callback_set()
142 * @see remote_control_focus_in_callback_unset()
144 typedef void (*remote_control_focus_in_cb)(void *user_data);
147 * @brief Register a callback function to be called when an associated text field has focus.
149 * @since_tizen @if TV 3.0 @endif
151 * @privlevel platform
153 * @privilege %http://tizen.org/privilege/imemanager
155 * @param[in] client The remote control client
156 * @param[in] func focus_in event callback function
157 * @param[in] user_data User data to be passed to the callback function
159 * @return 0 on success, otherwise a negative error value
160 * @retval #REMOTE_CONTROL_ERROR_NONE No error
161 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
162 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
163 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
164 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
166 * @see remote_control_focus_in_cb()
167 * @see remote_control_focus_in_callback_unset()
169 int remote_control_focus_in_callback_set(remote_control_client *client, remote_control_focus_in_cb func, void *user_data);
172 * @brief Remove a remote_control_focus_in_cb() callback function.
174 * @since_tizen @if TV 3.0 @endif
176 * @privlevel platform
178 * @privilege %http://tizen.org/privilege/imemanager
180 * @param[in] client The remote control client
182 * @return 0 on success, otherwise a negative error value
183 * @retval #REMOTE_CONTROL_ERROR_NONE No error
184 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
185 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
186 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
187 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
189 * @see remote_control_focus_in_cb()
190 * @see remote_control_focus_in_callback_set()
192 int remote_control_focus_in_callback_unset(remote_control_client *client);
195 * @brief Called when an associated text field loses focus.
197 * @since_tizen @if TV 3.0 @endif
199 * @privlevel platform
201 * @privilege %http://tizen.org/privilege/imemanager
203 * @param[in] user_data User data to be passed from the callback registration function
205 * @pre The callback can be registered using remote_control_focus_out_callback_set() function.
207 * @see remote_control_focus_out_callback_set()
208 * @see remote_control_focus_out_callback_unset()
210 typedef void (*remote_control_focus_out_cb)(void *user_data);
213 * @brief Register a callback function to be called when an associated text field loses focus.
215 * @since_tizen @if TV 3.0 @endif
217 * @privlevel platform
219 * @privilege %http://tizen.org/privilege/imemanager
221 * @param[in] client The remote control client
222 * @param[in] func focus_out event callback function
223 * @param[in] user_data User data to be passed to the callback function
225 * @return 0 on success, otherwise a negative error value
226 * @retval #REMOTE_CONTROL_ERROR_NONE No error
227 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
228 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
229 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
230 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
232 * @see remote_control_focus_out_cb()
233 * @see remote_control_focus_out_callback_unset()
235 int remote_control_focus_out_callback_set(remote_control_client *client, remote_control_focus_out_cb func , void *user_data);
238 * @brief Remove a remote_control_focus_out_cb() callback function.
240 * @since_tizen @if TV 3.0 @endif
242 * @privlevel platform
244 * @privilege %http://tizen.org/privilege/imemanager
246 * @param[in] client The remote control client
248 * @return 0 on success, otherwise a negative error value
249 * @retval #REMOTE_CONTROL_ERROR_NONE No error
250 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
251 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
252 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
253 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
255 * @see remote_control_focus_out_cb()
256 * @see remote_control_focus_out_callback_set()
258 int remote_control_focus_out_callback_unset(remote_control_client *client);
261 * @brief Called when an associated text field requests the input panel to set its attributes.
263 * @since_tizen @if TV 3.0 @endif
265 * @privlevel platform
267 * @privilege %http://tizen.org/privilege/imemanager
269 * @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
271 * @param[in] user_data User data to be passed from the callback registration function
272 * @param[in] data The structure pointer of text field attributes
274 * @pre The callback can be registered using remote_control_entry_metadata_callback_set() function.
276 * @see remote_control_entry_metadata_callback_set()
277 * @see remote_control_entry_metadata_callback_unset()
279 typedef void (*remote_control_entry_metadata_cb)(void *user_data, remote_control_entry_metadata_s *data);
282 * @brief Register a remote_control_entry_metadata_cb() callback function.
284 * @since_tizen @if TV 3.0 @endif
286 * @privlevel platform
288 * @privilege %http://tizen.org/privilege/imemanager
290 * @param[in] client The remote control client
291 * @param[in] func remote_control_entry_metadata_cb() callback function
292 * @param[in] user_data User data to be passed to the callback function
294 * @return 0 on success, otherwise a negative error value
295 * @retval #REMOTE_CONTROL_ERROR_NONE No error
296 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
297 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
298 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
299 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
301 * @see remote_control_entry_metadata_cb()
302 * @see remote_control_entry_metadata_callback_unset()
304 int remote_control_entry_metadata_callback_set(remote_control_client *client, remote_control_entry_metadata_cb func, void *user_data);
307 * @brief Remove a remote_control_entry_metadata_cb() callback function.
309 * @since_tizen @if TV 3.0 @endif
311 * @privlevel platform
313 * @privilege %http://tizen.org/privilege/imemanager
315 * @param[in] client The remote control client
317 * @return 0 on success, otherwise a negative error value
318 * @retval #REMOTE_CONTROL_ERROR_NONE No error
319 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
320 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
321 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
322 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
324 * @see remote_control_entry_metadata_cb()
325 * @see remote_control_entry_metadata_callback_set()
327 int remote_control_entry_metadata_callback_unset(remote_control_client *client);
330 * @brief Called when an associated text field responds to a request with the surrounding text.
332 * @since_tizen @if TV 3.0 @endif
334 * @privlevel platform
336 * @privilege %http://tizen.org/privilege/imemanager
338 * @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
340 * @param[in] user_data User data to be passed from the callback registration function
341 * @param[in] surrounding_text The UTF-8 string requested
342 * @param[in] cursor_pos The cursor position
344 * @pre The callback can be registered using remote_control_text_updated_callback_set() function.
346 * @see remote_control_text_updated_callback_set()
347 * @see remote_control_text_updated_callback_unset()
349 typedef void (*remote_control_text_updated_cb)(void *user_data, const char *surrounding_text, int cursor_pos);
352 * @brief Register a remote_control_text_updated_cb() callback function.
354 * @since_tizen @if TV 3.0 @endif
356 * @privlevel platform
358 * @privilege %http://tizen.org/privilege/imemanager
360 * @param[in] client The remote control client
361 * @param[in] func remote_control_text_updated_cb() callback function
362 * @param[in] user_data User data to be passed to the callback function
364 * @return 0 on success, otherwise a negative error value
365 * @retval #REMOTE_CONTROL_ERROR_NONE No error
366 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
367 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
368 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
369 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
371 * @see remote_control_text_updated_cb()
372 * @see remote_control_text_updated_callback_unset()
374 int remote_control_text_updated_callback_set(remote_control_client *client, remote_control_text_updated_cb func, void *user_data);
377 * @brief Remove a remote_control_text_updated_cb() callback function.
379 * @since_tizen @if TV 3.0 @endif
381 * @privlevel platform
383 * @privilege %http://tizen.org/privilege/imemanager
385 * @param[in] client The remote control client
387 * @return 0 on success, otherwise a negative error value
388 * @retval #REMOTE_CONTROL_ERROR_NONE No error
389 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
390 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
391 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
392 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
394 * @see remote_control_text_updated_cb()
395 * @see remote_control_text_updated_callback_set()
397 int remote_control_text_updated_callback_unset(remote_control_client *client);
400 * @brief Called when the input resource is changed.
402 * @since_tizen @if TV 3.0 @endif
404 * @privlevel platform
406 * @privilege %http://tizen.org/privilege/imemanager
408 * @param[in] user_data User data to be passed from the callback registration function
409 * @param[in] resource local input event callback function
411 * @pre The callback can be registered using remote_control_input_resource_changed_callback_set() function.
413 * @see remote_control_local_input_callback_set()
414 * @see remote_control_local_input_callback_unset()
416 typedef void (*remote_control_input_resource_changed_cb)(void *user_data, remote_control_input_resource resource);
419 * @brief Register a callback function to be called when the input resource is changed.
421 * @since_tizen @if TV 3.0 @endif
423 * @privlevel platform
425 * @privilege %http://tizen.org/privilege/imemanager
427 * @param[in] client The remote control client
428 * @param[in] func Input resource changed callback function
429 * @param[in] user_data User data to be passed to the callback function
431 * @return 0 on success, otherwise a negative error value
432 * @retval #REMOTE_CONTROL_ERROR_NONE No error
433 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
434 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
435 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
436 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
438 * @see remote_control_input_resource_changed_cb()
439 * @see remote_control_input_resource_changed_callback_unset()
441 int remote_control_input_resource_changed_callback_set(remote_control_client *client, remote_control_input_resource_changed_cb func , void *user_data);
444 * @brief Remove a remote_control_input_resource_changed_cb() callback function.
446 * @since_tizen @if TV 3.0 @endif
448 * @privlevel platform
450 * @privilege %http://tizen.org/privilege/imemanager
452 * @param[in] client The remote control client
454 * @return 0 on success, otherwise a negative error value
455 * @retval #REMOTE_CONTROL_ERROR_NONE No error
456 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
457 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
458 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
459 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
461 * @see remote_control_input_resource_changed_cb()
462 * @see remote_control_input_resource_changed_callback_set()
464 int remote_control_input_resource_changed_callback_unset(remote_control_client *client);
467 * @brief Sends the key event to the associated text field.
469 * @since_tizen @if TV 3.0 @endif
471 * @privlevel platform
473 * @privilege %http://tizen.org/privilege/imemanager
475 * @param[in] client The remote control client
476 * @param[in] key The remote_control_key_type_e information
478 * @return 0 on success, otherwise a negative error value
479 * @retval #REMOTE_CONTROL_ERROR_NONE No error
480 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
481 * @retval #REMOTE_CONTROL_INVALID_OPERATION Invalid operation
482 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
483 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
484 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
486 * @see remote_control_key_type_e
488 int remote_control_send_key_event(remote_control_client *client, remote_control_key_type_e key);
491 * @brief Sends the text to the associated text field.
493 * @since_tizen @if TV 3.0 @endif
495 * @privlevel platform
497 * @privilege %http://tizen.org/privilege/imemanager
499 * @param[in] client The remote control client
500 * @param[in] text The UTF-8 string to be committed
502 * @return 0 on success, otherwise a negative error value
503 * @retval #REMOTE_CONTROL_ERROR_NONE No error
504 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
505 * @retval #REMOTE_CONTROL_INVALID_OPERATION Invalid operation
506 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
507 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
508 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
510 * @see remote_control_update_preedit_string()
512 int remote_control_send_commit_string(remote_control_client *client, const char *text);
515 * @brief Updates a new preedit string to the associated text field.
517 * @since_tizen @if TV 3.0 @endif
519 * @privlevel platform
521 * @privilege %http://tizen.org/privilege/imemanager
523 * @param[in] client The remote control client
524 * @param[in] text The UTF-8 string to be updated in preedit
525 * @param[in] attrs An Eina_List of attributes
526 * @param[in] cursor_pos The cursor position; -1 means at the end of line
528 * @return 0 on success, otherwise a negative error value
529 * @retval #REMOTE_CONTROL_ERROR_NONE No error
530 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
531 * @retval #REMOTE_CONTROL_INVALID_OPERATION Invalid operation
532 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
533 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
534 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
536 * @see remote_control_send_commit_string()
538 int remote_control_update_preedit_string(remote_control_client *client, const char *text, Eina_List *attrs, int cursor_pos);
541 * @brief Requests to delete surrounding text.
543 * @since_tizen @if TV 3.0 @endif
545 * @privlevel platform
547 * @privilege %http://tizen.org/privilege/imemanager
549 * @param[in] client The remote control client
550 * @param[in] offset The offset value from the cursor position
551 * @param[in] len The length of the text to delete
553 * @return 0 on success, otherwise a negative error value
554 * @retval #REMOTE_CONTROL_ERROR_NONE No error
555 * @retval #REMOTE_CONTROL_PERMISSION_DENIED The application does not have the privilege to call this function
556 * @retval #REMOTE_CONTROL_INVALID_OPERATION Invalid operation
557 * @retval #REMOTE_CONTROL_INVALID_PARAMETER Invalid parameter
558 * @retval #REMOTE_CONTROL_REPLY_TIMEOUT Reply timeout
559 * @retval #REMOTE_CONTROL_CONNECTION_LOST Connection to server lost
561 int remote_control_delete_surrounding_text(remote_control_client *client, int offset, int len);
565 #endif /* __cplusplus */