Changeset 21081 in webkit


Ignore:
Timestamp:
Apr 24, 2007 9:22:56 PM (17 years ago)
Author:
sfalken
Message:

2007-04-24 Steve Falkenburg <sfalken@apple.com>

Reviewed by Darin, Oliver.

Refactor spelling codepaths

  • bridge/EditorClient.h:
  • page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected):
  • platform/ContextMenu.cpp: (WebCore::ContextMenu::populate): (WebCore::ContextMenu::checkOrEnableIfNeeded):
  • platform/gdk/EditorClientGdk.cpp: (WebCore::EditorClientGdk::ignoreWordInSpellDocument): (WebCore::EditorClientGdk::learnWord): (WebCore::EditorClientGdk::checkSpellingOfString): (WebCore::EditorClientGdk::checkGrammarOfString): (WebCore::EditorClientGdk::udpateSpellingUIWithGrammarString): (WebCore::EditorClientGdk::updateSpellingUIWithMisspelledWord): (WebCore::EditorClientGdk::showSpellingUI): (WebCore::EditorClientGdk::spellingUIIsShowing): (WebCore::EditorClientGdk::getGuessesForWord):
  • platform/gdk/EditorClientGdk.h:

2007-04-24 Steve Falkenburg <sfalken@apple.com>

Reviewed by Oliver.


Spelling and grammar stubs

  • WebCoreSupport/EditorClientQt.cpp: (WebCore::EditorClientQt::ignoreWordInSpellDocument): (WebCore::EditorClientQt::learnWord): (WebCore::EditorClientQt::checkSpellingOfString): (WebCore::EditorClientQt::checkGrammarOfString): (WebCore::EditorClientQt::udpateSpellingUIWithGrammarString): (WebCore::EditorClientQt::updateSpellingUIWithMisspelledWord): (WebCore::EditorClientQt::showSpellingUI): (WebCore::EditorClientQt::spellingUIIsShowing): (WebCore::EditorClientQt::getGuessesForWord):
  • WebCoreSupport/EditorClientQt.h:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r21079 r21081  
     12007-04-24  Steve Falkenburg  <sfalken@apple.com>
     2
     3        Reviewed by Darin, Oliver.
     4
     5        Refactor spelling codepaths
     6
     7        * bridge/EditorClient.h:
     8        * page/ContextMenuController.cpp:
     9        (WebCore::ContextMenuController::contextMenuItemSelected):
     10        * platform/ContextMenu.cpp:
     11        (WebCore::ContextMenu::populate):
     12        (WebCore::ContextMenu::checkOrEnableIfNeeded):
     13        * platform/gdk/EditorClientGdk.cpp:
     14        (WebCore::EditorClientGdk::ignoreWordInSpellDocument):
     15        (WebCore::EditorClientGdk::learnWord):
     16        (WebCore::EditorClientGdk::checkSpellingOfString):
     17        (WebCore::EditorClientGdk::checkGrammarOfString):
     18        (WebCore::EditorClientGdk::udpateSpellingUIWithGrammarString):
     19        (WebCore::EditorClientGdk::updateSpellingUIWithMisspelledWord):
     20        (WebCore::EditorClientGdk::showSpellingUI):
     21        (WebCore::EditorClientGdk::spellingUIIsShowing):
     22        (WebCore::EditorClientGdk::getGuessesForWord):
     23        * platform/gdk/EditorClientGdk.h:
     24
    1252007-04-24  Darin Adler  <darin@apple.com>
    226
  • trunk/WebCore/bridge/EditorClient.h

    r20108 r21081  
    2929
    3030#include "EditorInsertAction.h"
     31#include "PlatformString.h"
    3132#include "TextAffinity.h"
    3233#include <wtf/Forward.h>
     34#include <wtf/Vector.h>
    3335
    3436#if PLATFORM(MAC)
     
    4951class Node;
    5052class Range;
     53class Selection;
    5154class String;
     55class VisiblePosition;
     56
     57struct GrammarDetail {
     58    int location;
     59    int length;
     60    Vector<String> guesses;
     61    String userDescription;
     62};
    5263
    5364class EditorClient {
     
    118129    virtual NSArray* pasteboardTypesForSelection(Frame*) = 0;
    119130#endif
     131#else
     132    virtual void ignoreWordInSpellDocument(const String&) = 0;
     133    virtual void learnWord(const String&) = 0;
     134    virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength) = 0;
     135    virtual void checkGrammarOfString(const UChar*, int length, Vector<GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength) = 0;
     136    virtual void udpateSpellingUIWithGrammarString(const String&, const Vector<String>& guesses) = 0;
     137    virtual void updateSpellingUIWithMisspelledWord(const String&) = 0;
     138    virtual void showSpellingUI(bool show) = 0;
     139    virtual bool spellingUIIsShowing() = 0;
     140    virtual void getGuessesForWord(const String&, Vector<String>& guesses) = 0;
    120141#endif
    121142
  • trunk/WebCore/page/ContextMenuController.cpp

    r20921 r21081  
    244244            m_client->searchWithSpotlight();
    245245            break;
     246#endif
    246247        case ContextMenuItemTagShowSpellingPanel:
    247248            frame->editor()->showSpellingGuessPanel();
     
    258259            break;
    259260#endif
     261#if PLATFORM(MAC)
    260262        case ContextMenuItemTagShowFonts:
    261263            frame->editor()->showFontPanel();
  • trunk/WebCore/platform/ContextMenu.cpp

    r20862 r21081  
    337337        if (!inPasswordField) {
    338338            appendItem(*separatorItem());
    339 #if PLATFORM(MAC)
    340339#ifndef BUILDING_ON_TIGER
    341340            ContextMenuItem SpellingAndGrammarMenuItem(SubmenuType, ContextMenuItemTagSpellingMenu,
     
    349348            appendItem(SpellingMenuItem);
    350349#endif
    351 #endif
    352350            ContextMenuItem  FontMenuItem(SubmenuType, ContextMenuItemTagFontMenu,
    353351                contextMenuItemTagFontMenu());
     
    453451            shouldEnable = false;
    454452            break;
    455 #if PLATFORM(MAC)
    456453        case ContextMenuItemTagShowSpellingPanel:
    457454#ifndef BUILDING_ON_TIGER
     
    463460            shouldEnable = frame->editor()->canEdit();
    464461            break;
    465 #endif
    466462        case ContextMenuItemTagNoGuessesFound:
    467463            shouldEnable = false;
  • trunk/WebCore/platform/gdk/EditorClientGdk.cpp

    r20216 r21081  
    296296}
    297297
     298void EditorClientGdk::ignoreWordInSpellDocument(const String&)
     299{
     300    notImplementedGdk();
     301}
     302
     303void EditorClientGdk::learnWord(const String&)
     304{
     305    notImplementedGdk();
     306}
     307
     308void EditorClientGdk::checkSpellingOfString(const UChar*, int, int*, int*)
     309{
     310    notImplementedGdk();
     311}
     312
     313void EditorClientGdk::checkGrammarOfString(const UChar*, int, Vector<GrammarDetail>&, int*, int*)
     314{
     315    notImplementedGdk();
     316}
     317
     318void EditorClientGdk::udpateSpellingUIWithGrammarString(const String&, const Vector<String>&)
     319{
     320    notImplementedGdk();
     321}
     322
     323void EditorClientGdk::updateSpellingUIWithMisspelledWord(const String&)
     324{
     325    notImplementedGdk();
     326}
     327
     328void EditorClientGdk::showSpellingUI(bool)
     329{
     330    notImplementedGdk();
     331}
     332
     333bool EditorClientGdk::spellingUIIsShowing()
     334{
     335    notImplementedGdk();
     336    return false;
     337}
     338
     339void EditorClientGdk::getGuessesForWord(const String&, Vector<String>&)
     340{
     341    notImplementedGdk();
     342}
     343
    298344}
    299345
  • trunk/WebCore/platform/gdk/EditorClientGdk.h

    r20111 r21081  
    9393    virtual void textDidChangeInTextArea(Element*);
    9494
     95    virtual void ignoreWordInSpellDocument(const String&);
     96    virtual void learnWord(const String&);
     97    virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength);
     98    virtual void checkGrammarOfString(const UChar*, int length, Vector<GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength);
     99    virtual void udpateSpellingUIWithGrammarString(const String&, const Vector<String>& guesses);
     100    virtual void updateSpellingUIWithMisspelledWord(const String&);
     101    virtual void showSpellingUI(bool show);
     102    virtual bool spellingUIIsShowing();
     103    virtual void getGuessesForWord(const String&, Vector<String>& guesses);
     104
    95105    // EditorClientGdk only
    96106    void setPage(Page*);
  • trunk/WebKitQt/ChangeLog

    r20856 r21081  
     12007-04-24  Steve Falkenburg  <sfalken@apple.com>
     2
     3        Reviewed by Oliver.
     4       
     5        Spelling and grammar stubs
     6
     7        * WebCoreSupport/EditorClientQt.cpp:
     8        (WebCore::EditorClientQt::ignoreWordInSpellDocument):
     9        (WebCore::EditorClientQt::learnWord):
     10        (WebCore::EditorClientQt::checkSpellingOfString):
     11        (WebCore::EditorClientQt::checkGrammarOfString):
     12        (WebCore::EditorClientQt::udpateSpellingUIWithGrammarString):
     13        (WebCore::EditorClientQt::updateSpellingUIWithMisspelledWord):
     14        (WebCore::EditorClientQt::showSpellingUI):
     15        (WebCore::EditorClientQt::spellingUIIsShowing):
     16        (WebCore::EditorClientQt::getGuessesForWord):
     17        * WebCoreSupport/EditorClientQt.h:
     18
    1192007-04-11  MorganL  <morganl.webkit@yahoo.com>
    220
  • trunk/WebKitQt/WebCoreSupport/EditorClientQt.cpp

    r20235 r21081  
    302302}
    303303
     304void EditorClientQt::ignoreWordInSpellDocument(const String&)
     305{
     306    notImplemented();
     307}
     308
     309void EditorClientQt::learnWord(const String&)
     310{
     311    notImplemented();
     312}
     313
     314void EditorClientQt::checkSpellingOfString(const UChar*, int, int*, int*)
     315{
     316    notImplemented();
     317}
     318
     319void EditorClientQt::checkGrammarOfString(const UChar*, int, Vector<GrammarDetail>&, int*, int*)
     320{
     321    notImplemented();
     322}
     323
     324void EditorClientQt::udpateSpellingUIWithGrammarString(const String&, const Vector<String>&)
     325{
     326    notImplemented();
     327}
     328
     329void EditorClientQt::updateSpellingUIWithMisspelledWord(const String&)
     330{
     331    notImplemented();
     332}
     333
     334void EditorClientQt::showSpellingUI(bool)
     335{
     336    notImplemented();
     337}
     338
     339bool EditorClientQt::spellingUIIsShowing()
     340{
     341    notImplemented();
     342    return false;
     343}
     344
     345void EditorClientQt::getGuessesForWord(const String&, Vector<String>&)
     346{
     347    notImplemented();
     348}
     349
    304350bool EditorClientQt::isEditing() const
    305351{
  • trunk/WebKitQt/WebCoreSupport/EditorClientQt.h

    r20108 r21081  
    9393    virtual void textDidChangeInTextArea(Element*);
    9494
     95    virtual void ignoreWordInSpellDocument(const String&);
     96    virtual void learnWord(const String&);
     97    virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength);
     98    virtual void checkGrammarOfString(const UChar*, int length, Vector<GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength);
     99    virtual void udpateSpellingUIWithGrammarString(const String&, const Vector<String>& guesses);
     100    virtual void updateSpellingUIWithMisspelledWord(const String&);
     101    virtual void showSpellingUI(bool show);
     102    virtual bool spellingUIIsShowing();
     103    virtual void getGuessesForWord(const String&, Vector<String>& guesses);
     104
    95105    bool isEditing() const;
    96106
Note: See TracChangeset for help on using the changeset viewer.