Changes between Version 3 and Version 4 of WK2-EFLTextCheckerApiTutorial
- Timestamp:
- May 10, 2013, 2:29:25 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WK2-EFLTextCheckerApiTutorial
v3 v4 17 17 == Enabling text checker feature == 18 18 19 If an application wants to use this feature, the following API from ewk_ settings.h should be used:19 If an application wants to use this feature, the following API from ewk_text_checker.h should be used: 20 20 {{{ 21 void ewk_ settings_continuous_spell_checking_enabled_set(Eina_Bool enable);21 void ewk_text_checker_continuous_spell_checking_enabled_set(Eina_Bool enable); 22 22 }}} 23 23 Here is an example how an application can enable this feature: 24 24 {{{ 25 ewk_ settings_continuous_spell_checking_enabled_set(EINA_TRUE);25 ewk_text_checker_continuous_spell_checking_enabled_set(EINA_TRUE); 26 26 }}} 27 27 As a result, the text checker feature is enabled and the spell checking related functionalities are available for the user. … … 29 29 30 30 31 The user is able to query whether spellchecker continuous spell checking is enabled, the following API from ewk_ settings.h should be used:31 The user is able to query whether spellchecker continuous spell checking is enabled, the following API from ewk_text_checker.h should be used: 32 32 {{{ 33 Eina_Bool ewk_ settings_continuous_spell_checking_enabled_get(void);33 Eina_Bool ewk_text_checker_continuous_spell_checking_enabled_get(void); 34 34 }}} 35 35 Here is an example of its usage: 36 36 {{{ 37 Eina_Bool enabled = ewk_ settings_continuous_spell_checking_enabled_get();37 Eina_Bool enabled = ewk_text_checker_continuous_spell_checking_enabled_get(); 38 38 }}} 39 39 40 40 == Languages support == 41 By default, WebKit2-EFL performs spell checking based on the default OS language. An arbitrary language can be set by using the following API from the ewk_ settings.h:41 By default, WebKit2-EFL performs spell checking based on the default OS language. An arbitrary language can be set by using the following API from the ewk_text_checker.h: 42 42 {{{ 43 void ewk_ settings_spell_checking_languages_set(const char *languages);43 void ewk_text_checker_spell_checking_languages_set(const char *languages); 44 44 }}} 45 45 … … 47 47 {{{ 48 48 const char lang[] = "en_US"; 49 ewk_ settings_spell_checking_languages_set(lang);49 ewk_text_checker_spell_checking_languages_set(lang); 50 50 }}} 51 51 … … 53 53 {{{ 54 54 const char langs[] = "en_US,ko,pl"; 55 ewk_ settings_spell_checking_languages_set(langs);55 ewk_text_checker_spell_checking_languages_set(langs); 56 56 }}} 57 57 The presented example sets three languages (English, Korean and Polish) to be used in spell checking. The number of the languages is not limited. However, be aware that loading multiple dictionaries may slow down your application.[[BR]] 58 58 59 There is a possibility to retrieve a list of dictionaries that are supported/installed by OS. The following API from ewk_ settings.h should be used:59 There is a possibility to retrieve a list of dictionaries that are supported/installed by OS. The following API from ewk_text_checker.h should be used: 60 60 {{{ 61 61 Eina_List *ewk_settings_spell_checking_available_languages_get(void); … … 64 64 Here is an example of its usage. It gets the available languages and displays them on the standard output: 65 65 {{{ 66 Eina_List *available_langs = ewk_ settings_spell_checking_available_languages_get();66 Eina_List *available_langs = ewk_text_checker_spell_checking_available_languages_get(); 67 67 if (!available_langs) 68 68 return; … … 82 82 The client can get a list of dictionaries that have been already loaded and are in use to perform spellchecking. Here is an example: 83 83 {{{ 84 Eina_List *loaded_langs = ewk_ settings_spell_checking_languages_get();84 Eina_List *loaded_langs = ewk_text_checker_spell_checking_languages_get(); 85 85 if (!loaded_langs) 86 86 return; … … 101 101 There is a callback function used to notify the user when the continuous spell checking setting was changed by WebKit. Specifying of this callback is needed if the application wants to receive notifications once WebKit changes this setting. If the application is not interested, this callback is not set. Changing of this setting at the WebKit level can be made as a result of modifying options in a Context Menu by a user. The following API from ewk_settings.h can be used: 102 102 {{{ 103 void ewk_ settings_continuous_spell_checking_change_cb_set(Ewk_Settings_Continuous_Spell_Checking_Change_Cb cb);104 typedef void (*Ewk_ Settings_Continuous_Spell_Checking_Change_Cb)(Eina_Bool enable);103 void ewk_text_checker_continuous_spell_checking_change_cb_set(Ewk_Settings_Continuous_Spell_Checking_Change_Cb cb); 104 typedef void (*Ewk_Text_Checker_Continuous_Spell_Checking_Change_Cb)(Eina_Bool enable); 105 105 }}} 106 106 … … 115 115 ... 116 116 // Callback registration. 117 ewk_ settings_continuous_spell_checking_change_cb_set(setting_change);117 ewk_text_checker_continuous_spell_checking_change_cb_set(setting_change); 118 118 } 119 119 }}}