WebCore:
Reviewed by Adam.
Primarily, this patch implements/hooks-up actions for the sub-menu
items in WebCore context menus. I fixed a few other things along
the way too:
-Made BUILDING_ON_TIGER ifdef work within C++ as well as
Obj-C
-Fixed bug where we would throw and Obj-C exception and
fail to pop up menus with more than one separator item.
-Re-named some of the spelling/grammar tags since Tiger and
Leopard share more of the actions than initially
anticipated.
* WebCorePrefix.h: Make BUILDING_ON_TIGER available to C++
* bridge/EditorClient.h: New functions to toggle
spelling/grammar checking.
* editing/Editor.cpp:
(WebCore::Editor::toggleContinuousSpellChecking): Call into client.
(WebCore::Editor::toggleGrammarChecking): Same.
(WebCore::Editor::toggleBold): call execToggleBold()
(WebCore::Editor::toggleUnderline): Create appropriate underline
style and apply to selection.
(WebCore::Editor::setBaseWritingDirection): Create appropriate
writing direction and apply to selection.
* editing/Editor.h:
* editing/mac/EditorMac.mm: New functions to show spelling guesses,
fonts, styles, and color panels.
* page/ContextMenuClient.h: New functions for the speech sub-menu.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected): Fill in
editing sub-menu actions.
* platform/ContextMenu.cpp:
(WebCore::separatorItem): Helper function to create a separator
item.
(WebCore::createFontSubMenu): Put very mac-specific things within a
platform ifdef.
(WebCore::createSpellingAndGrammarSubMenu): Re-named some of the
spelling sub-menu tags.
(WebCore::createSpellingSubMenu): Same.
(WebCore::ContextMenu::populate): We can't share the separator
item. When we do, menus with more than one separator throw and obj-
c exception and fail to pop-up.
* platform/ContextMenuItem.h:
(WebCore::): Re-named some of the spelling sub-menu tags.
WebKit:
Reviewed by Adam.
WebKit support for editing sub-menu actions.
* WebCoreSupport/WebContextMenuClient.h: New functions for the
speech sub-menu.
* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::speak):
(WebContextMenuClient::stopSpeaking):
* WebCoreSupport/WebEditorClient.h: New functions to toggle
spelling/grammar checking.
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::toggleContinuousSpellChecking):
(WebEditorClient::toggleGrammarChecking):
* WebView/WebUIDelegatePrivate.h: Re-named some of the spelling
sub-menu tags.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@18166 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/bridge/EditorClient.h b/WebCore/bridge/EditorClient.h
index 0bc89050..92f95ef 100644
--- a/WebCore/bridge/EditorClient.h
+++ b/WebCore/bridge/EditorClient.h
@@ -51,9 +51,11 @@
virtual bool shouldDeleteRange(Range*) = 0;
virtual bool shouldShowDeleteInterface(HTMLElement*) = 0;
- virtual bool smartInsertDeleteEnabled() = 0;
+ virtual bool smartInsertDeleteEnabled() = 0;
virtual bool isContinuousSpellCheckingEnabled() = 0;
+ virtual void toggleContinuousSpellChecking() = 0;
virtual bool isGrammarCheckingEnabled() = 0;
+ virtual void toggleGrammarChecking() = 0;
virtual int spellCheckerDocumentTag() = 0;
virtual bool selectWordBeforeMenuEvent() = 0;