summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJihoon Kim <imfine98@gmail.com>2013-01-08 01:57:22 +0000
committerJihoon Kim <imfine98@gmail.com>2013-01-08 01:57:22 +0000
commitf35fd9762eac5bb23ecb3db7d78a8d9e45ea0015 (patch)
tree5176fdd3f1e8bfbc76e3a2489f2ed568d5aa291d /src
parentacf4ca6139c473e2802bc13d313b70191ec29956 (diff)
ecore_imf: move the docs to header
SVN revision: 82373
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_imf/Ecore_IMF.h883
-rw-r--r--src/lib/ecore_imf/ecore_imf_context.c815
2 files changed, 880 insertions, 818 deletions
diff --git a/src/lib/ecore_imf/Ecore_IMF.h b/src/lib/ecore_imf/Ecore_IMF.h
index 641ece74a3..41dca8cf1b 100644
--- a/src/lib/ecore_imf/Ecore_IMF.h
+++ b/src/lib/ecore_imf/Ecore_IMF.h
@@ -34,6 +34,30 @@ extern "C" {
34#endif 34#endif
35 35
36/** 36/**
37 * @defgroup Ecore_IMF_Context_Group Ecore Input Method Context Functions
38 * @ingroup Ecore_IMF_Lib_Group
39 *
40 * Functions that operate on Ecore Input Method Context objects.
41
42 * Ecore Input Method Context Function defines the interface for EFL input methods.
43 * An input method is used by EFL text input widgets like elm_entry
44 * (based on edje_entry) to map from key events to Unicode character strings.
45 *
46 * The default input method can be set through setting the ECORE_IMF_MODULE environment variable.
47 *
48 * An input method may consume multiple key events in sequence and finally output the composed result.
49 * This is called preediting, and an input method may provide feedback about
50 * this process by displaying the intermediate composition states as preedit text.
51 *
52 * Immodule is plugin to connect your application and input method framework such as SCIM, ibus, and so on.@n
53 * ecore_imf_init() should be called to initialize and load immodule.@n
54 * ecore_imf_shutdown() is used for shutdowning and unloading immodule.
55 *
56 * An example of usage of these functions can be found at:
57 * @li @ref ecore_imf_example_c
58 */
59
60/**
37 * @addtogroup Ecore_IMF_Context_Group 61 * @addtogroup Ecore_IMF_Context_Group
38 * 62 *
39 * @{ 63 * @{
@@ -53,7 +77,8 @@ typedef enum
53{ 77{
54 ECORE_IMF_INPUT_PANEL_STATE_SHOW, /**< Notification after the display of the input panel @since 1.7 */ 78 ECORE_IMF_INPUT_PANEL_STATE_SHOW, /**< Notification after the display of the input panel @since 1.7 */
55 ECORE_IMF_INPUT_PANEL_STATE_HIDE, /**< Notification prior to the dismissal of the input panel @since 1.7 */ 79 ECORE_IMF_INPUT_PANEL_STATE_HIDE, /**< Notification prior to the dismissal of the input panel @since 1.7 */
56 ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW /**< Notification prior to the display of the input panel @since 1.7 */ 80 ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW, /**< Notification prior to the display of the input panel @since 1.7 */
81 ECORE_IMF_INPUT_PANEL_STATE_WILL_HIDE /**< Notification prior to the dismissal of the input panel @since 1.8 */
57} Ecore_IMF_Input_Panel_State; 82} Ecore_IMF_Input_Panel_State;
58 83
59typedef enum 84typedef enum
@@ -237,8 +262,10 @@ typedef enum
237 ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */ 262 ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */
238 ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID, /**< Never use this */ 263 ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID, /**< Never use this */
239 ECORE_IMF_INPUT_PANEL_LAYOUT_HEX, /**< Hexadecimal layout @since 1.2 */ 264 ECORE_IMF_INPUT_PANEL_LAYOUT_HEX, /**< Hexadecimal layout @since 1.2 */
240 ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL, /**< Command-line terminal layout including esc, alt, ctrl key, so on (no auto-correct, no auto-capitalization) @since 1.2 */ 265 ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL, /**< Command-line terminal layout including ESC, Alt, Ctrl key, so on (no auto-correct, no auto-capitalization) @since 1.2 */
241 ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */ 266 ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD, /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */
267 ECORE_IMF_INPUT_PANEL_LAYOUT_NAME, /**< Name layout */
268 ECORE_IMF_INPUT_PANEL_LAYOUT_ADDRESS, /**< Address layout */
242} Ecore_IMF_Input_Panel_Layout; 269} Ecore_IMF_Input_Panel_Layout;
243 270
244/** 271/**
@@ -489,76 +516,926 @@ EAPI int ecore_imf_shutdown(void);
489 516
490EAPI void ecore_imf_module_register(const Ecore_IMF_Context_Info *info, Ecore_IMF_Context *(*imf_module_create)(void), Ecore_IMF_Context *(*imf_module_exit)(void)); 517EAPI void ecore_imf_module_register(const Ecore_IMF_Context_Info *info, Ecore_IMF_Context *(*imf_module_create)(void), Ecore_IMF_Context *(*imf_module_exit)(void));
491 518
519/**
520 * Get the list of the available Input Method Context ids.
521 *
522 * Note that the caller is responsible for freeing the Eina_List
523 * when finished with it. There is no need to finish the list strings.
524 *
525 * @return Return an Eina_List of strings;
526 * on failure it returns NULL.
527 * @ingroup Ecore_IMF_Context_Group
528 */
492EAPI Eina_List *ecore_imf_context_available_ids_get(void); 529EAPI Eina_List *ecore_imf_context_available_ids_get(void);
493EAPI Eina_List *ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type); 530EAPI Eina_List *ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type);
531
532/**
533 * Get the id of the default Input Method Context.
534 * The id may to used to create a new instance of an Input Method
535 * Context object.
536 *
537 * @return Return a string containing the id of the default Input
538 * Method Context; on failure it returns NULL.
539 * @ingroup Ecore_IMF_Context_Group
540 */
494EAPI const char *ecore_imf_context_default_id_get(void); 541EAPI const char *ecore_imf_context_default_id_get(void);
495EAPI const char *ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type); 542EAPI const char *ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type);
543
544/**
545 * Retrieve the info for the Input Method Context with @p id.
546 *
547 * @param id The Input Method Context id to query for.
548 * @return Return a #Ecore_IMF_Context_Info for the Input Method Context with @p id;
549 * on failure it returns NULL.
550 * @ingroup Ecore_IMF_Context_Group
551 *
552 * Example
553 * @code
554 *
555 * const char *ctx_id;
556 * const Ecore_IMF_Context_Info *ctx_info;
557 * Ecore_IMF_Context *imf_context;
558 * ctx_id = ecore_imf_context_default_id_get();
559 * if (ctx_id)
560 * {
561 * ctx_info = ecore_imf_context_info_by_id_get(ctx_id);
562 * if (!ctx_info->canvas_type ||
563 * strcmp(ctx_info->canvas_type, "evas") == 0)
564 * {
565 * imf_context = ecore_imf_context_add(ctx_id);
566 * }
567 * else
568 * {
569 * ctx_id = ecore_imf_context_default_id_by_canvas_type_get("evas");
570 * if (ctx_id)
571 * {
572 * imf_context = ecore_imf_context_add(ctx_id);
573 * }
574 * }
575 * }
576 * @endcode
577 */
496EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_by_id_get(const char *id); 578EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_by_id_get(const char *id);
497 579
580/**
581 * Create a new Input Method Context defined by the given id.
582 *
583 * @param id The Input Method Context id.
584 * @return A newly allocated Input Method Context;
585 * on failure it returns NULL.
586 * @ingroup Ecore_IMF_Context_Group
587 */
498EAPI Ecore_IMF_Context *ecore_imf_context_add(const char *id); 588EAPI Ecore_IMF_Context *ecore_imf_context_add(const char *id);
589
590/**
591 * Retrieve the info for the given Input Method Context.
592 *
593 * @param ctx An #Ecore_IMF_Context.
594 * @return Return a #Ecore_IMF_Context_Info for the given Input Method Context;
595 * on failure it returns NULL.
596 * @ingroup Ecore_IMF_Context_Group
597 */
499EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_get(Ecore_IMF_Context *ctx); 598EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_get(Ecore_IMF_Context *ctx);
599
600/**
601 * Delete the given Input Method Context and free its memory.
602 *
603 * @param ctx An #Ecore_IMF_Context.
604 * @ingroup Ecore_IMF_Context_Group
605 */
500EAPI void ecore_imf_context_del(Ecore_IMF_Context *ctx); 606EAPI void ecore_imf_context_del(Ecore_IMF_Context *ctx);
607
608/**
609 * Set the client window for the Input Method Context; this is the
610 * Ecore_X_Window when using X11, Ecore_Win32_Window when using Win32, etc.
611 * This window is used in order to correctly position status windows, and may
612 * also be used for purposes internal to the Input Method Context.
613 *
614 * @param ctx An #Ecore_IMF_Context.
615 * @param window The client window. This may be @c NULL to indicate
616 * that the previous client window no longer exists.
617 * @ingroup Ecore_IMF_Context_Group
618 */
501EAPI void ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window); 619EAPI void ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window);
620
621/**
622 * Get the client window of the Input Method Context
623 *
624 * See @ref ecore_imf_context_client_window_set for more details.
625 *
626 * @param ctx An #Ecore_IMF_Context.
627 * @return Return the client window.
628 * @ingroup Ecore_IMF_Context_Group
629 * @since 1.1.0
630 */
502EAPI void *ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx); 631EAPI void *ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx);
632
633/**
634 * Set the client canvas for the Input Method Context; this is the
635 * canvas in which the input appears.
636 * The canvas type can be determined by using the context canvas type.
637 * Actually only canvas with type "evas" (Evas *) is supported.
638 * This canvas may be used in order to correctly position status windows, and may
639 * also be used for purposes internal to the Input Method Context.
640 *
641 * @param ctx An #Ecore_IMF_Context.
642 * @param canvas The client canvas. This may be @c NULL to indicate
643 * that the previous client canvas no longer exists.
644 * @ingroup Ecore_IMF_Context_Group
645 */
503EAPI void ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas); 646EAPI void ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas);
647
648/**
649 * Get the client canvas of the Input Method Context.
650 *
651 * See @ref ecore_imf_context_client_canvas_set for more details.
652 *
653 * @param ctx An #Ecore_IMF_Context.
654 * @return Return the client canvas.
655 * @ingroup Ecore_IMF_Context_Group
656 * @since 1.1.0
657 */
504EAPI void *ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx); 658EAPI void *ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx);
659
660/**
661 * Ask the Input Method Context to show itself.
662 *
663 * @param ctx An #Ecore_IMF_Context.
664 * @ingroup Ecore_IMF_Context_Group
665 */
505EAPI void ecore_imf_context_show(Ecore_IMF_Context *ctx); 666EAPI void ecore_imf_context_show(Ecore_IMF_Context *ctx);
667
668/**
669 * Ask the Input Method Context to hide itself.
670 *
671 * @param ctx An #Ecore_IMF_Context.
672 * @ingroup Ecore_IMF_Context_Group
673 */
506EAPI void ecore_imf_context_hide(Ecore_IMF_Context *ctx); 674EAPI void ecore_imf_context_hide(Ecore_IMF_Context *ctx);
675
676/**
677 * Retrieve the current preedit string and cursor position
678 * for the Input Method Context.
679 *
680 * @param ctx An #Ecore_IMF_Context.
681 * @param str Location to store the retrieved string. The
682 * string retrieved must be freed with free().
683 * @param cursor_pos Location to store position of cursor (in characters)
684 * within the preedit string.
685 * @ingroup Ecore_IMF_Context_Group
686 */
507EAPI void ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos); 687EAPI void ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos);
688
689/**
690 * Retrieve the current preedit string, attributes and
691 * cursor position for the Input Method Context.
692 *
693 * @param ctx An #Ecore_IMF_Context.
694 * @param str Location to store the retrieved string. The
695 * string retrieved must be freed with free().
696 * @param attrs an Eina_List of attributes
697 * @param cursor_pos Location to store position of cursor (in characters)
698 * within the preedit string.
699 * @ingroup Ecore_IMF_Context_Group
700 *
701 * Example
702 * @code
703 * char *preedit_string;
704 * int cursor_pos;
705 * Eina_List *attrs = NULL, *l = NULL;
706 * Ecore_IMF_Preedit_Attr *attr;
707 *
708 * ecore_imf_context_preedit_string_with_attributes_get(imf_context,
709 * &preedit_string,
710 * &attrs, &cursor_pos);
711 * if (!preedit_string) return;
712 *
713 * if (strlen(preedit_string) > 0)
714 * {
715 * if (attrs)
716 * {
717 * EINA_LIST_FOREACH(attrs, l, attr)
718 * {
719 * if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB1)
720 * {
721 * // Something to do
722 * }
723 * else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB2)
724 * {
725 * // Something to do
726 * }
727 * else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB3)
728 * {
729 * // Something to do
730 * }
731 * }
732 * }
733 * }
734 *
735 * // delete attribute list
736 * EINA_LIST_FREE(attrs, attr) free(attr);
737 *
738 * free(preedit_string);
739 * @endcode
740 * @since 1.1.0
741 */
508EAPI void ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos); 742EAPI void ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos);
743
744/**
745 * Notify the Input Method Context that the widget to which its
746 * correspond has gained focus.
747 *
748 * @param ctx An #Ecore_IMF_Context.
749 * @ingroup Ecore_IMF_Context_Group
750 *
751 * Example
752 * @code
753 * static void
754 * _focus_in_cb(void *data, Evas_Object *o, const char *emission, const char *source)
755 * {
756 * ecore_imf_context_reset(imf_context);
757 * ecore_imf_context_focus_in(imf_context);
758 * }
759 *
760 * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_IN, _focus_in_cb, ed);
761 * @endcode
762 */
509EAPI void ecore_imf_context_focus_in(Ecore_IMF_Context *ctx); 763EAPI void ecore_imf_context_focus_in(Ecore_IMF_Context *ctx);
764
765/**
766 * Notify the Input Method Context that the widget to which its
767 * correspond has lost focus.
768 *
769 * @param ctx An #Ecore_IMF_Context.
770 * @ingroup Ecore_IMF_Context_Group
771 *
772 * Example
773 * @code
774 * static void
775 * _focus_out_cb(void *data, Evas_Object *o, const char *emission, const char *source)
776 * {
777 * ecore_imf_context_reset(imf_context);
778 * ecore_imf_context_focus_out(imf_context);
779 * }
780 *
781 * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_OUT, _focus_out_cb, ed);
782 * @endcode
783 */
510EAPI void ecore_imf_context_focus_out(Ecore_IMF_Context *ctx); 784EAPI void ecore_imf_context_focus_out(Ecore_IMF_Context *ctx);
785
786/**
787 * Notify the Input Method Context that a change such as a
788 * change in cursor position has been made. This will typically
789 * cause the Input Method Context to clear the preedit state.
790 *
791 * @param ctx An #Ecore_IMF_Context.
792 * @ingroup Ecore_IMF_Context_Group
793 *
794 * Example
795 * @code
796 * static void
797 * _focus_out_cb(void *data, Evas_Object *o, const char *emission, const char *source)
798 * {
799 * ecore_imf_context_reset(imf_context);
800 * ecore_imf_context_focus_out(imf_context);
801 * }
802 *
803 * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_OUT, _focus_out_cb, ed);
804 * @endcode
805 */
511EAPI void ecore_imf_context_reset(Ecore_IMF_Context *ctx); 806EAPI void ecore_imf_context_reset(Ecore_IMF_Context *ctx);
807
808/**
809 * Notify the Input Method Context that a change in the cursor
810 * position has been made.
811 *
812 * @param ctx An #Ecore_IMF_Context.
813 * @param cursor_pos New cursor position in characters.
814 * @ingroup Ecore_IMF_Context_Group
815 */
512EAPI void ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos); 816EAPI void ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos);
817
818/**
819 * Notify the Input Method Context that a change in the cursor
820 * location has been made. The location is relative to the canvas.
821 * The cursor location can be used to determine the position of
822 * candidate word window in the immodule.
823 *
824 * @param ctx An #Ecore_IMF_Context.
825 * @param x cursor x position.
826 * @param y cursor y position.
827 * @param w cursor width.
828 * @param h cursor height.
829 * @ingroup Ecore_IMF_Context_Group
830 * @since 1.1.0
831 */
513EAPI void ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int w, int h); 832EAPI void ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int w, int h);
833
834/**
835 * Set whether the IM context should use the preedit string
836 * to display feedback. If @c use_preedit is @c EINA_FALSE (default
837 * is @c EINA_TRUE), then the IM context may use some other method to display
838 * feedback, such as displaying it in a child of the root window.
839 *
840 * @param ctx An #Ecore_IMF_Context.
841 * @param use_preedit Whether the IM context should use the preedit string.
842 * @ingroup Ecore_IMF_Context_Group
843 */
514EAPI void ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit); 844EAPI void ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit);
845
846/**
847 * Set the callback to be used on surrounding_get request.
848 *
849 * This callback will be called when the Input Method Context
850 * module requests the surrounding context.
851 *
852 * @param ctx An #Ecore_IMF_Context.
853 * @param func The callback to be called.
854 * @param data The data pointer to be passed to @p func
855 * @ingroup Ecore_IMF_Context_Group
856 */
515EAPI void ecore_imf_context_retrieve_surrounding_callback_set(Ecore_IMF_Context *ctx, Eina_Bool (*func)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos), const void *data); 857EAPI void ecore_imf_context_retrieve_surrounding_callback_set(Ecore_IMF_Context *ctx, Eina_Bool (*func)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos), const void *data);
858
859/**
860 * Set the input mode used by the Ecore Input Context.
861 *
862 * The input mode can be one of the input modes defined in
863 * Ecore_IMF_Input_Mode. The default input mode is
864 * ECORE_IMF_INPUT_MODE_FULL.
865 *
866 * @param ctx An #Ecore_IMF_Context.
867 * @param input_mode The input mode to be used by @p ctx.
868 * @ingroup Ecore_IMF_Context_Group
869 */
516EAPI void ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode); 870EAPI void ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode);
871
872/**
873 * Get the input mode being used by the Ecore Input Context.
874 *
875 * See @ref ecore_imf_context_input_mode_set for more details.
876 *
877 * @param ctx An #Ecore_IMF_Context.
878 * @return The input mode being used by @p ctx.
879 * @ingroup Ecore_IMF_Context_Group
880 */
517EAPI Ecore_IMF_Input_Mode ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx); 881EAPI Ecore_IMF_Input_Mode ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx);
882
883/**
884 * Allow an Ecore Input Context to internally handle an event.
885 * If this function returns @c EINA_TRUE, then no further processing
886 * should be done for this event.
887 *
888 * Input methods must be able to accept all types of events (simply
889 * returning @c EINA_FALSE if the event was not handled), but there is no
890 * obligation of any events to be submitted to this function.
891 *
892 * @param ctx An #Ecore_IMF_Context.
893 * @param type The type of event defined by #Ecore_IMF_Event_Type.
894 * @param event The event itself.
895 * @return @c EINA_TRUE if the event was handled; otherwise @c EINA_FALSE.
896 * @ingroup Ecore_IMF_Context_Group
897 *
898 * Example
899 * @code
900 * static void
901 * _key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
902 * {
903 * Evas_Event_Key_Down *ev = event_info;
904 * if (!ev->keyname) return;
905 *
906 * if (imf_context)
907 * {
908 * Ecore_IMF_Event_Key_Down ecore_ev;
909 * ecore_imf_evas_event_key_down_wrap(ev, &ecore_ev);
910 * if (ecore_imf_context_filter_event(imf_context,
911 * ECORE_IMF_EVENT_KEY_DOWN,
912 * (Ecore_IMF_Event *)&ecore_ev))
913 * return;
914 * }
915 * }
916 *
917 * evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _key_down_cb, data);
918 * @endcode
919 */
518EAPI Eina_Bool ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event); 920EAPI Eina_Bool ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event);
519 921
520/* plugin specific functions */ 922/* plugin specific functions */
923
924/**
925 * @defgroup Ecore_IMF_Context_Module_Group Ecore Input Method Context Module Functions
926 * @ingroup Ecore_IMF_Lib_Group
927 *
928 * Functions that should be used by Ecore Input Method Context modules.
929 */
930
931/**
932 * Creates a new Input Method Context with klass specified by @p ctxc.
933 *
934 * This method should be used by modules implementing the Input
935 * Method Context interface.
936 *
937 * @param ctxc An #Ecore_IMF_Context_Class.
938 * @return A new #Ecore_IMF_Context; on failure it returns NULL.
939 * @ingroup Ecore_IMF_Context_Module_Group
940 */
521EAPI Ecore_IMF_Context *ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc); 941EAPI Ecore_IMF_Context *ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc);
942
943/**
944 * Set the Input Method Context specific data.
945 *
946 * Note that this method should be used by modules to set
947 * the Input Method Context specific data and it's not meant to
948 * be used by applications to store application specific data.
949 *
950 * @param ctx An #Ecore_IMF_Context.
951 * @param data The Input Method Context specific data.
952 * @return A new #Ecore_IMF_Context; on failure it returns NULL.
953 * @ingroup Ecore_IMF_Context_Module_Group
954 */
522EAPI void ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data); 955EAPI void ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data);
956
957/**
958 * Get the Input Method Context specific data.
959 *
960 * See @ref ecore_imf_context_data_set for more details.
961 *
962 * @param ctx An #Ecore_IMF_Context.
963 * @return The Input Method Context specific data.
964 * @ingroup Ecore_IMF_Context_Module_Group
965 */
523EAPI void *ecore_imf_context_data_get(Ecore_IMF_Context *ctx); 966EAPI void *ecore_imf_context_data_get(Ecore_IMF_Context *ctx);
967
968/**
969 * Retrieve context around insertion point.
970 * Input methods typically want context in order to constrain input text based on existing text;
971 * this is important for languages such as Thai where only some sequences of characters are allowed.
972 * In addition, the text around the insertion point can be used for supporting autocapital feature.
973 *
974 * This function is implemented by calling the
975 * Ecore_IMF_Context::retrieve_surrounding_func (
976 * set using #ecore_imf_context_retrieve_surrounding_callback_set).
977 *
978 * There is no obligation for a widget to respond to the
979 * retrieve_surrounding_func, so input methods must be prepared
980 * to function without context.
981 *
982 * @param ctx An #Ecore_IMF_Context.
983 * @param text Location to store a UTF-8 encoded string of text
984 * holding context around the insertion point.
985 * If the function returns @c EINA_TRUE, then you must free
986 * the result stored in this location with free().
987 * @param cursor_pos Location to store the position in characters of
988 * the insertion cursor within @p text.
989 * @return @c EINA_TRUE if surrounding text was provided; otherwise
990 * @c EINA_FALSE.
991 * @ingroup Ecore_IMF_Context_Module_Group
992 */
524EAPI Eina_Bool ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos); 993EAPI Eina_Bool ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos);
994
995/**
996 * Adds ECORE_IMF_EVENT_PREEDIT_START to the event queue.
997 *
998 * ECORE_IMF_EVENT_PREEDIT_START should be added when a new preedit sequence starts.
999 * It's asynchronous method to put event to the event queue.
1000 * ecore_imf_context_event_callback_call() can be used as synchronous method.
1001 *
1002 * @param ctx An #Ecore_IMF_Context.
1003 * @ingroup Ecore_IMF_Context_Module_Group
1004 */
525EAPI void ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx); 1005EAPI void ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx);
1006
1007/**
1008 * Adds ECORE_IMF_EVENT_PREEDIT_END to the event queue.
1009 *
1010 * ECORE_IMF_EVENT_PREEDIT_END should be added when a new preedit sequence has been completed or canceled.
1011 * It's asynchronous method to put event to the event queue.
1012 * ecore_imf_context_event_callback_call() can be used as synchronous method.
1013 *
1014 * @param ctx An #Ecore_IMF_Context.
1015 * @ingroup Ecore_IMF_Context_Module_Group
1016 */
526EAPI void ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx); 1017EAPI void ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx);
1018
1019/**
1020 * Adds ECORE_IMF_EVENT_PREEDIT_CHANGED to the event queue.
1021 *
1022 * It's asynchronous method to put event to the event queue.
1023 * ecore_imf_context_event_callback_call() can be used as synchronous method.
1024 *
1025 * @param ctx An #Ecore_IMF_Context.
1026 * @ingroup Ecore_IMF_Context_Module_Group
1027 */
527EAPI void ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx); 1028EAPI void ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx);
1029
1030/**
1031 * Adds ECORE_IMF_EVENT_COMMIT to the event queue.
1032 *
1033 * It's asynchronous method to put event to the event queue.
1034 * ecore_imf_context_event_callback_call() can be used as synchronous method.
1035 *
1036 * @param ctx An #Ecore_IMF_Context.
1037 * @param str The committed string.
1038 * @ingroup Ecore_IMF_Context_Module_Group
1039 */
528EAPI void ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str); 1040EAPI void ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str);
1041
1042/**
1043 * Adds ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.
1044 *
1045 * Asks the widget that the input context is attached to to delete characters around the cursor position
1046 * by adding the ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.
1047 * Note that offset and n_chars are in characters not in bytes.
1048 *
1049 * It's asynchronous method to put ECORE_IMF_EVENT_DELETE_SURROUNDING event to the event queue.
1050 * ecore_imf_context_event_callback_call() can be used as synchronous method.
1051 *
1052 * @param ctx An #Ecore_IMF_Context.
1053 * @param offset The start offset of surrounding to be deleted.
1054 * @param n_chars The number of characters to be deleted.
1055 * @ingroup Ecore_IMF_Context_Module_Group
1056 */
529EAPI void ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars); 1057EAPI void ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars);
1058
1059/**
1060 * Add (register) a callback function to a given context event.
1061 *
1062 * This function adds a function callback to the context @p ctx when the
1063 * event of type @p type occurs on it. The function pointer is @p
1064 * func.
1065 *
1066 * The event type @p type to trigger the function may be one of
1067 * #ECORE_IMF_CALLBACK_PREEDIT_START, #ECORE_IMF_CALLBACK_PREEDIT_END,
1068 * #ECORE_IMF_CALLBACK_PREEDIT_CHANGED, #ECORE_IMF_CALLBACK_COMMIT and
1069 * #ECORE_IMF_CALLBACK_DELETE_SURROUNDING.
1070 *
1071 * @param ctx Ecore_IMF_Context to attach a callback to.
1072 * @param type The type of event that will trigger the callback
1073 * @param func The (callback) function to be called when the event is
1074 * triggered
1075 * @param data The data pointer to be passed to @p func
1076 * @ingroup Ecore_IMF_Context_Group
1077 * @since 1.2.0
1078 *
1079 * Example
1080 * @code
1081 * static void
1082 * _imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
1083 * {
1084 * char *commit_str = event_info;
1085 * // something to do
1086 * }
1087 *
1088 * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _imf_event_commit_cb, data);
1089 * @endcode
1090 */
530EAPI void ecore_imf_context_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func, const void *data); 1091EAPI void ecore_imf_context_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func, const void *data);
1092
1093/**
1094 * Delete (unregister) a callback function registered to a given
1095 * context event.
1096 *
1097 * This function removes a function callback from the context @p ctx when the
1098 * event of type @p type occurs on it. The function pointer is @p
1099 * func.
1100 *
1101 * @see ecore_imf_context_event_callback_add() for more details
1102 *
1103 * @param ctx Ecore_IMF_Context to remove a callback from.
1104 * @param type The type of event that was triggering the callback
1105 * @param func The (callback) function that was to be called when the event was triggered
1106 * @return the data pointer
1107 * @ingroup Ecore_IMF_Context_Group
1108 * @since 1.2.0
1109 */
531EAPI void *ecore_imf_context_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func); 1110EAPI void *ecore_imf_context_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func);
1111
1112/**
1113 * Call a given callback on the context @p ctx.
1114 *
1115 * ecore_imf_context_preedit_start_event_add(), ecore_imf_context_preedit_end_event_add(),
1116 * ecore_imf_context_preedit_changed_event_add(), ecore_imf_context_commit_event_add() and
1117 * ecore_imf_context_delete_surrounding_event_add() APIs are asynchronous
1118 * because those API adds each event to the event queue.
1119 *
1120 * This API provides the way to call each callback function immediately.
1121 *
1122 * @param ctx Ecore_IMF_Context.
1123 * @param type The type of event that will trigger the callback
1124 * @param event_info The pointer to event specific struct or information to
1125 * pass to the callback functions registered on this event
1126 * @ingroup Ecore_IMF_Context_Module_Group
1127 * @since 1.2.0
1128 */
532EAPI void ecore_imf_context_event_callback_call(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, void *event_info); 1129EAPI void ecore_imf_context_event_callback_call(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, void *event_info);
1130
1131/**
1132 * Set whether the IM context should allow to use the text prediction.
1133 * If @p prediction is @c EINA_FALSE (default is @c EINA_TRUE), then the IM
1134 * context will not display the text prediction window.
1135 *
1136 * @param ctx An #Ecore_IMF_Context.
1137 * @param prediction Whether the IM context should allow to use the text prediction.
1138 * @note Default value is EINA_TRUE.
1139 * @ingroup Ecore_IMF_Context_Group
1140 * @since 1.1.0
1141 */
533EAPI void ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction); 1142EAPI void ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction);
1143
1144/**
1145 * Get whether the IM context should allow to use the text prediction.
1146 *
1147 * @param ctx An #Ecore_IMF_Context.
1148 * @return @c EINA_TRUE if it allows to use the text prediction, otherwise
1149 * @c EINA_FALSE.
1150 * @ingroup Ecore_IMF_Context_Group
1151 * @since 1.1.0
1152 */
534EAPI Eina_Bool ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx); 1153EAPI Eina_Bool ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx);
1154
1155/**
1156 * Set the autocapitalization type on the immodule.
1157 *
1158 * @param ctx An #Ecore_IMF_Context.
1159 * @param autocapital_type the autocapitalization type.
1160 * @note Default type is ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE.
1161 * @ingroup Ecore_IMF_Context_Group
1162 * @since 1.1.0
1163 */
535EAPI void ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type); 1164EAPI void ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type);
1165
1166/**
1167 * Get the autocapitalization type.
1168 *
1169 * @param ctx An #Ecore_IMF_Context.
1170 * @return The autocapital type being used by @p ctx.
1171 * @ingroup Ecore_IMF_Context_Group
1172 * @since 1.1.0
1173 */
536EAPI Ecore_IMF_Autocapital_Type ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx); 1174EAPI Ecore_IMF_Autocapital_Type ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx);
537 1175
1176/**
1177 * Ask the Input Method Context to show the control panel of using Input Method.
1178 *
1179 * @param ctx An #Ecore_IMF_Context.
1180 * @ingroup Ecore_IMF_Context_Group
1181 * @since 1.1.0
1182 */
538EAPI void ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx); 1183EAPI void ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx);
1184
1185/**
1186 * Ask the Input Method Context to hide the control panel of using Input Method.
1187 *
1188 * @param ctx An #Ecore_IMF_Context.
1189 * @ingroup Ecore_IMF_Context_Group
1190 * @since 1.1.0
1191 */
539EAPI void ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx); 1192EAPI void ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx);
540 1193
1194/**
1195 * Ask the Input Method Context to show the input panel (virtual keyboard).
1196 *
1197 * @param ctx An #Ecore_IMF_Context.
1198 * @ingroup Ecore_IMF_Context_Group
1199 * @since 1.1.0
1200 */
541EAPI void ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx); 1201EAPI void ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx);
1202
1203/**
1204 * Ask the Input Method Context to hide the input panel.
1205 *
1206 * @param ctx An #Ecore_IMF_Context.
1207 * @ingroup Ecore_IMF_Context_Group
1208 * @since 1.1.0
1209 */
542EAPI void ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx); 1210EAPI void ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx);
1211
1212/**
1213 * Set the layout of the input panel.
1214 *
1215 * @param ctx An #Ecore_IMF_Context.
1216 * @param layout see #Ecore_IMF_Input_Panel_Layout
1217 * @note Default layout type is ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL.
1218 * @ingroup Ecore_IMF_Context_Group
1219 * @since 1.1.0
1220 */
543EAPI void ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout); 1221EAPI void ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout);
1222
1223/**
1224 * Get the layout of the current active input panel.
1225 *
1226 * @param ctx An #Ecore_IMF_Context.
1227 * @return layout see #Ecore_IMF_Input_Panel_Layout
1228 * @ingroup Ecore_IMF_Context_Group
1229 * @since 1.1.0
1230 */
544EAPI Ecore_IMF_Input_Panel_Layout ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx); 1231EAPI Ecore_IMF_Input_Panel_Layout ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx);
1232
1233/**
1234 * Set the language of the input panel.
1235 * This API can be used when you want to show the English keyboard.
1236 *
1237 * @param ctx An #Ecore_IMF_Context.
1238 * @param lang the language to be set to the input panel.
1239 * @ingroup Ecore_IMF_Context_Group
1240 * @since 1.1.0
1241 */
545EAPI void ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang); 1242EAPI void ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
1243
1244/**
1245 * Get the language of the input panel.
1246 *
1247 * See @ref ecore_imf_context_input_panel_language_set for more details.
1248 *
1249 * @param ctx An #Ecore_IMF_Context.
1250 * @return Ecore_IMF_Input_Panel_Lang
1251 * @ingroup Ecore_IMF_Context_Group
1252 * @since 1.1.0
1253 */
546EAPI Ecore_IMF_Input_Panel_Lang ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx); 1254EAPI Ecore_IMF_Input_Panel_Lang ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx);
1255
1256/**
1257 * Set whether the Input Method Context should request to show the input panel automatically
1258 * when the widget has focus.
1259 *
1260 * @param ctx An #Ecore_IMF_Context.
1261 * @param enabled If true, the input panel will be shown when the widget is clicked or has focus.
1262 * @ingroup Ecore_IMF_Context_Group
1263 * @since 1.1.0
1264 */
547EAPI void ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx, Eina_Bool enable); 1265EAPI void ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx, Eina_Bool enable);
1266
1267/**
1268 * Get whether the Input Method Context requests to show the input panel automatically.
1269 *
1270 * @param ctx An #Ecore_IMF_Context.
1271 * @return Return the attribute to show the input panel automatically
1272 * @ingroup Ecore_IMF_Context_Group
1273 * @since 1.1.0
1274 */
548EAPI Eina_Bool ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx); 1275EAPI Eina_Bool ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx);
1276
1277/**
1278 * Set the input panel-specific data to deliver to the input panel.
1279 * This API is used by applications to deliver specific data to the input panel.
1280 * The data format MUST be negotiated by both application and the input panel.
1281 * The size and format of data are defined by the input panel.
1282 *
1283 * @param ctx An #Ecore_IMF_Context.
1284 * @param data The specific data to be set to the input panel.
1285 * @param len the length of data, in bytes, to send to the input panel
1286 * @ingroup Ecore_IMF_Context_Group
1287 * @since 1.2.0
1288 */
549EAPI void ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len); 1289EAPI void ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len);
1290
1291/**
1292 * Get the specific data of the current active input panel.
1293 *
1294 * @param ctx An #Ecore_IMF_Context.
1295 * @param data The specific data to be got from the input panel
1296 * @param len The length of data
1297 * @ingroup Ecore_IMF_Context_Group
1298 * @since 1.2.0
1299 */
550EAPI void ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len); 1300EAPI void ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len);
1301
1302/**
1303 * Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel.
1304 *
1305 * An input panel displays the string or icon associated with this type
1306 *
1307 * @param ctx An #Ecore_IMF_Context.
1308 * @param return_key_type The type of "return" key on the input panel
1309 * @note Default type is ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT.
1310 * @ingroup Ecore_IMF_Context_Group
1311 * @since 1.2.0
1312 */
551EAPI void ecore_imf_context_input_panel_return_key_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type); 1313EAPI void ecore_imf_context_input_panel_return_key_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type);
1314
1315/**
1316 * Get the "return" key type.
1317 *
1318 * @see ecore_imf_context_input_panel_return_key_type_set() for more details
1319 *
1320 * @param ctx An #Ecore_IMF_Context.
1321 * @return The type of "return" key on the input panel
1322 * @ingroup Ecore_IMF_Context_Group
1323 * @since 1.2.0
1324 */
552EAPI Ecore_IMF_Input_Panel_Return_Key_Type ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx); 1325EAPI Ecore_IMF_Input_Panel_Return_Key_Type ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx);
1326
1327/**
1328 * Set the return key on the input panel to be disabled.
1329 *
1330 * @param ctx An #Ecore_IMF_Context.
1331 * @param disabled The state
1332 * @ingroup Ecore_IMF_Context_Group
1333 * @since 1.2.0
1334 */
553EAPI void ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled); 1335EAPI void ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled);
1336
1337/**
1338 * Get whether the return key on the input panel should be disabled or not.
1339 *
1340 * @param ctx An #Ecore_IMF_Context.
1341 * @return @c EINA_TRUE if it should be disabled.
1342 * @ingroup Ecore_IMF_Context_Group
1343 * @since 1.2.0
1344 */
554EAPI Eina_Bool ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx); 1345EAPI Eina_Bool ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx);
1346
1347/**
1348 * Set the caps lock mode on the input panel.
1349 *
1350 * @param ctx An #Ecore_IMF_Context.
1351 * @param mode Turn on caps lock on the input panel if @c EINA_TRUE.
1352 * @ingroup Ecore_IMF_Context_Group
1353 * @since 1.2.0
1354 */
555EAPI void ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode); 1355EAPI void ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode);
1356
1357/**
1358 * Get the caps lock mode on the input panel.
1359 *
1360 * @param ctx An #Ecore_IMF_Context.
1361 * @return @c EINA_TRUE if the caps lock is turned on.
1362 * @ingroup Ecore_IMF_Context_Group
1363 * @since 1.2.0
1364 */
556EAPI Eina_Bool ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx); 1365EAPI Eina_Bool ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx);
1366
1367/**
1368 * Get the position of the current active input panel.
1369 *
1370 * @param ctx An #Ecore_IMF_Context.
1371 * @param x top-left x co-ordinate of the input panel
1372 * @param y top-left y co-ordinate of the input panel
1373 * @param w width of the input panel
1374 * @param h height of the input panel
1375 * @ingroup Ecore_IMF_Context_Group
1376 * @since 1.3
1377 */
557EAPI void ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h); 1378EAPI void ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
1379
1380/**
1381 * Get state of current active input panel.
1382 *
1383 * @param ctx An #Ecore_IMF_Context.
1384 * @return The state of input panel.
1385 * @ingroup Ecore_IMF_Context_Group
1386 * @since 1.3
1387 */
558EAPI Ecore_IMF_Input_Panel_State ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx); 1388EAPI Ecore_IMF_Input_Panel_State ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx);
1389
1390/**
1391 * Register a callback function which will be called if there is change in input panel state,language,mode etc.
1392 * In order to deregister the callback function
1393 * Use @ref ecore_imf_context_input_panel_event_callback_del.
1394 *
1395 * @param ctx An #Ecore_IMF_Context
1396 * @param type event type
1397 * @param func the callback function
1398 * @param data application-input panel specific data.
1399 * @ingroup Ecore_IMF_Context_Group
1400 * @since 1.3
1401 */
559EAPI void ecore_imf_context_input_panel_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value), const void *data); 1402EAPI void ecore_imf_context_input_panel_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value), const void *data);
1403
1404/**
1405 * Unregister a callback function which will be called if there is change in input panel state, language, mode etc.
1406 *
1407 * @param ctx An #Ecore_IMF_Context.
1408 * @param type An #Ecore_IMF_Input_Panel_Event.
1409 * @param func the callback function
1410 * @ingroup Ecore_IMF_Context_Group
1411 * @since 1.3
1412 */
560EAPI void ecore_imf_context_input_panel_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value)); 1413EAPI void ecore_imf_context_input_panel_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value));
1414
1415/**
1416 * Get the current language locale of the input panel.
1417 *
1418 * ex) fr_FR
1419 *
1420 * @param ctx An #Ecore_IMF_Context.
1421 * @param lang Location to store the retrieved language string. The
1422 * string retrieved must be freed with free().
1423 * @ingroup Ecore_IMF_Context_Group
1424 * @since 1.3
1425 */
561EAPI void ecore_imf_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx, char **lang); 1426EAPI void ecore_imf_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx, char **lang);
1427
1428/**
1429 * Get the geometry information of the candidate panel.
1430 *
1431 * @param ctx An #Ecore_IMF_Context.
1432 * @param x top-left x co-ordinate of the candidate panel
1433 * @param y top-left y co-ordinate of the candidate panel
1434 * @param w width of the candidate panel
1435 * @param h height of the candidate panel
1436 * @ingroup Ecore_IMF_Context_Group
1437 * @since 1.3
1438 */
562EAPI void ecore_imf_context_candidate_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h); 1439EAPI void ecore_imf_context_candidate_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
563 1440
564/* The following entry points must be exported by each input method module 1441/* The following entry points must be exported by each input method module
diff --git a/src/lib/ecore_imf/ecore_imf_context.c b/src/lib/ecore_imf/ecore_imf_context.c
index 4e4fadced3..8f6efa623a 100644
--- a/src/lib/ecore_imf/ecore_imf_context.c
+++ b/src/lib/ecore_imf/ecore_imf_context.c
@@ -12,40 +12,6 @@
12#include "Ecore_IMF.h" 12#include "Ecore_IMF.h"
13#include "ecore_imf_private.h" 13#include "ecore_imf_private.h"
14 14
15/**
16 * @defgroup Ecore_IMF_Context_Group Ecore Input Method Context Functions
17 * @ingroup Ecore_IMF_Lib_Group
18 *
19 * Functions that operate on Ecore Input Method Context objects.
20
21 * Ecore Input Method Context Function defines the interface for EFL input methods.
22 * An input method is used by EFL text input widgets like elm_entry
23 * (based on edje_entry) to map from key events to Unicode character strings.
24 *
25 * The default input method can be set through setting the ECORE_IMF_MODULE environment variable.
26 *
27 * An input method may consume multiple key events in sequence and finally output the composed result.
28 * This is called preediting, and an input method may provide feedback about
29 * this process by displaying the intermediate composition states as preedit text.
30 *
31 * Immodule is plugin to connect your application and input method framework such as SCIM, ibus, and so on.@n
32 * ecore_imf_init() should be called to initialize and load immodule.@n
33 * ecore_imf_shutdown() is used for shutdowning and unloading immodule.
34 *
35 * An example of usage of these functions can be found at:
36 * @li @ref ecore_imf_example_c
37 */
38
39/**
40 * Get the list of the available Input Method Context ids.
41 *
42 * Note that the caller is responsible for freeing the Eina_List
43 * when finished with it. There is no need to finish the list strings.
44 *
45 * @return Return an Eina_List of strings;
46 * on failure it returns NULL.
47 * @ingroup Ecore_IMF_Context_Group
48 */
49EAPI Eina_List * 15EAPI Eina_List *
50ecore_imf_context_available_ids_get(void) 16ecore_imf_context_available_ids_get(void)
51{ 17{
@@ -81,15 +47,6 @@ _ecore_imf_context_match_locale(const char *locale, const char *against, int aga
81 return 0; 47 return 0;
82} 48}
83 49
84/**
85 * Get the id of the default Input Method Context.
86 * The id may to used to create a new instance of an Input Method
87 * Context object.
88 *
89 * @return Return a string containing the id of the default Input
90 * Method Context; on failure it returns NULL.
91 * @ingroup Ecore_IMF_Context_Group
92 */
93EAPI const char * 50EAPI const char *
94ecore_imf_context_default_id_get(void) 51ecore_imf_context_default_id_get(void)
95{ 52{
@@ -154,40 +111,6 @@ ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type)
154 return id; 111 return id;
155} 112}
156 113
157/**
158 * Retrieve the info for the Input Method Context with @p id.
159 *
160 * @param id The Input Method Context id to query for.
161 * @return Return a #Ecore_IMF_Context_Info for the Input Method Context with @p id;
162 * on failure it returns NULL.
163 * @ingroup Ecore_IMF_Context_Group
164 *
165 * Example
166 * @code
167 *
168 * const char *ctx_id;
169 * const Ecore_IMF_Context_Info *ctx_info;
170 * Ecore_IMF_Context *imf_context;
171 * ctx_id = ecore_imf_context_default_id_get();
172 * if (ctx_id)
173 * {
174 * ctx_info = ecore_imf_context_info_by_id_get(ctx_id);
175 * if (!ctx_info->canvas_type ||
176 * strcmp(ctx_info->canvas_type, "evas") == 0)
177 * {
178 * imf_context = ecore_imf_context_add(ctx_id);
179 * }
180 * else
181 * {
182 * ctx_id = ecore_imf_context_default_id_by_canvas_type_get("evas");
183 * if (ctx_id)
184 * {
185 * imf_context = ecore_imf_context_add(ctx_id);
186 * }
187 * }
188 * }
189 * @endcode
190 */
191EAPI const Ecore_IMF_Context_Info * 114EAPI const Ecore_IMF_Context_Info *
192ecore_imf_context_info_by_id_get(const char *id) 115ecore_imf_context_info_by_id_get(const char *id)
193{ 116{
@@ -199,14 +122,6 @@ ecore_imf_context_info_by_id_get(const char *id)
199 return module->info; 122 return module->info;
200} 123}
201 124
202/**
203 * Create a new Input Method Context defined by the given id.
204 *
205 * @param id The Input Method Context id.
206 * @return A newly allocated Input Method Context;
207 * on failure it returns NULL.
208 * @ingroup Ecore_IMF_Context_Group
209 */
210EAPI Ecore_IMF_Context * 125EAPI Ecore_IMF_Context *
211ecore_imf_context_add(const char *id) 126ecore_imf_context_add(const char *id)
212{ 127{
@@ -242,14 +157,6 @@ ecore_imf_context_add(const char *id)
242 return ctx; 157 return ctx;
243} 158}
244 159
245/**
246 * Retrieve the info for the given Input Method Context.
247 *
248 * @param ctx An #Ecore_IMF_Context.
249 * @return Return a #Ecore_IMF_Context_Info for the given Input Method Context;
250 * on failure it returns NULL.
251 * @ingroup Ecore_IMF_Context_Group
252 */
253EAPI const Ecore_IMF_Context_Info * 160EAPI const Ecore_IMF_Context_Info *
254ecore_imf_context_info_get(Ecore_IMF_Context *ctx) 161ecore_imf_context_info_get(Ecore_IMF_Context *ctx)
255{ 162{
@@ -262,12 +169,6 @@ ecore_imf_context_info_get(Ecore_IMF_Context *ctx)
262 return ctx->module->info; 169 return ctx->module->info;
263} 170}
264 171
265/**
266 * Delete the given Input Method Context and free its memory.
267 *
268 * @param ctx An #Ecore_IMF_Context.
269 * @ingroup Ecore_IMF_Context_Group
270 */
271EAPI void 172EAPI void
272ecore_imf_context_del(Ecore_IMF_Context *ctx) 173ecore_imf_context_del(Ecore_IMF_Context *ctx)
273{ 174{
@@ -291,17 +192,6 @@ ecore_imf_context_del(Ecore_IMF_Context *ctx)
291 free(ctx); 192 free(ctx);
292} 193}
293 194
294/**
295 * Set the client window for the Input Method Context; this is the
296 * Ecore_X_Window when using X11, Ecore_Win32_Window when using Win32, etc.
297 * This window is used in order to correctly position status windows, and may
298 * also be used for purposes internal to the Input Method Context.
299 *
300 * @param ctx An #Ecore_IMF_Context.
301 * @param window The client window. This may be @c NULL to indicate
302 * that the previous client window no longer exists.
303 * @ingroup Ecore_IMF_Context_Group
304 */
305EAPI void 195EAPI void
306ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window) 196ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window)
307{ 197{
@@ -315,16 +205,6 @@ ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window)
315 ctx->window = window; 205 ctx->window = window;
316} 206}
317 207
318/**
319 * Get the client window of the Input Method Context
320 *
321 * See @ref ecore_imf_context_client_window_set for more details.
322 *
323 * @param ctx An #Ecore_IMF_Context.
324 * @return Return the client window.
325 * @ingroup Ecore_IMF_Context_Group
326 * @since 1.1.0
327 */
328EAPI void * 208EAPI void *
329ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx) 209ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx)
330{ 210{
@@ -337,19 +217,6 @@ ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx)
337 return ctx->window; 217 return ctx->window;
338} 218}
339 219
340/**
341 * Set the client canvas for the Input Method Context; this is the
342 * canvas in which the input appears.
343 * The canvas type can be determined by using the context canvas type.
344 * Actually only canvas with type "evas" (Evas *) is supported.
345 * This canvas may be used in order to correctly position status windows, and may
346 * also be used for purposes internal to the Input Method Context.
347 *
348 * @param ctx An #Ecore_IMF_Context.
349 * @param canvas The client canvas. This may be @c NULL to indicate
350 * that the previous client canvas no longer exists.
351 * @ingroup Ecore_IMF_Context_Group
352 */
353EAPI void 220EAPI void
354ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas) 221ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas)
355{ 222{
@@ -363,16 +230,6 @@ ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas)
363 ctx->client_canvas = canvas; 230 ctx->client_canvas = canvas;
364} 231}
365 232
366/**
367 * Get the client canvas of the Input Method Context.
368 *
369 * See @ref ecore_imf_context_client_canvas_set for more details.
370 *
371 * @param ctx An #Ecore_IMF_Context.
372 * @return Return the client canvas.
373 * @ingroup Ecore_IMF_Context_Group
374 * @since 1.1.0
375 */
376EAPI void * 233EAPI void *
377ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx) 234ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx)
378{ 235{
@@ -385,12 +242,6 @@ ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx)
385 return ctx->client_canvas; 242 return ctx->client_canvas;
386} 243}
387 244
388/**
389 * Ask the Input Method Context to show itself.
390 *
391 * @param ctx An #Ecore_IMF_Context.
392 * @ingroup Ecore_IMF_Context_Group
393 */
394EAPI void 245EAPI void
395ecore_imf_context_show(Ecore_IMF_Context *ctx) 246ecore_imf_context_show(Ecore_IMF_Context *ctx)
396{ 247{
@@ -403,12 +254,6 @@ ecore_imf_context_show(Ecore_IMF_Context *ctx)
403 if (ctx->klass->show) ctx->klass->show(ctx); 254 if (ctx->klass->show) ctx->klass->show(ctx);
404} 255}
405 256
406/**
407 * Ask the Input Method Context to hide itself.
408 *
409 * @param ctx An #Ecore_IMF_Context.
410 * @ingroup Ecore_IMF_Context_Group
411 */
412EAPI void 257EAPI void
413ecore_imf_context_hide(Ecore_IMF_Context *ctx) 258ecore_imf_context_hide(Ecore_IMF_Context *ctx)
414{ 259{
@@ -421,17 +266,6 @@ ecore_imf_context_hide(Ecore_IMF_Context *ctx)
421 if (ctx->klass->hide) ctx->klass->hide(ctx); 266 if (ctx->klass->hide) ctx->klass->hide(ctx);
422} 267}
423 268
424/**
425 * Retrieve the current preedit string and cursor position
426 * for the Input Method Context.
427 *
428 * @param ctx An #Ecore_IMF_Context.
429 * @param str Location to store the retrieved string. The
430 * string retrieved must be freed with free().
431 * @param cursor_pos Location to store position of cursor (in characters)
432 * within the preedit string.
433 * @ingroup Ecore_IMF_Context_Group
434 */
435EAPI void 269EAPI void
436ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos) 270ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos)
437{ 271{
@@ -450,59 +284,6 @@ ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cu
450 } 284 }
451} 285}
452 286
453/**
454 * Retrieve the current preedit string, attributes and
455 * cursor position for the Input Method Context.
456 *
457 * @param ctx An #Ecore_IMF_Context.
458 * @param str Location to store the retrieved string. The
459 * string retrieved must be freed with free().
460 * @param attrs an Eina_List of attributes
461 * @param cursor_pos Location to store position of cursor (in characters)
462 * within the preedit string.
463 * @ingroup Ecore_IMF_Context_Group
464 *
465 * Example
466 * @code
467 * char *preedit_string;
468 * int cursor_pos;
469 * Eina_List *attrs = NULL, *l = NULL;
470 * Ecore_IMF_Preedit_Attr *attr;
471 *
472 * ecore_imf_context_preedit_string_with_attributes_get(imf_context,
473 * &preedit_string,
474 * &attrs, &cursor_pos);
475 * if (!preedit_string) return;
476 *
477 * if (strlen(preedit_string) > 0)
478 * {
479 * if (attrs)
480 * {
481 * EINA_LIST_FOREACH(attrs, l, attr)
482 * {
483 * if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB1)
484 * {
485 * // Something to do
486 * }
487 * else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB2)
488 * {
489 * // Something to do
490 * }
491 * else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB3)
492 * {
493 * // Something to do
494 * }
495 * }
496 * }
497 * }
498 *
499 * // delete attribute list
500 * EINA_LIST_FREE(attrs, attr) free(attr);
501 *
502 * free(preedit_string);
503 * @endcode
504 * @since 1.1.0
505 */
506EAPI void 287EAPI void
507ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos) 288ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos)
508{ 289{
@@ -522,25 +303,6 @@ ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, cha
522 } 303 }
523} 304}
524 305
525/**
526 * Notify the Input Method Context that the widget to which its
527 * correspond has gained focus.
528 *
529 * @param ctx An #Ecore_IMF_Context.
530 * @ingroup Ecore_IMF_Context_Group
531 *
532 * Example
533 * @code
534 * static void
535 * _focus_in_cb(void *data, Evas_Object *o, const char *emission, const char *source)
536 * {
537 * ecore_imf_context_reset(imf_context);
538 * ecore_imf_context_focus_in(imf_context);
539 * }
540 *
541 * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_IN, _focus_in_cb, ed);
542 * @endcode
543 */
544EAPI void 306EAPI void
545ecore_imf_context_focus_in(Ecore_IMF_Context *ctx) 307ecore_imf_context_focus_in(Ecore_IMF_Context *ctx)
546{ 308{
@@ -553,25 +315,6 @@ ecore_imf_context_focus_in(Ecore_IMF_Context *ctx)
553 if (ctx->klass->focus_in) ctx->klass->focus_in(ctx); 315 if (ctx->klass->focus_in) ctx->klass->focus_in(ctx);
554} 316}
555 317
556/**
557 * Notify the Input Method Context that the widget to which its
558 * correspond has lost focus.
559 *
560 * @param ctx An #Ecore_IMF_Context.
561 * @ingroup Ecore_IMF_Context_Group
562 *
563 * Example
564 * @code
565 * static void
566 * _focus_out_cb(void *data, Evas_Object *o, const char *emission, const char *source)
567 * {
568 * ecore_imf_context_reset(imf_context);
569 * ecore_imf_context_focus_out(imf_context);
570 * }
571 *
572 * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_OUT, _focus_out_cb, ed);
573 * @endcode
574 */
575EAPI void 318EAPI void
576ecore_imf_context_focus_out(Ecore_IMF_Context *ctx) 319ecore_imf_context_focus_out(Ecore_IMF_Context *ctx)
577{ 320{
@@ -584,26 +327,6 @@ ecore_imf_context_focus_out(Ecore_IMF_Context *ctx)
584 if (ctx->klass->focus_out) ctx->klass->focus_out(ctx); 327 if (ctx->klass->focus_out) ctx->klass->focus_out(ctx);
585} 328}
586 329
587/**
588 * Notify the Input Method Context that a change such as a
589 * change in cursor position has been made. This will typically
590 * cause the Input Method Context to clear the preedit state.
591 *
592 * @param ctx An #Ecore_IMF_Context.
593 * @ingroup Ecore_IMF_Context_Group
594 *
595 * Example
596 * @code
597 * static void
598 * _focus_out_cb(void *data, Evas_Object *o, const char *emission, const char *source)
599 * {
600 * ecore_imf_context_reset(imf_context);
601 * ecore_imf_context_focus_out(imf_context);
602 * }
603 *
604 * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_OUT, _focus_out_cb, ed);
605 * @endcode
606 */
607EAPI void 330EAPI void
608ecore_imf_context_reset(Ecore_IMF_Context *ctx) 331ecore_imf_context_reset(Ecore_IMF_Context *ctx)
609{ 332{
@@ -616,14 +339,6 @@ ecore_imf_context_reset(Ecore_IMF_Context *ctx)
616 if (ctx->klass->reset) ctx->klass->reset(ctx); 339 if (ctx->klass->reset) ctx->klass->reset(ctx);
617} 340}
618 341
619/**
620 * Notify the Input Method Context that a change in the cursor
621 * position has been made.
622 *
623 * @param ctx An #Ecore_IMF_Context.
624 * @param cursor_pos New cursor position in characters.
625 * @ingroup Ecore_IMF_Context_Group
626 */
627EAPI void 342EAPI void
628ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos) 343ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos)
629{ 344{
@@ -636,20 +351,6 @@ ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos)
636 if (ctx->klass->cursor_position_set) ctx->klass->cursor_position_set(ctx, cursor_pos); 351 if (ctx->klass->cursor_position_set) ctx->klass->cursor_position_set(ctx, cursor_pos);
637} 352}
638 353
639/**
640 * Notify the Input Method Context that a change in the cursor
641 * location has been made. The location is relative to the canvas.
642 * The cursor location can be used to determine the position of
643 * candidate word window in the immodule.
644 *
645 * @param ctx An #Ecore_IMF_Context.
646 * @param x cursor x position.
647 * @param y cursor y position.
648 * @param w cursor width.
649 * @param h cursor height.
650 * @ingroup Ecore_IMF_Context_Group
651 * @since 1.1.0
652 */
653EAPI void 354EAPI void
654ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int w, int h) 355ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int w, int h)
655{ 356{
@@ -662,16 +363,6 @@ ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int
662 if (ctx->klass->cursor_location_set) ctx->klass->cursor_location_set(ctx, x, y, w, h); 363 if (ctx->klass->cursor_location_set) ctx->klass->cursor_location_set(ctx, x, y, w, h);
663} 364}
664 365
665/**
666 * Set whether the IM context should use the preedit string
667 * to display feedback. If @c use_preedit is @c EINA_FALSE (default
668 * is @c EINA_TRUE), then the IM context may use some other method to display
669 * feedback, such as displaying it in a child of the root window.
670 *
671 * @param ctx An #Ecore_IMF_Context.
672 * @param use_preedit Whether the IM context should use the preedit string.
673 * @ingroup Ecore_IMF_Context_Group
674 */
675EAPI void 366EAPI void
676ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit) 367ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit)
677{ 368{
@@ -684,17 +375,6 @@ ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit)
684 if (ctx->klass->use_preedit_set) ctx->klass->use_preedit_set(ctx, use_preedit); 375 if (ctx->klass->use_preedit_set) ctx->klass->use_preedit_set(ctx, use_preedit);
685} 376}
686 377
687/**
688 * Set whether the IM context should allow to use the text prediction.
689 * If @p prediction is @c EINA_FALSE (default is @c EINA_TRUE), then the IM
690 * context will not display the text prediction window.
691 *
692 * @param ctx An #Ecore_IMF_Context.
693 * @param prediction Whether the IM context should allow to use the text prediction.
694 * @note Default value is EINA_TRUE.
695 * @ingroup Ecore_IMF_Context_Group
696 * @since 1.1.0
697 */
698EAPI void 378EAPI void
699ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction) 379ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction)
700{ 380{
@@ -711,15 +391,6 @@ ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool predict
711 ctx->klass->prediction_allow_set(ctx, prediction); 391 ctx->klass->prediction_allow_set(ctx, prediction);
712} 392}
713 393
714/**
715 * Get whether the IM context should allow to use the text prediction.
716 *
717 * @param ctx An #Ecore_IMF_Context.
718 * @return @c EINA_TRUE if it allows to use the text prediction, otherwise
719 * @c EINA_FALSE.
720 * @ingroup Ecore_IMF_Context_Group
721 * @since 1.1.0
722 */
723EAPI Eina_Bool 394EAPI Eina_Bool
724ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx) 395ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx)
725{ 396{
@@ -733,15 +404,6 @@ ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx)
733 return ctx->allow_prediction; 404 return ctx->allow_prediction;
734} 405}
735 406
736/**
737 * Set the autocapitalization type on the immodule.
738 *
739 * @param ctx An #Ecore_IMF_Context.
740 * @param autocapital_type the autocapitalization type.
741 * @note Default type is ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE.
742 * @ingroup Ecore_IMF_Context_Group
743 * @since 1.1.0
744 */
745EAPI void 407EAPI void
746ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type) 408ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type)
747{ 409{
@@ -757,14 +419,6 @@ ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocap
757 if (ctx->klass->autocapital_type_set) ctx->klass->autocapital_type_set(ctx, autocapital_type); 419 if (ctx->klass->autocapital_type_set) ctx->klass->autocapital_type_set(ctx, autocapital_type);
758} 420}
759 421
760/**
761 * Get the autocapitalization type.
762 *
763 * @param ctx An #Ecore_IMF_Context.
764 * @return The autocapital type being used by @p ctx.
765 * @ingroup Ecore_IMF_Context_Group
766 * @since 1.1.0
767 */
768EAPI Ecore_IMF_Autocapital_Type 422EAPI Ecore_IMF_Autocapital_Type
769ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx) 423ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx)
770{ 424{
@@ -778,17 +432,6 @@ ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx)
778 return ctx->autocapital_type; 432 return ctx->autocapital_type;
779} 433}
780 434
781/**
782 * Set the callback to be used on surrounding_get request.
783 *
784 * This callback will be called when the Input Method Context
785 * module requests the surrounding context.
786 *
787 * @param ctx An #Ecore_IMF_Context.
788 * @param func The callback to be called.
789 * @param data The data pointer to be passed to @p func
790 * @ingroup Ecore_IMF_Context_Group
791 */
792EAPI void 435EAPI void
793ecore_imf_context_retrieve_surrounding_callback_set(Ecore_IMF_Context *ctx, Eina_Bool (*func)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos), const void *data) 436ecore_imf_context_retrieve_surrounding_callback_set(Ecore_IMF_Context *ctx, Eina_Bool (*func)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos), const void *data)
794{ 437{
@@ -803,17 +446,6 @@ ecore_imf_context_retrieve_surrounding_callback_set(Ecore_IMF_Context *ctx, Eina
803 ctx->retrieve_surrounding_data = (void *) data; 446 ctx->retrieve_surrounding_data = (void *) data;
804} 447}
805 448
806/**
807 * Set the input mode used by the Ecore Input Context.
808 *
809 * The input mode can be one of the input modes defined in
810 * Ecore_IMF_Input_Mode. The default input mode is
811 * ECORE_IMF_INPUT_MODE_FULL.
812 *
813 * @param ctx An #Ecore_IMF_Context.
814 * @param input_mode The input mode to be used by @p ctx.
815 * @ingroup Ecore_IMF_Context_Group
816 */
817EAPI void 449EAPI void
818ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode) 450ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode)
819{ 451{
@@ -827,15 +459,6 @@ ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode in
827 ctx->input_mode = input_mode; 459 ctx->input_mode = input_mode;
828} 460}
829 461
830/**
831 * Get the input mode being used by the Ecore Input Context.
832 *
833 * See @ref ecore_imf_context_input_mode_set for more details.
834 *
835 * @param ctx An #Ecore_IMF_Context.
836 * @return The input mode being used by @p ctx.
837 * @ingroup Ecore_IMF_Context_Group
838 */
839EAPI Ecore_IMF_Input_Mode 462EAPI Ecore_IMF_Input_Mode
840ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx) 463ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx)
841{ 464{
@@ -848,43 +471,6 @@ ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx)
848 return ctx->input_mode; 471 return ctx->input_mode;
849} 472}
850 473
851/**
852 * Allow an Ecore Input Context to internally handle an event.
853 * If this function returns @c EINA_TRUE, then no further processing
854 * should be done for this event.
855 *
856 * Input methods must be able to accept all types of events (simply
857 * returning @c EINA_FALSE if the event was not handled), but there is no
858 * obligation of any events to be submitted to this function.
859 *
860 * @param ctx An #Ecore_IMF_Context.
861 * @param type The type of event defined by #Ecore_IMF_Event_Type.
862 * @param event The event itself.
863 * @return @c EINA_TRUE if the event was handled; otherwise @c EINA_FALSE.
864 * @ingroup Ecore_IMF_Context_Group
865 *
866 * Example
867 * @code
868 * static void
869 * _key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
870 * {
871 * Evas_Event_Key_Down *ev = event_info;
872 * if (!ev->keyname) return;
873 *
874 * if (imf_context)
875 * {
876 * Ecore_IMF_Event_Key_Down ecore_ev;
877 * ecore_imf_evas_event_key_down_wrap(ev, &ecore_ev);
878 * if (ecore_imf_context_filter_event(imf_context,
879 * ECORE_IMF_EVENT_KEY_DOWN,
880 * (Ecore_IMF_Event *)&ecore_ev))
881 * return;
882 * }
883 * }
884 *
885 * evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _key_down_cb, data);
886 * @endcode
887 */
888EAPI Eina_Bool 474EAPI Eina_Bool
889ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event) 475ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event)
890{ 476{
@@ -898,23 +484,6 @@ ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type
898 return EINA_FALSE; 484 return EINA_FALSE;
899} 485}
900 486
901/**
902 * @defgroup Ecore_IMF_Context_Module_Group Ecore Input Method Context Module Functions
903 * @ingroup Ecore_IMF_Lib_Group
904 *
905 * Functions that should be used by Ecore Input Method Context modules.
906 */
907
908/**
909 * Creates a new Input Method Context with klass specified by @p ctxc.
910 *
911 * This method should be used by modules implementing the Input
912 * Method Context interface.
913 *
914 * @param ctxc An #Ecore_IMF_Context_Class.
915 * @return A new #Ecore_IMF_Context; on failure it returns NULL.
916 * @ingroup Ecore_IMF_Context_Module_Group
917 */
918EAPI Ecore_IMF_Context * 487EAPI Ecore_IMF_Context *
919ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc) 488ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc)
920{ 489{
@@ -931,18 +500,6 @@ ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc)
931 return ctx; 500 return ctx;
932} 501}
933 502
934/**
935 * Set the Input Method Context specific data.
936 *
937 * Note that this method should be used by modules to set
938 * the Input Method Context specific data and it's not meant to
939 * be used by applications to store application specific data.
940 *
941 * @param ctx An #Ecore_IMF_Context.
942 * @param data The Input Method Context specific data.
943 * @return A new #Ecore_IMF_Context; on failure it returns NULL.
944 * @ingroup Ecore_IMF_Context_Module_Group
945 */
946EAPI void 503EAPI void
947ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data) 504ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data)
948{ 505{
@@ -955,15 +512,6 @@ ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data)
955 ctx->data = data; 512 ctx->data = data;
956} 513}
957 514
958/**
959 * Get the Input Method Context specific data.
960 *
961 * See @ref ecore_imf_context_data_set for more details.
962 *
963 * @param ctx An #Ecore_IMF_Context.
964 * @return The Input Method Context specific data.
965 * @ingroup Ecore_IMF_Context_Module_Group
966 */
967EAPI void *ecore_imf_context_data_get(Ecore_IMF_Context *ctx) 515EAPI void *ecore_imf_context_data_get(Ecore_IMF_Context *ctx)
968{ 516{
969 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) 517 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
@@ -975,31 +523,6 @@ EAPI void *ecore_imf_context_data_get(Ecore_IMF_Context *ctx)
975 return ctx->data; 523 return ctx->data;
976} 524}
977 525
978/**
979 * Retrieve context around insertion point.
980 * Input methods typically want context in order to constrain input text based on existing text;
981 * this is important for languages such as Thai where only some sequences of characters are allowed.
982 * In addition, the text around the insertion point can be used for supporting autocapital feature.
983 *
984 * This function is implemented by calling the
985 * Ecore_IMF_Context::retrieve_surrounding_func (
986 * set using #ecore_imf_context_retrieve_surrounding_callback_set).
987 *
988 * There is no obligation for a widget to respond to the
989 * retrieve_surrounding_func, so input methods must be prepared
990 * to function without context.
991 *
992 * @param ctx An #Ecore_IMF_Context.
993 * @param text Location to store a UTF-8 encoded string of text
994 * holding context around the insertion point.
995 * If the function returns @c EINA_TRUE, then you must free
996 * the result stored in this location with free().
997 * @param cursor_pos Location to store the position in characters of
998 * the insertion cursor within @p text.
999 * @return @c EINA_TRUE if surrounding text was provided; otherwise
1000 * @c EINA_FALSE.
1001 * @ingroup Ecore_IMF_Context_Module_Group
1002 */
1003EAPI Eina_Bool 526EAPI Eina_Bool
1004ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos) 527ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos)
1005{ 528{
@@ -1030,16 +553,6 @@ _ecore_imf_event_free_preedit(void *data EINA_UNUSED, void *event)
1030 free(event); 553 free(event);
1031} 554}
1032 555
1033/**
1034 * Adds ECORE_IMF_EVENT_PREEDIT_START to the event queue.
1035 *
1036 * ECORE_IMF_EVENT_PREEDIT_START should be added when a new preedit sequence starts.
1037 * It's asynchronous method to put event to the event queue.
1038 * ecore_imf_context_event_callback_call() can be used as synchronous method.
1039 *
1040 * @param ctx An #Ecore_IMF_Context.
1041 * @ingroup Ecore_IMF_Context_Module_Group
1042 */
1043EAPI void 556EAPI void
1044ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx) 557ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx)
1045{ 558{
@@ -1058,16 +571,6 @@ ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx)
1058 ev, _ecore_imf_event_free_preedit, NULL); 571 ev, _ecore_imf_event_free_preedit, NULL);
1059} 572}
1060 573
1061/**
1062 * Adds ECORE_IMF_EVENT_PREEDIT_END to the event queue.
1063 *
1064 * ECORE_IMF_EVENT_PREEDIT_END should be added when a new preedit sequence has been completed or canceled.
1065 * It's asynchronous method to put event to the event queue.
1066 * ecore_imf_context_event_callback_call() can be used as synchronous method.
1067 *
1068 * @param ctx An #Ecore_IMF_Context.
1069 * @ingroup Ecore_IMF_Context_Module_Group
1070 */
1071EAPI void 574EAPI void
1072ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx) 575ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx)
1073{ 576{
@@ -1086,15 +589,6 @@ ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx)
1086 ev, _ecore_imf_event_free_preedit, NULL); 589 ev, _ecore_imf_event_free_preedit, NULL);
1087} 590}
1088 591
1089/**
1090 * Adds ECORE_IMF_EVENT_PREEDIT_CHANGED to the event queue.
1091 *
1092 * It's asynchronous method to put event to the event queue.
1093 * ecore_imf_context_event_callback_call() can be used as synchronous method.
1094 *
1095 * @param ctx An #Ecore_IMF_Context.
1096 * @ingroup Ecore_IMF_Context_Module_Group
1097 */
1098EAPI void 592EAPI void
1099ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx) 593ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx)
1100{ 594{
@@ -1123,16 +617,6 @@ _ecore_imf_event_free_commit(void *data EINA_UNUSED, void *event)
1123 free(ev); 617 free(ev);
1124} 618}
1125 619
1126/**
1127 * Adds ECORE_IMF_EVENT_COMMIT to the event queue.
1128 *
1129 * It's asynchronous method to put event to the event queue.
1130 * ecore_imf_context_event_callback_call() can be used as synchronous method.
1131 *
1132 * @param ctx An #Ecore_IMF_Context.
1133 * @param str The committed string.
1134 * @ingroup Ecore_IMF_Context_Module_Group
1135 */
1136EAPI void 620EAPI void
1137ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str) 621ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str)
1138{ 622{
@@ -1150,7 +634,6 @@ ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str)
1150 ev->str = str ? strdup(str) : NULL; 634 ev->str = str ? strdup(str) : NULL;
1151 ecore_event_add(ECORE_IMF_EVENT_COMMIT, 635 ecore_event_add(ECORE_IMF_EVENT_COMMIT,
1152 ev, _ecore_imf_event_free_commit, NULL); 636 ev, _ecore_imf_event_free_commit, NULL);
1153
1154} 637}
1155 638
1156static void 639static void
@@ -1159,21 +642,6 @@ _ecore_imf_event_free_delete_surrounding(void *data EINA_UNUSED, void *event)
1159 free(event); 642 free(event);
1160} 643}
1161 644
1162/**
1163 * Adds ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.
1164 *
1165 * Asks the widget that the input context is attached to to delete characters around the cursor position
1166 * by adding the ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.
1167 * Note that offset and n_chars are in characters not in bytes.
1168 *
1169 * It's asynchronous method to put ECORE_IMF_EVENT_DELETE_SURROUNDING event to the event queue.
1170 * ecore_imf_context_event_callback_call() can be used as synchronous method.
1171 *
1172 * @param ctx An #Ecore_IMF_Context.
1173 * @param offset The start offset of surrounding to be deleted.
1174 * @param n_chars The number of characters to be deleted.
1175 * @ingroup Ecore_IMF_Context_Module_Group
1176 */
1177EAPI void 645EAPI void
1178ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars) 646ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars)
1179{ 647{
@@ -1194,38 +662,6 @@ ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offse
1194 ev, _ecore_imf_event_free_delete_surrounding, NULL); 662 ev, _ecore_imf_event_free_delete_surrounding, NULL);
1195} 663}
1196 664
1197/**
1198 * Add (register) a callback function to a given context event.
1199 *
1200 * This function adds a function callback to the context @p ctx when the
1201 * event of type @p type occurs on it. The function pointer is @p
1202 * func.
1203 *
1204 * The event type @p type to trigger the function may be one of
1205 * #ECORE_IMF_CALLBACK_PREEDIT_START, #ECORE_IMF_CALLBACK_PREEDIT_END,
1206 * #ECORE_IMF_CALLBACK_PREEDIT_CHANGED, #ECORE_IMF_CALLBACK_COMMIT and
1207 * #ECORE_IMF_CALLBACK_DELETE_SURROUNDING.
1208 *
1209 * @param ctx Ecore_IMF_Context to attach a callback to.
1210 * @param type The type of event that will trigger the callback
1211 * @param func The (callback) function to be called when the event is
1212 * triggered
1213 * @param data The data pointer to be passed to @p func
1214 * @ingroup Ecore_IMF_Context_Group
1215 * @since 1.2.0
1216 *
1217 * Example
1218 * @code
1219 * static void
1220 * _imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
1221 * {
1222 * char *commit_str = event_info;
1223 * // something to do
1224 * }
1225 *
1226 * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _imf_event_commit_cb, data);
1227 * @endcode
1228 */
1229EAPI void 665EAPI void
1230ecore_imf_context_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func, const void *data) 666ecore_imf_context_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func, const void *data)
1231{ 667{
@@ -1250,23 +686,6 @@ ecore_imf_context_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_
1250 ctx->callbacks = eina_list_append(ctx->callbacks, fn); 686 ctx->callbacks = eina_list_append(ctx->callbacks, fn);
1251} 687}
1252 688
1253/**
1254 * Delete (unregister) a callback function registered to a given
1255 * context event.
1256 *
1257 * This function removes a function callback from the context @p ctx when the
1258 * event of type @p type occurs on it. The function pointer is @p
1259 * func.
1260 *
1261 * @see ecore_imf_context_event_callback_add() for more details
1262 *
1263 * @param ctx Ecore_IMF_Context to remove a callback from.
1264 * @param type The type of event that was triggering the callback
1265 * @param func The (callback) function that was to be called when the event was triggered
1266 * @return the data pointer
1267 * @ingroup Ecore_IMF_Context_Group
1268 * @since 1.2.0
1269 */
1270EAPI void * 689EAPI void *
1271ecore_imf_context_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func) 690ecore_imf_context_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func)
1272{ 691{
@@ -1297,23 +716,6 @@ ecore_imf_context_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_
1297 return NULL; 716 return NULL;
1298} 717}
1299 718
1300/**
1301 * Call a given callback on the context @p ctx.
1302 *
1303 * ecore_imf_context_preedit_start_event_add(), ecore_imf_context_preedit_end_event_add(),
1304 * ecore_imf_context_preedit_changed_event_add(), ecore_imf_context_commit_event_add() and
1305 * ecore_imf_context_delete_surrounding_event_add() APIs are asynchronous
1306 * because those API adds each event to the event queue.
1307 *
1308 * This API provides the way to call each callback function immediately.
1309 *
1310 * @param ctx Ecore_IMF_Context.
1311 * @param type The type of event that will trigger the callback
1312 * @param event_info The pointer to event specific struct or information to
1313 * pass to the callback functions registered on this event
1314 * @ingroup Ecore_IMF_Context_Module_Group
1315 * @since 1.2.0
1316 */
1317EAPI void 719EAPI void
1318ecore_imf_context_event_callback_call(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, void *event_info) 720ecore_imf_context_event_callback_call(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, void *event_info)
1319{ 721{
@@ -1334,13 +736,6 @@ ecore_imf_context_event_callback_call(Ecore_IMF_Context *ctx, Ecore_IMF_Callback
1334 } 736 }
1335} 737}
1336 738
1337/**
1338 * Ask the Input Method Context to show the control panel of using Input Method.
1339 *
1340 * @param ctx An #Ecore_IMF_Context.
1341 * @ingroup Ecore_IMF_Context_Group
1342 * @since 1.1.0
1343 */
1344EAPI void 739EAPI void
1345ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx) 740ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx)
1346{ 741{
@@ -1354,13 +749,6 @@ ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx)
1354 if (ctx->klass->control_panel_show) ctx->klass->control_panel_show(ctx); 749 if (ctx->klass->control_panel_show) ctx->klass->control_panel_show(ctx);
1355} 750}
1356 751
1357/**
1358 * Ask the Input Method Context to hide the control panel of using Input Method.
1359 *
1360 * @param ctx An #Ecore_IMF_Context.
1361 * @ingroup Ecore_IMF_Context_Group
1362 * @since 1.1.0
1363 */
1364EAPI void 752EAPI void
1365ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx) 753ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx)
1366{ 754{
@@ -1374,13 +762,6 @@ ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx)
1374 if (ctx->klass->control_panel_hide) ctx->klass->control_panel_hide(ctx); 762 if (ctx->klass->control_panel_hide) ctx->klass->control_panel_hide(ctx);
1375} 763}
1376 764
1377/**
1378 * Ask the Input Method Context to show the input panel (virtual keyboard).
1379 *
1380 * @param ctx An #Ecore_IMF_Context.
1381 * @ingroup Ecore_IMF_Context_Group
1382 * @since 1.1.0
1383 */
1384EAPI void 765EAPI void
1385ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx) 766ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx)
1386{ 767{
@@ -1394,13 +775,6 @@ ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx)
1394 if (ctx->klass->show) ctx->klass->show(ctx); 775 if (ctx->klass->show) ctx->klass->show(ctx);
1395} 776}
1396 777
1397/**
1398 * Ask the Input Method Context to hide the input panel.
1399 *
1400 * @param ctx An #Ecore_IMF_Context.
1401 * @ingroup Ecore_IMF_Context_Group
1402 * @since 1.1.0
1403 */
1404EAPI void 778EAPI void
1405ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx) 779ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx)
1406{ 780{
@@ -1414,15 +788,6 @@ ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx)
1414 if (ctx->klass->hide) ctx->klass->hide(ctx); 788 if (ctx->klass->hide) ctx->klass->hide(ctx);
1415} 789}
1416 790
1417/**
1418 * Set the layout of the input panel.
1419 *
1420 * @param ctx An #Ecore_IMF_Context.
1421 * @param layout see #Ecore_IMF_Input_Panel_Layout
1422 * @note Default layout type is ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL.
1423 * @ingroup Ecore_IMF_Context_Group
1424 * @since 1.1.0
1425 */
1426EAPI void 791EAPI void
1427ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout) 792ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout)
1428{ 793{
@@ -1439,14 +804,6 @@ ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input
1439 ctx->input_panel_layout = layout; 804 ctx->input_panel_layout = layout;
1440} 805}
1441 806
1442/**
1443 * Get the layout of the current active input panel.
1444 *
1445 * @param ctx An #Ecore_IMF_Context.
1446 * @return layout see #Ecore_IMF_Input_Panel_Layout
1447 * @ingroup Ecore_IMF_Context_Group
1448 * @since 1.1.0
1449 */
1450EAPI Ecore_IMF_Input_Panel_Layout 807EAPI Ecore_IMF_Input_Panel_Layout
1451ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx) 808ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx)
1452{ 809{
@@ -1463,15 +820,6 @@ ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx)
1463 return ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID; 820 return ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID;
1464} 821}
1465 822
1466/**
1467 * Set the language of the input panel.
1468 * This API can be used when you want to show the English keyboard.
1469 *
1470 * @param ctx An #Ecore_IMF_Context.
1471 * @param lang the language to be set to the input panel.
1472 * @ingroup Ecore_IMF_Context_Group
1473 * @since 1.1.0
1474 */
1475EAPI void 823EAPI void
1476ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang) 824ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang)
1477{ 825{
@@ -1486,16 +834,6 @@ ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Inp
1486 ctx->input_panel_lang = lang; 834 ctx->input_panel_lang = lang;
1487} 835}
1488 836
1489/**
1490 * Get the language of the input panel.
1491 *
1492 * See @ref ecore_imf_context_input_panel_language_set for more details.
1493 *
1494 * @param ctx An #Ecore_IMF_Context.
1495 * @return Ecore_IMF_Input_Panel_Lang
1496 * @ingroup Ecore_IMF_Context_Group
1497 * @since 1.1.0
1498 */
1499EAPI Ecore_IMF_Input_Panel_Lang 837EAPI Ecore_IMF_Input_Panel_Lang
1500ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx) 838ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx)
1501{ 839{
@@ -1509,15 +847,6 @@ ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx)
1509 return ctx->input_panel_lang; 847 return ctx->input_panel_lang;
1510} 848}
1511 849
1512/**
1513 * Set whether the Input Method Context should request to show the input panel automatically
1514 * when the widget has focus.
1515 *
1516 * @param ctx An #Ecore_IMF_Context.
1517 * @param enabled If true, the input panel will be shown when the widget is clicked or has focus.
1518 * @ingroup Ecore_IMF_Context_Group
1519 * @since 1.1.0
1520 */
1521EAPI void 850EAPI void
1522ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx, 851ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx,
1523 Eina_Bool enabled) 852 Eina_Bool enabled)
@@ -1532,14 +861,6 @@ ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx,
1532 ctx->input_panel_enabled = enabled; 861 ctx->input_panel_enabled = enabled;
1533} 862}
1534 863
1535/**
1536 * Get whether the Input Method Context requests to show the input panel automatically.
1537 *
1538 * @param ctx An #Ecore_IMF_Context.
1539 * @return Return the attribute to show the input panel automatically
1540 * @ingroup Ecore_IMF_Context_Group
1541 * @since 1.1.0
1542 */
1543EAPI Eina_Bool 864EAPI Eina_Bool
1544ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx) 865ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx)
1545{ 866{
@@ -1553,18 +874,6 @@ ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx)
1553 return ctx->input_panel_enabled; 874 return ctx->input_panel_enabled;
1554} 875}
1555 876
1556/**
1557 * Set the input panel-specific data to deliver to the input panel.
1558 * This API is used by applications to deliver specific data to the input panel.
1559 * The data format MUST be negotiated by both application and the input panel.
1560 * The size and format of data are defined by the input panel.
1561 *
1562 * @param ctx An #Ecore_IMF_Context.
1563 * @param data The specific data to be set to the input panel.
1564 * @param len the length of data, in bytes, to send to the input panel
1565 * @ingroup Ecore_IMF_Context_Group
1566 * @since 1.2.0
1567 */
1568EAPI void 877EAPI void
1569ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len) 878ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len)
1570{ 879{
@@ -1581,15 +890,6 @@ ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *dat
1581 ctx->klass->input_panel_imdata_set(ctx, data, len); 890 ctx->klass->input_panel_imdata_set(ctx, data, len);
1582} 891}
1583 892
1584/**
1585 * Get the specific data of the current active input panel.
1586 *
1587 * @param ctx An #Ecore_IMF_Context.
1588 * @param data The specific data to be got from the input panel
1589 * @param len The length of data
1590 * @ingroup Ecore_IMF_Context_Group
1591 * @since 1.2.0
1592 */
1593EAPI void 893EAPI void
1594ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len) 894ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len)
1595{ 895{
@@ -1606,17 +906,6 @@ ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int
1606 ctx->klass->input_panel_imdata_get(ctx, data, len); 906 ctx->klass->input_panel_imdata_get(ctx, data, len);
1607} 907}
1608 908
1609/**
1610 * Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel.
1611 *
1612 * An input panel displays the string or icon associated with this type
1613 *
1614 * @param ctx An #Ecore_IMF_Context.
1615 * @param return_key_type The type of "return" key on the input panel
1616 * @note Default type is ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT.
1617 * @ingroup Ecore_IMF_Context_Group
1618 * @since 1.2.0
1619 */
1620EAPI void 909EAPI void
1621ecore_imf_context_input_panel_return_key_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type) 910ecore_imf_context_input_panel_return_key_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type)
1622{ 911{
@@ -1631,16 +920,6 @@ ecore_imf_context_input_panel_return_key_type_set(Ecore_IMF_Context *ctx, Ecore_
1631 if (ctx->klass->input_panel_return_key_type_set) ctx->klass->input_panel_return_key_type_set(ctx, return_key_type); 920 if (ctx->klass->input_panel_return_key_type_set) ctx->klass->input_panel_return_key_type_set(ctx, return_key_type);
1632} 921}
1633 922
1634/**
1635 * Get the "return" key type.
1636 *
1637 * @see ecore_imf_context_input_panel_return_key_type_set() for more details
1638 *
1639 * @param ctx An #Ecore_IMF_Context.
1640 * @return The type of "return" key on the input panel
1641 * @ingroup Ecore_IMF_Context_Group
1642 * @since 1.2.0
1643 */
1644EAPI Ecore_IMF_Input_Panel_Return_Key_Type 923EAPI Ecore_IMF_Input_Panel_Return_Key_Type
1645ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx) 924ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx)
1646{ 925{
@@ -1654,14 +933,6 @@ ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx)
1654 return ctx->input_panel_return_key_type; 933 return ctx->input_panel_return_key_type;
1655} 934}
1656 935
1657/**
1658 * Set the return key on the input panel to be disabled.
1659 *
1660 * @param ctx An #Ecore_IMF_Context.
1661 * @param disabled The state
1662 * @ingroup Ecore_IMF_Context_Group
1663 * @since 1.2.0
1664 */
1665EAPI void 936EAPI void
1666ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled) 937ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled)
1667{ 938{
@@ -1676,14 +947,6 @@ ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Ei
1676 if (ctx->klass->input_panel_return_key_disabled_set) ctx->klass->input_panel_return_key_disabled_set(ctx, disabled); 947 if (ctx->klass->input_panel_return_key_disabled_set) ctx->klass->input_panel_return_key_disabled_set(ctx, disabled);
1677} 948}
1678 949
1679/**
1680 * Get whether the return key on the input panel should be disabled or not.
1681 *
1682 * @param ctx An #Ecore_IMF_Context.
1683 * @return @c EINA_TRUE if it should be disabled.
1684 * @ingroup Ecore_IMF_Context_Group
1685 * @since 1.2.0
1686 */
1687EAPI Eina_Bool 950EAPI Eina_Bool
1688ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx) 951ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx)
1689{ 952{
@@ -1697,14 +960,6 @@ ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx)
1697 return ctx->input_panel_return_key_disabled; 960 return ctx->input_panel_return_key_disabled;
1698} 961}
1699 962
1700/**
1701 * Set the caps lock mode on the input panel.
1702 *
1703 * @param ctx An #Ecore_IMF_Context.
1704 * @param mode Turn on caps lock on the input panel if @c EINA_TRUE.
1705 * @ingroup Ecore_IMF_Context_Group
1706 * @since 1.2.0
1707 */
1708EAPI void 963EAPI void
1709ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode) 964ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode)
1710{ 965{
@@ -1721,14 +976,6 @@ ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bo
1721 ctx->input_panel_caps_lock_mode = mode; 976 ctx->input_panel_caps_lock_mode = mode;
1722} 977}
1723 978
1724/**
1725 * Get the caps lock mode on the input panel.
1726 *
1727 * @param ctx An #Ecore_IMF_Context.
1728 * @return @c EINA_TRUE if the caps lock is turned on.
1729 * @ingroup Ecore_IMF_Context_Group
1730 * @since 1.2.0
1731 */
1732EAPI Eina_Bool 979EAPI Eina_Bool
1733ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx) 980ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx)
1734{ 981{
@@ -1742,17 +989,6 @@ ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx)
1742 return ctx->input_panel_caps_lock_mode; 989 return ctx->input_panel_caps_lock_mode;
1743} 990}
1744 991
1745/**
1746 * Get the position of the current active input panel.
1747 *
1748 * @param ctx An #Ecore_IMF_Context.
1749 * @param x top-left x co-ordinate of the input panel
1750 * @param y top-left y co-ordinate of the input panel
1751 * @param w width of the input panel
1752 * @param h height of the input panel
1753 * @ingroup Ecore_IMF_Context_Group
1754 * @since 1.3
1755 */
1756EAPI void 992EAPI void
1757ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h) 993ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h)
1758{ 994{
@@ -1767,14 +1003,6 @@ ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *
1767 ctx->klass->input_panel_geometry_get(ctx, x, y, w, h); 1003 ctx->klass->input_panel_geometry_get(ctx, x, y, w, h);
1768} 1004}
1769 1005
1770/**
1771 * Get state of current active input panel.
1772 *
1773 * @param ctx An #Ecore_IMF_Context.
1774 * @return The state of input panel.
1775 * @ingroup Ecore_IMF_Context_Group
1776 * @since 1.3
1777 */
1778EAPI Ecore_IMF_Input_Panel_State 1006EAPI Ecore_IMF_Input_Panel_State
1779ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx) 1007ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx)
1780{ 1008{
@@ -1792,18 +1020,6 @@ ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx)
1792 return state; 1020 return state;
1793} 1021}
1794 1022
1795/**
1796 * Register a callback function which will be called if there is change in input panel state,language,mode etc.
1797 * In order to deregister the callback function
1798 * Use @ref ecore_imf_context_input_panel_event_callback_del.
1799 *
1800 * @param ctx An #Ecore_IMF_Context
1801 * @param type event type
1802 * @param func the callback function
1803 * @param data application-input panel specific data.
1804 * @ingroup Ecore_IMF_Context_Group
1805 * @since 1.3
1806 */
1807EAPI void 1023EAPI void
1808ecore_imf_context_input_panel_event_callback_add(Ecore_IMF_Context *ctx, 1024ecore_imf_context_input_panel_event_callback_add(Ecore_IMF_Context *ctx,
1809 Ecore_IMF_Input_Panel_Event type, 1025 Ecore_IMF_Input_Panel_Event type,
@@ -1821,15 +1037,6 @@ ecore_imf_context_input_panel_event_callback_add(Ecore_IMF_Context *ctx,
1821 ctx->klass->input_panel_event_callback_add(ctx, type, func, (void *)data); 1037 ctx->klass->input_panel_event_callback_add(ctx, type, func, (void *)data);
1822} 1038}
1823 1039
1824/**
1825 * Unregister a callback function which will be called if there is change in input panel state, language, mode etc.
1826 *
1827 * @param ctx An #Ecore_IMF_Context.
1828 * @param type An #Ecore_IMF_Input_Panel_Event.
1829 * @param func the callback function
1830 * @ingroup Ecore_IMF_Context_Group
1831 * @since 1.3
1832 */
1833EAPI void 1040EAPI void
1834ecore_imf_context_input_panel_event_callback_del(Ecore_IMF_Context *ctx, 1041ecore_imf_context_input_panel_event_callback_del(Ecore_IMF_Context *ctx,
1835 Ecore_IMF_Input_Panel_Event type, 1042 Ecore_IMF_Input_Panel_Event type,
@@ -1846,17 +1053,6 @@ ecore_imf_context_input_panel_event_callback_del(Ecore_IMF_Context *ctx,
1846 ctx->klass->input_panel_event_callback_del(ctx, type, func); 1053 ctx->klass->input_panel_event_callback_del(ctx, type, func);
1847} 1054}
1848 1055
1849/**
1850 * Get the current language locale of the input panel.
1851 *
1852 * ex) fr_FR
1853 *
1854 * @param ctx An #Ecore_IMF_Context.
1855 * @param lang Location to store the retrieved language string. The
1856 * string retrieved must be freed with free().
1857 * @ingroup Ecore_IMF_Context_Group
1858 * @since 1.3
1859 */
1860EAPI void 1056EAPI void
1861ecore_imf_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx, char **lang) 1057ecore_imf_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx, char **lang)
1862{ 1058{
@@ -1875,17 +1071,6 @@ ecore_imf_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx, char *
1875 } 1071 }
1876} 1072}
1877 1073
1878/**
1879 * Get the geometry information of the candidate panel.
1880 *
1881 * @param ctx An #Ecore_IMF_Context.
1882 * @param x top-left x co-ordinate of the candidate panel
1883 * @param y top-left y co-ordinate of the candidate panel
1884 * @param w width of the candidate panel
1885 * @param h height of the candidate panel
1886 * @ingroup Ecore_IMF_Context_Group
1887 * @since 1.3
1888 */
1889EAPI void 1074EAPI void
1890ecore_imf_context_candidate_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h) 1075ecore_imf_context_candidate_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h)
1891{ 1076{