summaryrefslogtreecommitdiff
path: root/src/lib/ecore_imf/Ecore_IMF.h
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/lib/ecore_imf/Ecore_IMF.h
parentacf4ca6139c473e2802bc13d313b70191ec29956 (diff)
ecore_imf: move the docs to header
SVN revision: 82373
Diffstat (limited to 'src/lib/ecore_imf/Ecore_IMF.h')
-rw-r--r--src/lib/ecore_imf/Ecore_IMF.h883
1 files changed, 880 insertions, 3 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