PageRenderTime 47ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/webkit-efl/Source/WebKit/mac/WebView/WebUIDelegatePrivate.h

https://review.tizen.org/git/
C Header | 250 lines | 125 code | 26 blank | 99 comment | 0 complexity | e8ccd6fb5b5fd406f3d003941d65cf01 MD5 | raw file
Possible License(s): GPL-3.0, AGPL-3.0, GPL-2.0, MPL-2.0, JSON, WTFPL, CC-BY-SA-4.0, CC-BY-3.0, BSD-3-Clause, LGPL-2.0, MPL-2.0-no-copyleft-exception, AGPL-1.0, 0BSD, Zlib, Unlicense, BSD-2-Clause, Apache-2.0, LGPL-3.0, ISC, MIT, CC-BY-SA-3.0, CC0-1.0, LGPL-2.1
  1. /*
  2. * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 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. *
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
  14. * its contributors may be used to endorse or promote products derived
  15. * from this software without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
  18. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  19. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  20. * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
  21. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  22. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  23. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  24. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  26. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. */
  28. #import <WebKit/WebUIDelegate.h>
  29. #if !defined(ENABLE_DASHBOARD_SUPPORT)
  30. #define ENABLE_DASHBOARD_SUPPORT 1
  31. #endif
  32. #if !defined(ENABLE_FULLSCREEN_API)
  33. #define ENABLE_FULLSCREEN_API 1
  34. #endif
  35. // Mail on Tiger expects the old value for WebMenuItemTagSearchInGoogle
  36. #define WebMenuItemTagSearchInGoogle OldWebMenuItemTagSearchWeb
  37. #define WEBMENUITEMTAG_WEBKIT_3_0_SPI_START 2000
  38. enum {
  39. // The next three values were used in WebKit 2.0 for SPI. In WebKit 3.0 these are API, with different values.
  40. OldWebMenuItemTagSearchInSpotlight = 1000,
  41. OldWebMenuItemTagSearchWeb,
  42. OldWebMenuItemTagLookUpInDictionary,
  43. // FIXME: These should move to WebUIDelegate.h as part of the WebMenuItemTag enum there, when we're not in API freeze
  44. // Note that these values must be kept aligned with values in WebCore/ContextMenuItem.h
  45. WebMenuItemTagOpenLink = WEBMENUITEMTAG_WEBKIT_3_0_SPI_START,
  46. WebMenuItemTagIgnoreGrammar,
  47. WebMenuItemTagSpellingMenu,
  48. WebMenuItemTagShowSpellingPanel,
  49. WebMenuItemTagCheckSpelling,
  50. WebMenuItemTagCheckSpellingWhileTyping,
  51. WebMenuItemTagCheckGrammarWithSpelling,
  52. WebMenuItemTagFontMenu,
  53. WebMenuItemTagShowFonts,
  54. WebMenuItemTagBold,
  55. WebMenuItemTagItalic,
  56. WebMenuItemTagUnderline,
  57. WebMenuItemTagOutline,
  58. WebMenuItemTagStyles,
  59. WebMenuItemTagShowColors,
  60. WebMenuItemTagSpeechMenu,
  61. WebMenuItemTagStartSpeaking,
  62. WebMenuItemTagStopSpeaking,
  63. WebMenuItemTagWritingDirectionMenu,
  64. WebMenuItemTagDefaultDirection,
  65. WebMenuItemTagLeftToRight,
  66. WebMenuItemTagRightToLeft,
  67. WebMenuItemPDFSinglePageScrolling,
  68. WebMenuItemPDFFacingPagesScrolling,
  69. WebMenuItemTagInspectElement,
  70. WebMenuItemTagTextDirectionMenu,
  71. WebMenuItemTagTextDirectionDefault,
  72. WebMenuItemTagTextDirectionLeftToRight,
  73. WebMenuItemTagTextDirectionRightToLeft,
  74. WebMenuItemTagCorrectSpellingAutomatically,
  75. WebMenuItemTagSubstitutionsMenu,
  76. WebMenuItemTagShowSubstitutions,
  77. WebMenuItemTagSmartCopyPaste,
  78. WebMenuItemTagSmartQuotes,
  79. WebMenuItemTagSmartDashes,
  80. WebMenuItemTagSmartLinks,
  81. WebMenuItemTagTextReplacement,
  82. WebMenuItemTagTransformationsMenu,
  83. WebMenuItemTagMakeUpperCase,
  84. WebMenuItemTagMakeLowerCase,
  85. WebMenuItemTagCapitalize,
  86. WebMenuItemTagChangeBack,
  87. WebMenuItemTagBaseApplication = 10000
  88. };
  89. // Message Sources.
  90. extern NSString *WebConsoleMessageHTMLMessageSource;
  91. extern NSString *WebConsoleMessageXMLMessageSource;
  92. extern NSString *WebConsoleMessageJSMessageSource;
  93. extern NSString *WebConsoleMessageNetworkMessageSource;
  94. extern NSString *WebConsoleMessageConsoleAPIMessageSource;
  95. extern NSString *WebConsoleMessageOtherMessageSource;
  96. // Message Types.
  97. extern NSString *WebConsoleMessageLogMessageType;
  98. extern NSString *WebConsoleMessageDirMessageType;
  99. extern NSString *WebConsoleMessageDirXMLMessageType;
  100. extern NSString *WebConsoleMessageTraceMessageType;
  101. extern NSString *WebConsoleMessageStartGroupMessageType;
  102. extern NSString *WebConsoleMessageStartGroupCollapsedMessageType;
  103. extern NSString *WebConsoleMessageEndGroupMessageType;
  104. extern NSString *WebConsoleMessageAssertMessageType;
  105. // Message Levels.
  106. extern NSString *WebConsoleMessageTipMessageLevel;
  107. extern NSString *WebConsoleMessageLogMessageLevel;
  108. extern NSString *WebConsoleMessageWarningMessageLevel;
  109. extern NSString *WebConsoleMessageErrorMessageLevel;
  110. extern NSString *WebConsoleMessageDebugMessageLevel;
  111. @class DOMElement;
  112. @class DOMNode;
  113. @class WebSecurityOrigin;
  114. @protocol WebAllowDenyPolicyListener <NSObject>
  115. - (void)allow;
  116. - (void)deny;
  117. @end
  118. #if ENABLE_FULLSCREEN_API
  119. @protocol WebKitFullScreenListener<NSObject>
  120. - (void)webkitWillEnterFullScreen;
  121. - (void)webkitDidEnterFullScreen;
  122. - (void)webkitWillExitFullScreen;
  123. - (void)webkitDidExitFullScreen;
  124. @end
  125. #endif
  126. @interface NSObject (WebUIDelegatePrivate)
  127. - (void)webView:(WebView *)webView addMessageToConsole:(NSDictionary *)message;
  128. /*!
  129. @method webView:addMessageToConsole:withSource:
  130. @param webView The WebView sending the delegate method.
  131. @param message A dictionary representation of the console message.
  132. @param source Where the message came from. See WebConsoleMessageHTMLMessageSource and other source types.
  133. @discussion The dictionary contains the following keys:
  134. <dl>
  135. <dt>message</dt>
  136. <dd>The message itself.</dd>
  137. <dt>lineNumber</dt>
  138. <dd>If this came from a file, this is the line number in the file this message originates from.</dd>
  139. <dt>sourceURL</dt>
  140. <dd>If this came from a file, this is the URL to the file this message originates from.</dd>
  141. <dt>MessageSource</dt>
  142. <dd>
  143. Where the message came from. HTML, XML, JavaScript, CSS, etc.
  144. See WebConsoleMessageHTMLMessageSource and similar constants.
  145. </dd>
  146. <dt>MessageType</dt>
  147. <dd>
  148. Class of message. Start / End of a Group, a Log, Network related, etc.
  149. See WebConsoleMessageLogMessageType and similar constants.
  150. </dd>
  151. <dt>MessageLevel</dt>
  152. <dd>
  153. Severity level of the message. Tip, Log, Warning, etc.
  154. See WebConsoleMessageTipMessageLevel and similar constants.
  155. </dd>
  156. </dl>
  157. */
  158. - (void)webView:(WebView *)webView addMessageToConsole:(NSDictionary *)message withSource:(NSString *)source;
  159. - (NSView *)webView:(WebView *)webView plugInViewWithArguments:(NSDictionary *)arguments;
  160. #if ENABLE_DASHBOARD_SUPPORT
  161. // regions is an dictionary whose keys are regions label and values are arrays of WebDashboardRegions.
  162. - (void)webView:(WebView *)webView dashboardRegionsChanged:(NSDictionary *)regions;
  163. #endif
  164. - (void)webView:(WebView *)sender dragImage:(NSImage *)anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag forView:(NSView *)view;
  165. - (void)webView:(WebView *)sender didDrawRect:(NSRect)rect;
  166. - (void)webView:(WebView *)sender didScrollDocumentInFrameView:(WebFrameView *)frameView;
  167. // FIXME: If we ever make this method public, it should include a WebFrame parameter.
  168. - (BOOL)webViewShouldInterruptJavaScript:(WebView *)sender;
  169. - (void)webView:(WebView *)sender willPopupMenu:(NSMenu *)menu;
  170. - (void)webView:(WebView *)sender contextMenuItemSelected:(NSMenuItem *)item forElement:(NSDictionary *)element;
  171. - (void)webView:(WebView *)sender saveFrameView:(WebFrameView *)frameView showingPanel:(BOOL)showingPanel;
  172. - (BOOL)webView:(WebView *)sender didPressMissingPluginButton:(DOMElement *)element;
  173. /*!
  174. @method webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:
  175. @param sender The WebView sending the delegate method.
  176. @param frame The WebFrame whose JavaScript initiated this call.
  177. @param origin The security origin that needs a larger quota.
  178. @param databaseIdentifier The identifier of the database involved.
  179. */
  180. - (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier;
  181. /*!
  182. @method webView:exceededApplicationCacheOriginQuotaForSecurityOrigin:totalSpaceNeeded:
  183. @param sender The WebView sending the delegate method.
  184. @param origin The security origin that needs a larger quota.
  185. @param totalSpaceNeeded The amount of space needed to store the new manifest and keep all other
  186. previously stored caches for this origin.
  187. @discussion This method is called when a page attempts to store more in the Application Cache
  188. for an origin than was allowed by the quota (or default) set for the origin. This allows the
  189. quota to be increased for the security origin.
  190. */
  191. - (void)webView:(WebView *)sender exceededApplicationCacheOriginQuotaForSecurityOrigin:(WebSecurityOrigin *)origin totalSpaceNeeded:(NSUInteger)totalSpaceNeeded;
  192. - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request windowFeatures:(NSDictionary *)features;
  193. - (BOOL)webView:(WebView *)sender shouldReplaceUploadFile:(NSString *)path usingGeneratedFilename:(NSString **)filename;
  194. - (NSString *)webView:(WebView *)sender generateReplacementFile:(NSString *)path;
  195. /*!
  196. @method webView:decidePolicyForGeolocationRequestFromOrigin:frame:listener:
  197. @abstract
  198. @param webView The WebView sending the delegate method.
  199. @param origin The security origin that would like to use Geolocation.
  200. @param frame The WebFrame whose JavaScript initiated this call.
  201. @param listener The object to call when the decision is made
  202. */
  203. - (void)webView:(WebView *)webView decidePolicyForGeolocationRequestFromOrigin:(WebSecurityOrigin *)origin
  204. frame:(WebFrame *)frame
  205. listener:(id<WebAllowDenyPolicyListener>)listener;
  206. - (void)webView:(WebView *)webView decidePolicyForNotificationRequestFromOrigin:(WebSecurityOrigin *)origin listener:(id<WebAllowDenyPolicyListener>)listener;
  207. - (void)webView:(WebView *)sender elementDidFocusNode:(DOMNode *)node;
  208. - (void)webView:(WebView *)sender elementDidBlurNode:(DOMNode *)node;
  209. /*!
  210. @method webView:printFrame:
  211. @abstract Informs that a WebFrame needs to be printed
  212. @param webView The WebView sending the delegate method
  213. @param frameView The WebFrame needing to be printed
  214. @discussion This method is called when a script or user requests the page to be printed.
  215. */
  216. - (void)webView:(WebView *)sender printFrame:(WebFrame *)frame;
  217. #if ENABLE_FULLSCREEN_API
  218. - (BOOL)webView:(WebView *)sender supportsFullScreenForElement:(DOMElement *)element;
  219. - (void)webView:(WebView *)sender enterFullScreenForElement:(DOMElement *)element;
  220. - (void)webView:(WebView *)sender exitFullScreenForElement:(DOMElement *)element;
  221. #endif
  222. - (void)webView:(WebView *)sender didDrawFrame:(WebFrame *)frame;
  223. @end