webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
EditingDelegate.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007, 2015 Apple Inc. All rights reserved.
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  *
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of Apple Inc. ("Apple") nor the names of
14  * its contributors may be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef EditingDelegate_h
30 #define EditingDelegate_h
31 
32 #include <WebKit/WebKit.h>
33 
34 class __declspec(uuid("265DCD4B-79C3-44a2-84BC-511C3EDABD6F")) EditingDelegate : public IWebEditingDelegate2, public IWebNotificationObserver {
35 public:
37 
38  void setAcceptsEditing(bool b) { m_acceptsEditing = b; }
39 
40  // IUnknown
41  virtual HRESULT STDMETHODCALLTYPE QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppvObject);
42  virtual ULONG STDMETHODCALLTYPE AddRef();
43  virtual ULONG STDMETHODCALLTYPE Release();
44 
45  // IWebEditingDelegate
46  virtual HRESULT STDMETHODCALLTYPE shouldBeginEditingInDOMRange(_In_opt_ IWebView*, _In_opt_ IDOMRange*, _Out_ BOOL* result);
47  virtual HRESULT STDMETHODCALLTYPE shouldEndEditingInDOMRange(_In_opt_ IWebView*, _In_opt_ IDOMRange*, _Out_ BOOL* result);
48  virtual HRESULT STDMETHODCALLTYPE shouldInsertNode(_In_opt_ IWebView*, _In_opt_ IDOMNode*, _In_opt_ IDOMRange*, WebViewInsertAction);
49  virtual HRESULT STDMETHODCALLTYPE shouldInsertText(_In_opt_ IWebView*, _In_ BSTR text, _In_opt_ IDOMRange*, WebViewInsertAction, _Out_ BOOL* result);
50  virtual HRESULT STDMETHODCALLTYPE shouldDeleteDOMRange(_In_opt_ IWebView*, _In_opt_ IDOMRange*, _Out_ BOOL* result);
51  virtual HRESULT STDMETHODCALLTYPE shouldChangeSelectedDOMRange(_In_opt_ IWebView*, _In_opt_ IDOMRange*, _In_opt_ IDOMRange*,
52  WebSelectionAffinity, BOOL stillSelecting, _Out_ BOOL* result);
53  virtual HRESULT STDMETHODCALLTYPE shouldApplyStyle(_In_opt_ IWebView*, _In_opt_ IDOMCSSStyleDeclaration*, _In_opt_ IDOMRange*, _Out_ BOOL* result);
54  virtual HRESULT STDMETHODCALLTYPE shouldChangeTypingStyle(_In_opt_ IWebView*, _In_opt_ IDOMCSSStyleDeclaration* currentStyle,
55  _In_opt_ IDOMCSSStyleDeclaration* proposedStyle, _Out_ BOOL* result);
56  virtual HRESULT STDMETHODCALLTYPE doPlatformCommand(_In_opt_ IWebView*, _In_ BSTR command, _Out_ BOOL* result);
57  virtual HRESULT STDMETHODCALLTYPE webViewDidBeginEditing(_In_opt_ IWebNotification*);
58  virtual HRESULT STDMETHODCALLTYPE webViewDidChange(_In_opt_ IWebNotification*);
59  virtual HRESULT STDMETHODCALLTYPE webViewDidEndEditing(_In_opt_ IWebNotification*);
60  virtual HRESULT STDMETHODCALLTYPE webViewDidChangeTypingStyle(_In_opt_ IWebNotification*);
61  virtual HRESULT STDMETHODCALLTYPE webViewDidChangeSelection(_In_opt_ IWebNotification*);
62  virtual HRESULT STDMETHODCALLTYPE undoManagerForWebView(_In_opt_ IWebView*, _COM_Outptr_opt_ IWebUndoManager **);
63  virtual HRESULT STDMETHODCALLTYPE ignoreWordInSpellDocument(_In_opt_ IWebView*, _In_ BSTR word) { return E_NOTIMPL; }
64  virtual HRESULT STDMETHODCALLTYPE learnWord(_In_ BSTR word) { return E_NOTIMPL; }
65  virtual HRESULT STDMETHODCALLTYPE checkSpellingOfString(_In_opt_ IWebView*, _In_ LPCTSTR text, int length, _Out_ int* misspellingLocation, _Out_ int* misspellingLength);
66  virtual HRESULT STDMETHODCALLTYPE checkGrammarOfString(_In_opt_ IWebView*, _In_ LPCTSTR text, int length, _COM_Outptr_opt_ IEnumWebGrammarDetails**,
67  _Out_ int* badGrammarLocation, _Out_ int* badGrammarLength);
68  virtual HRESULT STDMETHODCALLTYPE updateSpellingUIWithGrammarString(_In_ BSTR string, int location, int length, _In_ BSTR userDescription,
69  _In_opt_ BSTR* guesses, int guessesCount)
70  {
71  return E_NOTIMPL;
72  }
73 
74  virtual HRESULT STDMETHODCALLTYPE updateSpellingUIWithMisspelledWord(_In_ BSTR) { return E_NOTIMPL; }
75  virtual HRESULT STDMETHODCALLTYPE showSpellingUI(BOOL) { return E_NOTIMPL; }
76  virtual HRESULT STDMETHODCALLTYPE spellingUIIsShowing(_Out_ BOOL*) { return E_NOTIMPL; }
77  virtual HRESULT STDMETHODCALLTYPE guessesForWord(_In_ BSTR word, _COM_Outptr_opt_ IEnumSpellingGuesses** guesses);
78  virtual HRESULT STDMETHODCALLTYPE closeSpellDocument(_In_opt_ IWebView*) { return E_NOTIMPL; }
79  virtual HRESULT STDMETHODCALLTYPE sharedSpellCheckerExists(_Out_ BOOL*) { return E_NOTIMPL; }
80  virtual HRESULT STDMETHODCALLTYPE preflightChosenSpellServer() { return E_NOTIMPL; }
81  virtual HRESULT STDMETHODCALLTYPE updateGrammar() { return E_NOTIMPL; }
82 
83  // IWebNotificationObserver
84  virtual HRESULT STDMETHODCALLTYPE onNotify(_In_opt_ IWebNotification*);
85 
86  // IWebEditingDelegate2
87  virtual HRESULT STDMETHODCALLTYPE shouldInsertNode(_In_opt_ IWebView*, _In_opt_ IDOMNode*, _In_opt_ IDOMRange*, WebViewInsertAction, _Out_ BOOL* result);
88 
89 private:
90  ULONG m_refCount { 1 };
91  bool m_acceptsEditing { true };
92 };
93 
94 #endif // !defined(EditingDelegate_h)
HRESULT showSpellingUI([in] BOOL show)
BOOL
Definition: PlatformScreenIOS.mm:46
HRESULT spellingUIIsShowing([out, retval] BOOL *result)
Definition: XMLHttpRequest.idl:39
Definition: IWebNotification.idl:37
HRESULT undoManagerForWebView([in] IWebView *webView, [out, retval] IWebUndoManager **undoManager)
unsigned long ULONG
Definition: MD5.h:32
HRESULT shouldBeginEditingInDOMRange([in] IWebView *webView, [in] IDOMRange *range, [out, retval] BOOL *result)
HRESULT updateSpellingUIWithMisspelledWord([in] BSTR word)
HRESULT shouldChangeTypingStyle([in] IWebView *webView, [in] IDOMCSSStyleDeclaration *currentStyle, [in] IDOMCSSStyleDeclaration *proposedStyle, [out, retval] BOOL *result)
HRESULT webViewDidEndEditing([in] IWebNotification *notification)
HRESULT
Definition: RenderThemeWin.cpp:150
HRESULT shouldInsertNode([in] IWebView *webView, [in] IDOMNode *node, [in] IDOMRange *range, [in] WebViewInsertAction action, [out, retval] BOOL *result)
HRESULT guessesForWord([in] BSTR word, [out, retval] IEnumSpellingGuesses **guesses)
HRESULT shouldDeleteDOMRange([in] IWebView *webView, [in] IDOMRange *range, [out, retval] BOOL *result)
Definition: IWebEditingDelegate.idl:195
sender AddRef()
GLint location
Definition: gl2.h:455
HRESULT shouldApplyStyle([in] IWebView *webView, [in] IDOMCSSStyleDeclaration *style, [in] IDOMRange *range, [out, retval] BOOL *result)
HRESULT checkGrammarOfString([in] IWebView *view, [in] LPCTSTR text, [in] int length, [out] IEnumWebGrammarDetails **grammarDetails, [out] int *badGrammarLocation, [out] int *badGrammarLength)
Definition: DOMCSS.idl:125
HRESULT ignoreWordInSpellDocument([in] IWebView *view, [in] BSTR word)
HRESULT doPlatformCommand([in] IWebView *webView, [in] BSTR command, [out, retval] BOOL *result)
enum _WebSelectionAffinity WebSelectionAffinity
Definition: EditingDelegate.h:32
Definition: IWebUndoManager.idl:40
wchar_t * BSTR
Definition: BString.h:36
HRESULT updateGrammar()
HRESULT webViewDidBeginEditing([in] IWebNotification *notification)
LPCWSTR LPCTSTR
Definition: WebKitGraphics.h:38
HRESULT shouldInsertText([in] IWebView *webView, [in] BSTR text, [in] IDOMRange *range, [in] WebViewInsertAction action, [out, retval] BOOL *result)
Definition: IWebNotificationObserver.idl:39
HRESULT shouldChangeSelectedDOMRange([in] IWebView *webView, [in] IDOMRange *currentRange, [in] IDOMRange *proposedRange, [in] WebSelectionAffinity selectionAffinity, [in] BOOL stillSelecting, [out, retval] BOOL *result)
HRESULT webViewDidChange([in] IWebNotification *notification)
HRESULT onNotify([in] IWebNotification *notification)
HRESULT closeSpellDocument([in] IWebView *view)
Definition: IWebEditingDelegate.idl:56
enum _WebViewInsertAction WebViewInsertAction
HRESULT updateSpellingUIWithGrammarString([in] BSTR string, [in] int location, [in] int length, [in] BSTR userDescription, [in] BSTR *guesses, [in] int guessesCount)
int Release(RepeatedCompositeContainer *self)
Definition: repeated_composite_container.cc:458
HRESULT webViewDidChangeTypingStyle([in] IWebNotification *notification)
HRESULT webViewDidChangeSelection([in] IWebNotification *notification)
result
Definition: target-blank-opener-post-window.php:5
Definition: IWebEditingDelegate.idl:84
Definition: DOMRange.idl:67
HRESULT checkSpellingOfString([in] IWebView *view, [in] LPCTSTR text, [in] int length, [out] int *misspellingLocation, [out] int *misspellingLength)
HRESULT shouldEndEditingInDOMRange([in] IWebView *webView, [in] IDOMRange *range, [out, retval] BOOL *result)
HRESULT preflightChosenSpellServer()
GLboolean GLboolean GLboolean b
Definition: gl2ext.h:306
HRESULT learnWord([in] BSTR word)
Definition: IWebView.idl:161
HRESULT sharedSpellCheckerExists([out, retval] BOOL *exists)
const GUID __declspec(selectany) SID_AccessibleComparable
Definition: DOMCore.idl:95
% % Enter the path to YOUR executable and remember to define the perprocessor % variable PRINT_MIPS te get the instructions printed to the screen % command
Definition: complexityMeasures.m:7
GLuint GLsizei GLsizei * length
Definition: gl2.h:435
coclass WebKit::WebKitMessageLoop uuid