ChangeLog

 12012-09-24 Grzegorz Czajkowski <g.czajkowski@samsung.com>, Michal Roj <m.roj@sasmung.com>
 2
 3 [WK2][EFL] Implementation of spellchecking feature.
 4 https://bugs.webkit.org/show_bug.cgi?id=91854
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Enable spellchecking feature for WK2-Efl.
 9
 10 * Source/cmake/FindEnchant.cmake: Added.
 11 * Source/cmake/OptionsEfl.cmake: Define SPELLCHECK macro.
 12
1132012-09-24 Vivek Galatage <vivekgalatage@gmail.com>
214
315 Web Inspector: implement testing harness for pure protocol tests.

Source/WebCore/ChangeLog

 12012-09-24 Grzegorz Czajkowski <g.czajkowski@samsung.com>, Michal Roj <m.roj@samsung.com>
 2
 3 [WK2][EFL] Implementation of spellchecking feature.
 4 https://bugs.webkit.org/show_bug.cgi?id=91854
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * PlatformEfl.cmake:
 9 Add enchant-related compiler flags: header paths and the library flag.
 10
1112012-09-24 Pavel Feldman <pfeldman@chromium.org>
212
313 Web Inspector:EXC_BAD_ACCESS upon closing page with node highlighted

Source/WebCore/PlatformEfl.cmake

@@LIST(APPEND WebCore_SOURCES
8282 platform/PlatformStrategies.cpp
8383 platform/posix/FileSystemPOSIX.cpp
8484 platform/text/efl/TextBreakIteratorInternalICUEfl.cpp
 85 platform/text/enchant/TextCheckerEnchant.cpp
8586)
8687
8788IF (ENABLE_BATTERY_STATUS)

@@IF (ENABLE_WEB_AUDIO)
329330 ADD_DEFINITIONS(-DUNINSTALLED_AUDIO_RESOURCES_DIR="${WEBCORE_DIR}/platform/audio/resources")
330331ENDIF ()
331332
 333IF (ENABLE_SPELLCHECK)
 334 LIST(APPEND WebCore_INCLUDE_DIRECTORIES
 335 ${ENCHANT_INCLUDE_DIRS}
 336 )
 337 LIST(APPEND WebCore_LIBRARIES
 338 ${ENCHANT_LIBRARIES}
 339 )
 340ENDIF()

Source/WebKit2/ChangeLog

 12012-09-24 Grzegorz Czajkowski <g.czajkowski@samsung.com>, Michal Roj <m.roj@samsung.com>
 2
 3 Implementation of spellchecking feature.
 4 https://bugs.webkit.org/show_bug.cgi?id=91854
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Add spelling implementation for WebKit2-EFL that is based on Enchant library.
 9
 10 Additionally the patch provides API to overwrite the default WebKit spellchecker implementation
 11 as Enchant library doesn't ensure grammar checking.
 12 Application is able to overwrite it (both grammar and spell checking) by defining
 13 its own implementation and setting appropriate callback functions.
 14
 15 * PlatformEfl.cmake:
 16 Add enchant-related compiler flags: header paths and the library flag.
 17
 18 * UIProcess/API/efl/EWebKit2.h:
 19 Add files that contain the API to the main WebKit2-EFL's header to be available for applications.
 20
 21 * UIProcess/API/efl/WebKitTextChecker.cpp: Added.
 22 Implement callbacks functions of WKTextChecker.
 23
 24 (WebKit):
 25 (WebKit::isContinuousSpellCheckingAllowed):
 26 (WebKit::isContinuousSpellCheckingEnabled):
 27 (WebKit::setContinuousSpellCheckingEnabled):
 28 (WebKit::isGrammarCheckingEnabled):
 29 (WebKit::setGrammarCheckingEnabled):
 30 (WebKit::uniqueSpellDocumentTag):
 31 (WebKit::closeSpellDocumentWithTag):
 32 (WebKit::checkSpellingOfString):
 33 (WebKit::checkGrammarOfString):
 34 (WebKit::spellingUIIsShowing):
 35 (WebKit::toggleSpellingUIIsShowing):
 36 (WebKit::updateSpellingUIWithMisspelledWord):
 37 (WebKit::updateSpellingUIWithGrammarString):
 38 (WebKit::guessesForWord):
 39 (WebKit::learnWord):
 40 (WebKit::ignoreWord):
 41 Those methods are directly given as callback functions for WKTextChecker's client.
 42 They choose between WebKit's spelling implementation and client's ones.
 43
 44 (WebKit::availableSpellCheckingLanguages):
 45 (WebKit::updateSpellCheckingLanguages):
 46 (WebKit::loadedSpellCheckingLanguages):
 47 They are used by ewk_text_checker_settings.cpp file and allow to do not
 48 expose 'm_textCheckerEnchant'.
 49
 50 * UIProcess/API/efl/WebKitTextChecker.h: Added.
 51 Define the functions which chooses between client's implementation of spelling and the WebKit one.
 52
 53 (WebKit):
 54 * UIProcess/API/efl/ewk_context.cpp:
 55 (_Ewk_Context::_Ewk_Context):
 56 Initialize spellchecker feature.
 57
 58 * UIProcess/API/efl/ewk_text_checker.cpp: Added.
 59 (ewkTextChecker):
 60 Get the client's callback functions.
 61
 62 * UIProcess/API/efl/ewk_text_checker.h: Added.
 63 Define API to set the client's own spelling implementation.
 64
 65 * UIProcess/API/efl/ewk_text_checker_private.h: Added.
 66 (_Ewk_Text_Checker):
 67 Define struct with client's callbacks responisble for spelling.
 68
 69 * UIProcess/API/efl/ewk_text_checker_settings.cpp: Added.
 70 (idlerGrammarCheckingChanged):
 71 (idlerSpellCheckingLanguagesSet):
 72 The application is notified about spelling settings change (they may be changed
 73 through context menu option) on idler to do not block WebKit.
 74
 75 (spellCheckingLanguagesSet):
 76 The dictionaries are requested on idler to do not block WebKit.
 77
 78 (ewk_text_checker_settings_continuous_spell_checking_changed_cb_set):
 79 (ewk_text_checker_settings_grammar_checking_changed_cb_set):
 80 Set the callback functions used to notify the client when the spelling settings
 81 were changed by WebKit.
 82
 83 (ewk_text_checker_settings_enable_continuous_spell_checking_get):
 84 (ewk_text_checker_settings_enable_continuous_spell_checking_set):
 85 API to set/get the continuous spell checking.
 86
 87 (ewk_text_checker_settings_enable_grammar_checking_get):
 88 (ewk_text_checker_settings_enable_grammar_checking_set):
 89 API to set/get the grammar checking.
 90
 91 (ewk_text_checker_settings_available_spell_checking_languages_get):
 92 (ewk_text_checker_settings_spell_checking_languages_set):
 93 (ewk_text_checker_settings_spell_checking_languages_get):
 94 API to set/get languages to use by WebKit implementation based on Enchant library.
 95
 96 * UIProcess/API/efl/ewk_text_checker_settings.h: Added.
 97 Add API for manipulating spell checker feature.
 98
 99 * UIProcess/efl/TextCheckerEfl.cpp:
 100 (WebKit::TextChecker::state):
 101 (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
 102 (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
 103 (WebKit::TextChecker::setGrammarCheckingEnabled):
 104 (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged):
 105 (WebKit::TextChecker::grammarCheckingEnabledStateChanged):
 106 (WebKit::TextChecker::uniqueSpellDocumentTag):
 107 (WebKit::TextChecker::closeSpellDocumentWithTag):
 108 (WebKit::TextChecker::checkSpellingOfString):
 109 (WebKit::TextChecker::checkGrammarOfString): Remove WebCore namaspace as it's already defined for the whole file.
 110 (WebKit::TextChecker::spellingUIIsShowing):
 111 (WebKit::TextChecker::toggleSpellingUIIsShowing):
 112 (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
 113 (WebKit::TextChecker::updateSpellingUIWithGrammarString):
 114 (WebKit::TextChecker::getGuessesForWord):
 115 (WebKit::TextChecker::learnWord):
 116 (WebKit::TextChecker::ignoreWord):
 117 Those call WKTextChecker client methods.
 118
11192012-09-24 Byungwoo Lee <bw80.lee@samsung.com>
2120
3121 [EFL][WK2] Change the install path for libewk2UnitTestInjectedBundleSample.so.

Source/WebKit2/PlatformEfl.cmake

@@LIST(APPEND WebKit2_SOURCES
4040 UIProcess/API/efl/NetworkInfoProvider.cpp
4141 UIProcess/API/efl/PageClientImpl.cpp
4242 UIProcess/API/efl/VibrationProvider.cpp
 43 UIProcess/API/efl/WebKitTextChecker.cpp
4344 UIProcess/API/efl/ewk_back_forward_list.cpp
4445 UIProcess/API/efl/ewk_back_forward_list_item.cpp
4546 UIProcess/API/efl/ewk_context.cpp

@@LIST(APPEND WebKit2_SOURCES
5455 UIProcess/API/efl/ewk_navigation_policy_decision.cpp
5556 UIProcess/API/efl/ewk_popup_menu_item.cpp
5657 UIProcess/API/efl/ewk_settings.cpp
 58 UIProcess/API/efl/ewk_text_checker.cpp
 59 UIProcess/API/efl/ewk_text_checker_settings.cpp
5760 UIProcess/API/efl/ewk_url_request.cpp
5861 UIProcess/API/efl/ewk_url_response.cpp
5962 UIProcess/API/efl/ewk_url_scheme_request.cpp

@@LIST(APPEND WebKit2_INCLUDE_DIRECTORIES
121124 "${WEBCORE_DIR}/platform/efl"
122125 "${WEBCORE_DIR}/platform/graphics/cairo"
123126 "${WEBCORE_DIR}/platform/network/soup"
 127 "${WEBCORE_DIR}/platform/text/enchant"
124128 "${WEBCORE_DIR}/svg/graphics"
125129 "${WEBKIT2_DIR}/Shared/efl"
126130 "${WEBKIT2_DIR}/Shared/soup"

@@SET (EWebKit2_HEADERS
224228 "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_popup_menu_item.h"
225229 "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_settings.h"
226230 "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_touch.h"
 231 "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_text_checker.h"
 232 "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_text_checker_settings.h"
227233 "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_url_request.h"
228234 "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_url_response.h"
229235 "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_url_scheme_request.h"

@@IF (ENABLE_INSPECTOR)
327333 PATTERN "*.gif"
328334 PATTERN "*.png")
329335ENDIF ()
 336
 337IF (ENABLE_SPELLCHECK)
 338 LIST(APPEND WebKit2_INCLUDE_DIRECTORIES
 339 ${ENCHANT_INCLUDE_DIRS}
 340 )
 341 LIST(APPEND WebKit2_LIBRARIES
 342 ${ENCHANT_LIBRARIES}
 343 )
 344ENDIF()

Source/WebKit2/UIProcess/API/efl/EWebKit2.h

4141#include "ewk_popup_menu_item.h"
4242#include "ewk_settings.h"
4343#include "ewk_touch.h"
 44#include "ewk_text_checker.h"
 45#include "ewk_text_checker_settings.h"
4446#include "ewk_url_request.h"
4547#include "ewk_url_response.h"
4648#include "ewk_url_scheme_request.h"

Source/WebKit2/UIProcess/API/efl/WebKitTextChecker.cpp

 1/*
 2 * Copyright (C) 2012 Samsung Electronics
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 14 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 22 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 23 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "WebKitTextChecker.h"
 28
 29#if ENABLE(SPELLCHECK)
 30
 31#include "NotImplemented.h"
 32#include "WKAPICast.h"
 33#include "WKMutableArray.h"
 34#include "WKRetainPtr.h"
 35#include "WebPageProxy.h"
 36#include "WebString.h"
 37#include "ewk_text_checker_private.h"
 38#include "ewk_text_checker_settings.h"
 39#include <Eina.h>
 40#include <wtf/OwnPtr.h>
 41#include <wtf/text/CString.h>
 42
 43namespace WebKit {
 44
 45static OwnPtr<WebCore::TextCheckerEnchant> textCheckerEnchant = WebCore::TextCheckerEnchant::create();
 46static Ewk_Text_Checker* ewkTextCheckerCallback = ewkTextChecker();
 47
 48bool isContinuousSpellCheckingAllowed(const void*)
 49{
 50 notImplemented();
 51 // This method is not called by WebKit2/WebCore. Just keep it for API compatibility.
 52 return false;
 53}
 54
 55bool isContinuousSpellCheckingEnabled(const void*)
 56{
 57 return ewk_text_checker_settings_enable_continuous_spell_checking_get();
 58}
 59
 60void setContinuousSpellCheckingEnabled(bool enabled, const void*)
 61{
 62 ewk_text_checker_settings_enable_continuous_spell_checking_set(enabled);
 63}
 64
 65bool isGrammarCheckingEnabled(const void*)
 66{
 67 return ewk_text_checker_settings_enable_grammar_checking_get();
 68}
 69
 70void setGrammarCheckingEnabled(bool enabled, const void*)
 71{
 72 ewk_text_checker_settings_enable_grammar_checking_set(enabled);
 73}
 74
 75uint64_t uniqueSpellDocumentTag(WKPageRef page, const void*)
 76{
 77 if (ewkTextCheckerCallback->unique_spell_document_tag_get)
 78 return ewkTextCheckerCallback->unique_spell_document_tag_get(toImpl(page)->viewWidget());
 79
 80 return 0;
 81}
 82
 83void closeSpellDocumentWithTag(uint64_t tag, const void*)
 84{
 85 if (ewkTextCheckerCallback->unique_spell_document_tag_close)
 86 ewkTextCheckerCallback->unique_spell_document_tag_close(tag);
 87}
 88
 89void checkSpellingOfString(uint64_t tag, WKStringRef text, int32_t* misspellingLocation, int32_t* misspellingLength, const void*)
 90{
 91 if (ewkTextCheckerCallback->string_spelling_check)
 92 ewkTextCheckerCallback->string_spelling_check(tag, toImpl(text)->string().utf8().data(), misspellingLocation, misspellingLength);
 93 else
 94 textCheckerEnchant->checkSpellingOfString(toImpl(text)->string(), *misspellingLocation, *misspellingLength);
 95}
 96
 97void checkGrammarOfString(uint64_t, WKStringRef, WKArrayRef*, int32_t*, int32_t*, const void*)
 98{
 99 // FIXME: call client's function.
 100 notImplemented();
 101}
 102
 103bool spellingUIIsShowing(const void*)
 104{
 105 if (ewkTextCheckerCallback->ui_spelling_status_get)
 106 return ewkTextCheckerCallback->ui_spelling_status_get();
 107
 108 return false;
 109}
 110
 111void toggleSpellingUIIsShowing(const void*)
 112{
 113 if (ewkTextCheckerCallback->ui_spelling_status_toggle)
 114 ewkTextCheckerCallback->ui_spelling_status_toggle();
 115}
 116
 117void updateSpellingUIWithMisspelledWord(uint64_t tag, WKStringRef misspelledWord, const void*)
 118{
 119 if (ewkTextCheckerCallback->ui_spelling_misspelled_word_update)
 120 ewkTextCheckerCallback->ui_spelling_misspelled_word_update(tag, toImpl(misspelledWord)->string().utf8().data());
 121}
 122
 123void updateSpellingUIWithGrammarString(uint64_t, WKStringRef, WKGrammarDetailRef, const void*)
 124{
 125 // FIXME: call client's function.
 126 notImplemented();
 127}
 128
 129WKArrayRef guessesForWord(uint64_t tag, WKStringRef word, const void*)
 130{
 131 WKMutableArrayRef suggestionsForWord = WKMutableArrayCreate();
 132
 133 if (ewkTextCheckerCallback->word_guesses_get) {
 134 Eina_List* list = ewkTextCheckerCallback->word_guesses_get(tag, toImpl(word)->string().utf8().data());
 135 void* item;
 136
 137 EINA_LIST_FREE(list, item) {
 138 WKRetainPtr<WKStringRef> suggestion(AdoptWK, WKStringCreateWithUTF8CString(static_cast<char*>(item)));
 139 WKArrayAppendItem(suggestionsForWord, suggestion.get());
 140 free(item);
 141 }
 142
 143 } else {
 144 Vector<String> guesses = textCheckerEnchant->getGuessesForWord(toImpl(word)->string());
 145 size_t numberOfGuesses = guesses.size();
 146 for (size_t i = 0; i < numberOfGuesses; ++i) {
 147 WKRetainPtr<WKStringRef> suggestion(AdoptWK, WKStringCreateWithUTF8CString(guesses[i].utf8().data()));
 148 WKArrayAppendItem(suggestionsForWord, suggestion.get());
 149 }
 150 }
 151
 152 return suggestionsForWord;
 153}
 154
 155void learnWord(uint64_t tag, WKStringRef word, const void*)
 156{
 157 if (ewkTextCheckerCallback->word_learn)
 158 ewkTextCheckerCallback->word_learn(tag, toImpl(word)->string().utf8().data());
 159 else
 160 textCheckerEnchant->learnWord(toImpl(word)->string());
 161}
 162
 163void ignoreWord(uint64_t tag, WKStringRef word, const void*)
 164{
 165 if (ewkTextCheckerCallback->word_ignore)
 166 ewkTextCheckerCallback->word_ignore(tag, toImpl(word)->string().utf8().data());
 167 else
 168 textCheckerEnchant->ignoreWord(toImpl(word)->string());
 169}
 170
 171Vector<String> availableSpellCheckingLanguages()
 172{
 173 return textCheckerEnchant->availableSpellCheckingLanguages();
 174}
 175
 176void updateSpellCheckingLanguages(const Vector<String>& languages)
 177{
 178 textCheckerEnchant->updateSpellCheckingLanguages(languages);
 179}
 180
 181Vector<String> loadedSpellCheckingLanguages()
 182{
 183 return textCheckerEnchant->loadedSpellCheckingLanguages();
 184}
 185
 186} // namespace WebKit
 187
 188#endif // ENABLE(SPELLCHECK)

Source/WebKit2/UIProcess/API/efl/WebKitTextChecker.h

 1/*
 2 * Copyright (C) 2012 Samsung Electronics
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 14 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 22 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 23 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef WebKitTextChecker_h
 27#define WebKitTextChecker_h
 28
 29#if ENABLE(SPELLCHECK)
 30
 31#include "TextCheckerEnchant.h"
 32#include "WKArray.h"
 33#include "WKPage.h"
 34#include "WKString.h"
 35
 36namespace WebKit {
 37
 38// The functions mainly choose between client's implementation of spelling and the WebKit one.
 39
 40// Callbacks required by WKTextChecker.
 41bool isContinuousSpellCheckingAllowed(const void* clientInfo);
 42bool isContinuousSpellCheckingEnabled(const void* clientInfo);
 43void setContinuousSpellCheckingEnabled(bool enabled, const void* clientInfo);
 44bool isGrammarCheckingEnabled(const void* clientInfo);
 45void setGrammarCheckingEnabled(bool enabled, const void* clientInfo);
 46
 47uint64_t uniqueSpellDocumentTag(WKPageRef page, const void* clientInfo);
 48void closeSpellDocumentWithTag(uint64_t tag, const void* clientInfo);
 49
 50void checkSpellingOfString(uint64_t tag, WKStringRef text, int32_t* misspellingLocation, int32_t* misspellingLength, const void* clientInfo);
 51void checkGrammarOfString(uint64_t tag, WKStringRef text, WKArrayRef* grammarDetails, int32_t* badGrammarLocation, int32_t* badGrammarLength, const void* clientInfo);
 52
 53bool spellingUIIsShowing(const void* clientInfo);
 54void toggleSpellingUIIsShowing(const void* clientInfo);
 55void updateSpellingUIWithMisspelledWord(uint64_t tag, WKStringRef misspelledWord, const void* clientInfo);
 56void updateSpellingUIWithGrammarString(uint64_t tag, WKStringRef badGrammarPhrase, WKGrammarDetailRef grammarDetail, const void* clientInfo);
 57
 58WKArrayRef guessesForWord(uint64_t tag, WKStringRef word, const void* clientInfo);
 59void learnWord(uint64_t tag, WKStringRef word, const void* clientInfo);
 60void ignoreWord(uint64_t tag, WKStringRef word, const void* clientInfo);
 61
 62// Enchant's helper.
 63Vector<String> availableSpellCheckingLanguages();
 64void updateSpellCheckingLanguages(const Vector<String>& languages);
 65Vector<String> loadedSpellCheckingLanguages();
 66
 67} // namespace WebKit
 68
 69#endif // ENABLE(SPELLCHECK)
 70#endif // WebKitTextChecker_h

Source/WebKit2/UIProcess/API/efl/ewk_context.cpp

3838#include <WebCore/FileSystem.h>
3939#include <wtf/HashMap.h>
4040#include <wtf/text/WTFString.h>
 41#if ENABLE(SPELLCHECK)
 42#include "ewk_text_checker_private.h"
 43#include "ewk_text_checker_settings.h"
 44#endif
4145
4246using namespace WebCore;
4347using namespace WebKit;

@@struct _Ewk_Context {
103107#endif
104108 ewk_context_request_manager_client_attach(this);
105109 ewk_context_download_client_attach(this);
 110#if ENABLE(SPELLCHECK)
 111 ewk_text_checker_client_attach();
 112 if (ewk_text_checker_settings_enable_continuous_spell_checking_get())
 113 ewk_text_checker_settings_spell_checking_languages_set(0);
 114#endif
 115
106116 }
107117
108118 ~_Ewk_Context()

Source/WebKit2/UIProcess/API/efl/ewk_text_checker.cpp

 1/*
 2 * Copyright (C) 2012 Samsung Electronics
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 14 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 22 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 23 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "ewk_text_checker.h"
 28
 29#if ENABLE(SPELLCHECK)
 30#include "WKTextChecker.h"
 31#include "WebKitTextChecker.h"
 32#include "ewk_text_checker_private.h"
 33
 34using namespace WebKit;
 35
 36// Initializes client's functions to @c 0 to be sure that they are not defined.
 37static Ewk_Text_Checker ewkTextCheckerCallback = {
 38 0, // unique_spell_document_tag_get
 39 0, // unique_spell_document_tag_close
 40 0, // string_spelling_check
 41 0, // ui_spelling_status_get
 42 0, // ui_toggle_spelling_status_get
 43 0, // ui_spelling_misspelled_word_update
 44 0, // word_guesses_get
 45 0, // word_learn
 46 0 // word_ignore
 47};
 48
 49#define EWK_TEXT_CHECKER_CALLBACK_SET(TYPE_NAME, NAME) \
 50void ewk_text_checker_##NAME##_cb_set(TYPE_NAME cb) \
 51{ \
 52 ewkTextCheckerCallback.NAME = cb; \
 53}
 54
 55/**
 56 * Attaches spellchecker feature.
 57 *
 58 * @internal
 59 *
 60 * The default spellchecker feature is based on Enchant library.
 61 * Client may use own implementation of spellchecker previously set
 62 * through the callback functions.
 63 */
 64void ewk_text_checker_client_attach()
 65{
 66 static bool didInitializeTextCheckerClient = false;
 67 if (didInitializeTextCheckerClient)
 68 return;
 69
 70 WKTextCheckerClient textCheckerClient = {
 71 kWKTextCheckerClientCurrentVersion,
 72 0, // clientInfo
 73 isContinuousSpellCheckingAllowed,
 74 isContinuousSpellCheckingEnabled,
 75 setContinuousSpellCheckingEnabled,
 76 isGrammarCheckingEnabled,
 77 setGrammarCheckingEnabled,
 78 uniqueSpellDocumentTag,
 79 closeSpellDocumentWithTag,
 80 checkSpellingOfString,
 81 checkGrammarOfString,
 82 spellingUIIsShowing,
 83 toggleSpellingUIIsShowing,
 84 updateSpellingUIWithMisspelledWord,
 85 updateSpellingUIWithGrammarString,
 86 guessesForWord,
 87 learnWord,
 88 ignoreWord
 89 };
 90 WKTextCheckerSetClient(&textCheckerClient);
 91
 92 didInitializeTextCheckerClient = true;
 93}
 94
 95/*
 96 * Gets to the client's callbacks.
 97 *
 98 * @internal
 99 *
 100 * The client't callbacks are not defined by default.
 101 * If the client hasn't set the callback, the corresponding callback will
 102 * return @c 0 and the default WebKit implementation will be used for this
 103 * functionality.
 104 *
 105 * @return the struct with the client's callbacks.
 106 */
 107Ewk_Text_Checker* ewkTextChecker()
 108{
 109 return &ewkTextCheckerCallback;
 110}
 111
 112#else
 113
 114// Defines an empty API to do not break build.
 115#define EWK_TEXT_CHECKER_CALLBACK_SET(TYPE_NAME, NAME) \
 116void ewk_text_checker_##NAME##_cb_set(TYPE_NAME) \
 117{ \
 118}
 119#endif // ENABLE(SPELLCHECK)
 120
 121EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_Unique_Spell_Document_Tag_Get, unique_spell_document_tag_get)
 122EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_Unique_Spell_Document_Tag_Close, unique_spell_document_tag_close)
 123EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_String_Spelling_Check, string_spelling_check)
 124EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_UI_Spelling_Status_Get, ui_spelling_status_get)
 125EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_UI_Spelling_Status_Toggle, ui_spelling_status_toggle)
 126EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_UI_Spelling_Misspelled_Word_Update, ui_spelling_misspelled_word_update)
 127EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_Word_Guesses_Get, word_guesses_get)
 128EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_Word_Learn, word_learn)
 129EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_Word_Ignore, word_ignore)

Source/WebKit2/UIProcess/API/efl/ewk_text_checker.h

 1/*
 2 * Copyright (C) 2012 Samsung Electronics
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 14 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 22 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 23 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26/**
 27 * @file ewk_text_checker.h
 28 * @brief Provides API to overwrite the default WebKit spellchecker implementation.
 29 *
 30 * There is one spellchecker object per application and it's disabled by default.
 31 * It allows to check spelling in the editable areas.
 32 * If application wants to enable the feature, API from @a ewk_text_checker_setting.h
 33 * should be used.
 34 *
 35 * The default WebKit spellchecker implementation is based on the Enchant library.
 36 * It doesn't ensure grammar checking. Application is able to overwrite the default
 37 * WebKit spellchecker implementation by defining its own implementation and setting
 38 * appropriate callback functions.
 39 */
 40
 41#ifndef ewk_text_checker_h
 42#define ewk_text_checker_h
 43
 44#include <Evas.h>
 45
 46#ifdef __cplusplus
 47extern "C" {
 48#endif
 49
 50/**
 51 * Defines a type name for the callback function to return a tag (identifier) which is guaranteed to be unique.
 52 *
 53 * Unique tags help to avoid collisions with other objects that are checked for spelling mistakes.
 54 *
 55 * @param o the view object to get unique tag
 56 *
 57 * @return unique tag for the given @a o view object
 58 */
 59typedef uint64_t (*Ewk_Text_Checker_Unique_Spell_Document_Tag_Get)(const Evas_Object *o);
 60
 61/**
 62 * Defines a type name for the callback function to close the prviously set tag.
 63 *
 64 * This callback will notify the receiver that the user has finished with the tagged document.
 65 *
 66 * @param tag the tag to be closed
 67 */
 68typedef void (*Ewk_Text_Checker_Unique_Spell_Document_Tag_Close)(uint64_t tag);
 69
 70/**
 71 * Defines a type name for the callback function to search for a misspelled words in the given string.
 72 *
 73 * @param tag unique tag to notify the spell checker which document that @a text is associated,
 74 * in most cases not necessarily, just for ignored word,
 75 * @c 0 can be passed in for text not associated with a particular document
 76 * @param text the text containing the words to spellcheck
 77 * @param misspelling_location a pointer to store the beginning of the misspelled @a text, @c -1 if the @a text is correct
 78 * @param misspelling_length a pointer to store the length of misspelled @a text, @c 0 if the @a text is correct
 79 */
 80typedef void (*Ewk_Text_Checker_String_Spelling_Check)(uint64_t tag, const char *text, int32_t *misspelling_location, int32_t *misspelling_length);
 81
 82/**
 83 * Defines a type name for the callback function to get the status of UI Spelling.
 84 *
 85 * @return @c EINA_TRUE if the UI Spelling is shown, @c EINA_FALSE if it's hidden
 86 */
 87typedef Eina_Bool (*Ewk_Text_Checker_UI_Spelling_Status_Get)(void);
 88
 89/**
 90 * Defines a type name for the callback function to toggle the UI Spelling.
 91 */
 92typedef void (*Ewk_Text_Checker_UI_Spelling_Status_Toggle)(void);
 93
 94/**
 95 * Defines a type name for the callback function to update the UI Spelling for the misspelled word.
 96 *
 97 * @param tag unique tag to notify the spell checker which document that the misspelled word is associated,
 98 * @param misspelled_word the misspelled word
 99 */
 100typedef void (*Ewk_Text_Checker_UI_Spelling_Misspelled_Word_Update)(uint64_t tag, const char *misspelled_word);
 101
 102/**
 103 * Defines a type name for the callback function to get a list of suggested spellings for a misspelled @a word.
 104 *
 105 * @param tag unique tag to notify the spell checker which document that @a text is associated,
 106 * @c 0 can be passed for text not associated with a particular document
 107 * @param word the word to get guesses
 108 * @return a list of dynamically allocated strings (as char*) and
 109 * caller is responsible for destroying them.
 110 */
 111typedef Eina_List *(*Ewk_Text_Checker_Word_Guesses_Get)(uint64_t tag, const char *word);
 112
 113/**
 114 * Sets a callback function to add the word to the spell checker dictionary.
 115 *
 116 * @param tag unique tag to notify the spell checker which document that @a text is associated,
 117 * @c 0 can be passed for text not associated with a particular document
 118 * @param word the word to add
 119 */
 120typedef void (*Ewk_Text_Checker_Word_Learn)(uint64_t tag, const char *word);
 121
 122/**
 123 * Sets a callback function to tell the spell checker to ignore a given word.
 124 *
 125 * @param tag unique tag to notify the spell checker which document that @a text is associated,
 126 * @c 0 can be passed for text not associated with a particular document
 127 * @param word the word to ignore
 128 */
 129typedef void (*Ewk_Text_Checker_Word_Ignore)(uint64_t tag, const char *word);
 130
 131/**
 132 * Sets a callback function to get a unique spell document tag.
 133 *
 134 * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation
 135 */
 136EAPI void ewk_text_checker_unique_spell_document_tag_get_cb_set(Ewk_Text_Checker_Unique_Spell_Document_Tag_Get cb);
 137
 138/**
 139 * Sets a callback function to close a unique spell document tag.
 140 *
 141 * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation
 142 */
 143EAPI void ewk_text_checker_unique_spell_document_tag_close_cb_set(Ewk_Text_Checker_Unique_Spell_Document_Tag_Close cb);
 144
 145/**
 146 * Sets a callback function to search for a misspelled words in the given string.
 147 *
 148 * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation
 149 */
 150EAPI void ewk_text_checker_string_spelling_check_cb_set(Ewk_Text_Checker_String_Spelling_Check cb);
 151
 152/**
 153 * Sets a callback function to get the status of UI Spelling.
 154 *
 155 * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation
 156 */
 157EAPI void ewk_text_checker_ui_spelling_status_get_cb_set(Ewk_Text_Checker_UI_Spelling_Status_Get cb);
 158
 159/**
 160 * Sets a callback function to toggle the UI Spelling.
 161 *
 162 * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation
 163 */
 164EAPI void ewk_text_checker_ui_spelling_status_toggle_cb_set(Ewk_Text_Checker_UI_Spelling_Status_Toggle cb);
 165
 166/**
 167 * Sets a callback function to update the UI Spelling for the misspelled word.
 168 *
 169 * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation
 170 */
 171EAPI void ewk_text_checker_ui_spelling_misspelled_word_update_cb_set(Ewk_Text_Checker_UI_Spelling_Misspelled_Word_Update cb);
 172
 173/**
 174 * Sets a callback function to get an array of suggested spellings for a misspelled word.
 175 *
 176 * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation
 177 */
 178EAPI void ewk_text_checker_word_guesses_get_cb_set(Ewk_Text_Checker_Word_Guesses_Get cb);
 179
 180/**
 181 * Sets a callback function to add the word to the spell checker dictionary.
 182 *
 183 * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation
 184 */
 185EAPI void ewk_text_checker_word_learn_cb_set(Ewk_Text_Checker_Word_Learn cb);
 186
 187/**
 188 * Sets a callback function to tell the spell checker to ignore a given word.
 189 *
 190 * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation
 191 */
 192EAPI void ewk_text_checker_word_ignore_cb_set(Ewk_Text_Checker_Word_Ignore cb);
 193
 194#ifdef __cplusplus
 195}
 196#endif
 197#endif // ewk_text_checker_h

Source/WebKit2/UIProcess/API/efl/ewk_text_checker_private.h

 1/*
 2 * Copyright (C) 2012 Samsung Electronics
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 14 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 22 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 23 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef ewk_text_checker_private_h
 27#define ewk_text_checker_private_h
 28
 29#if ENABLE(SPELLCHECK)
 30#include "ewk_text_checker.h"
 31
 32/**
 33 * @brief Structure that keeps client's callback functions.
 34 *
 35 * @internal
 36 */
 37struct _Ewk_Text_Checker {
 38 Ewk_Text_Checker_Unique_Spell_Document_Tag_Get unique_spell_document_tag_get;
 39 Ewk_Text_Checker_Unique_Spell_Document_Tag_Close unique_spell_document_tag_close;
 40 Ewk_Text_Checker_String_Spelling_Check string_spelling_check;
 41 Ewk_Text_Checker_UI_Spelling_Status_Get ui_spelling_status_get;
 42 Ewk_Text_Checker_UI_Spelling_Status_Toggle ui_spelling_status_toggle;
 43 Ewk_Text_Checker_UI_Spelling_Misspelled_Word_Update ui_spelling_misspelled_word_update;
 44 Ewk_Text_Checker_Word_Guesses_Get word_guesses_get;
 45 Ewk_Text_Checker_Word_Learn word_learn;
 46 Ewk_Text_Checker_Word_Ignore word_ignore;
 47};
 48typedef _Ewk_Text_Checker Ewk_Text_Checker;
 49
 50Ewk_Text_Checker* ewkTextChecker();
 51
 52// Makes it visible for WTR.
 53EAPI void ewk_text_checker_client_attach();
 54
 55#endif // ENABLE(SPELLCHECK)
 56#endif // ewk_text_checker_private_h

Source/WebKit2/UIProcess/API/efl/ewk_text_checker_settings.cpp

 1/*
 2 * Copyright (C) 2012 Samsung Electronics
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 14 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 22 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 23 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "ewk_text_checker_settings.h"
 28
 29#if ENABLE(SPELLCHECK)
 30#include "WKTextChecker.h"
 31#include "WebKitTextChecker.h"
 32#include <Ecore.h>
 33#include <wtf/Vector.h>
 34#include <wtf/text/CString.h>
 35
 36using namespace WebKit;
 37
 38static struct {
 39 bool enableContinuousSpellChecking : 1;
 40 bool enableGrammarChecking : 1;
 41 struct {
 42 Ewk_Text_Checker_Settings_Continuous_Spell_Checking_Changed continuousSpellCheckingChanged;
 43 Ewk_Text_Checker_Settings_Grammar_Checking_Changed grammarCheckingChanged;
 44 } settingsChangedCallbacks;
 45 Vector<String> spellCheckingLanguages;
 46} ewkTextCheckerSettings = { false, false, {0, 0}, Vector<String>() };
 47
 48static Eina_Bool idlerContinuousSpellCheckingChanged(void*)
 49{
 50 if (ewkTextCheckerSettings.settingsChangedCallbacks.continuousSpellCheckingChanged)
 51 ewkTextCheckerSettings.settingsChangedCallbacks.continuousSpellCheckingChanged(
 52 ewkTextCheckerSettings.enableContinuousSpellChecking);
 53
 54 return ECORE_CALLBACK_CANCEL;
 55}
 56
 57static Eina_Bool idlerGrammarCheckingChanged(void*)
 58{
 59 if (ewkTextCheckerSettings.settingsChangedCallbacks.grammarCheckingChanged)
 60 ewkTextCheckerSettings.settingsChangedCallbacks.grammarCheckingChanged(
 61 ewkTextCheckerSettings.enableGrammarChecking);
 62
 63 return ECORE_CALLBACK_CANCEL;
 64}
 65
 66static Eina_Bool idlerSpellCheckingLanguagesSet(void*)
 67{
 68 // FIXME: Consider to delegate calling of this method in WebProcess to do not delay/block UIProcess.
 69 updateSpellCheckingLanguages(ewkTextCheckerSettings.spellCheckingLanguages);
 70 return ECORE_CALLBACK_CANCEL;
 71}
 72
 73static void spellCheckingLanguagesSet(const Vector<String>& newLanguages)
 74{
 75 ewkTextCheckerSettings.spellCheckingLanguages = newLanguages;
 76 ecore_idler_add(idlerSpellCheckingLanguagesSet, 0);
 77}
 78#endif // ENABLE(SPELLCHECK)
 79
 80void ewk_text_checker_settings_continuous_spell_checking_changed_cb_set(Ewk_Text_Checker_Settings_Continuous_Spell_Checking_Changed callback)
 81{
 82#if ENABLE(SPELLCHECK)
 83 ewkTextCheckerSettings.settingsChangedCallbacks.continuousSpellCheckingChanged = callback;
 84#endif
 85}
 86
 87void ewk_text_checker_settings_grammar_checking_changed_cb_set(Ewk_Text_Checker_Settings_Grammar_Checking_Changed callback)
 88{
 89#if ENABLE(SPELLCHECK)
 90 ewkTextCheckerSettings.settingsChangedCallbacks.grammarCheckingChanged = callback;
 91#endif
 92}
 93
 94Eina_Bool ewk_text_checker_settings_enable_continuous_spell_checking_get()
 95{
 96#if ENABLE(SPELLCHECK)
 97 return ewkTextCheckerSettings.enableContinuousSpellChecking;
 98#else
 99 return false;
 100#endif
 101}
 102
 103void ewk_text_checker_settings_enable_continuous_spell_checking_set(Eina_Bool enable)
 104{
 105#if ENABLE(SPELLCHECK)
 106 enable = !!enable;
 107 if (ewkTextCheckerSettings.enableContinuousSpellChecking != enable) {
 108 ewkTextCheckerSettings.enableContinuousSpellChecking = enable;
 109
 110 WKTextCheckerContinuousSpellCheckingEnabledStateChanged(enable);
 111
 112 // Sets default language if user didn't specify any.
 113 if (enable && loadedSpellCheckingLanguages().isEmpty())
 114 spellCheckingLanguagesSet(Vector<String>());
 115
 116 if (ewkTextCheckerSettings.settingsChangedCallbacks.continuousSpellCheckingChanged)
 117 ecore_idler_add(idlerContinuousSpellCheckingChanged, 0);
 118 }
 119#endif
 120}
 121
 122Eina_Bool ewk_text_checker_settings_enable_grammar_checking_get()
 123{
 124#if ENABLE(SPELLCHECK)
 125 return ewkTextCheckerSettings.enableGrammarChecking;
 126#else
 127 return false;
 128#endif
 129}
 130
 131void ewk_text_checker_settings_enable_grammar_checking_set(Eina_Bool enable)
 132{
 133#if ENABLE(SPELLCHECK)
 134 enable = !!enable;
 135 if (ewkTextCheckerSettings.enableGrammarChecking != enable) {
 136 ewkTextCheckerSettings.enableGrammarChecking = enable;
 137
 138 WKTextCheckerGrammarCheckingEnabledStateChanged(enable);
 139
 140 if (ewkTextCheckerSettings.settingsChangedCallbacks.grammarCheckingChanged)
 141 ecore_idler_add(idlerGrammarCheckingChanged, 0);
 142 }
 143#endif
 144}
 145
 146Eina_List* ewk_text_checker_settings_available_spell_checking_languages_get()
 147{
 148 Eina_List* listOflanguages = 0;
 149#if ENABLE(SPELLCHECK)
 150 Vector<String> languages = availableSpellCheckingLanguages();
 151 size_t numberOfLanuages = languages.size();
 152
 153 for (size_t i = 0; i < numberOfLanuages; ++i)
 154 listOflanguages = eina_list_append(listOflanguages, eina_stringshare_add(languages[i].utf8().data()));
 155
 156#endif
 157 return listOflanguages;
 158}
 159
 160void ewk_text_checker_settings_spell_checking_languages_set(const char* languages)
 161{
 162#if ENABLE(SPELLCHECK)
 163 Vector<String> newLanguages;
 164 String::fromUTF8(languages).split(',', newLanguages);
 165
 166 spellCheckingLanguagesSet(newLanguages);
 167#endif
 168}
 169
 170Eina_List* ewk_text_checker_settings_spell_checking_languages_get()
 171{
 172 Eina_List* listOflanguages = 0;
 173#if ENABLE(SPELLCHECK)
 174 Vector<String> languages = loadedSpellCheckingLanguages();
 175 size_t numberOfLanuages = languages.size();
 176
 177 for (size_t i = 0; i < numberOfLanuages; ++i)
 178 listOflanguages = eina_list_append(listOflanguages, eina_stringshare_add(languages[i].utf8().data()));
 179
 180#endif
 181 return listOflanguages;
 182}

Source/WebKit2/UIProcess/API/efl/ewk_text_checker_settings.h

 1/*
 2 * Copyright (C) 2012 Samsung Electronics
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 14 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 22 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 23 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26/**
 27 * @file ewk_text_checker_setting.h
 28 * @brief API for manipulating spell checker feature.
 29 */
 30
 31#ifndef ewk_text_checker_setting_h
 32#define ewk_text_checker_setting_h
 33
 34#include <Eina.h>
 35
 36#ifdef __cplusplus
 37extern "C" {
 38#endif
 39
 40/**
 41 * Creates a type name for the callback function used to notify the client when
 42 * the continuous spell checking setting was changed by WebKit.
 43 *
 44 * @param @c EINA_TRUE if continuous spell checking is enabled or @ EINA_FALSE if it's disabled
 45 */
 46typedef void (*Ewk_Text_Checker_Settings_Continuous_Spell_Checking_Changed)(Eina_Bool enable);
 47
 48/**
 49 * Sets a callback function used to notify the client when
 50 * the grammar checking setting was changed by WebKit.
 51 *
 52 * @param @c EINA_TRUE if grammar checking is enabled or @ EINA_FALSE if it's disabled
 53 */
 54typedef void (*Ewk_Text_Checker_Settings_Grammar_Checking_Changed)(Eina_Bool enable);
 55
 56/**
 57 * Sets a callback function used to notify the client when
 58 * the continuous spell checking setting was changed by WebKit.
 59 *
 60 * Specifying of this callback is needed if the application wants to receive notifications
 61 * once WebKit changes this setting.
 62 * If the application is not interested, this callback is not set.
 63 * Changing of this setting at the WebKit level can be made as a result of modifying
 64 * options in a Context Menu by a user.
 65 *
 66 * @param cb a new callback function to set or @c NULL to invalidate the previous one
 67 */
 68EAPI void ewk_text_checker_settings_continuous_spell_checking_changed_cb_set(Ewk_Text_Checker_Settings_Continuous_Spell_Checking_Changed cb);
 69
 70/**
 71 * Sets a callback function used to notify the client when
 72 * the grammar checking setting was changed by WebKit.
 73 *
 74 * Specifying of this callback is needed if the application wants to receive notifications
 75 * once WebKit changes this setting.
 76 * If the application is not interested, this callback is not set.
 77 * Changing of this setting at the WebKit level can be made as a result of modifying
 78 * options in a Context Menu by a user.
 79 *
 80 * @param cb a new callback function to set or @c NULL to invalidate the previous one
 81 */
 82EAPI void ewk_text_checker_settings_grammar_checking_changed_cb_set(Ewk_Text_Checker_Settings_Grammar_Checking_Changed cb);
 83
 84/**
 85 * Queries if continuous spell checking is enabled.
 86 *
 87 * @return @c EINA_TRUE if continuous spell checking is enabled or @c EINA_FALSE if it's disabled
 88 */
 89EAPI Eina_Bool ewk_text_checker_settings_enable_continuous_spell_checking_get(void);
 90
 91/**
 92 * Enables/disables continuous spell checking.
 93 *
 94 * Additionally, this function calls a callback function (if defined) to notify
 95 * the client about the change of the setting.
 96 * This feature is disabled by default.
 97 *
 98 * @see ewk_text_checker_setting_continuous_spell_checking_changed_cb_set
 99 *
 100 * @param enable @c EINA_TRUE to enable continuous spell checking or @c EINA_FALSE to disable
 101 */
 102EAPI void ewk_text_checker_settings_enable_continuous_spell_checking_set(Eina_Bool enable);
 103
 104/**
 105 * Queries if grammar checking is enabled.
 106 *
 107 * Application may overwrite webkit grammar checking implementation by setting callback functions
 108 * @see ewk_text_checker.h
 109 *
 110 * @return @c EINA_TRUE if grammar checking is enabled or @c EINA_FALSE if it's disabled
 111 */
 112EAPI Eina_Bool ewk_text_checker_settings_enable_grammar_checking_get(void);
 113
 114/**
 115 * Enables/disables grammar checking.
 116 *
 117 * Additionally, this function calls a callback function (if defined) to notify
 118 * the client about the change of the setting.
 119 * This feature is disabled and is not supported by WebKit-EFL by default.
 120 *
 121 * @see ewk_text_checker_setting_grammar_checking_changed_cb_set
 122 *
 123 * @param enable @c EINA_TRUE to enable grammar checking or @c EINA_FALSE to disable
 124 */
 125EAPI void ewk_text_checker_settings_enable_grammar_checking_set(Eina_Bool enable);
 126
 127/*
 128 * Gets the the list of all available and installed spell checking languages to use.
 129 *
 130 * @see ewk_text_checker_setting_spell_checking_languages_set
 131 *
 132 * @return the list with available spell checking languages, or @c NULL on failure
 133 * the Eina_List and its items should be freed after, use eina_stringshare_del()
 134 */
 135EAPI Eina_List *ewk_text_checker_settings_available_spell_checking_languages_get(void);
 136
 137/**
 138 * Sets @a languages as the list of languages to use by default WebKit
 139 * implementation of spellchecker feature with Enchant library support.
 140 *
 141 * If @languages is @c NULL, the default language is used.
 142 * If the default language can not be determined then any available dictionary will be used.
 143 *
 144 * @note This function invalidates the previously set languages.
 145 * The dictionaries are requested asynchronously.
 146 *
 147 * @param languages a list of comma (',') separated language codes
 148 * of the form 'en_US', ie, language_VARIANT, may be @c NULL.
 149 */
 150EAPI void ewk_text_checker_settings_spell_checking_languages_set(const char *languages);
 151
 152/*
 153 * Gets the the list of the spell checking languages in use.
 154 *
 155 * @see ewk_text_checker_setting_available_spell_checking_languages_get
 156 * @see ewk_text_checker_setting_spell_checking_languages_set
 157 *
 158 * @return the list with the spell checking languages in use,
 159 * the Eina_List and its items should be freed after, use eina_stringshare_del()
 160 */
 161EAPI Eina_List *ewk_text_checker_settings_spell_checking_languages_get(void);
 162
 163#ifdef __cplusplus
 164}
 165#endif
 166
 167#endif // ewk_text_checker_setting_h

Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp

11/*
2  * Copyright (C) 2011 Samsung Electronics
 2 * Copyright (C) 2012 Samsung Electronics
 3 * Copyright (C) 2010 Apple Inc. All rights reserved.
 4 * Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved.
35 *
46 * Redistribution and use in source and binary forms, with or without
57 * modification, are permitted provided that the following conditions

2729#include "TextChecker.h"
2830
2931#include "TextCheckerState.h"
30 #include <WebCore/NotImplemented.h>
 32#if ENABLE(SPELLCHECK)
 33#include "WebTextChecker.h"
 34#endif
3135
3236using namespace WebCore;
3337

@@static TextCheckerState textCheckerState;
3741
3842const TextCheckerState& TextChecker::state()
3943{
40  notImplemented();
 44#if ENABLE(SPELLCHECK)
 45 static bool didInitializeState = false;
 46 if (didInitializeState)
 47 return textCheckerState;
 48
 49 WebTextCheckerClient& client = WebTextChecker::shared()->client();
 50 textCheckerState.isContinuousSpellCheckingEnabled = client.continuousSpellCheckingEnabled();
 51 textCheckerState.isGrammarCheckingEnabled = client.grammarCheckingEnabled();
 52
 53 didInitializeState = true;
 54#endif
4155 return textCheckerState;
4256}
4357
4458bool TextChecker::isContinuousSpellCheckingAllowed()
4559{
46  notImplemented();
47  return false;
 60#if ENABLE(SPELLCHECK)
 61 return WebTextChecker::shared()->client().continuousSpellCheckingAllowed();
 62#else
 63 return false;
 64#endif
4865}
4966
50 void TextChecker::setContinuousSpellCheckingEnabled(bool)
 67void TextChecker::setContinuousSpellCheckingEnabled(bool isContinuousSpellCheckingEnabled)
5168{
52  notImplemented();
 69#if ENABLE(SPELLCHECK)
 70 if (state().isContinuousSpellCheckingEnabled == isContinuousSpellCheckingEnabled)
 71 return;
 72
 73 textCheckerState.isContinuousSpellCheckingEnabled = isContinuousSpellCheckingEnabled;
 74 WebTextChecker::shared()->client().setContinuousSpellCheckingEnabled(isContinuousSpellCheckingEnabled);
 75#endif
5376}
5477
55 void TextChecker::setGrammarCheckingEnabled(bool)
 78void TextChecker::setGrammarCheckingEnabled(bool isGrammarCheckingEnabled)
5679{
57  notImplemented();
 80#if ENABLE(SPELLCHECK)
 81 if (state().isGrammarCheckingEnabled == isGrammarCheckingEnabled)
 82 return;
 83
 84 textCheckerState.isGrammarCheckingEnabled = isGrammarCheckingEnabled;
 85 WebTextChecker::shared()->client().setGrammarCheckingEnabled(isGrammarCheckingEnabled);
 86#endif
5887}
5988
60 void TextChecker::continuousSpellCheckingEnabledStateChanged(bool /*enabled*/)
 89void TextChecker::continuousSpellCheckingEnabledStateChanged(bool enabled)
6190{
62  notImplemented();
 91#if ENABLE(SPELLCHECK)
 92 textCheckerState.isContinuousSpellCheckingEnabled = enabled;
 93#endif
6394}
6495
65 void TextChecker::grammarCheckingEnabledStateChanged(bool /*enabled*/)
 96void TextChecker::grammarCheckingEnabledStateChanged(bool enabled)
6697{
67  notImplemented();
 98#if ENABLE(SPELLCHECK)
 99 textCheckerState.isGrammarCheckingEnabled = enabled;
 100#endif
68101}
69102
70 int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
 103int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy* page)
71104{
72  notImplemented();
 105#if ENABLE(SPELLCHECK)
 106 return WebTextChecker::shared()->client().uniqueSpellDocumentTag(page);
 107#else
73108 return 0;
 109#endif
74110}
75111
76 void TextChecker::closeSpellDocumentWithTag(int64_t)
 112void TextChecker::closeSpellDocumentWithTag(int64_t tag)
77113{
78  notImplemented();
 114#if ENABLE(SPELLCHECK)
 115 WebTextChecker::shared()->client().closeSpellDocumentWithTag(tag);
 116#endif
79117}
80118
81 void TextChecker::checkSpellingOfString(int64_t, const UChar*, uint32_t, int32_t&, int32_t&)
 119void TextChecker::checkSpellingOfString(int64_t spellDocumentTag, const UChar* text, uint32_t length, int32_t& misspellingLocation, int32_t& misspellingLength)
82120{
83  notImplemented();
 121#if ENABLE(SPELLCHECK)
 122 WebTextChecker::shared()->client().checkSpellingOfString(spellDocumentTag, String(text, length), misspellingLocation, misspellingLength);
 123#endif
84124}
85125
86 void TextChecker::checkGrammarOfString(int64_t, const UChar*, uint32_t, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&)
 126void TextChecker::checkGrammarOfString(int64_t spellDocumentTag, const UChar* text, uint32_t length, Vector<GrammarDetail>& grammarDetails, int32_t& badGrammarLocation, int32_t& badGrammarLength)
87127{
88  notImplemented();
 128#if ENABLE(SPELLCHECK)
 129 WebTextChecker::shared()->client().checkGrammarOfString(spellDocumentTag, String(text, length), grammarDetails, badGrammarLocation, badGrammarLength);
 130#endif
89131}
90132
91133bool TextChecker::spellingUIIsShowing()
92134{
93  notImplemented();
 135#if ENABLE(SPELLCHECK)
 136 return WebTextChecker::shared()->client().spellingUIIsShowing();
 137#else
94138 return false;
 139#endif
95140}
96141
97142void TextChecker::toggleSpellingUIIsShowing()
98143{
99  notImplemented();
 144#if ENABLE(SPELLCHECK)
 145 WebTextChecker::shared()->client().toggleSpellingUIIsShowing();
 146#endif
100147}
101148
102 void TextChecker::updateSpellingUIWithMisspelledWord(int64_t, const String&)
 149void TextChecker::updateSpellingUIWithMisspelledWord(int64_t spellDocumentTag, const String& misspelledWord)
103150{
104  notImplemented();
 151#if ENABLE(SPELLCHECK)
 152 WebTextChecker::shared()->client().updateSpellingUIWithMisspelledWord(spellDocumentTag, misspelledWord);
 153#endif
105154}
106155
107 void TextChecker::updateSpellingUIWithGrammarString(int64_t, const String&, const GrammarDetail&)
 156void TextChecker::updateSpellingUIWithGrammarString(int64_t spellDocumentTag, const String& badGrammarPhrase, const GrammarDetail& grammarDetail)
108157{
109  notImplemented();
 158#if ENABLE(SPELLCHECK)
 159 WebTextChecker::shared()->client().updateSpellingUIWithGrammarString(spellDocumentTag, badGrammarPhrase, grammarDetail);
 160#endif
110161}
111162
112 void TextChecker::getGuessesForWord(int64_t, const String&, const String&, Vector<String>&)
 163void TextChecker::getGuessesForWord(int64_t spellDocumentTag, const String& word, const String& context, Vector<String>& guesses)
113164{
114  notImplemented();
 165#if ENABLE(SPELLCHECK)
 166 WebTextChecker::shared()->client().guessesForWord(spellDocumentTag, word, guesses);
 167#endif
115168}
116169
117 void TextChecker::learnWord(int64_t, const String&)
 170void TextChecker::learnWord(int64_t spellDocumentTag, const String& word)
118171{
119  notImplemented();
 172#if ENABLE(SPELLCHECK)
 173 WebTextChecker::shared()->client().learnWord(spellDocumentTag, word);
 174#endif
120175}
121176
122 void TextChecker::ignoreWord(int64_t, const String&)
 177void TextChecker::ignoreWord(int64_t spellDocumentTag, const String& word)
123178{
124  notImplemented();
 179#if ENABLE(SPELLCHECK)
 180 WebTextChecker::shared()->client().ignoreWord(spellDocumentTag, word);
 181#endif
125182}
126183
127184} // namespace WebKit

Source/cmake/FindEnchant.cmake

 1# - Try to find Enchant
 2# Once done, this will define
 3#
 4# ENCHANT_INCLUDE_DIRS - the Enchant include drectories
 5# ENCHANT_LIBRARIES - link these to use Enchant
 6#
 7# Copyright (C) 2012 Samsung Electronics
 8#
 9# Redistribution and use in source and binary forms, with or without
 10# modification, are permitted provided that the following conditions
 11# are met:
 12# 1. Redistributions of source code must retain the above copyright
 13# notice, this list of conditions and the following disclaimer.
 14# 2. Redistributions in binary form must reproduce the above copyright
 15# notice, this list of conditions and the following disclaimer in the
 16# documentation and/or other materials provided with the distribution.
 17#
 18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
 19# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 20# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 21# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
 22# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 23# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 24# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 25# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 26# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 27# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 28# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 29
 30FIND_PACKAGE(PkgConfig)
 31PKG_CHECK_MODULES(PC_ENCHANT enchant)
 32
 33FIND_PATH(ENCHANT_INCLUDE_DIRS
 34 NAMES enchant.h
 35 PATHS ${PC_ENCHANT_INCLUDEDIR}
 36 ${PC_ENCHANT_INCLUDE_DIRS}
 37)
 38
 39FIND_LIBRARY(ENCHANT_LIBRARIES
 40 NAMES enchant
 41 PATHS ${PC_ENCHANT_LIBDIR}
 42 ${PC_ENCHANT_LIBRARY_DIRS}
 43)

Source/cmake/OptionsEfl.cmake

@@IF (WTF_USE_TILED_BACKING_STORE)
168168 FIND_PACKAGE(OpenGL REQUIRED)
169169ENDIF()
170170
 171OPTION(ENABLE_SPELLCHECK "Enable spellchecking feature (requires enchant)" ON)
 172IF (ENABLE_SPELLCHECK)
 173 FIND_PACKAGE(Enchant REQUIRED)
 174 ADD_DEFINITIONS(-DENABLE_SPELLCHECK=1)
 175ENDIF()