webengine/osswebengine/WebKitTools/DumpRenderTree/win/UIDelegate.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2  * Copyright (C) 2005, 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  *
       
     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 Computer, 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 UIDelegate_h
       
    30 #define UIDelegate_h
       
    31 
       
    32 #include <WebKit/IWebUIDelegate.h>
       
    33 #include <WebKit/IWebUIDelegatePrivate.h>
       
    34 
       
    35 class UIDelegate : public IWebUIDelegate, IWebUIDelegatePrivate {
       
    36 public:
       
    37     UIDelegate() : m_refCount(1), m_frame(0) { }
       
    38 
       
    39     void processWork();
       
    40 
       
    41     // IUnknown
       
    42     virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
       
    43     virtual ULONG STDMETHODCALLTYPE AddRef(void);
       
    44     virtual ULONG STDMETHODCALLTYPE Release(void);
       
    45 
       
    46     // IWebUIDelegate
       
    47     virtual HRESULT STDMETHODCALLTYPE createWebViewWithRequest( 
       
    48         /* [in] */ IWebView *sender,
       
    49         /* [in] */ IWebURLRequest *request,
       
    50         /* [retval][out] */ IWebView **newWebView) { return E_NOTIMPL; }
       
    51 
       
    52     virtual HRESULT STDMETHODCALLTYPE webViewShow( 
       
    53         /* [in] */ IWebView *sender) { return E_NOTIMPL; }
       
    54 
       
    55     virtual HRESULT STDMETHODCALLTYPE webViewClose( 
       
    56         /* [in] */ IWebView *sender) { return E_NOTIMPL; }
       
    57 
       
    58     virtual HRESULT STDMETHODCALLTYPE webViewFocus( 
       
    59         /* [in] */ IWebView *sender) { return E_NOTIMPL; }
       
    60 
       
    61     virtual HRESULT STDMETHODCALLTYPE webViewUnfocus( 
       
    62         /* [in] */ IWebView *sender) { return E_NOTIMPL; }
       
    63 
       
    64     virtual HRESULT STDMETHODCALLTYPE webViewFirstResponder( 
       
    65         /* [in] */ IWebView *sender,
       
    66         /* [retval][out] */ OLE_HANDLE *responder) { return E_NOTIMPL; }
       
    67 
       
    68     virtual HRESULT STDMETHODCALLTYPE makeFirstResponder( 
       
    69         /* [in] */ IWebView *sender,
       
    70         /* [in] */ OLE_HANDLE responder) { return E_NOTIMPL; }
       
    71 
       
    72     virtual HRESULT STDMETHODCALLTYPE setStatusText( 
       
    73         /* [in] */ IWebView *sender,
       
    74         /* [in] */ BSTR text) { return E_NOTIMPL; }
       
    75 
       
    76     virtual HRESULT STDMETHODCALLTYPE webViewStatusText( 
       
    77         /* [in] */ IWebView *sender,
       
    78         /* [retval][out] */ BSTR *text) { return E_NOTIMPL; }
       
    79 
       
    80     virtual HRESULT STDMETHODCALLTYPE webViewAreToolbarsVisible( 
       
    81         /* [in] */ IWebView *sender,
       
    82         /* [retval][out] */ BOOL *visible) { return E_NOTIMPL; }
       
    83 
       
    84     virtual HRESULT STDMETHODCALLTYPE setToolbarsVisible( 
       
    85         /* [in] */ IWebView *sender,
       
    86         /* [in] */ BOOL visible) { return E_NOTIMPL; }
       
    87 
       
    88     virtual HRESULT STDMETHODCALLTYPE webViewIsStatusBarVisible( 
       
    89         /* [in] */ IWebView *sender,
       
    90         /* [retval][out] */ BOOL *visible) { return E_NOTIMPL; }
       
    91 
       
    92     virtual HRESULT STDMETHODCALLTYPE setStatusBarVisible( 
       
    93         /* [in] */ IWebView *sender,
       
    94         /* [in] */ BOOL visible) { return E_NOTIMPL; }
       
    95 
       
    96     virtual HRESULT STDMETHODCALLTYPE webViewIsResizable( 
       
    97         /* [in] */ IWebView *sender,
       
    98         /* [retval][out] */ BOOL *resizable) { return E_NOTIMPL; }
       
    99 
       
   100     virtual HRESULT STDMETHODCALLTYPE setResizable( 
       
   101         /* [in] */ IWebView *sender,
       
   102         /* [in] */ BOOL resizable) { return E_NOTIMPL; }
       
   103 
       
   104     virtual HRESULT STDMETHODCALLTYPE setFrame( 
       
   105         /* [in] */ IWebView *sender,
       
   106         /* [in] */ RECT *frame);
       
   107 
       
   108     virtual HRESULT STDMETHODCALLTYPE webViewFrame( 
       
   109         /* [in] */ IWebView *sender,
       
   110         /* [retval][out] */ RECT *frame);
       
   111 
       
   112     virtual HRESULT STDMETHODCALLTYPE setContentRect( 
       
   113         /* [in] */ IWebView *sender,
       
   114         /* [in] */ RECT *contentRect) { return E_NOTIMPL; }
       
   115 
       
   116     virtual HRESULT STDMETHODCALLTYPE webViewContentRect( 
       
   117         /* [in] */ IWebView *sender,
       
   118         /* [retval][out] */ RECT *contentRect) { return E_NOTIMPL; }
       
   119 
       
   120     virtual HRESULT STDMETHODCALLTYPE runJavaScriptAlertPanelWithMessage( 
       
   121         /* [in] */ IWebView *sender,
       
   122         /* [in] */ BSTR message);
       
   123 
       
   124     virtual HRESULT STDMETHODCALLTYPE runJavaScriptConfirmPanelWithMessage( 
       
   125         /* [in] */ IWebView *sender,
       
   126         /* [in] */ BSTR message,
       
   127         /* [retval][out] */ BOOL *result) { return E_NOTIMPL; }
       
   128 
       
   129     virtual HRESULT STDMETHODCALLTYPE runJavaScriptTextInputPanelWithPrompt( 
       
   130         /* [in] */ IWebView *sender,
       
   131         /* [in] */ BSTR message,
       
   132         /* [in] */ BSTR defaultText,
       
   133         /* [retval][out] */ BSTR *result) { return E_NOTIMPL; }
       
   134 
       
   135     virtual HRESULT STDMETHODCALLTYPE runBeforeUnloadConfirmPanelWithMessage( 
       
   136         /* [in] */ IWebView *sender,
       
   137         /* [in] */ BSTR message,
       
   138         /* [in] */ IWebFrame *initiatedByFrame,
       
   139         /* [retval][out] */ BOOL *result) { return E_NOTIMPL; } 
       
   140 
       
   141     virtual HRESULT STDMETHODCALLTYPE runOpenPanelForFileButtonWithResultListener( 
       
   142         /* [in] */ IWebView *sender,
       
   143         /* [in] */ IWebOpenPanelResultListener *resultListener) { return E_NOTIMPL; }
       
   144 
       
   145     virtual HRESULT STDMETHODCALLTYPE mouseDidMoveOverElement( 
       
   146         /* [in] */ IWebView *sender,
       
   147         /* [in] */ IPropertyBag *elementInformation,
       
   148         /* [in] */ UINT modifierFlags) { return E_NOTIMPL; }
       
   149 
       
   150     virtual HRESULT STDMETHODCALLTYPE contextMenuItemsForElement( 
       
   151         /* [in] */ IWebView *sender,
       
   152         /* [in] */ IPropertyBag *element,
       
   153         /* [in] */ OLE_HANDLE defaultItems,
       
   154         /* [retval][out] */ OLE_HANDLE *resultMenu) { return E_NOTIMPL; }
       
   155 
       
   156     virtual HRESULT STDMETHODCALLTYPE validateUserInterfaceItem( 
       
   157         /* [in] */ IWebView *webView,
       
   158         /* [in] */ UINT itemCommandID,
       
   159         /* [in] */ BOOL defaultValidation,
       
   160         /* [retval][out] */ BOOL *isValid) { return E_NOTIMPL; }
       
   161 
       
   162     virtual HRESULT STDMETHODCALLTYPE shouldPerformAction( 
       
   163         /* [in] */ IWebView *webView,
       
   164         /* [in] */ UINT itemCommandID,
       
   165         /* [in] */ UINT sender) { return E_NOTIMPL; }
       
   166 
       
   167     virtual HRESULT STDMETHODCALLTYPE dragDestinationActionMaskForDraggingInfo( 
       
   168         /* [in] */ IWebView *webView,
       
   169         /* [in] */ IDataObject *draggingInfo,
       
   170         /* [retval][out] */ WebDragDestinationAction *action) { return E_NOTIMPL; }
       
   171 
       
   172     virtual HRESULT STDMETHODCALLTYPE willPerformDragDestinationAction( 
       
   173         /* [in] */ IWebView *webView,
       
   174         /* [in] */ WebDragDestinationAction action,
       
   175         /* [in] */ IDataObject *draggingInfo) { return E_NOTIMPL; }
       
   176 
       
   177     virtual HRESULT STDMETHODCALLTYPE dragSourceActionMaskForPoint( 
       
   178         /* [in] */ IWebView *webView,
       
   179         /* [in] */ LPPOINT point,
       
   180         /* [retval][out] */ WebDragSourceAction *action) { return E_NOTIMPL; }
       
   181 
       
   182     virtual HRESULT STDMETHODCALLTYPE willPerformDragSourceAction( 
       
   183         /* [in] */ IWebView *webView,
       
   184         /* [in] */ WebDragSourceAction action,
       
   185         /* [in] */ LPPOINT point,
       
   186         /* [in] */ IDataObject *pasteboard) { return E_NOTIMPL; }
       
   187 
       
   188     virtual HRESULT STDMETHODCALLTYPE contextMenuItemSelected( 
       
   189         /* [in] */ IWebView *sender,
       
   190         /* [in] */ void *item,
       
   191         /* [in] */ IPropertyBag *element) { return E_NOTIMPL; } 
       
   192         
       
   193     virtual HRESULT STDMETHODCALLTYPE hasCustomMenuImplementation( 
       
   194         /* [retval][out] */ BOOL *hasCustomMenus);
       
   195     
       
   196     virtual HRESULT STDMETHODCALLTYPE trackCustomPopupMenu( 
       
   197         /* [in] */ IWebView *sender,
       
   198         /* [in] */ OLE_HANDLE menu,
       
   199         /* [in] */ LPPOINT point) { return E_NOTIMPL; }
       
   200        
       
   201     virtual HRESULT STDMETHODCALLTYPE measureCustomMenuItem( 
       
   202         /* [in] */ IWebView *sender,
       
   203         /* [in] */ void *measureItem) { return E_NOTIMPL; }
       
   204         
       
   205     virtual HRESULT STDMETHODCALLTYPE drawCustomMenuItem( 
       
   206         /* [in] */ IWebView *sender,
       
   207         /* [in] */ void *drawItem) { return E_NOTIMPL; }
       
   208 
       
   209     virtual HRESULT STDMETHODCALLTYPE addCustomMenuDrawingData( 
       
   210         /* [in] */ IWebView *sender,
       
   211         /* [in] */ OLE_HANDLE menu) { return E_NOTIMPL; }
       
   212 
       
   213     virtual HRESULT STDMETHODCALLTYPE cleanUpCustomMenuDrawingData( 
       
   214         /* [in] */ IWebView *sender,
       
   215         /* [in] */ OLE_HANDLE menu) { return E_NOTIMPL; }
       
   216 
       
   217     virtual HRESULT STDMETHODCALLTYPE canTakeFocus( 
       
   218         /* [in] */ IWebView *sender,
       
   219         /* [in] */ BOOL forward,
       
   220         /* [out] */ BOOL *result) { return E_NOTIMPL; }
       
   221         
       
   222     virtual HRESULT STDMETHODCALLTYPE takeFocus( 
       
   223         /* [in] */ IWebView *sender,
       
   224         /* [in] */ BOOL forward) { return E_NOTIMPL; }
       
   225     
       
   226     virtual HRESULT STDMETHODCALLTYPE registerUndoWithTarget( 
       
   227         /* [in] */ IWebUndoTarget *target,
       
   228         /* [in] */ BSTR actionName,
       
   229         /* [in] */ IUnknown *actionArg) { return E_NOTIMPL; }
       
   230     
       
   231     virtual HRESULT STDMETHODCALLTYPE removeAllActionsWithTarget( 
       
   232         /* [in] */ IWebUndoTarget *target) { return E_NOTIMPL; }
       
   233     
       
   234     virtual HRESULT STDMETHODCALLTYPE setActionTitle( 
       
   235         /* [in] */ BSTR actionTitle) { return E_NOTIMPL; }
       
   236     
       
   237     virtual HRESULT STDMETHODCALLTYPE undo( void) { return E_NOTIMPL; }
       
   238     
       
   239     virtual HRESULT STDMETHODCALLTYPE redo( void) { return E_NOTIMPL; }
       
   240     
       
   241     virtual HRESULT STDMETHODCALLTYPE canUndo( 
       
   242         /* [retval][out] */ BOOL *result) { return E_NOTIMPL; }
       
   243     
       
   244     virtual HRESULT STDMETHODCALLTYPE canRedo( 
       
   245         /* [retval][out] */ BOOL *result) { return E_NOTIMPL; }
       
   246 
       
   247 protected:
       
   248     // IWebUIDelegatePrivate
       
   249 
       
   250     virtual HRESULT STDMETHODCALLTYPE webViewResizerRect( 
       
   251         /* [in] */ IWebView *sender,
       
   252         /* [retval][out] */ RECT *rect) { return E_NOTIMPL; }
       
   253     
       
   254     virtual HRESULT STDMETHODCALLTYPE webViewDrawResizer( 
       
   255         /* [in] */ IWebView *sender,
       
   256         /* [in] */ HDC dc,
       
   257         /* [in] */ BOOL overlapsContent,
       
   258         /* [in] */ RECT *rect) { return E_NOTIMPL; }
       
   259     
       
   260     virtual HRESULT STDMETHODCALLTYPE webViewScrolled( 
       
   261         /* [in] */ IWebView *sender) { return E_NOTIMPL; }
       
   262     
       
   263     virtual HRESULT STDMETHODCALLTYPE webViewAddMessageToConsole( 
       
   264         /* [in] */ IWebView *sender,
       
   265         /* [in] */ BSTR message,
       
   266         /* [in] */ int lineNumber,
       
   267         /* [in] */ BSTR url,
       
   268         /* [in] */ BOOL isError);
       
   269     
       
   270     virtual HRESULT STDMETHODCALLTYPE webViewShouldInterruptJavaScript( 
       
   271         /* [in] */ IWebView *sender,
       
   272         /* [retval][out] */ BOOL *result) { return E_NOTIMPL; }
       
   273     
       
   274     virtual HRESULT STDMETHODCALLTYPE webViewReceivedFocus( 
       
   275         /* [in] */ IWebView *sender) { return E_NOTIMPL; }
       
   276     
       
   277     virtual HRESULT STDMETHODCALLTYPE webViewLostFocus( 
       
   278         /* [in] */ IWebView *sender,
       
   279         /* [in] */ OLE_HANDLE loseFocusTo) { return E_NOTIMPL; }
       
   280 
       
   281     virtual HRESULT STDMETHODCALLTYPE doDragDrop( 
       
   282         /* [in] */ IWebView *sender,
       
   283         /* [in] */ IDataObject *dataObject,
       
   284         /* [in] */ IDropSource *dropSource,
       
   285         /* [in] */ DWORD okEffect,
       
   286         /* [retval][out] */ DWORD *performedEffect);
       
   287 
       
   288     virtual HRESULT STDMETHODCALLTYPE webViewGetDlgCode( 
       
   289         /* [in] */ IWebView *sender,
       
   290         /* [in] */ UINT keyCode,
       
   291         /* [retval][out] */ LONG_PTR *code);
       
   292 
       
   293     ULONG                   m_refCount;
       
   294 
       
   295 private:
       
   296     RECT* m_frame;
       
   297 };
       
   298 
       
   299 #endif