webengine/osswebengine/WebKit/win/WebView.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2  * Copyright (C) 2006, 2007 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  * 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 APPLE COMPUTER, INC. ``AS IS'' AND ANY
       
    14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
       
    15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
       
    16  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. 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
       
    22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
       
    23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
       
    24  */
       
    25 
       
    26 #ifndef WebView_H
       
    27 #define WebView_H
       
    28 
       
    29 #include "COMPtr.h"
       
    30 #include "IWebNotificationObserver.h"
       
    31 #include "IWebUIDelegatePrivate.h"
       
    32 #include "IWebView.h"
       
    33 #include "IWebViewPrivate.h"
       
    34 #include "WebFrame.h"
       
    35 
       
    36 #include <WebCore/IntRect.h>
       
    37 #include <WebCore/Timer.h>
       
    38 #include <wtf/OwnPtr.h>
       
    39 
       
    40 class WebFrame;
       
    41 class WebBackForwardList;
       
    42 class WebInspectorClient;
       
    43 
       
    44 WebCore::Page* core(IWebView*);
       
    45 
       
    46 interface IDropTargetHelper;
       
    47 
       
    48 class WebView 
       
    49     : public IWebView
       
    50     , public IWebViewPrivate
       
    51     , public IWebIBActions
       
    52     , public IWebViewCSS
       
    53     , public IWebViewEditing
       
    54     , public IWebViewUndoableEditing
       
    55     , public IWebViewEditingActions
       
    56     , public IWebNotificationObserver
       
    57     , public IDropTarget
       
    58 {
       
    59 public:
       
    60     static WebView* createInstance();
       
    61 protected:
       
    62     WebView();
       
    63     ~WebView();
       
    64 
       
    65 public:
       
    66     // IUnknown
       
    67     virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
       
    68     virtual ULONG STDMETHODCALLTYPE AddRef(void);
       
    69     virtual ULONG STDMETHODCALLTYPE Release(void);
       
    70 
       
    71     // IWebView
       
    72 
       
    73     virtual HRESULT STDMETHODCALLTYPE canShowMIMEType( 
       
    74         /* [in] */ BSTR mimeType,
       
    75         /* [retval][out] */ BOOL *canShow);
       
    76     
       
    77     virtual HRESULT STDMETHODCALLTYPE canShowMIMETypeAsHTML( 
       
    78         /* [in] */ BSTR mimeType,
       
    79         /* [retval][out] */ BOOL *canShow);
       
    80     
       
    81     virtual HRESULT STDMETHODCALLTYPE MIMETypesShownAsHTML( 
       
    82         /* [retval][out] */ IEnumVARIANT **enumVariant);
       
    83     
       
    84     virtual HRESULT STDMETHODCALLTYPE setMIMETypesShownAsHTML( 
       
    85         /* [size_is][in] */ BSTR *mimeTypes,
       
    86         /* [in] */ int cMimeTypes);
       
    87     
       
    88     virtual HRESULT STDMETHODCALLTYPE URLFromPasteboard( 
       
    89         /* [in] */ IDataObject *pasteboard,
       
    90         /* [retval][out] */ BSTR *url);
       
    91     
       
    92     virtual HRESULT STDMETHODCALLTYPE URLTitleFromPasteboard( 
       
    93         /* [in] */ IDataObject *pasteboard,
       
    94         /* [retval][out] */ BSTR *urlTitle);
       
    95     
       
    96     virtual HRESULT STDMETHODCALLTYPE initWithFrame( 
       
    97         /* [in] */ RECT frame,
       
    98         /* [in] */ BSTR frameName,
       
    99         /* [in] */ BSTR groupName);
       
   100     
       
   101     virtual HRESULT STDMETHODCALLTYPE setUIDelegate( 
       
   102         /* [in] */ IWebUIDelegate *d);
       
   103     
       
   104     virtual HRESULT STDMETHODCALLTYPE uiDelegate( 
       
   105         /* [out][retval] */ IWebUIDelegate **d);
       
   106     
       
   107     virtual HRESULT STDMETHODCALLTYPE setResourceLoadDelegate( 
       
   108         /* [in] */ IWebResourceLoadDelegate *d);
       
   109     
       
   110     virtual HRESULT STDMETHODCALLTYPE resourceLoadDelegate( 
       
   111         /* [out][retval] */ IWebResourceLoadDelegate **d);
       
   112     
       
   113     virtual HRESULT STDMETHODCALLTYPE setDownloadDelegate( 
       
   114         /* [in] */ IWebDownloadDelegate *d);
       
   115     
       
   116     virtual HRESULT STDMETHODCALLTYPE downloadDelegate( 
       
   117         /* [out][retval] */ IWebDownloadDelegate **d);
       
   118     
       
   119     virtual HRESULT STDMETHODCALLTYPE setFrameLoadDelegate( 
       
   120         /* [in] */ IWebFrameLoadDelegate *d);
       
   121     
       
   122     virtual HRESULT STDMETHODCALLTYPE frameLoadDelegate( 
       
   123         /* [out][retval] */ IWebFrameLoadDelegate **d);
       
   124     
       
   125     virtual HRESULT STDMETHODCALLTYPE setPolicyDelegate( 
       
   126         /* [in] */ IWebPolicyDelegate *d);
       
   127     
       
   128     virtual HRESULT STDMETHODCALLTYPE policyDelegate( 
       
   129         /* [out][retval] */ IWebPolicyDelegate **d);
       
   130     
       
   131     virtual HRESULT STDMETHODCALLTYPE mainFrame( 
       
   132         /* [out][retval] */ IWebFrame **frame);
       
   133 
       
   134     virtual HRESULT STDMETHODCALLTYPE focusedFrame( 
       
   135         /* [out][retval] */ IWebFrame **frame);
       
   136     
       
   137     virtual HRESULT STDMETHODCALLTYPE backForwardList( 
       
   138         /* [out][retval] */ IWebBackForwardList **list);
       
   139     
       
   140     virtual HRESULT STDMETHODCALLTYPE setMaintainsBackForwardList( 
       
   141         /* [in] */ BOOL flag);
       
   142     
       
   143     virtual HRESULT STDMETHODCALLTYPE goBack( 
       
   144         /* [retval][out] */ BOOL *succeeded);
       
   145     
       
   146     virtual HRESULT STDMETHODCALLTYPE goForward( 
       
   147         /* [retval][out] */ BOOL *succeeded);
       
   148     
       
   149     virtual HRESULT STDMETHODCALLTYPE goToBackForwardItem( 
       
   150         /* [in] */ IWebHistoryItem *item,
       
   151         /* [retval][out] */ BOOL *succeeded);
       
   152     
       
   153     virtual HRESULT STDMETHODCALLTYPE setTextSizeMultiplier( 
       
   154         /* [in] */ float multiplier);
       
   155     
       
   156     virtual HRESULT STDMETHODCALLTYPE textSizeMultiplier( 
       
   157         /* [retval][out] */ float *multiplier);
       
   158     
       
   159     virtual HRESULT STDMETHODCALLTYPE setApplicationNameForUserAgent( 
       
   160         /* [in] */ BSTR applicationName);
       
   161     
       
   162     virtual HRESULT STDMETHODCALLTYPE applicationNameForUserAgent( 
       
   163         /* [retval][out] */ BSTR *applicationName);
       
   164     
       
   165     virtual HRESULT STDMETHODCALLTYPE setCustomUserAgent( 
       
   166         /* [in] */ BSTR userAgentString);
       
   167     
       
   168     virtual HRESULT STDMETHODCALLTYPE customUserAgent( 
       
   169         /* [retval][out] */ BSTR *userAgentString);
       
   170     
       
   171     virtual HRESULT STDMETHODCALLTYPE userAgentForURL( 
       
   172         /* [in] */ BSTR url,
       
   173         /* [retval][out] */ BSTR *userAgent);
       
   174     
       
   175     virtual HRESULT STDMETHODCALLTYPE supportsTextEncoding( 
       
   176         /* [retval][out] */ BOOL *supports);
       
   177     
       
   178     virtual HRESULT STDMETHODCALLTYPE setCustomTextEncodingName( 
       
   179         /* [in] */ BSTR encodingName);
       
   180     
       
   181     virtual HRESULT STDMETHODCALLTYPE customTextEncodingName( 
       
   182         /* [retval][out] */ BSTR *encodingName);
       
   183     
       
   184     virtual HRESULT STDMETHODCALLTYPE setMediaStyle( 
       
   185         /* [in] */ BSTR media);
       
   186     
       
   187     virtual HRESULT STDMETHODCALLTYPE mediaStyle( 
       
   188         /* [retval][out] */ BSTR *media);
       
   189     
       
   190     virtual HRESULT STDMETHODCALLTYPE stringByEvaluatingJavaScriptFromString( 
       
   191         /* [in] */ BSTR script,
       
   192         /* [retval][out] */ BSTR *result);
       
   193     
       
   194     virtual HRESULT STDMETHODCALLTYPE windowScriptObject( 
       
   195         /* [retval][out] */ IWebScriptObject **webScriptObject);
       
   196     
       
   197     virtual HRESULT STDMETHODCALLTYPE setPreferences( 
       
   198         /* [in] */ IWebPreferences *prefs);
       
   199     
       
   200     virtual HRESULT STDMETHODCALLTYPE preferences( 
       
   201         /* [retval][out] */ IWebPreferences **prefs);
       
   202     
       
   203     virtual HRESULT STDMETHODCALLTYPE setPreferencesIdentifier( 
       
   204         /* [in] */ BSTR anIdentifier);
       
   205     
       
   206     virtual HRESULT STDMETHODCALLTYPE preferencesIdentifier( 
       
   207         /* [retval][out] */ BSTR *anIdentifier);
       
   208     
       
   209     virtual HRESULT STDMETHODCALLTYPE setHostWindow( 
       
   210         /* [in] */ OLE_HANDLE window);
       
   211     
       
   212     virtual HRESULT STDMETHODCALLTYPE hostWindow( 
       
   213         /* [retval][out] */ OLE_HANDLE *window);
       
   214     
       
   215     virtual HRESULT STDMETHODCALLTYPE searchFor( 
       
   216         /* [in] */ BSTR str,
       
   217         /* [in] */ BOOL forward,
       
   218         /* [in] */ BOOL caseFlag,
       
   219         /* [in] */ BOOL wrapFlag,
       
   220         /* [retval][out] */ BOOL *found);
       
   221     
       
   222     virtual HRESULT STDMETHODCALLTYPE registerViewClass( 
       
   223         /* [in] */ IWebDocumentView *view,
       
   224         /* [in] */ IWebDocumentRepresentation *representation,
       
   225         /* [in] */ BSTR forMIMEType);
       
   226 
       
   227     virtual HRESULT STDMETHODCALLTYPE setGroupName( 
       
   228         /* [in] */ BSTR groupName);
       
   229     
       
   230     virtual HRESULT STDMETHODCALLTYPE groupName( 
       
   231         /* [retval][out] */ BSTR *groupName);
       
   232     
       
   233     virtual HRESULT STDMETHODCALLTYPE estimatedProgress( 
       
   234         /* [retval][out] */ double *estimatedProgress);
       
   235     
       
   236     virtual HRESULT STDMETHODCALLTYPE isLoading( 
       
   237         /* [retval][out] */ BOOL *isLoading);
       
   238     
       
   239     virtual HRESULT STDMETHODCALLTYPE elementAtPoint( 
       
   240         /* [in] */ LPPOINT point,
       
   241         /* [retval][out] */ IPropertyBag **elementDictionary);
       
   242     
       
   243     virtual HRESULT STDMETHODCALLTYPE pasteboardTypesForSelection( 
       
   244         /* [retval][out] */ IEnumVARIANT **enumVariant);
       
   245     
       
   246     virtual HRESULT STDMETHODCALLTYPE writeSelectionWithPasteboardTypes( 
       
   247         /* [size_is][in] */ BSTR *types,
       
   248         /* [in] */ int cTypes,
       
   249         /* [in] */ IDataObject *pasteboard);
       
   250     
       
   251     virtual HRESULT STDMETHODCALLTYPE pasteboardTypesForElement( 
       
   252         /* [in] */ IPropertyBag *elementDictionary,
       
   253         /* [retval][out] */ IEnumVARIANT **enumVariant);
       
   254     
       
   255     virtual HRESULT STDMETHODCALLTYPE writeElement( 
       
   256         /* [in] */ IPropertyBag *elementDictionary,
       
   257         /* [size_is][in] */ BSTR *withPasteboardTypes,
       
   258         /* [in] */ int cWithPasteboardTypes,
       
   259         /* [in] */ IDataObject *pasteboard);
       
   260     
       
   261     virtual HRESULT STDMETHODCALLTYPE selectedText(
       
   262         /* [out, retval] */ BSTR* str);
       
   263 
       
   264     virtual HRESULT STDMETHODCALLTYPE centerSelectionInVisibleArea(
       
   265         /* [in] */ IUnknown* sender);
       
   266 
       
   267     virtual HRESULT STDMETHODCALLTYPE moveDragCaretToPoint( 
       
   268         /* [in] */ LPPOINT point);
       
   269     
       
   270     virtual HRESULT STDMETHODCALLTYPE removeDragCaret( void);
       
   271     
       
   272     virtual HRESULT STDMETHODCALLTYPE setDrawsBackground( 
       
   273         /* [in] */ BOOL drawsBackground);
       
   274     
       
   275     virtual HRESULT STDMETHODCALLTYPE drawsBackground( 
       
   276         /* [retval][out] */ BOOL *drawsBackground);
       
   277     
       
   278     virtual HRESULT STDMETHODCALLTYPE setMainFrameURL( 
       
   279         /* [in] */ BSTR urlString);
       
   280     
       
   281     virtual HRESULT STDMETHODCALLTYPE mainFrameURL( 
       
   282         /* [retval][out] */ BSTR *urlString);
       
   283     
       
   284     virtual HRESULT STDMETHODCALLTYPE mainFrameDocument( 
       
   285         /* [retval][out] */ IDOMDocument **document);
       
   286     
       
   287     virtual HRESULT STDMETHODCALLTYPE mainFrameTitle( 
       
   288         /* [retval][out] */ BSTR *title);
       
   289     
       
   290     virtual HRESULT STDMETHODCALLTYPE mainFrameIcon( 
       
   291         /* [retval][out] */ OLE_HANDLE *hBitmap);
       
   292 
       
   293     // IWebIBActions
       
   294 
       
   295     virtual HRESULT STDMETHODCALLTYPE takeStringURLFrom( 
       
   296         /* [in] */ IUnknown *sender);
       
   297     
       
   298     virtual HRESULT STDMETHODCALLTYPE stopLoading( 
       
   299         /* [in] */ IUnknown *sender);
       
   300     
       
   301     virtual HRESULT STDMETHODCALLTYPE reload( 
       
   302         /* [in] */ IUnknown *sender);
       
   303     
       
   304     virtual HRESULT STDMETHODCALLTYPE canGoBack( 
       
   305         /* [in] */ IUnknown *sender,
       
   306         /* [retval][out] */ BOOL *result);
       
   307     
       
   308     virtual HRESULT STDMETHODCALLTYPE goBack( 
       
   309         /* [in] */ IUnknown *sender);
       
   310     
       
   311     virtual HRESULT STDMETHODCALLTYPE canGoForward( 
       
   312         /* [in] */ IUnknown *sender,
       
   313         /* [retval][out] */ BOOL *result);
       
   314     
       
   315     virtual HRESULT STDMETHODCALLTYPE goForward( 
       
   316         /* [in] */ IUnknown *sender);
       
   317     
       
   318     virtual HRESULT STDMETHODCALLTYPE canMakeTextLarger( 
       
   319         /* [in] */ IUnknown *sender,
       
   320         /* [retval][out] */ BOOL *result);
       
   321     
       
   322     virtual HRESULT STDMETHODCALLTYPE makeTextLarger( 
       
   323         /* [in] */ IUnknown *sender);
       
   324     
       
   325     virtual HRESULT STDMETHODCALLTYPE canMakeTextSmaller( 
       
   326         /* [in] */ IUnknown *sender,
       
   327         /* [retval][out] */ BOOL *result);
       
   328     
       
   329     virtual HRESULT STDMETHODCALLTYPE makeTextSmaller( 
       
   330         /* [in] */ IUnknown *sender);
       
   331 
       
   332     virtual HRESULT STDMETHODCALLTYPE canMakeTextStandardSize( 
       
   333         /* [in] */ IUnknown *sender,
       
   334         /* [retval][out] */ BOOL *result);
       
   335     
       
   336     virtual HRESULT STDMETHODCALLTYPE makeTextStandardSize( 
       
   337         /* [in] */ IUnknown *sender);
       
   338     
       
   339     virtual HRESULT STDMETHODCALLTYPE toggleContinuousSpellChecking( 
       
   340         /* [in] */ IUnknown *sender);
       
   341     
       
   342     virtual HRESULT STDMETHODCALLTYPE toggleSmartInsertDelete( 
       
   343         /* [in] */ IUnknown *sender);
       
   344 
       
   345     virtual HRESULT STDMETHODCALLTYPE toggleGrammarChecking( 
       
   346         /* [in] */ IUnknown *sender);
       
   347 
       
   348     // IWebViewCSS
       
   349 
       
   350     virtual HRESULT STDMETHODCALLTYPE computedStyleForElement( 
       
   351         /* [in] */ IDOMElement *element,
       
   352         /* [in] */ BSTR pseudoElement,
       
   353         /* [retval][out] */ IDOMCSSStyleDeclaration **style);
       
   354 
       
   355     // IWebViewEditing
       
   356 
       
   357     virtual HRESULT STDMETHODCALLTYPE editableDOMRangeForPoint( 
       
   358         /* [in] */ LPPOINT point,
       
   359         /* [retval][out] */ IDOMRange **range);
       
   360     
       
   361     virtual HRESULT STDMETHODCALLTYPE setSelectedDOMRange( 
       
   362         /* [in] */ IDOMRange *range,
       
   363         /* [in] */ WebSelectionAffinity affinity);
       
   364     
       
   365     virtual HRESULT STDMETHODCALLTYPE selectedDOMRange( 
       
   366         /* [retval][out] */ IDOMRange **range);
       
   367     
       
   368     virtual HRESULT STDMETHODCALLTYPE selectionAffinity( 
       
   369         /* [retval][out][retval][out] */ WebSelectionAffinity *affinity);
       
   370     
       
   371     virtual HRESULT STDMETHODCALLTYPE setEditable( 
       
   372         /* [in] */ BOOL flag);
       
   373     
       
   374     virtual HRESULT STDMETHODCALLTYPE isEditable( 
       
   375         /* [retval][out] */ BOOL *isEditable);
       
   376     
       
   377     virtual HRESULT STDMETHODCALLTYPE setTypingStyle( 
       
   378         /* [in] */ IDOMCSSStyleDeclaration *style);
       
   379     
       
   380     virtual HRESULT STDMETHODCALLTYPE typingStyle( 
       
   381         /* [retval][out] */ IDOMCSSStyleDeclaration **style);
       
   382     
       
   383     virtual HRESULT STDMETHODCALLTYPE setSmartInsertDeleteEnabled( 
       
   384         /* [in] */ BOOL flag);
       
   385     
       
   386     virtual HRESULT STDMETHODCALLTYPE smartInsertDeleteEnabled( 
       
   387         /* [in] */ BOOL *enabled);
       
   388     
       
   389     virtual HRESULT STDMETHODCALLTYPE setContinuousSpellCheckingEnabled( 
       
   390         /* [in] */ BOOL flag);
       
   391     
       
   392     virtual HRESULT STDMETHODCALLTYPE isContinuousSpellCheckingEnabled( 
       
   393         /* [retval][out] */ BOOL *enabled);
       
   394     
       
   395     virtual HRESULT STDMETHODCALLTYPE spellCheckerDocumentTag( 
       
   396         /* [retval][out] */ int *tag);
       
   397     
       
   398     virtual HRESULT STDMETHODCALLTYPE undoManager( 
       
   399         /* [retval][out] */ IWebUndoManager **manager);
       
   400     
       
   401     virtual HRESULT STDMETHODCALLTYPE setEditingDelegate( 
       
   402         /* [in] */ IWebEditingDelegate *d);
       
   403     
       
   404     virtual HRESULT STDMETHODCALLTYPE editingDelegate( 
       
   405         /* [retval][out] */ IWebEditingDelegate **d);
       
   406     
       
   407     virtual HRESULT STDMETHODCALLTYPE styleDeclarationWithText( 
       
   408         /* [in] */ BSTR text,
       
   409         /* [retval][out] */ IDOMCSSStyleDeclaration **style);
       
   410     
       
   411     virtual HRESULT STDMETHODCALLTYPE hasSelectedRange( 
       
   412         /* [retval][out] */ BOOL *hasSelectedRange);
       
   413     
       
   414     virtual HRESULT STDMETHODCALLTYPE cutEnabled( 
       
   415         /* [retval][out] */ BOOL *enabled);
       
   416     
       
   417     virtual HRESULT STDMETHODCALLTYPE copyEnabled( 
       
   418         /* [retval][out] */ BOOL *enabled);
       
   419     
       
   420     virtual HRESULT STDMETHODCALLTYPE pasteEnabled( 
       
   421         /* [retval][out] */ BOOL *enabled);
       
   422     
       
   423     virtual HRESULT STDMETHODCALLTYPE deleteEnabled( 
       
   424         /* [retval][out] */ BOOL *enabled);
       
   425 
       
   426     virtual HRESULT STDMETHODCALLTYPE editingEnabled( 
       
   427         /* [retval][out] */ BOOL *enabled);
       
   428 
       
   429     virtual HRESULT STDMETHODCALLTYPE isGrammarCheckingEnabled( 
       
   430         /* [retval][out] */ BOOL *enabled);
       
   431     
       
   432     virtual HRESULT STDMETHODCALLTYPE setGrammarCheckingEnabled( 
       
   433         BOOL enabled);
       
   434 
       
   435     // IWebViewUndoableEditing
       
   436 
       
   437     virtual HRESULT STDMETHODCALLTYPE replaceSelectionWithNode( 
       
   438         /* [in] */ IDOMNode *node);
       
   439     
       
   440     virtual HRESULT STDMETHODCALLTYPE replaceSelectionWithText( 
       
   441         /* [in] */ BSTR text);
       
   442     
       
   443     virtual HRESULT STDMETHODCALLTYPE replaceSelectionWithMarkupString( 
       
   444         /* [in] */ BSTR markupString);
       
   445     
       
   446     virtual HRESULT STDMETHODCALLTYPE replaceSelectionWithArchive( 
       
   447         /* [in] */ IWebArchive *archive);
       
   448     
       
   449     virtual HRESULT STDMETHODCALLTYPE deleteSelection( void);
       
   450 
       
   451     virtual HRESULT STDMETHODCALLTYPE clearSelection(void);
       
   452     
       
   453     virtual HRESULT STDMETHODCALLTYPE applyStyle( 
       
   454         /* [in] */ IDOMCSSStyleDeclaration *style);
       
   455 
       
   456     // IWebViewEditingActions
       
   457 
       
   458     virtual HRESULT STDMETHODCALLTYPE copy( 
       
   459         /* [in] */ IUnknown *sender);
       
   460     
       
   461     virtual HRESULT STDMETHODCALLTYPE cut( 
       
   462         /* [in] */ IUnknown *sender);
       
   463     
       
   464     virtual HRESULT STDMETHODCALLTYPE paste( 
       
   465         /* [in] */ IUnknown *sender);
       
   466     
       
   467     virtual HRESULT STDMETHODCALLTYPE copyURL( 
       
   468         /* [in] */ BSTR url);
       
   469 
       
   470     virtual HRESULT STDMETHODCALLTYPE copyFont( 
       
   471         /* [in] */ IUnknown *sender);
       
   472     
       
   473     virtual HRESULT STDMETHODCALLTYPE pasteFont( 
       
   474         /* [in] */ IUnknown *sender);
       
   475     
       
   476     virtual HRESULT STDMETHODCALLTYPE delete_( 
       
   477         /* [in] */ IUnknown *sender);
       
   478     
       
   479     virtual HRESULT STDMETHODCALLTYPE pasteAsPlainText( 
       
   480         /* [in] */ IUnknown *sender);
       
   481     
       
   482     virtual HRESULT STDMETHODCALLTYPE pasteAsRichText( 
       
   483         /* [in] */ IUnknown *sender);
       
   484     
       
   485     virtual HRESULT STDMETHODCALLTYPE changeFont( 
       
   486         /* [in] */ IUnknown *sender);
       
   487     
       
   488     virtual HRESULT STDMETHODCALLTYPE changeAttributes( 
       
   489         /* [in] */ IUnknown *sender);
       
   490     
       
   491     virtual HRESULT STDMETHODCALLTYPE changeDocumentBackgroundColor( 
       
   492         /* [in] */ IUnknown *sender);
       
   493     
       
   494     virtual HRESULT STDMETHODCALLTYPE changeColor( 
       
   495         /* [in] */ IUnknown *sender);
       
   496     
       
   497     virtual HRESULT STDMETHODCALLTYPE alignCenter( 
       
   498         /* [in] */ IUnknown *sender);
       
   499     
       
   500     virtual HRESULT STDMETHODCALLTYPE alignJustified( 
       
   501         /* [in] */ IUnknown *sender);
       
   502     
       
   503     virtual HRESULT STDMETHODCALLTYPE alignLeft( 
       
   504         /* [in] */ IUnknown *sender);
       
   505     
       
   506     virtual HRESULT STDMETHODCALLTYPE alignRight( 
       
   507         /* [in] */ IUnknown *sender);
       
   508     
       
   509     virtual HRESULT STDMETHODCALLTYPE checkSpelling( 
       
   510         /* [in] */ IUnknown *sender);
       
   511     
       
   512     virtual HRESULT STDMETHODCALLTYPE showGuessPanel( 
       
   513         /* [in] */ IUnknown *sender);
       
   514     
       
   515     virtual HRESULT STDMETHODCALLTYPE performFindPanelAction( 
       
   516         /* [in] */ IUnknown *sender);
       
   517     
       
   518     virtual HRESULT STDMETHODCALLTYPE startSpeaking( 
       
   519         /* [in] */ IUnknown *sender);
       
   520     
       
   521     virtual HRESULT STDMETHODCALLTYPE stopSpeaking( 
       
   522         /* [in] */ IUnknown *sender);
       
   523 
       
   524     // IWebNotificationObserver
       
   525 
       
   526     virtual HRESULT STDMETHODCALLTYPE onNotify( 
       
   527         /* [in] */ IWebNotification *notification);
       
   528 
       
   529     // IWebViewPrivate
       
   530     virtual HRESULT STDMETHODCALLTYPE setCustomDropTarget(
       
   531         /* [in] */ IDropTarget* dt);
       
   532 
       
   533     virtual HRESULT STDMETHODCALLTYPE removeCustomDropTarget();
       
   534 
       
   535     virtual HRESULT STDMETHODCALLTYPE setInViewSourceMode( 
       
   536         /* [in] */ BOOL flag);
       
   537     
       
   538     virtual HRESULT STDMETHODCALLTYPE inViewSourceMode( 
       
   539         /* [retval][out] */ BOOL* flag);
       
   540 
       
   541     virtual HRESULT STDMETHODCALLTYPE viewWindow( 
       
   542         /* [retval][out] */ OLE_HANDLE *window);
       
   543 
       
   544     virtual HRESULT STDMETHODCALLTYPE setFormDelegate( 
       
   545         /* [in] */ IWebFormDelegate *formDelegate);
       
   546 
       
   547     virtual HRESULT STDMETHODCALLTYPE formDelegate( 
       
   548         /* [retval][out] */ IWebFormDelegate **formDelegate);
       
   549 
       
   550     virtual HRESULT STDMETHODCALLTYPE setFrameLoadDelegatePrivate( 
       
   551         /* [in] */ IWebFrameLoadDelegatePrivate *frameLoadDelegatePrivate);
       
   552 
       
   553     virtual HRESULT STDMETHODCALLTYPE frameLoadDelegatePrivate( 
       
   554         /* [retval][out] */ IWebFrameLoadDelegatePrivate **frameLoadDelegatePrivate);
       
   555 
       
   556     virtual HRESULT STDMETHODCALLTYPE scrollOffset( 
       
   557         /* [retval][out] */ LPPOINT offset);
       
   558 
       
   559     virtual HRESULT STDMETHODCALLTYPE scrollBy( 
       
   560         /* [in] */ LPPOINT offset);
       
   561 
       
   562     virtual HRESULT STDMETHODCALLTYPE visibleContentRect( 
       
   563         /* [retval][out] */ LPRECT rect);
       
   564 
       
   565     virtual HRESULT STDMETHODCALLTYPE updateActiveState(void);
       
   566 
       
   567     virtual HRESULT STDMETHODCALLTYPE markAllMatchesForText(
       
   568         BSTR search, BOOL caseSensitive, BOOL highlight, UINT limit, UINT* matches);
       
   569 
       
   570     virtual HRESULT STDMETHODCALLTYPE unmarkAllTextMatches();
       
   571 
       
   572     virtual HRESULT STDMETHODCALLTYPE rectsForTextMatches(
       
   573         IEnumTextMatches** pmatches);
       
   574 
       
   575     virtual HRESULT STDMETHODCALLTYPE generateSelectionImage(
       
   576         BOOL forceWhiteText, OLE_HANDLE* hBitmap);
       
   577 
       
   578     virtual HRESULT STDMETHODCALLTYPE selectionImageRect(
       
   579         RECT* rc);
       
   580     
       
   581     virtual HRESULT STDMETHODCALLTYPE DragEnter(
       
   582         IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect);
       
   583 
       
   584     virtual HRESULT STDMETHODCALLTYPE DragOver(
       
   585         DWORD grfKeyState, POINTL pt, DWORD* pdwEffect);
       
   586     
       
   587     virtual HRESULT STDMETHODCALLTYPE DragLeave();
       
   588     
       
   589     virtual HRESULT STDMETHODCALLTYPE Drop(
       
   590         IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect);
       
   591 
       
   592     virtual HRESULT STDMETHODCALLTYPE canHandleRequest( 
       
   593         IWebURLRequest *request,
       
   594         BOOL *result);
       
   595 
       
   596     virtual HRESULT STDMETHODCALLTYPE clearFocusNode();
       
   597 
       
   598     virtual HRESULT STDMETHODCALLTYPE setInitialFocus(
       
   599         /* [in] */ BOOL forward);
       
   600     
       
   601     virtual HRESULT STDMETHODCALLTYPE setTabKeyCyclesThroughElements( 
       
   602         /* [in] */ BOOL cycles);
       
   603     
       
   604     virtual HRESULT STDMETHODCALLTYPE tabKeyCyclesThroughElements( 
       
   605         /* [retval][out] */ BOOL *result);
       
   606 
       
   607     virtual HRESULT STDMETHODCALLTYPE setAllowSiteSpecificHacks(
       
   608         /* [in] */ BOOL allows);
       
   609 
       
   610     virtual HRESULT STDMETHODCALLTYPE addAdditionalPluginPath( 
       
   611         /* [in] */ BSTR path);    
       
   612 
       
   613     virtual HRESULT STDMETHODCALLTYPE loadBackForwardListFromOtherView( 
       
   614         /* [in] */ IWebView *otherView);
       
   615 
       
   616     // WebView
       
   617     WebCore::Page* page();
       
   618     bool handleMouseEvent(UINT, WPARAM, LPARAM);
       
   619     void setMouseActivated(bool flag) { m_mouseActivated = flag; }
       
   620     bool handleContextMenuEvent(WPARAM, LPARAM);
       
   621     bool onMeasureItem(WPARAM, LPARAM);
       
   622     bool onDrawItem(WPARAM, LPARAM);
       
   623     bool onInitMenuPopup(WPARAM, LPARAM);
       
   624     bool onUninitMenuPopup(WPARAM, LPARAM);
       
   625     void performContextMenuAction(WPARAM, LPARAM, bool byPosition);
       
   626     bool mouseWheel(WPARAM, LPARAM, bool isHorizontal);
       
   627     bool execCommand(WPARAM wParam, LPARAM lParam);
       
   628     bool keyDown(WPARAM, LPARAM, bool systemKeyDown = false);
       
   629     bool keyUp(WPARAM, LPARAM);
       
   630     HRESULT updateWebCoreSettingsFromPreferences(IWebPreferences* preferences);
       
   631     bool inResizer(LPARAM lParam);
       
   632     void paint(HDC, LPARAM);
       
   633     void paintIntoBackingStore(WebCore::FrameView*, HDC bitmapDC, LPRECT dirtyRect);
       
   634     void paintIntoWindow(HDC bitmapDC, HDC windowDC, LPRECT dirtyRect);
       
   635     bool ensureBackingStore();
       
   636     void addToDirtyRegion(const WebCore::IntRect&);
       
   637     void addToDirtyRegion(HRGN);
       
   638     void scrollBackingStore(WebCore::FrameView*, int dx, int dy, const WebCore::IntRect& scrollViewRect, const WebCore::IntRect& clipRect);
       
   639     void updateBackingStore(WebCore::FrameView*, HDC, bool backingStoreCompletelyDirty);
       
   640     void deleteBackingStore();
       
   641     void frameRect(RECT* rect);
       
   642     void closeWindow();
       
   643     void closeWindowSoon();
       
   644     void close();
       
   645     bool didClose() const { return m_didClose; }
       
   646     void setProhibitsMainFrameScrolling(bool = true);
       
   647 
       
   648     bool onIMEStartComposition();
       
   649     bool onIMEComposition(LPARAM);
       
   650     bool onIMEEndComposition();
       
   651     bool onIMEChar(WPARAM, LPARAM);
       
   652     bool onIMENotify(WPARAM, LPARAM, LRESULT*);
       
   653     bool onIMERequest(WPARAM, LPARAM, LRESULT*);
       
   654     bool onIMESelect(WPARAM, LPARAM);
       
   655     bool onIMESetContext(WPARAM, LPARAM);
       
   656     void selectionChanged();
       
   657     void resetIME(WebCore::Frame*);
       
   658     bool inIMEKeyDown() const { return m_inIMEKeyDown; }
       
   659     void setInputMethodState(bool);
       
   660 
       
   661     HRESULT registerDragDrop();
       
   662     HRESULT revokeDragDrop();
       
   663 
       
   664     // Convenient to be able to violate the rules of COM here for easy movement to the frame.
       
   665     WebFrame* topLevelFrame() { return m_mainFrame; }
       
   666     const WebCore::String& userAgentForKURL(const WebCore::KURL& url);
       
   667 
       
   668     static bool canHandleRequest(const WebCore::ResourceRequest&);
       
   669 
       
   670     void setIsBeingDestroyed() { m_isBeingDestroyed = true; }
       
   671     bool isBeingDestroyed() const { return m_isBeingDestroyed; }
       
   672 
       
   673     const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
       
   674     bool handleEditingKeyboardEvent(WebCore::KeyboardEvent*);
       
   675 
       
   676     bool isPainting() const { return m_paintCount > 0; }
       
   677 
       
   678     void setToolTip(const WebCore::String&);
       
   679 
       
   680     void registerForIconNotification(bool listen);
       
   681     HRESULT notifyDidAddIcon(IWebNotification*);
       
   682     void dispatchDidReceiveIconFromWebFrame(WebFrame*);
       
   683 
       
   684 protected:
       
   685     HIMC getIMMContext();
       
   686     void releaseIMMContext(HIMC);
       
   687     static bool allowSiteSpecificHacks() { return s_allowSiteSpecificHacks; } 
       
   688     void preflightSpellChecker();
       
   689     bool continuousCheckingAllowed();
       
   690     void initializeCacheSizesIfNecessary();
       
   691     void initializeToolTipWindow();
       
   692     void closeWindowTimerFired(WebCore::Timer<WebView>*);
       
   693     void prepareCandidateWindow(WebCore::Frame*, HIMC);
       
   694     void updateSelectionForIME();
       
   695     bool onIMERequestCharPosition(WebCore::Frame*, IMECHARPOSITION*, LRESULT*);
       
   696     bool onIMERequestReconvertString(WebCore::Frame*, RECONVERTSTRING*, LRESULT*);
       
   697     bool developerExtrasEnabled() const;
       
   698 
       
   699     ULONG m_refCount;
       
   700     WebCore::String m_groupName;
       
   701     HWND m_hostWindow;
       
   702     HWND m_viewWindow;
       
   703     WebFrame* m_mainFrame;
       
   704     WebCore::Page* m_page;
       
   705     
       
   706     OwnPtr<HBITMAP> m_backingStoreBitmap;
       
   707     SIZE m_backingStoreSize;
       
   708     OwnPtr<HRGN> m_backingStoreDirtyRegion;
       
   709 
       
   710     COMPtr<IWebEditingDelegate> m_editingDelegate;
       
   711     COMPtr<IWebFrameLoadDelegate> m_frameLoadDelegate;
       
   712     COMPtr<IWebFrameLoadDelegatePrivate> m_frameLoadDelegatePrivate;
       
   713     COMPtr<IWebUIDelegate> m_uiDelegate;
       
   714     COMPtr<IWebUIDelegatePrivate> m_uiDelegatePrivate;
       
   715     COMPtr<IWebFormDelegate> m_formDelegate;
       
   716     COMPtr<IWebPolicyDelegate> m_policyDelegate;
       
   717     COMPtr<IWebPreferences> m_preferences;
       
   718     COMPtr<IWebResourceLoadDelegate> m_resourceLoadDelegate;
       
   719     COMPtr<IWebDownloadDelegate> m_downloadDelegate;
       
   720     bool m_userAgentOverridden;
       
   721     bool m_useBackForwardList;
       
   722     WebCore::String m_userAgentCustom;
       
   723     WebCore::String m_userAgentStandard;
       
   724     float m_textSizeMultiplier;
       
   725     WebCore::String m_overrideEncoding;
       
   726     WebCore::String m_applicationName;
       
   727     bool m_mouseActivated;
       
   728     // WebCore dragging logic needs to be able to inspect the drag data
       
   729     // this is updated in DragEnter/Leave/Drop
       
   730     COMPtr<IDataObject> m_dragData;
       
   731     COMPtr<IDropTargetHelper> m_dropTargetHelper;
       
   732     UChar m_currentCharacterCode;
       
   733     bool m_isBeingDestroyed;
       
   734     unsigned m_paintCount;
       
   735     bool m_hasSpellCheckerDocumentTag;
       
   736     bool m_smartInsertDeleteEnabled;
       
   737     bool m_didClose;
       
   738     bool m_hasCustomDropTarget;
       
   739     unsigned m_inIMEComposition;
       
   740     bool m_inIMEKeyDown;
       
   741     HWND m_toolTipHwnd;
       
   742     WebCore::String m_toolTip;
       
   743 
       
   744     static bool s_allowSiteSpecificHacks;
       
   745 
       
   746     WebCore::Timer<WebView> m_closeWindowTimer;
       
   747 };
       
   748 
       
   749 #endif