IWebFrameLoadDelegate.idl 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. /*
  2. * Copyright (C) 2006, 2007, 2008, 2009 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. #ifndef DO_NO_IMPORTS
  26. import "oaidl.idl";
  27. import "ocidl.idl";
  28. import "IWebScriptObject.idl";
  29. import "IWebView.idl";
  30. import "IWebFrame.idl";
  31. import "JavaScriptCoreAPITypes.idl";
  32. #endif
  33. interface IWebError;
  34. interface IWebFrame;
  35. interface IWebScriptObject;
  36. interface IWebView;
  37. /*!
  38. @category WebFrameLoadDelegate
  39. @discussion A WebView's WebFrameLoadDelegate tracks the loading progress of its frames.
  40. When a data source of a frame starts to load, the data source is considered "provisional".
  41. Once at least one byte is received, the data source is considered "committed". This is done
  42. so the contents of the frame will not be lost if the new data source fails to successfully load.
  43. @interface NSObject (WebFrameLoadDelegate)
  44. */
  45. [
  46. object,
  47. oleautomation,
  48. uuid(3354665B-84BA-4fdf-B35E-BF5CF9D96026),
  49. pointer_default(unique)
  50. ]
  51. interface IWebFrameLoadDelegate : IUnknown
  52. {
  53. /*!
  54. @method webView:didStartProvisionalLoadForFrame:
  55. @abstract Notifies the delegate that the provisional load of a frame has started
  56. @param webView The WebView sending the message
  57. @param frame The frame for which the provisional load has started
  58. @discussion This method is called after the provisional data source of a frame
  59. has started to load.
  60. - (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame;
  61. */
  62. HRESULT didStartProvisionalLoadForFrame([in] IWebView* webView, [in] IWebFrame* frame);
  63. /*!
  64. @method webView:didReceiveServerRedirectForProvisionalLoadForFrame:
  65. @abstract Notifies the delegate that a server redirect occurred during the provisional load
  66. @param webView The WebView sending the message
  67. @param frame The frame for which the redirect occurred
  68. - (void)webView:(WebView *)sender didReceiveServerRedirectForProvisionalLoadForFrame:(WebFrame *)frame;
  69. */
  70. HRESULT didReceiveServerRedirectForProvisionalLoadForFrame([in] IWebView* webView, [in] IWebFrame* frame);
  71. /*!
  72. @method webView:didFailProvisionalLoadWithError:forFrame:
  73. @abstract Notifies the delegate that the provisional load has failed
  74. @param webView The WebView sending the message
  75. @param error The error that occurred
  76. @param frame The frame for which the error occurred
  77. @discussion This method is called after the provisional data source has failed to load.
  78. The frame will continue to display the contents of the committed data source if there is one.
  79. - (void)webView:(WebView *)sender didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
  80. */
  81. HRESULT didFailProvisionalLoadWithError([in] IWebView* webView, [in] IWebError* error, [in] IWebFrame* frame);
  82. /*!
  83. @method webView:didCommitLoadForFrame:
  84. @abstract Notifies the delegate that the load has changed from provisional to committed
  85. @param webView The WebView sending the message
  86. @param frame The frame for which the load has committed
  87. @discussion This method is called after the provisional data source has become the
  88. committed data source.
  89. In some cases, a single load may be committed more than once. This happens
  90. in the case of multipart/x-mixed-replace, also known as "server push". In this case,
  91. a single location change leads to multiple documents that are loaded in sequence. When
  92. this happens, a new commit will be sent for each document.
  93. - (void)webView:(WebView *)sender didCommitLoadForFrame:(WebFrame *)frame;
  94. */
  95. HRESULT didCommitLoadForFrame([in] IWebView* webView, [in] IWebFrame* frame);
  96. /*!
  97. @method webView:didReceiveTitle:forFrame:
  98. @abstract Notifies the delegate that the page title for a frame has been received
  99. @param webView The WebView sending the message
  100. @param title The new page title
  101. @param frame The frame for which the title has been received
  102. @discussion The title may update during loading; clients should be prepared for this.
  103. - (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame;
  104. */
  105. HRESULT didReceiveTitle([in] IWebView* webView, [in] BSTR title, [in] IWebFrame* frame);
  106. /*!
  107. @method webView:didReceiveIcon:forFrame:
  108. @abstract Notifies the delegate that a page icon image for a frame has been received
  109. @param webView The WebView sending the message
  110. @param image The icon image. Also known as a "favicon".
  111. @param frame The frame for which a page icon has been received
  112. - (void)webView:(WebView *)sender didReceiveIcon:(NSImage *)image forFrame:(WebFrame *)frame;
  113. */
  114. HRESULT didReceiveIcon([in] IWebView* webView, [in] OLE_HANDLE hBitmap, [in] IWebFrame* frame);
  115. /*!
  116. @method webView:didFinishLoadForFrame:
  117. @abstract Notifies the delegate that the committed load of a frame has completed
  118. @param webView The WebView sending the message
  119. @param frame The frame that finished loading
  120. @discussion This method is called after the committed data source of a frame has successfully loaded
  121. and will only be called when all subresources such as images and stylesheets are done loading.
  122. Plug-In content and JavaScript-requested loads may occur after this method is called.
  123. - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame;
  124. */
  125. HRESULT didFinishLoadForFrame([in] IWebView* webView, [in] IWebFrame* frame);
  126. /*!
  127. @method webView:didFailLoadWithError:forFrame:
  128. @abstract Notifies the delegate that the committed load of a frame has failed
  129. @param webView The WebView sending the message
  130. @param error The error that occurred
  131. @param frame The frame that failed to load
  132. @discussion This method is called after a data source has committed but failed to completely load.
  133. - (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
  134. */
  135. HRESULT didFailLoadWithError([in] IWebView* webView, [in] IWebError* error, [in] IWebFrame* forFrame);
  136. /*!
  137. @method webView:didChangeLocationWithinPageForFrame:
  138. @abstract Notifies the delegate that the scroll position in a frame has changed
  139. @param webView The WebView sending the message
  140. @param frame The frame that scrolled
  141. @discussion This method is called when anchors within a page have been clicked.
  142. - (void)webView:(WebView *)sender didChangeLocationWithinPageForFrame:(WebFrame *)frame;
  143. */
  144. HRESULT didChangeLocationWithinPageForFrame([in] IWebView* webView, [in] IWebFrame* frame);
  145. /*!
  146. @method webView:willPerformClientRedirectToURL:delay:fireDate:forFrame:
  147. @abstract Notifies the delegate that a frame will perform a client-side redirect
  148. @param webView The WebView sending the message
  149. @param URL The URL to be redirected to
  150. @param seconds Seconds in which the redirect will happen
  151. @param date The fire date
  152. @param frame The frame on which the redirect will occur
  153. @discussion This method can be used to continue progress feedback while a client-side
  154. redirect is pending.
  155. - (void)webView:(WebView *)sender willPerformClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date forFrame:(WebFrame *)frame;
  156. */
  157. HRESULT willPerformClientRedirectToURL([in] IWebView* webView, [in] BSTR url, [in] double delaySeconds, [in] DATE fireDate, [in] IWebFrame* frame);
  158. /*!
  159. @method webView:didCancelClientRedirectForFrame:
  160. @abstract Notifies the delegate that a pending client-side redirect has been cancelled
  161. @param webView The WebView sending the message
  162. @param frame The frame for which the pending redirect was cancelled
  163. @discussion A client-side redirect can be cancelled if a frame changes location before the timeout.
  164. - (void)webView:(WebView *)sender didCancelClientRedirectForFrame:(WebFrame *)frame;
  165. */
  166. HRESULT didCancelClientRedirectForFrame([in] IWebView* webView, [in] IWebFrame* frame);
  167. /*!
  168. @method webView:willCloseFrame:
  169. @abstract Notifies the delegate that a frame will be closed
  170. @param webView The WebView sending the message
  171. @param frame The frame that will be closed
  172. @discussion This method is called right before WebKit is done with the frame
  173. and the objects that it contains.
  174. - (void)webView:(WebView *)sender willCloseFrame:(WebFrame *)frame;
  175. */
  176. HRESULT willCloseFrame([in] IWebView* webView, [in] IWebFrame* frame);
  177. /*!
  178. @method webView:windowScriptObjectAvailable:
  179. @abstract Notifies the delegate that the scripting object for a page is available. This is called
  180. before the page is loaded. It may be useful to allow delegates to bind native objects to the window.
  181. @param webView The webView sending the message.
  182. @param windowScriptObject The WebScriptObject for the window in the scripting environment.
  183. - (void)webView:(WebView *)webView windowScriptObjectAvailable:(WebScriptObject *)windowScriptObject;
  184. */
  185. [local] HRESULT windowScriptObjectAvailable([in] IWebView* webView, [in] JSContextRef context, [in] JSObjectRef windowScriptObject);
  186. [local] HRESULT didClearWindowObject([in] IWebView* webView, [in] JSContextRef context, [in] JSObjectRef windowScriptObject, [in] IWebFrame* frame);
  187. }