webengine/osswebengine/WebKit/win/Interfaces/IWebDocument.idl
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 cpp_quote("/*")
       
    27 cpp_quote(" * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.")
       
    28 cpp_quote(" *")
       
    29 cpp_quote(" * Redistribution and use in source and binary forms, with or without")
       
    30 cpp_quote(" * modification, are permitted provided that the following conditions")
       
    31 cpp_quote(" * are met:")
       
    32 cpp_quote(" * 1. Redistributions of source code must retain the above copyright")
       
    33 cpp_quote(" *    notice, this list of conditions and the following disclaimer.")
       
    34 cpp_quote(" * 2. Redistributions in binary form must reproduce the above copyright")
       
    35 cpp_quote(" *    notice, this list of conditions and the following disclaimer in the")
       
    36 cpp_quote(" *    documentation and/or other materials provided with the distribution.")
       
    37 cpp_quote(" *")
       
    38 cpp_quote(" * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY")
       
    39 cpp_quote(" * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE")
       
    40 cpp_quote(" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR")
       
    41 cpp_quote(" * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR")
       
    42 cpp_quote(" * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,")
       
    43 cpp_quote(" * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,")
       
    44 cpp_quote(" * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR")
       
    45 cpp_quote(" * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY")
       
    46 cpp_quote(" * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT")
       
    47 cpp_quote(" * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE")
       
    48 cpp_quote(" * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ")
       
    49 cpp_quote(" */")
       
    50 
       
    51 import "oaidl.idl";
       
    52 import "ocidl.idl";
       
    53 import "IWebError.idl";
       
    54 import "IWebDataSource.idl";
       
    55 import "IWebError.idl";
       
    56 
       
    57 interface IWebError;
       
    58 interface IWebDataSource;
       
    59 
       
    60 /*!
       
    61     @protocol WebDocumentView
       
    62     @discussion Protocol implemented by the document view of WebFrameView
       
    63 
       
    64     @protocol WebDocumentView <NSObject>
       
    65 */
       
    66 [
       
    67     object,
       
    68     oleautomation,
       
    69     uuid(0A6397A7-90FE-49a0-B9C1-44693DD779F7),
       
    70     pointer_default(unique)
       
    71 ]
       
    72 interface IWebDocumentView : IUnknown
       
    73 {
       
    74     /*!
       
    75         @method setDataSource:
       
    76         @abstract Called when the corresponding data source has been created.
       
    77         @param dataSource The corresponding data source.
       
    78         - (void)setDataSource:(WebDataSource *)dataSource;
       
    79     */
       
    80     HRESULT setDataSource([in] IWebDataSource* dataSource);
       
    81 
       
    82     /*!
       
    83         @method dataSourceUpdated:
       
    84         @abstract Called when the corresponding data source has received data.
       
    85         @param dataSource The corresponding data source.
       
    86         - (void)dataSourceUpdated:(WebDataSource *)dataSource;
       
    87     */
       
    88     HRESULT dataSourceUpdated([in] IWebDataSource* dataSource);
       
    89 
       
    90     /*!
       
    91         @method setNeedsLayout:
       
    92         @discussion Called when WebKit has determined that the document view needs to layout.
       
    93         This method should simply set a flag and call layout from drawRect if the flag is YES.
       
    94         @param flag YES to cause a layout, no to not cause a layout.
       
    95         - (void)setNeedsLayout:(BOOL)flag;
       
    96     */
       
    97     HRESULT setNeedsLayout([in] BOOL flag);
       
    98 
       
    99     /*!
       
   100         @method layout
       
   101         @discussion Called when the document view must immediately layout. For simple views,
       
   102         setting the frame is a sufficient implementation of this method.
       
   103         - (void)layout;
       
   104     */
       
   105     HRESULT layout();
       
   106 
       
   107     /*!
       
   108         @method viewWillMoveToHostWindow:
       
   109         @param hostWindow The host window for the document view.
       
   110         @abstract Called before the host window is set on the parent web view.
       
   111         - (void)viewWillMoveToHostWindow:(NSWindow *)hostWindow;
       
   112     */
       
   113     HRESULT viewWillMoveToHostWindow([in] OLE_HANDLE hwnd);
       
   114 
       
   115     /*!
       
   116         @method viewDidMoveToHostWindow
       
   117         @abstract Called after the host window is set on the parent web view.
       
   118         - (void)viewDidMoveToHostWindow;
       
   119     */
       
   120     HRESULT viewDidMoveToHostWindow();
       
   121 }
       
   122 
       
   123 /*!
       
   124     @protocol WebDocumentSearching
       
   125     @discussion Optional protocol for searching document view of WebFrameView. 
       
   126     
       
   127     @protocol WebDocumentSearching <NSObject>
       
   128 */
       
   129 [
       
   130     object,
       
   131     oleautomation,
       
   132     uuid(0213643B-8DF9-4ba4-9534-61D92CB75007),
       
   133     pointer_default(unique)
       
   134 ]
       
   135 interface IWebDocumentSearching : IUnknown
       
   136 {
       
   137     /*!
       
   138         @method searchFor:direction:caseSensitive:wrap:
       
   139         @abstract Searches a document view for a string and highlights the string if it is found.
       
   140         @param string The string to search for.
       
   141         @param forward YES to search forward, NO to seach backwards.
       
   142         @param caseFlag YES to for case-sensitive search, NO for case-insensitive search.
       
   143         @param wrapFlag YES to wrap around, NO to avoid wrapping.
       
   144         @result YES if found, NO if not found.
       
   145         - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag;
       
   146     */
       
   147     HRESULT searchFor([in] BSTR str, [in] BOOL forwardDirection, [in] BOOL caseSensitive, [in] BOOL wrap, [out, retval] BOOL* result);
       
   148 }
       
   149 
       
   150 /*!
       
   151     @protocol WebDocumentText
       
   152     @discussion Optional protocol for supporting text operations.
       
   153 
       
   154     @protocol WebDocumentText <NSObject>
       
   155 */
       
   156 [
       
   157     object,
       
   158     oleautomation,
       
   159     uuid(B6282B92-6F31-4948-A3A0-89763C56BBBF),
       
   160     pointer_default(unique)
       
   161 ]
       
   162 interface IWebDocumentText : IUnknown
       
   163 {
       
   164     /*!
       
   165         @method supportsTextEncoding
       
   166         @result YES if the document view support text encoding, NO if it doesn't.
       
   167         - (BOOL)supportsTextEncoding;
       
   168     */
       
   169     HRESULT supportsTextEncoding([out, retval] BOOL* result);
       
   170 
       
   171     /*!
       
   172         @method string
       
   173         @result String that represents the entire document.
       
   174         - (NSString *)string;
       
   175     */
       
   176     HRESULT string([out, retval] BSTR* result);
       
   177 
       
   178     /*!
       
   179         @method selectedString
       
   180         @result String that represents the current selection.
       
   181         - (NSString *)selectedString;
       
   182     */
       
   183     HRESULT selectedString([out, retval] BSTR* result);
       
   184 
       
   185     /*!
       
   186         @method selectAll
       
   187         @abstract Selects all the text in the document.
       
   188         - (void)selectAll;
       
   189     */
       
   190     HRESULT selectAll();
       
   191 
       
   192     /*!
       
   193         @method deselectText
       
   194         @abstract Causes a text selection to lose its selection.
       
   195         - (void)deselectAll;
       
   196     */
       
   197     HRESULT deselectAll();
       
   198 }
       
   199 
       
   200 /*!
       
   201     @protocol WebDocumentRepresentation
       
   202     @discussion Protocol implemented by the document representation of a data source.
       
   203 
       
   204     @protocol WebDocumentRepresentation <NSObject>
       
   205 */
       
   206 [
       
   207     object,
       
   208     oleautomation,
       
   209     uuid(3C9F6251-CFD8-447a-B429-6B6AE627436C),
       
   210     pointer_default(unique)
       
   211 ]
       
   212 interface IWebDocumentRepresentation : IUnknown
       
   213 {
       
   214     /*!
       
   215         @method setDataSource:
       
   216         @abstract Called soon after the document representation is created.
       
   217         @param dataSource The data source that is set.
       
   218         - (void)setDataSource:(WebDataSource *)dataSource;
       
   219     */
       
   220     HRESULT setDataSource([in] IWebDataSource* dataSource);
       
   221 
       
   222     /*!
       
   223         @method receivedData:withDataSource:
       
   224         @abstract Called when the data source has received data.
       
   225         @param data The data that the data source has received.
       
   226         @param dataSource The data source that has received data.
       
   227         - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource;
       
   228     */
       
   229     HRESULT receivedData([in] IStream* data, [in] IWebDataSource* dataSource);
       
   230 
       
   231     /*!
       
   232         @method receivedError:withDataSource:
       
   233         @abstract Called when the data source has received an error.
       
   234         @param error The error that the data source has received.
       
   235         @param dataSource The data source that has received the error.
       
   236         - (void)receivedError:(NSError *)error withDataSource:(WebDataSource *)dataSource;
       
   237     */
       
   238     HRESULT receivedError([in] IWebError* error, [in] IWebDataSource* dataSource);
       
   239 
       
   240     /*!
       
   241         @method finishedLoadingWithDataSource:
       
   242         @abstract Called when the data source has finished loading.
       
   243         @param dataSource The datasource that has finished loading.
       
   244         - (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource;
       
   245     */
       
   246     HRESULT finishedLoadingWithDataSource([in] IWebDataSource* dataSource);
       
   247 
       
   248     /*!
       
   249         @method canProvideDocumentSource
       
   250         @result Returns true if the representation can provide document source.
       
   251         - (BOOL)canProvideDocumentSource;
       
   252     */
       
   253     HRESULT canProvideDocumentSource([out, retval] BOOL* result);
       
   254 
       
   255     /*!
       
   256         @method documentSource
       
   257         @result Returns the textual source representation of the document.  For HTML documents
       
   258         this is the original HTML source.
       
   259         - (NSString *)documentSource;
       
   260     */
       
   261     HRESULT documentSource([out, retval] BSTR* source);
       
   262 
       
   263     /*!
       
   264         @method title
       
   265         @result Return the title for the document.
       
   266         - (NSString *)title;
       
   267     */
       
   268     HRESULT title([out, retval] BSTR* docTitle);
       
   269 }