webengine/osswebengine/WebKit/win/Interfaces/IWebDataSource.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 "IWebMutableURLRequest.idl";
       
    54 import "IWebURLResponse.idl";
       
    55 import "IWebResource.idl";
       
    56 import "IWebArchive.idl";
       
    57 import "IWebDocument.idl";
       
    58 import "IWebFrame.idl";
       
    59 
       
    60 
       
    61 interface IWebMutableURLRequest;
       
    62 interface IWebURLConnection;
       
    63 interface IWebURLRequest;
       
    64 interface IWebURLResponse;
       
    65 interface IWebArchive;
       
    66 interface IWebDataSourcePrivate;
       
    67 interface IWebFrame;
       
    68 interface IWebResource;
       
    69 
       
    70 interface IWebDocumentRepresentation;
       
    71 
       
    72 /*!
       
    73     @class WebDataSource
       
    74     @discussion A WebDataSource represents the data associated with a web page.
       
    75     A datasource has a WebDocumentRepresentation which holds an appropriate
       
    76     representation of the data.  WebDataSources manage a hierarchy of WebFrames.
       
    77     WebDataSources are typically related to a view by their containing WebFrame.
       
    78 */
       
    79 [
       
    80     object,
       
    81     oleautomation,
       
    82     uuid(5221A975-AE09-4a7b-A4DF-E3B1B5F38A21),
       
    83     pointer_default(unique)
       
    84 ]
       
    85 interface IWebDataSource : IUnknown
       
    86 {
       
    87     /*!
       
    88         @method initWithRequest:
       
    89         @abstract The designated initializer for WebDataSource.
       
    90         @param request The request to use in creating a datasource.
       
    91         @result Returns an initialized WebDataSource.
       
    92         - (id)initWithRequest:(NSURLRequest *)request;
       
    93     */
       
    94     HRESULT initWithRequest([in] IWebURLRequest* request);
       
    95 
       
    96     /*!
       
    97         @method data
       
    98         @discussion The data will be incomplete until the datasource has completely loaded.  
       
    99         @result Returns the raw data associated with the datasource.  Returns nil
       
   100         if the datasource hasn't loaded any data.
       
   101         - (NSData *)data;
       
   102     */
       
   103     HRESULT data([out, retval] IStream** stream);
       
   104 
       
   105     /*!
       
   106         @method representation
       
   107         @discussion A representation holds a type specific representation
       
   108         of the datasource's data.  The representation class is determined by mapping
       
   109         a MIME type to a class.  The representation is created once the MIME type
       
   110         of the datasource content has been determined.
       
   111         @result Returns the representation associated with this datasource.
       
   112         Returns nil if the datasource hasn't created it's representation.
       
   113         - (id <WebDocumentRepresentation>)representation;
       
   114     */
       
   115     HRESULT representation([out, retval] IWebDocumentRepresentation** rep);
       
   116 
       
   117     /*!
       
   118         @method webFrame
       
   119         @result Return the frame that represents this data source.
       
   120         - (WebFrame *)webFrame;
       
   121     */
       
   122     HRESULT webFrame([out, retval] IWebFrame** frame);
       
   123 
       
   124     /*!
       
   125         @method initialRequest
       
   126         @result Returns a reference to the original request that created the
       
   127         datasource.  This request will be unmodified by WebKit. 
       
   128         - (NSURLRequest *)initialRequest;
       
   129     */
       
   130     HRESULT initialRequest([out, retval] IWebURLRequest** request);
       
   131 
       
   132     /*!
       
   133         @method request
       
   134         @result Returns the request that was used to create this datasource.
       
   135         - (NSMutableURLRequest *)request;
       
   136     */
       
   137     HRESULT request([out, retval] IWebMutableURLRequest** request);
       
   138 
       
   139     /*!
       
   140         @method response
       
   141         @result returns the WebResourceResponse for the data source.
       
   142         - (NSURLResponse *)response;
       
   143     */
       
   144     HRESULT response([out, retval] IWebURLResponse** response);
       
   145 
       
   146     /*!
       
   147         @method textEncodingName
       
   148         @result Returns either the override encoding, as set on the WebView for this 
       
   149         dataSource or the encoding from the response.
       
   150         - (NSString *)textEncodingName;
       
   151     */
       
   152     HRESULT textEncodingName([out, retval] BSTR* name);
       
   153 
       
   154     /*!
       
   155         @method isLoading
       
   156         @discussion Returns YES if there are any pending loads.
       
   157         - (BOOL)isLoading;
       
   158     */
       
   159     HRESULT isLoading([out, retval] BOOL* loading);
       
   160 
       
   161     /*!
       
   162         @method pageTitle
       
   163         @result Returns nil or the page title.
       
   164         - (NSString *)pageTitle;
       
   165     */
       
   166     HRESULT pageTitle([out, retval] BSTR* title);
       
   167 
       
   168     /*!
       
   169         @method unreachableURL
       
   170         @discussion This will be non-nil only for dataSources created by calls to the 
       
   171         WebFrame method loadAlternateHTMLString:baseURL:forUnreachableURL:.
       
   172         @result returns the unreachableURL for which this dataSource is showing alternate content, or nil
       
   173         - (NSURL *)unreachableURL;
       
   174     */
       
   175     HRESULT unreachableURL([out, retval] BSTR* url);
       
   176 
       
   177     /*!
       
   178         @method webArchive
       
   179         @result A WebArchive representing the data source, its subresources and child frames.
       
   180         @description This method constructs a WebArchive using the original downloaded data.
       
   181         In the case of HTML, if the current state of the document is preferred, webArchive should be
       
   182         called on the DOM document instead.
       
   183         - (WebArchive *)webArchive;
       
   184     */
       
   185     HRESULT webArchive([out, retval] IWebArchive** archive);
       
   186 
       
   187     /*!
       
   188         @method mainResource
       
   189         @result A WebResource representing the data source.
       
   190         @description This method constructs a WebResource using the original downloaded data.
       
   191         This method can be used to construct a WebArchive in case the archive returned by
       
   192         WebDataSource's webArchive isn't sufficient.
       
   193         - (WebResource *)mainResource;
       
   194     */
       
   195     HRESULT mainResource([out, retval] IWebResource** resource);
       
   196 
       
   197     /*!
       
   198         @method subresources
       
   199         @abstract Returns all the subresources associated with the data source.
       
   200         @description The returned array only contains subresources that have fully downloaded.
       
   201         - (NSArray *)subresources;
       
   202     */
       
   203     HRESULT subresources([out, retval] IEnumVARIANT** enumResources);
       
   204 
       
   205     /*!
       
   206         method subresourceForURL:
       
   207         @abstract Returns a subresource for a given URL.
       
   208         @param URL The URL of the subresource.
       
   209         @description Returns non-nil if the data source has fully downloaded a subresource with the given URL.
       
   210         - (WebResource *)subresourceForURL:(NSURL *)URL;
       
   211     */
       
   212     HRESULT subresourceForURL([in] BSTR url, [out, retval] IWebResource** resource);
       
   213 
       
   214     /*!
       
   215         @method addSubresource:
       
   216         @abstract Adds a subresource to the data source.
       
   217         @param subresource The subresource to be added.
       
   218         @description addSubresource: adds a subresource to the data source's list of subresources.
       
   219         Later, if something causes the data source to load the URL of the subresource, the data source
       
   220         will load the data from the subresource instead of from the network. For example, if one wants to add
       
   221         an image that is already downloaded to a web page, addSubresource: can be called so that the data source
       
   222         uses the downloaded image rather than accessing the network. NOTE: If the data source already has a
       
   223         subresource with the same URL, addSubresource: will replace it.
       
   224         - (void)addSubresource:(WebResource *)subresource;
       
   225     */
       
   226     HRESULT addSubresource([in] IWebResource* subresource);
       
   227 }
       
   228 
       
   229 [
       
   230     object,
       
   231     oleautomation,
       
   232     uuid(4B80B7D4-98D7-4a80-AF46-2AF84B2F2E8F),
       
   233     pointer_default(unique)
       
   234 ]
       
   235 interface IWebDataSourcePrivate : IUnknown
       
   236 {
       
   237     HRESULT overrideEncoding([out, retval] BSTR* encoding);
       
   238     HRESULT setOverrideEncoding([in] BSTR encoding);
       
   239     HRESULT mainDocumentError([out, retval] IWebError** error);
       
   240 }