1/*
2 * Copyright (C) 2006, 2007, 2008 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 DO_NO_IMPORTS
27import "oaidl.idl";
28import "ocidl.idl";
29import "DOMHTML.idl";
30import "IWebFrame.idl";
31#endif
32
33interface IDOMElement;
34interface IDOMHTMLInputElement;
35interface IDOMHTMLTextAreaElement;
36interface IWebFrame;
37
38/*!
39    @protocol  WebFormSubmissionListener
40    @discussion .
41*/
42[
43    object,
44    oleautomation,
45    uuid(1911D650-035E-4204-8746-ABECF77A4C9B),
46    pointer_default(unique)
47]
48interface IWebFormSubmissionListener : IUnknown
49{
50    HRESULT continueSubmit();
51}
52
53/*!
54    @class WebFormDelegate
55    @discussion The WebFormDelegate class responds to all WebFormDelegate protocol
56    methods by doing nothing. It's provided for the convenience of clients who only want
57    to implement some of the above methods and ignore others.
58*/
59/*!
60    @protocol  WebFormDelegate
61    @discussion .
62
63    Various methods send by controls that edit text to their delegates, which are all
64    analogous to similar methods in AppKit/NSControl.h.
65    These methods are forwarded from widgets used in forms to the WebFormDelegate.
66*/
67[
68    object,
69    oleautomation,
70    uuid(4CBEC1BD-ABC3-4bdb-8E5E-4D3BCF9E8C1E),
71    pointer_default(unique)
72]
73interface IWebFormDelegate : IUnknown
74{
75    //- (void)textFieldDidBeginEditing:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame;
76    HRESULT textFieldDidBeginEditing([in] IDOMHTMLInputElement* element, [in] IWebFrame* frame);
77
78    //- (void)textFieldDidEndEditing:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame;
79    HRESULT textFieldDidEndEditing([in] IDOMHTMLInputElement* element, [in] IWebFrame* frame);
80
81    //- (void)textDidChangeInTextField:(DOMHTMLInputElement *)element inFrame:(WebFrame *)frame;
82    HRESULT textDidChangeInTextField([in] IDOMHTMLInputElement* element, [in] IWebFrame* frame);
83
84    //- (void)textDidChangeInTextArea:(DOMHTMLTextAreaElement *)element inFrame:(WebFrame *)frame;
85    HRESULT textDidChangeInTextArea([in] IDOMHTMLTextAreaElement* element, [in] IWebFrame* frame);
86
87    //- (BOOL)textField:(DOMHTMLInputElement *)element doCommandBySelector:(SEL)commandSelector inFrame:(WebFrame *)frame;
88    HRESULT doPlatformCommand([in] IDOMHTMLInputElement* element, [in] BSTR command, [in] IWebFrame* frame, [out, retval] BOOL* result);
89
90    //- (BOOL)textField:(DOMHTMLInputElement *)element shouldHandleEvent:(NSEvent *)event inFrame:(WebFrame *)frame;
91    [local] HRESULT shouldHandleEvent([in] IDOMHTMLInputElement* element, [in] void* event, [in] IWebFrame* frame, [out, retval] BOOL* result);
92
93    // Sent when a form is just about to be submitted (before the load is started)
94    // listener must be sent continue when the delegate is done.
95    //- (void)frame:(WebFrame *)frame sourceFrame:(WebFrame *)sourceFrame willSubmitForm:(DOMElement *)form withValues:(NSDictionary *)values submissionListener:(id <WebFormSubmissionListener>)listener;
96    HRESULT willSubmitForm([in] IWebFrame* frame, [in] IWebFrame* sourceFrame, [in] IDOMElement* form, [in] IPropertyBag* values, [in] IWebFormSubmissionListener* listener);
97}
98