Title: [132657] trunk/Source/WebKit2
Revision
132657
Author
[email protected]
Date
2012-10-26 07:58:31 -0700 (Fri, 26 Oct 2012)

Log Message

[EFL][WK2] Get rid of C'ism in text checker API
https://bugs.webkit.org/show_bug.cgi?id=100513

Patch by Christophe Dumez <[email protected]> on 2012-10-26
Reviewed by Kenneth Rohde Christiansen.

Make Ewk_Text_Checker a C++ class and move the
WebKitTextChecker code to this new class. This
gets rid of the C'ism in the text checker code
and make it consistent with other Ewk classes.

* PlatformEfl.cmake:
* UIProcess/API/efl/ewk_context.cpp:
(Ewk_Context::Ewk_Context):
* UIProcess/API/efl/ewk_settings.cpp:
(spellCheckingLanguagesSetUpdate):
(ewk_settings_continuous_spell_checking_enabled_set):
(ewk_settings_spell_checking_available_languages_get):
(ewk_settings_spell_checking_languages_get):
* UIProcess/API/efl/ewk_text_checker.cpp:
(ClientCallbacks):
(textCheckerEnchant):
(clientCallbacks):
(isContinuousSpellCheckingEnabled):
(setContinuousSpellCheckingEnabled):
(uniqueSpellDocumentTag):
(closeSpellDocumentWithTag):
(checkSpellingOfString):
(guessesForWord):
(learnWord):
(ignoreWord):
(Ewk_Text_Checker):
(Ewk_Text_Checker::availableSpellCheckingLanguages):
(Ewk_Text_Checker::updateSpellCheckingLanguages):
(Ewk_Text_Checker::loadedSpellCheckingLanguages):
(Ewk_Text_Checker::initialize):
* UIProcess/API/efl/ewk_text_checker_private.h:
(Ewk_Text_Checker):
* UIProcess/efl/WebKitTextChecker.cpp: Removed.
* UIProcess/efl/WebKitTextChecker.h: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (132656 => 132657)


--- trunk/Source/WebKit2/ChangeLog	2012-10-26 14:58:17 UTC (rev 132656)
+++ trunk/Source/WebKit2/ChangeLog	2012-10-26 14:58:31 UTC (rev 132657)
@@ -1,3 +1,45 @@
+2012-10-26  Christophe Dumez  <[email protected]>
+
+        [EFL][WK2] Get rid of C'ism in text checker API
+        https://bugs.webkit.org/show_bug.cgi?id=100513
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Make Ewk_Text_Checker a C++ class and move the
+        WebKitTextChecker code to this new class. This
+        gets rid of the C'ism in the text checker code
+        and make it consistent with other Ewk classes.
+
+        * PlatformEfl.cmake:
+        * UIProcess/API/efl/ewk_context.cpp:
+        (Ewk_Context::Ewk_Context):
+        * UIProcess/API/efl/ewk_settings.cpp:
+        (spellCheckingLanguagesSetUpdate):
+        (ewk_settings_continuous_spell_checking_enabled_set):
+        (ewk_settings_spell_checking_available_languages_get):
+        (ewk_settings_spell_checking_languages_get):
+        * UIProcess/API/efl/ewk_text_checker.cpp:
+        (ClientCallbacks):
+        (textCheckerEnchant):
+        (clientCallbacks):
+        (isContinuousSpellCheckingEnabled):
+        (setContinuousSpellCheckingEnabled):
+        (uniqueSpellDocumentTag):
+        (closeSpellDocumentWithTag):
+        (checkSpellingOfString):
+        (guessesForWord):
+        (learnWord):
+        (ignoreWord):
+        (Ewk_Text_Checker):
+        (Ewk_Text_Checker::availableSpellCheckingLanguages):
+        (Ewk_Text_Checker::updateSpellCheckingLanguages):
+        (Ewk_Text_Checker::loadedSpellCheckingLanguages):
+        (Ewk_Text_Checker::initialize):
+        * UIProcess/API/efl/ewk_text_checker_private.h:
+        (Ewk_Text_Checker):
+        * UIProcess/efl/WebKitTextChecker.cpp: Removed.
+        * UIProcess/efl/WebKitTextChecker.h: Removed.
+
 2012-10-26  Mikhail Pozdnyakov  <[email protected]>
 
         [EFL][WK2] Clean up construction/destruction code in Ewk_view

Modified: trunk/Source/WebKit2/PlatformEfl.cmake (132656 => 132657)


--- trunk/Source/WebKit2/PlatformEfl.cmake	2012-10-26 14:58:17 UTC (rev 132656)
+++ trunk/Source/WebKit2/PlatformEfl.cmake	2012-10-26 14:58:31 UTC (rev 132657)
@@ -87,7 +87,6 @@
     UIProcess/efl/WebContextEfl.cpp
     UIProcess/efl/WebFullScreenManagerProxyEfl.cpp
     UIProcess/efl/WebInspectorProxyEfl.cpp
-    UIProcess/efl/WebKitTextChecker.cpp
     UIProcess/efl/WebPageProxyEfl.cpp
     UIProcess/efl/WebPopupMenuProxyEfl.cpp
     UIProcess/efl/WebPreferencesEfl.cpp

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp (132656 => 132657)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp	2012-10-26 14:58:17 UTC (rev 132656)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp	2012-10-26 14:58:31 UTC (rev 132657)
@@ -90,7 +90,7 @@
 #endif
 
 #if ENABLE(SPELLCHECK)
-    ewk_text_checker_client_attach();
+    Ewk_Text_Checker::initialize();
     if (ewk_settings_continuous_spell_checking_enabled_get()) {
         // Load the default language.
         ewk_settings_spell_checking_languages_set(0);

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp (132656 => 132657)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp	2012-10-26 14:58:17 UTC (rev 132656)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp	2012-10-26 14:58:31 UTC (rev 132657)
@@ -35,7 +35,7 @@
 
 #if ENABLE(SPELLCHECK)
 #include "WKTextChecker.h"
-#include "WebKitTextChecker.h"
+#include "ewk_text_checker_private.h"
 #include <Ecore.h>
 #include <wtf/Vector.h>
 #include <wtf/text/CString.h>
@@ -71,7 +71,7 @@
 static Eina_Bool spellCheckingLanguagesSetUpdate(void*)
 {
     // FIXME: Consider to delegate calling of this method in WebProcess to do not delay/block UIProcess.
-    updateSpellCheckingLanguages(ewkTextCheckerSettings.spellCheckingLanguages);
+    Ewk_Text_Checker::updateSpellCheckingLanguages(ewkTextCheckerSettings.spellCheckingLanguages);
     return ECORE_CALLBACK_CANCEL;
 }
 
@@ -225,7 +225,7 @@
         WKTextCheckerContinuousSpellCheckingEnabledStateChanged(enable);
 
         // Sets the default language if user didn't specify any.
-        if (enable && loadedSpellCheckingLanguages().isEmpty())
+        if (enable && Ewk_Text_Checker::loadedSpellCheckingLanguages().isEmpty())
             spellCheckingLanguagesSet(Vector<String>());
 
         if (ewkTextCheckerSettings.onContinuousSpellChecking)
@@ -238,7 +238,7 @@
 {
     Eina_List* listOflanguages = 0;
 #if ENABLE(SPELLCHECK)
-    Vector<String> languages = availableSpellCheckingLanguages();
+    const Vector<String>& languages = Ewk_Text_Checker::availableSpellCheckingLanguages();
     size_t numberOfLanuages = languages.size();
 
     for (size_t i = 0; i < numberOfLanuages; ++i)
@@ -261,7 +261,7 @@
 {
     Eina_List* listOflanguages = 0;
 #if ENABLE(SPELLCHECK)
-    Vector<String> languages = loadedSpellCheckingLanguages();
+    Vector<String> languages = Ewk_Text_Checker::loadedSpellCheckingLanguages();
     size_t numberOfLanuages = languages.size();
 
     for (size_t i = 0; i < numberOfLanuages; ++i)

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_text_checker.cpp (132656 => 132657)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_text_checker.cpp	2012-10-26 14:58:17 UTC (rev 132656)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_text_checker.cpp	2012-10-26 14:58:31 UTC (rev 132657)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2012 Samsung Electronics
+ * Copyright (C) 2012 Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -28,38 +29,149 @@
 
 #if ENABLE(SPELLCHECK)
 
+#include "TextCheckerEnchant.h"
+#include "WKAPICast.h"
+#include "WKMutableArray.h"
+#include "WKRetainPtr.h"
+#include "WKString.h"
 #include "WKTextChecker.h"
-#include "WebKitTextChecker.h"
+#include "WebPageProxy.h"
+#include "WebString.h"
+#include "ewk_settings.h"
 #include "ewk_text_checker_private.h"
+#include <Eina.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/text/CString.h>
 
+using namespace WebCore;
 using namespace WebKit;
 
-// Initializes the client's functions to @c 0 to be sure that they are not defined.
-static Ewk_Text_Checker ewkTextCheckerCallbacks = {
-    0, // unique_spell_document_tag_get
-    0, // unique_spell_document_tag_close
-    0, // string_spelling_check
-    0, // word_guesses_get
-    0, // word_learn
-    0 // word_ignore
+/**
+ * @brief Structure to store client callback functions.
+ *
+ * @internal
+ */
+struct ClientCallbacks {
+    Ewk_Text_Checker_Unique_Spell_Document_Tag_Get_Cb unique_spell_document_tag_get;
+    Ewk_Text_Checker_Unique_Spell_Document_Tag_Close_Cb unique_spell_document_tag_close;
+    Ewk_Text_Checker_String_Spelling_Check_Cb string_spelling_check;
+    Ewk_Text_Checker_Word_Guesses_Get_Cb word_guesses_get;
+    Ewk_Text_Checker_Word_Learn_Cb word_learn;
+    Ewk_Text_Checker_Word_Ignore_Cb word_ignore;
 };
 
-#define EWK_TEXT_CHECKER_CALLBACK_SET(TYPE_NAME, NAME)  \
-void ewk_text_checker_##NAME##_cb_set(TYPE_NAME cb)     \
-{                                                       \
-    ewkTextCheckerCallbacks.NAME = cb;                  \
+static inline TextCheckerEnchant* textCheckerEnchant()
+{
+    static OwnPtr<TextCheckerEnchant> textCheckerEnchant = TextCheckerEnchant::create();
+    return textCheckerEnchant.get();
 }
 
+static inline ClientCallbacks& clientCallbacks()
+{
+    DEFINE_STATIC_LOCAL(ClientCallbacks, clientCallbacks, ());
+    return clientCallbacks;
+}
+
+static bool isContinuousSpellCheckingEnabled(const void*)
+{
+    return ewk_settings_continuous_spell_checking_enabled_get();
+}
+
+static void setContinuousSpellCheckingEnabled(bool enabled, const void*)
+{
+    ewk_settings_continuous_spell_checking_enabled_set(enabled);
+}
+
+static uint64_t uniqueSpellDocumentTag(WKPageRef page, const void*)
+{
+    if (clientCallbacks().unique_spell_document_tag_get)
+        return clientCallbacks().unique_spell_document_tag_get(toImpl(page)->viewWidget());
+
+    return 0;
+}
+
+static void closeSpellDocumentWithTag(uint64_t tag, const void*)
+{
+    if (clientCallbacks().unique_spell_document_tag_close)
+        clientCallbacks().unique_spell_document_tag_close(tag);
+}
+
+static void checkSpellingOfString(uint64_t tag, WKStringRef text, int32_t* misspellingLocation, int32_t* misspellingLength, const void*)
+{
+    if (clientCallbacks().string_spelling_check)
+        clientCallbacks().string_spelling_check(tag, toImpl(text)->string().utf8().data(), misspellingLocation, misspellingLength);
+    else
+        textCheckerEnchant()->checkSpellingOfString(toImpl(text)->string(), *misspellingLocation, *misspellingLength);
+}
+
+static WKArrayRef guessesForWord(uint64_t tag, WKStringRef word, const void*)
+{
+    WKMutableArrayRef suggestionsForWord = WKMutableArrayCreate();
+
+    if (clientCallbacks().word_guesses_get) {
+        Eina_List* list = clientCallbacks().word_guesses_get(tag, toImpl(word)->string().utf8().data());
+        void* item;
+
+        EINA_LIST_FREE(list, item) {
+            WKRetainPtr<WKStringRef> suggestion(AdoptWK, WKStringCreateWithUTF8CString(static_cast<const char*>(item)));
+            WKArrayAppendItem(suggestionsForWord, suggestion.get());
+            free(item);
+        }
+    } else {
+        const Vector<String>& guesses = textCheckerEnchant()->getGuessesForWord(toImpl(word)->string());
+        size_t numberOfGuesses = guesses.size();
+        for (size_t i = 0; i < numberOfGuesses; ++i) {
+            WKRetainPtr<WKStringRef> suggestion(AdoptWK, WKStringCreateWithUTF8CString(guesses[i].utf8().data()));
+            WKArrayAppendItem(suggestionsForWord, suggestion.get());
+        }
+    }
+
+    return suggestionsForWord;
+}
+
+static void learnWord(uint64_t tag, WKStringRef word, const void*)
+{
+    if (clientCallbacks().word_learn)
+        clientCallbacks().word_learn(tag, toImpl(word)->string().utf8().data());
+    else
+        textCheckerEnchant()->learnWord(toImpl(word)->string());
+}
+
+static void ignoreWord(uint64_t tag, WKStringRef word, const void*)
+{
+    if (clientCallbacks().word_ignore)
+        clientCallbacks().word_ignore(tag, toImpl(word)->string().utf8().data());
+    else
+        textCheckerEnchant()->ignoreWord(toImpl(word)->string());
+}
+
+namespace Ewk_Text_Checker {
+
+Vector<String> availableSpellCheckingLanguages()
+{
+    return textCheckerEnchant()->availableSpellCheckingLanguages();
+}
+
+void updateSpellCheckingLanguages(const Vector<String>& languages)
+{
+    textCheckerEnchant()->updateSpellCheckingLanguages(languages);
+}
+
+Vector<String> loadedSpellCheckingLanguages()
+{
+    return textCheckerEnchant()->loadedSpellCheckingLanguages();
+}
+
 /**
- * Attaches spellchecker feature.
+ * Initializes spellcheck feature.
  *
  * @internal
  *
- * The default spellchecker feature is based on Enchant library.
- * Client may use own implementation of spellchecker previously set
+ * The default spellcheck feature is based on Enchant library.
+ * Client may use own spellcheck implementation previously set
  * through the callback functions.
  */
-void ewk_text_checker_client_attach()
+void initialize()
 {
     static bool didInitializeTextCheckerClient = false;
     if (didInitializeTextCheckerClient)
@@ -90,21 +202,12 @@
     didInitializeTextCheckerClient = true;
 }
 
-/*
- * Gets the client's callbacks.
- *
- * @internal
- *
- * The client't callbacks are not defined by default.
- * If the client hasn't set the callback, the corresponding callback will
- * return @c 0 and the default WebKit implementation will be used for this
- * functionality.
- *
- * @return the struct with the client's callbacks.
- */
-Ewk_Text_Checker* ewk_text_checker_callbacks_get()
-{
-    return &ewkTextCheckerCallbacks;
+} // namespace Ewk_Text_Checker
+
+#define EWK_TEXT_CHECKER_CALLBACK_SET(TYPE_NAME, NAME)  \
+void ewk_text_checker_##NAME##_cb_set(TYPE_NAME cb)     \
+{                                                       \
+    clientCallbacks().NAME = cb;      \
 }
 
 #else

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_private.h (132656 => 132657)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_private.h	2012-10-26 14:58:17 UTC (rev 132656)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_private.h	2012-10-26 14:58:31 UTC (rev 132657)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2012 Samsung Electronics
+ * Copyright (C) 2012 Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -30,24 +31,16 @@
 
 #include "ewk_text_checker.h"
 
-/**
- * @brief Structure keeps client's callback functions.
- *
- * @internal
- */
-struct Ewk_Text_Checker {
-    Ewk_Text_Checker_Unique_Spell_Document_Tag_Get_Cb unique_spell_document_tag_get;
-    Ewk_Text_Checker_Unique_Spell_Document_Tag_Close_Cb unique_spell_document_tag_close;
-    Ewk_Text_Checker_String_Spelling_Check_Cb string_spelling_check;
-    Ewk_Text_Checker_Word_Guesses_Get_Cb word_guesses_get;
-    Ewk_Text_Checker_Word_Learn_Cb word_learn;
-    Ewk_Text_Checker_Word_Ignore_Cb word_ignore;
-};
+namespace Ewk_Text_Checker {
 
-Ewk_Text_Checker* ewk_text_checker_callbacks_get();
+void initialize();
 
-// Makes it visible for WTR.
-EAPI void ewk_text_checker_client_attach();
+// Enchant helpers.
+Vector<String> availableSpellCheckingLanguages();
+void updateSpellCheckingLanguages(const Vector<String>& languages);
+Vector<String> loadedSpellCheckingLanguages();
 
+}
+
 #endif // ENABLE(SPELLCHECK)
 #endif // ewk_text_checker_private_h

Deleted: trunk/Source/WebKit2/UIProcess/efl/WebKitTextChecker.cpp (132656 => 132657)


--- trunk/Source/WebKit2/UIProcess/efl/WebKitTextChecker.cpp	2012-10-26 14:58:17 UTC (rev 132656)
+++ trunk/Source/WebKit2/UIProcess/efl/WebKitTextChecker.cpp	2012-10-26 14:58:31 UTC (rev 132657)
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 2012 Samsung Electronics
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WebKitTextChecker.h"
-
-#if ENABLE(SPELLCHECK)
-
-#include "NotImplemented.h"
-#include "WKAPICast.h"
-#include "WKMutableArray.h"
-#include "WKRetainPtr.h"
-#include "WebPageProxy.h"
-#include "WebString.h"
-#include "ewk_settings.h"
-#include "ewk_text_checker_private.h"
-#include <Eina.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/text/CString.h>
-
-namespace WebKit {
-
-static OwnPtr<WebCore::TextCheckerEnchant> textCheckerEnchant = WebCore::TextCheckerEnchant::create();
-
-static Ewk_Text_Checker* ewkTextCheckerCallbacks = ewk_text_checker_callbacks_get();
-
-bool isContinuousSpellCheckingEnabled(const void*)
-{
-    return ewk_settings_continuous_spell_checking_enabled_get();
-}
-
-void setContinuousSpellCheckingEnabled(bool enabled, const void*)
-{
-    ewk_settings_continuous_spell_checking_enabled_set(enabled);
-}
-
-uint64_t uniqueSpellDocumentTag(WKPageRef page, const void*)
-{
-    if (ewkTextCheckerCallbacks->unique_spell_document_tag_get)
-        return ewkTextCheckerCallbacks->unique_spell_document_tag_get(toImpl(page)->viewWidget());
-
-    return 0;
-}
-
-void closeSpellDocumentWithTag(uint64_t tag, const void*)
-{
-    if (ewkTextCheckerCallbacks->unique_spell_document_tag_close)
-        ewkTextCheckerCallbacks->unique_spell_document_tag_close(tag);
-}
-
-void checkSpellingOfString(uint64_t tag, WKStringRef text, int32_t* misspellingLocation, int32_t* misspellingLength, const void*)
-{
-    if (ewkTextCheckerCallbacks->string_spelling_check)
-        ewkTextCheckerCallbacks->string_spelling_check(tag, toImpl(text)->string().utf8().data(), misspellingLocation, misspellingLength);
-    else
-        textCheckerEnchant->checkSpellingOfString(toImpl(text)->string(), *misspellingLocation, *misspellingLength);
-}
-
-WKArrayRef guessesForWord(uint64_t tag, WKStringRef word, const void*)
-{
-    WKMutableArrayRef suggestionsForWord = WKMutableArrayCreate();
-
-    if (ewkTextCheckerCallbacks->word_guesses_get) {
-        Eina_List* list = ewkTextCheckerCallbacks->word_guesses_get(tag, toImpl(word)->string().utf8().data());
-        void* item;
-
-        EINA_LIST_FREE(list, item) {
-            WKRetainPtr<WKStringRef> suggestion(AdoptWK, WKStringCreateWithUTF8CString(static_cast<char*>(item)));
-            WKArrayAppendItem(suggestionsForWord, suggestion.get());
-            free(item);
-        }
-    } else {
-        Vector<String> guesses = textCheckerEnchant->getGuessesForWord(toImpl(word)->string());
-        size_t numberOfGuesses = guesses.size();
-        for (size_t i = 0; i < numberOfGuesses; ++i) {
-            WKRetainPtr<WKStringRef> suggestion(AdoptWK, WKStringCreateWithUTF8CString(guesses[i].utf8().data()));
-            WKArrayAppendItem(suggestionsForWord, suggestion.get());
-        }
-    }
-
-    return suggestionsForWord;
-}
-
-void learnWord(uint64_t tag, WKStringRef word, const void*)
-{
-    if (ewkTextCheckerCallbacks->word_learn)
-        ewkTextCheckerCallbacks->word_learn(tag, toImpl(word)->string().utf8().data());
-    else
-        textCheckerEnchant->learnWord(toImpl(word)->string());
-}
-
-void ignoreWord(uint64_t tag, WKStringRef word, const void*)
-{
-    if (ewkTextCheckerCallbacks->word_ignore)
-        ewkTextCheckerCallbacks->word_ignore(tag, toImpl(word)->string().utf8().data());
-    else
-        textCheckerEnchant->ignoreWord(toImpl(word)->string());
-}
-
-Vector<String> availableSpellCheckingLanguages()
-{
-    return textCheckerEnchant->availableSpellCheckingLanguages();
-}
-
-void updateSpellCheckingLanguages(const Vector<String>& languages)
-{
-    textCheckerEnchant->updateSpellCheckingLanguages(languages);
-}
-
-Vector<String> loadedSpellCheckingLanguages()
-{
-    return textCheckerEnchant->loadedSpellCheckingLanguages();
-}
-
-} // namespace WebKit
-
-#endif // ENABLE(SPELLCHECK)

Deleted: trunk/Source/WebKit2/UIProcess/efl/WebKitTextChecker.h (132656 => 132657)


--- trunk/Source/WebKit2/UIProcess/efl/WebKitTextChecker.h	2012-10-26 14:58:17 UTC (rev 132656)
+++ trunk/Source/WebKit2/UIProcess/efl/WebKitTextChecker.h	2012-10-26 14:58:31 UTC (rev 132657)
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2012 Samsung Electronics
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WebKitTextChecker_h
-#define WebKitTextChecker_h
-
-#if ENABLE(SPELLCHECK)
-
-#include "TextCheckerEnchant.h"
-#include "WKArray.h"
-#include "WKPage.h"
-#include "WKString.h"
-
-namespace WebKit {
-
-// The functions mainly choose between client's implementation of spelling and the WebKit one.
-
-// Callbacks required by WKTextChecker.
-bool isContinuousSpellCheckingEnabled(const void* clientInfo);
-void setContinuousSpellCheckingEnabled(bool enabled, const void* clientInfo);
-
-uint64_t uniqueSpellDocumentTag(WKPageRef, const void* clientInfo);
-void closeSpellDocumentWithTag(uint64_t tag, const void* clientInfo);
-
-void checkSpellingOfString(uint64_t tag, WKStringRef text, int32_t* misspellingLocation, int32_t* misspellingLength, const void* clientInfo);
-WKArrayRef guessesForWord(uint64_t tag, WKStringRef word, const void* clientInfo);
-void learnWord(uint64_t tag, WKStringRef word, const void* clientInfo);
-void ignoreWord(uint64_t tag, WKStringRef word, const void* clientInfo);
-
-// Enchant's helper.
-Vector<String> availableSpellCheckingLanguages();
-void updateSpellCheckingLanguages(const Vector<String>& languages);
-Vector<String> loadedSpellCheckingLanguages();
-
-} // namespace WebKit
-
-#endif // ENABLE(SPELLCHECK)
-#endif // WebKitTextChecker_h
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to