summaryrefslogtreecommitdiffstats
path: root/WebKit/win/Interfaces/IWebUIDelegate.idl
blob: 5886c7c727a17624b5c69ece265a61117f5713b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
/*
 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 */

#ifndef DO_NO_IMPORTS
import "oaidl.idl";
import "ocidl.idl";
import "IWebUndoTarget.idl";
import "IWebURLRequest.idl";
import "IWebFrame.idl";
#endif

interface IWebFrame;
interface IWebView;
interface IWebURLRequest;
interface IWebUndoTarget;

/*!
    @enum WebMenuItemTag
    @discussion Each menu item in the default menu items array passed in
    contextMenuItemsForElement:defaultMenuItems: has its tag set to one of the WebMenuItemTags.
    When iterating through the default menu items array, use the tag to differentiate between them.
*/
typedef enum WebMenuItemTag {
    WebMenuItemTagOpenLinkInNewWindow=1,
    WebMenuItemTagDownloadLinkToDisk,
    WebMenuItemTagCopyLinkToClipboard,
    WebMenuItemTagOpenImageInNewWindow,
    WebMenuItemTagDownloadImageToDisk,
    WebMenuItemTagCopyImageToClipboard,
    WebMenuItemTagOpenFrameInNewWindow,
    WebMenuItemTagCopy,
    WebMenuItemTagGoBack,
    WebMenuItemTagGoForward,
    WebMenuItemTagStop,
    WebMenuItemTagReload,
    WebMenuItemTagCut,
    WebMenuItemTagPaste,
    WebMenuItemTagSpellingGuess,
    WebMenuItemTagNoGuessesFound,
    WebMenuItemTagIgnoreSpelling,
    WebMenuItemTagLearnSpelling,
    WebMenuItemTagOther,
    WebMenuItemTagSearchInSpotlight,
    WebMenuItemTagSearchWeb,
    WebMenuItemTagLookUpInDictionary,
    WebMenuItemTagOpenWithDefaultApplication,
    WebMenuItemPDFActualSize,
    WebMenuItemPDFZoomIn,
    WebMenuItemPDFZoomOut,
    WebMenuItemPDFAutoSize,
    WebMenuItemPDFSinglePage,
    WebMenuItemPDFFacingPages,
    WebMenuItemPDFContinuous,
    WebMenuItemPDFNextPage,
    WebMenuItemPDFPreviousPage,
    // FIXME: Review these names before release!
    WebMenuItemTagOpenLink = 2000,
    WebMenuItemTagIgnoreGrammar,
    WebtMenuItemTagSpellingMenu,
    WebMenuItemTagShowSpellingPanel,
    WebMenuItemTagCheckSpelling,
    WebMenuItemTagCheckSpellingWhileTyping,
    WebMenuItemTagCheckGrammarWithSpelling,
    WebMenuItemTagFontMenu,
    WebMenuItemTagShowFonts,
    WebMenuItemTagBold,
    WebMenuItemTagItalic,
    WebMenuItemTagUnderline,
    WebMenuItemTagOutline,
    WebMenuItemTagStyles,
    WebMenuItemTagShowColors,
    WebMenuItemTagSpeechMenu,
    WebMenuItemTagStartSpeaking,
    WebMenuItemTagStopSpeaking,
    WebMenuItemTagWritingDirectionMenu,
    WebMenuItemTagDefaultDirection,
    WebMenuItemTagLeftToRight,
    WebMenuItemTagRightToLeft,
    WebMenuItemTagPDFSinglePageScrolling,
    WebMenuItemTagPDFFacingPagesScrolling,
    WebMenuItemTagInspectElement,
    WebMenuItemBaseApplicationTag=10000
} WebMenuItemTag;

/*!
    @enum WebDragDestinationAction
    @abstract Actions that the destination of a drag can perform.
    @constant WebDragDestinationActionNone No action
    @constant WebDragDestinationActionDHTML Allows DHTML (such as JavaScript) to handle the drag
    @constant WebDragDestinationActionEdit Allows editable documents to be edited from the drag
    @constant WebDragDestinationActionLoad Allows a location change from the drag
    @constant WebDragDestinationActionAny Allows any of the above to occur
*/
typedef enum WebDragDestinationAction {
    WebDragDestinationActionNone    = 0,
    WebDragDestinationActionDHTML   = 1,
    WebDragDestinationActionEdit    = 2,
    WebDragDestinationActionLoad    = 4,
    WebDragDestinationActionAny     = (unsigned long)-1
} WebDragDestinationAction;

/*!
    @enum WebDragSourceAction
    @abstract Actions that the source of a drag can perform.
    @constant WebDragSourceActionNone No action
    @constant WebDragSourceActionDHTML Allows DHTML (such as JavaScript) to start a drag
    @constant WebDragSourceActionImage Allows an image drag to occur
    @constant WebDragSourceActionLink Allows a link drag to occur
    @constant WebDragSourceActionSelection Allows a selection drag to occur
    @constant WebDragSourceActionAny Allows any of the above to occur
*/
typedef enum WebDragSourceAction {
    WebDragSourceActionNone         = 0,
    WebDragSourceActionDHTML        = 1,
    WebDragSourceActionImage        = 2,
    WebDragSourceActionLink         = 4,
    WebDragSourceActionSelection    = 8,
    WebDragSourceActionAny          = (unsigned long)-1
} WebDragSourceAction;


/*!
    @protocol WebOpenPanelResultListener
    @discussion This protocol is used to call back with the results of
    the file open panel requested by runOpenPanelForFileButtonWithResultListener:
    @protocol WebOpenPanelResultListener <NSObject>
*/
[
    object,
    oleautomation,
    uuid(634198C7-9DFC-4aba-9E8C-90AEEA7A4144),
    pointer_default(unique)
]
interface IWebOpenPanelResultListener : IUnknown
{
    /*!
        @method chooseFilename:
        @abstract Call this method to return a filename from the file open panel.
        @param fileName
        - (void)chooseFilename:(NSString *)fileName;
    */
    HRESULT chooseFilename([out, retval] BSTR* fileName);

    /*!
        @method cancel
        @abstract Call this method to indicate that the file open panel was cancelled.
        - (void)cancel;
    */
    HRESULT cancel();
}

/*!
    @category WebUIDelegate
    @discussion A class that implements WebUIDelegate provides
    window-related methods that may be used by Javascript, plugins and
    other aspects of web pages. These methods are used to open new
    windows and control aspects of existing windows.
    @interface NSObject (WebUIDelegate)
*/
[
    object,
    oleautomation,
    uuid(042B7EE3-A5A4-4a8f-8C33-775CD9E89C7C),
    pointer_default(unique)
]
interface IWebUIDelegate : IUnknown
{
    /*!
        @method webView:createWebViewWithRequest:
        @abstract Create a new window and begin to load the specified request.
        @discussion The newly created window is hidden, and the window operations delegate on the
        new WebViews will get a webViewShow: call.
        @param sender The WebView sending the delegate method.
        @param request The request to load.
        @result The WebView for the new window.
        - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request;
    */
    HRESULT createWebViewWithRequest([in] IWebView* sender, [in] IWebURLRequest* request, [out, retval] IWebView** newWebView);

    /*!
        @method webViewShow:
        @param sender The WebView sending the delegate method.
        @abstract Show the window that contains the top level view of the WebView,
        ordering it frontmost.
        @discussion This will only be called just after createWindowWithRequest:
        is used to create a new window.
        - (void)webViewShow:(WebView *)sender;
    */
    HRESULT webViewShow([in] IWebView* sender);

    /*!
        @method webViewClose:
        @abstract Close the current window. 
        @param sender The WebView sending the delegate method.
        @discussion Clients showing multiple views in one window may
        choose to close only the one corresponding to this
        WebView. Other clients may choose to ignore this method
        entirely.
        - (void)webViewClose:(WebView *)sender;
    */
    HRESULT webViewClose([in] IWebView* sender);

    /*!
        @method webViewFocus:
        @abstract Focus the current window (i.e. makeKeyAndOrderFront:).
        @param The WebView sending the delegate method.
        @discussion Clients showing multiple views in one window may want to
        also do something to focus the one corresponding to this WebView.
        - (void)webViewFocus:(WebView *)sender;
    */
    HRESULT webViewFocus([in] IWebView* sender);

    /*!
        @method webViewUnfocus:
        @abstract Unfocus the current window.
        @param sender The WebView sending the delegate method.
        @discussion Clients showing multiple views in one window may want to
        also do something to unfocus the one corresponding to this WebView.
        - (void)webViewUnfocus:(WebView *)sender;
    */
    HRESULT webViewUnfocus([in] IWebView* sender);

    /*!
        @method webViewFirstResponder:
        @abstract Get the first responder for this window.
        @param sender The WebView sending the delegate method.
        @discussion This method should return the focused control in the
        WebView's view, if any. If the view is out of the window
        hierarchy, this might return something than calling firstResponder
        on the real NSWindow would. It's OK to return either nil or the
        real first responder if some control not in the window has focus.
        - (NSResponder *)webViewFirstResponder:(WebView *)sender;
    */
    HRESULT webViewFirstResponder([in] IWebView* sender, [out, retval] OLE_HANDLE* responderHWnd);

    /*!
        @method webView:makeFirstResponder:
        @abstract Set the first responder for this window.
        @param sender The WebView sending the delegate method.
        @param responder The responder to make first (will always be a view)
        @discussion responder will always be a view that is in the view
        subhierarchy of the top-level web view for this WebView. If the
        WebView's top level view is currently out of the view
        hierarchy, it may be desirable to save the first responder
        elsewhere, or possibly ignore this call.
        - (void)webView:(WebView *)sender makeFirstResponder:(NSResponder *)responder;
    */
    HRESULT makeFirstResponder([in] IWebView* sender, [in] OLE_HANDLE responderHWnd);

    /*!
        @method webView:setStatusText:
        @abstract Set the window's status display, if any, to the specified string.
        @param sender The WebView sending the delegate method.
        @param text The status text to set
        - (void)webView:(WebView *)sender setStatusText:(NSString *)text;
    */
    HRESULT setStatusText([in] IWebView* sender, [in] BSTR text);

    /*!
        @method webViewStatusText:
        @abstract Get the currently displayed status text.
        @param sender The WebView sending the delegate method.
        @result The status text
        - (NSString *)webViewStatusText:(WebView *)sender;
    */
    HRESULT webViewStatusText([in] IWebView* sender, [out, retval] BSTR* text);

    /*!
        @method webViewAreToolbarsVisible:
        @abstract Determine whether the window's toolbars are currently visible
        @param sender The WebView sending the delegate method.
        @discussion This method should return YES if the window has any
        toolbars that are currently on, besides the status bar. If the app
        has more than one toolbar per window, for example a regular
        command toolbar and a favorites bar, it should return YES from
        this method if at least one is on.
        @result YES if at least one toolbar is visible, otherwise NO.
        - (BOOL)webViewAreToolbarsVisible:(WebView *)sender;
    */
    HRESULT webViewAreToolbarsVisible([in] IWebView* sender, [out, retval] BOOL* visible);

    /*!
        @method webView:setToolbarsVisible:
        @param sender The WebView sending the delegate method.
        @abstract Set whether the window's toolbars are currently visible.
        @param visible New value for toolbar visibility
        @discussion Setting this to YES should turn on all toolbars
        (except for a possible status bar). Setting it to NO should turn
        off all toolbars (with the same exception).
        - (void)webView:(WebView *)sender setToolbarsVisible:(BOOL)visible;
    */
    HRESULT setToolbarsVisible([in] IWebView* sender, [in] BOOL visible);

    /*!
        @method webViewIsStatusBarVisible:
        @abstract Determine whether the status bar is visible.
        @param sender The WebView sending the delegate method.
        @result YES if the status bar is visible, otherwise NO.
        - (BOOL)webViewIsStatusBarVisible:(WebView *)sender;
    */
    HRESULT webViewIsStatusBarVisible([in] IWebView* sender, [out, retval] BOOL* visible);

    /*!
        @method webView:setStatusBarVisible:
        @abstract Set whether the status bar is currently visible.
        @param visible The new visibility value
        @discussion Setting this to YES should show the status bar,
        setting it to NO should hide it.
        - (void)webView:(WebView *)sender setStatusBarVisible:(BOOL)visible;
    */
    HRESULT setStatusBarVisible([in] IWebView* sender, [in] BOOL visible);

    /*!
        @method webViewIsResizable:
        @abstract Determine whether the window is resizable or not.
        @param sender The WebView sending the delegate method.
        @result YES if resizable, NO if not.
        @discussion If there are multiple views in the same window, they
        have have their own separate resize controls and this may need to
        be handled specially.
        - (BOOL)webViewIsResizable:(WebView *)sender;
    */
    HRESULT webViewIsResizable([in] IWebView* sender, [out, retval] BOOL* resizable);

    /*!
        @method webView:setResizable:
        @abstract Set the window to resizable or not
        @param sender The WebView sending the delegate method.
        @param resizable YES if the window should be made resizable, NO if not.
        @discussion If there are multiple views in the same window, they
        have have their own separate resize controls and this may need to
        be handled specially.
        - (void)webView:(WebView *)sender setResizable:(BOOL)resizable;
    */
    HRESULT setResizable([in] IWebView* sender, [in] BOOL resizable);

    /*!
        @method webView:setFrame:
        @abstract Set the window's frame rect
        @param sender The WebView sending the delegate method.
        @param frame The new window frame size
        @discussion Even though a caller could set the frame directly using the NSWindow,
        this method is provided so implementors of this protocol can do special
        things on programmatic move/resize, like avoiding autosaving of the size.
        - (void)webView:(WebView *)sender setFrame:(NSRect)frame;
    */
    HRESULT setFrame([in] IWebView* sender, [in] RECT* frame);

    /*!
        @method webViewFrame:
        @param sender The WebView sending the delegate method.
        @abstract REturn the window's frame rect
        @discussion 
        - (NSRect)webViewFrame:(WebView *)sender;
    */
    HRESULT webViewFrame([in] IWebView* sender, [out, retval] RECT* frame);

    /*!
        @method webView:setContentRect:
        @abstract Set the window's content rect
        @param sender The WebView sending the delegate method.
        @param frame The new window content rect
        @discussion Even though a caller could set the content rect
        directly using the NSWindow, this method is provided so
        implementors of this protocol can do special things on
        programmatic move/resize, like avoiding autosaving of the size.
        - (void)webView:(WebView *)sender setContentRect:(NSRect)contentRect;
    */
    HRESULT setContentRect([in] IWebView* sender, [in] RECT* contentRect);

    /*!
        @method webViewContentRect:
        @abstract Return the window's content rect
        @discussion 
        - (NSRect)webViewContentRect:(WebView *)sender;
    */
    HRESULT webViewContentRect([in] IWebView* sender, [out, retval] RECT* contentRect);

    /*!
        @method webView:runJavaScriptAlertPanelWithMessage:
        @abstract Display a JavaScript alert panel
        @param sender The WebView sending the delegate method.
        @param message The message to display
        @discussion Clients should visually indicate that this panel comes
        from JavaScript. The panel should have a single OK button.
        - (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message;
    */
    HRESULT runJavaScriptAlertPanelWithMessage([in] IWebView* sender, [in] BSTR message);

    /*!
        @method webView:runJavaScriptConfirmPanelWithMessage:
        @abstract Display a JavaScript confirm panel
        @param sender The WebView sending the delegate method.
        @param message The message to display
        @result YES if the user hit OK, no if the user chose Cancel.
        @discussion Clients should visually indicate that this panel comes
        from JavaScript. The panel should have two buttons, e.g. "OK" and
        "Cancel".
        - (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message;
    */
    HRESULT runJavaScriptConfirmPanelWithMessage([in] IWebView* sender, [in] BSTR message, [out, retval] BOOL* result);

    /*!
        @method webView:runJavaScriptTextInputPanelWithPrompt:defaultText:
        @abstract Display a JavaScript text input panel
        @param sender The WebView sending the delegate method.
        @param message The message to display
        @param defaultText The initial text for the text entry area.
        @result The typed text if the user hit OK, otherwise nil.
        @discussion Clients should visually indicate that this panel comes
        from JavaScript. The panel should have two buttons, e.g. "OK" and
        "Cancel", and an area to type text.
        - (NSString *)webView:(WebView *)sender runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText;
    */
    HRESULT runJavaScriptTextInputPanelWithPrompt([in] IWebView* sender, [in] BSTR message, [in] BSTR defaultText, [out, retval] BSTR* result);

    /*!
        @method webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:
        @abstract Display a confirm panel by an "before unload" event handler.
        @param sender The WebView sending the delegate method.
        @param message The message to display.
        @param frame The WebFrame whose JavaScript initiated this call.
        @result YES if the user hit OK, NO if the user chose Cancel.
        @discussion Clients should include a message in addition to the one
        supplied by the web page that indicates. The panel should have 
        two buttons, e.g. "OK" and "Cancel".
        - (BOOL)webView:(WebView *)sender runBeforeUnloadConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
    */
    HRESULT runBeforeUnloadConfirmPanelWithMessage([in] IWebView* sender, [in] BSTR message, [in] IWebFrame* initiatedByFrame, [out, retval] BOOL* result);

    /*!
        @method webView:runOpenPanelForFileButtonWithResultListener:
        @abstract Display a file open panel for a file input control.
        @param sender The WebView sending the delegate method.
        @param resultListener The object to call back with the results.
        @discussion This method is passed a callback object instead of giving a return
        value so that it can be handled with a sheet.
        - (void)webView:(WebView *)sender runOpenPanelForFileButtonWithResultListener:(id<WebOpenPanelResultListener>)resultListener;
    */
    HRESULT runOpenPanelForFileButtonWithResultListener([in] IWebView* sender, [in] IWebOpenPanelResultListener* resultListener);

    /*!
        @method webView:mouseDidMoveOverElement:modifierFlags:
        @abstract Update the window's feedback for mousing over links to reflect a new item the mouse is over
        or new modifier flags.
        @param sender The WebView sending the delegate method.
        @param elementInformation Dictionary that describes the element that the mouse is over, or nil.
        @param modifierFlags The modifier flags as in NSEvent.
        - (void)webView:(WebView *)sender mouseDidMoveOverElement:(NSDictionary *)elementInformation modifierFlags:(WebNSUInt)modifierFlags;
    */
    HRESULT mouseDidMoveOverElement([in] IWebView* sender, [in] IPropertyBag* elementInformation, [in] UINT modifierFlags);

    /*!
        @method webView:contextMenuItemsForElement:defaultMenuItems:
        @abstract Returns the menu items to display in an element's contextual menu.
        @param sender The WebView sending the delegate method.
        @param element A dictionary representation of the clicked element.
        @param defaultMenuItems An array of default NSMenuItems to include in all contextual menus.
        @result An array of NSMenuItems to include in the contextual menu.
        - (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *)defaultMenuItems;
    */
    HRESULT contextMenuItemsForElement([in] IWebView* sender, [in] IPropertyBag* element, [in] OLE_HANDLE defaultItemsHMenu, [out, retval] OLE_HANDLE* resultHMenu);

    /*!
        @method webView:validateUserInterfaceItem:defaultValidation:
        @abstract Controls UI validation
        @param webView The WebView sending the delegate method
        @param item The user interface item being validated
        @pararm defaultValidation Whether or not the WebView thinks the item is valid
        @discussion This method allows the UI delegate to control WebView's validation of user interface items.
        See WebView.h to see the methods to that WebView can currently validate. See NSUserInterfaceValidations and
        NSValidatedUserInterfaceItem for information about UI validation.
        - (BOOL)webView:(WebView *)webView validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item defaultValidation:(BOOL)defaultValidation;
    */
    HRESULT validateUserInterfaceItem([in] IWebView* webView, [in] UINT itemCommandID, [in] BOOL defaultValidation, [out, retval] BOOL* isValid);

    /*!
        @method webView:shouldPerformAction:fromSender:
        @abstract Controls actions
        @param webView The WebView sending the delegate method
        @param action The action being sent
        @param sender The sender of the action
        @discussion This method allows the UI delegate to control WebView's behavior when an action is being sent.
        For example, if the action is copy:, the delegate can return YES to allow WebView to perform its default
        copy behavior or return NO and perform copy: in some other way. See WebView.h to see the actions that
        WebView can perform.
        - (BOOL)webView:(WebView *)webView shouldPerformAction:(SEL)action fromSender:(id)sender;
    */
    HRESULT shouldPerformAction([in] IWebView* webView, [in] UINT itemCommandID, [in] UINT sender);

    /*!
        @method webView:dragDestinationActionMaskForDraggingInfo:
        @abstract Controls behavior when dragging to a WebView
        @param webView The WebView sending the delegate method
        @param draggingInfo The dragging info of the drag
        @discussion This method is called periodically as something is dragged over a WebView. The UI delegate can return a mask
        indicating which drag destination actions can occur, WebDragDestinationActionAny to allow any kind of action or
        WebDragDestinationActionNone to not accept the drag.
        - (unsigned)webView:(WebView *)webView dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
    */
    HRESULT dragDestinationActionMaskForDraggingInfo([in] IWebView* webView, [in] IDataObject* draggingInfo, [out, retval] WebDragDestinationAction* action);

    /*!
        @method webView:willPerformDragDestinationAction:forDraggingInfo:
        @abstract Informs that WebView will perform a drag destination action
        @param webView The WebView sending the delegate method
        @param action The drag destination action
        @param draggingInfo The dragging info of the drag
        @discussion This method is called after the last call to webView:dragDestinationActionMaskForDraggingInfo: after something is dropped on a WebView.
        This method informs the UI delegate of the drag destination action that WebView will perform.
        - (void)webView:(WebView *)webView willPerformDragDestinationAction:(WebDragDestinationAction)action forDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
    */
    HRESULT willPerformDragDestinationAction([in] IWebView* webView, [in] WebDragDestinationAction action, [in] IDataObject* draggingInfo);

    /*!
        @method webView:dragSourceActionMaskForPoint:
        @abstract Controls behavior when dragging from a WebView
        @param webView The WebView sending the delegate method
        @param point The point where the drag started in the coordinates of the WebView
        @discussion This method is called after the user has begun a drag from a WebView. The UI delegate can return a mask indicating
        which drag source actions can occur, WebDragSourceActionAny to allow any kind of action or WebDragSourceActionNone to not begin a drag.
        - (unsigned)webView:(WebView *)webView dragSourceActionMaskForPoint:(NSPoint)point;
    */
    HRESULT dragSourceActionMaskForPoint([in] IWebView* webView, [in] LPPOINT point, [out, retval] WebDragSourceAction* action);

    /*!
        @method webView:willPerformDragSourceAction:fromPoint:withPasteboard:
        @abstract Informs that a drag a has begun from a WebView
        @param webView The WebView sending the delegate method
        @param action The drag source action
        @param point The point where the drag started in the coordinates of the WebView
        @param pasteboard The drag pasteboard
        @discussion This method is called after webView:dragSourceActionMaskForPoint: is called after the user has begun a drag from a WebView.
        This method informs the UI delegate of the drag source action that will be performed and gives the delegate an opportunity to modify
        the contents of the dragging pasteboard.
        - (void)webView:(WebView *)webView willPerformDragSourceAction:(WebDragSourceAction)action fromPoint:(NSPoint)point withPasteboard:(NSPasteboard *)pasteboard;
    */
    HRESULT willPerformDragSourceAction([in] IWebView* webView, [in] WebDragSourceAction action, [in] LPPOINT point, [in] IDataObject* pasteboard, [out, retval] IDataObject** newPasteboard);

    /*!
        @method webView:contextMenuItemSelected:ForElement:
        @abstract Perform the action associated with the selected item.
        @param sender The WebView sending the delegate method.
        @param item The menu item that was selected.
        @param element A dictionary representation of the clicked element.
    */
    [local] HRESULT contextMenuItemSelected([in] IWebView* sender, [in] void* item, [in] IPropertyBag* element);

    /*
        @method hasCustomMenuImplementation:
        @abstract Returns whether the application uses the following functions to create a custom menu impementation.
    */
    HRESULT hasCustomMenuImplementation([out, retval] BOOL* hasCustomMenus);
    
    /*
        @method webView:trackCutsomPopupMenu
        @abstract Adds custom draw data to the menu items and calls a custom trackPopupMenu.
        @param sender The WebView sending the delegate method.
        @param menu The menu that we want to pop up.
        @param point The point associated with the context menu event in the coordinates of the WebView
    */
    HRESULT trackCustomPopupMenu([in] IWebView* sender, [in] OLE_HANDLE hMenu, [in] LPPOINT point);

    /*
        @method webView:measureCustomMenuItem
        @abstract This is called when the WM_MEASUREITEM command is received to measure the custom menu items
        @param sender The WebView sending the delegate method.
        @param measureItem The LPMEASUREITEMSTRUCT associated with the item.
    */
    [local] HRESULT measureCustomMenuItem([in] IWebView* sender, [in] void* measureItem);

    /*
        @method webView:drawCustomMenuItem
        @abstract This is called when the WM_DRAWITEM command is received to draw the custom menu item
        @param sender The WebView sending the delegate method.
        @param drawItem The LPDRAWITEMSTRUCT associated with the item.
    */
    [local] HRESULT drawCustomMenuItem([in] IWebView* sender, [in] void* drawItem);

    /*
        @method webView:addCustomMenuDrawingData
        @abstract Add custom data to the menu that the delegate can use when asked to draw.
        @param sender The WebView sending the delegate method.
        @param menu The cutsom menu to clean up.
        @discussion This method is called for submenus as well.
    */
    HRESULT addCustomMenuDrawingData([in] IWebView* sender, [in] OLE_HANDLE hMenu);

    /*
        @method webView:cleanUpCustomMenuDrawingData
        @abstract Clean up any custom data added to the menu items
        @param sender The WebView sending the delegate method.
        @param menu The cutsom menu to clean up.
    */
    HRESULT cleanUpCustomMenuDrawingData([in] IWebView* sender, [in] OLE_HANDLE hMenu);

    /*!
        @method webView:canTakeFocus:
        @abstract Informs whether focus can be transferred out of the WebView in the specified direction
        @param sender The WebView sending the delegate method.
        @param forward Whether focus is moving forward or backward.
    */
    HRESULT canTakeFocus([in] IWebView* sender, [in] BOOL forward, [out] BOOL* result);

    /*!
        @method webView:takeFocus:
        @abstract Instructs the delegate to take focus out of the WebView
        @param sender The WebView sending the delegate method.
        @param forward Whether focus is moving forward or backward.
    */
    HRESULT takeFocus([in] IWebView* sender, [in] BOOL forward);

    /// Undo related UI delegate methods --------------------------------------------------------------------------------

    /*!
        @method registerUndoWithTarget:
        @abstract Registers an undo operation of a IWebUndoTarget on the undo/redo stack.
        @param target The target that will be called back when the action is undone
        @param actionName The name of the action - this will be passed back to the target when we need to undo the operation
        @param actionArg An object that target used to save undo information
    */
    HRESULT registerUndoWithTarget([in] IWebUndoTarget* target, [in] BSTR actionName, [in] IUnknown* actionArg);

    /*!
        @method removeAllActionsWithTarget:
        @abstract remove all the undo operations that are registered for the passed in target on the undo/redo stack.
        @param target 
    */
    HRESULT removeAllActionsWithTarget([in] IWebUndoTarget* target);

    /*!
        @method setActionTitle:
        @abstract Sets the name of the action for the current group of undo operations
        @param actionName Name of the action
    */
    HRESULT setActionTitle([in] BSTR actionTitle);

    /*!
        @method undo:
        @abstract Undo the last group of operations
    */
    HRESULT undo();

    /*!
        @method redo:
        @abstract Redo the last group of operations
    */
    HRESULT redo();

    /*!
        @method canUndo:
        @abstract Returns whether there's anything on the undo stack to be undone
    */
    HRESULT canUndo([out, retval] BOOL* result);

    /*!
        @method canRedo:
        @abstract Returns whether there's anything on the redo stack to be redone
    */
    HRESULT canRedo([out, retval] BOOL* result);

/*!
    @method webView:printFrame:
    @abstract Informs that a WebFrame needs to be printed
    @param webView The WebView sending the delegate method
    @param frame The WebFrame needing to be printed
    @discussion This method is called when a script or user requests the page to be printed.
    In this method the delegate can prepare the WebFrame to be printed.
*/
    HRESULT printFrame([in] IWebView* webView, [in] IWebFrame* frame);

/*!
    @method webView:ftpDirectoryTemplatePath
    @abstract Returns the path to the FTP directory listing template document
    @param webView The WebView sending the delegate method
    @param path The path to the template document
    @discussion This method is called when an FTP directory listing is viewed in a webView.  
    In practice, all WebViews show the same template document data that was loaded for the very
    first WebView that displayed a directory listing, so this will only be called once.
*/
    HRESULT ftpDirectoryTemplatePath([in] IWebView* webView, [out, retval] BSTR* path);

/*!
    @method webViewHeaderHeight:
    @param webView The WebView sending the delegate method
    @abstract Reserve a height for the printed page header.
    @result The height to reserve for the printed page header, return 0.0 to not reserve any space for a header.
    @discussion The height returned will be used to calculate the rect passed to webView:drawHeaderInRect:.

    - (float)webViewHeaderHeight:(WebView *)sender;
*/
    HRESULT webViewHeaderHeight([in] IWebView* webView, [out, retval] float* result);

/*!
    @method webViewFooterHeight:
    @param webView The WebView sending the delegate method
    @abstract Reserve a height for the printed page footer.
    @result The height to reserve for the printed page footer, return 0.0 to not reserve any space for a footer.
    @discussion The height returned will be used to calculate the rect passed to webView:drawFooterInRect:.

    - (float)webViewFooterHeight:(WebView *)sender;
*/
    HRESULT webViewFooterHeight([in] IWebView* webView, [out, retval] float* result);

/*!
    @method webView:drawHeaderInRect:
    @param webView The WebView sending the delegate method
    @param rect The NSRect reserved for the header of the page
    @abstract The delegate should draw a header for the sender in the supplied rect.

    - (void)webView:(WebView *)sender drawHeaderInRect:(NSRect)rect;
*/
    HRESULT drawHeaderInRect([in] IWebView* webView, [in] RECT* rect, [in] OLE_HANDLE drawingContext);

/*!
    @method webView:drawFooterInRect:
    @param webView The WebView sending the delegate method
    @param rect The NSRect reserved for the footer of the page
    @abstract The delegate should draw a footer for the sender in the supplied rect.

    - (void)webView:(WebView *)sender drawFooterInRect:(NSRect)rect;
*/
    HRESULT drawFooterInRect([in] IWebView* webView, [in] RECT* rect, [in] OLE_HANDLE drawingContext, [in] UINT pageIndex, [in] UINT pageCount);

    HRESULT webViewPrintingMarginRect([in] IWebView* webView, [out, retval] RECT* rect);

    HRESULT canRunModal([in] IWebView* webView, [out, retval] BOOL* canRunBoolean);
    HRESULT createModalDialog([in] IWebView* sender, [in] IWebURLRequest* request, [out, retval] IWebView** newWebView);
    HRESULT runModal([in] IWebView* webView);
    HRESULT isMenuBarVisible([in] IWebView* webView, [out, retval] BOOL* visible);
    HRESULT setMenuBarVisible([in] IWebView* webView, [in] BOOL visible);
    HRESULT runDatabaseSizeLimitPrompt([in] IWebView* webView, [in] BSTR displayName, [in] IWebFrame* initiatedByFrame, [out, retval] BOOL* allowed);
    HRESULT paintCustomScrollbar([in] IWebView* webView, [in] HDC hDC, [in] RECT rect, [in] WebScrollBarControlSize size, [in] WebScrollbarControlState state, 
                                 [in] WebScrollbarControlPart pressedPart, [in] BOOL vertical, [in] float value, [in] float proportion, [in] WebScrollbarControlPartMask parts);
    HRESULT paintCustomScrollCorner([in] IWebView* webView, [in] HDC hDC, [in] RECT rect);
}