1 /* 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2010 Igalia S.L 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of 15 * its contributors may be used to endorse or promote products derived 16 * from this software without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30 // This header contains WebView declarations that can be used anywhere in WebKit, but are neither SPI nor API. 31 32 #import "WebPreferences.h" 33 #import "WebViewPrivate.h" 34 #import "WebTypesInternal.h" 35 36 #ifdef __cplusplus 37 #import <WebCore/WebCoreKeyboardUIMode.h> 38 39 #include <wtf/Forward.h> 40 41 namespace WebCore { 42 class Element; 43 class Frame; 44 class HistoryItem; 45 class KURL; 46 class KeyboardEvent; 47 class Page; 48 class RenderBox; 49 class Node; 50 } 51 #endif 52 53 @class WebBasePluginPackage; 54 @class WebDownload; 55 @class WebNodeHighlight; 56 57 #ifdef __cplusplus 58 59 @interface WebView (WebViewEditingExtras) 60 - (BOOL)_shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag; 61 @end 62 63 @interface WebView (AllWebViews) 64 + (void)_makeAllWebViewsPerformSelector:(SEL)selector; 65 - (void)_removeFromAllWebViewsSet; 66 - (void)_addToAllWebViewsSet; 67 @end 68 69 @interface WebView (WebViewInternal) 70 71 + (BOOL)shouldIncludeInWebKitStatistics; 72 73 - (WebCore::Frame*)_mainCoreFrame; 74 - (WebFrame *)_selectedOrMainFrame; 75 76 - (WebCore::KeyboardUIMode)_keyboardUIMode; 77 78 - (BOOL)_becomingFirstResponderFromOutside; 79 80 #if ENABLE(ICONDATABASE) 81 - (void)_registerForIconNotification:(BOOL)listen; 82 - (void)_dispatchDidReceiveIconFromWebFrame:(WebFrame *)webFrame; 83 #endif 84 85 - (void)_selectionChanged; 86 87 #if USE(ACCELERATED_COMPOSITING) 88 - (BOOL)_needsOneShotDrawingSynchronization; 89 - (void)_setNeedsOneShotDrawingSynchronization:(BOOL)needsSynchronization; 90 - (void)_scheduleCompositingLayerSync; 91 #endif 92 93 #if ENABLE(GLIB_SUPPORT) 94 - (void)_scheduleGlibContextIterations; 95 #endif 96 97 @end 98 99 #endif 100 101 @interface WebView (WebViewEventHandling) 102 - (void)_closingEventHandling; 103 - (void)_updateMouseoverWithFakeEvent; 104 - (void)_cancelUpdateMouseoverTimer; 105 - (void)_stopAutoscrollTimer; 106 - (void)_setToolTip:(NSString *)toolTip; 107 @end 108 109 // FIXME: Temporary way to expose methods that are in the wrong category inside WebView. 110 @interface WebView (WebViewOtherInternal) 111 112 + (void)_setCacheModel:(WebCacheModel)cacheModel; 113 + (WebCacheModel)_cacheModel; 114 115 #ifdef __cplusplus 116 - (WebCore::Page*)page; 117 - (void)_setGlobalHistoryItem:(WebCore::HistoryItem*)historyItem; 118 #endif 119 120 - (NSMenu *)_menuForElement:(NSDictionary *)element defaultItems:(NSArray *)items; 121 - (id)_UIDelegateForwarder; 122 - (id)_editingDelegateForwarder; 123 - (id)_policyDelegateForwarder; 124 - (void)_pushPerformingProgrammaticFocus; 125 - (void)_popPerformingProgrammaticFocus; 126 - (void)_didStartProvisionalLoadForFrame:(WebFrame *)frame; 127 + (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType allowingPlugins:(BOOL)allowPlugins; 128 - (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType; 129 + (void)_registerPluginMIMEType:(NSString *)MIMEType; 130 + (void)_unregisterPluginMIMEType:(NSString *)MIMEType; 131 + (BOOL)_canShowMIMEType:(NSString *)MIMEType allowingPlugins:(BOOL)allowPlugins; 132 - (BOOL)_canShowMIMEType:(NSString *)MIMEType; 133 + (NSString *)_MIMETypeForFile:(NSString *)path; 134 - (WebDownload *)_downloadURL:(NSURL *)URL; 135 + (NSString *)_generatedMIMETypeForURLScheme:(NSString *)URLScheme; 136 + (BOOL)_representationExistsForURLScheme:(NSString *)URLScheme; 137 - (BOOL)_isPerformingProgrammaticFocus; 138 - (void)_mouseDidMoveOverElement:(NSDictionary *)dictionary modifierFlags:(NSUInteger)modifierFlags; 139 - (WebView *)_openNewWindowWithRequest:(NSURLRequest *)request; 140 - (void)_writeImageForElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard; 141 - (void)_writeLinkElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard; 142 - (void)_openFrameInNewWindowFromMenu:(NSMenuItem *)sender; 143 - (void)_searchWithGoogleFromMenu:(id)sender; 144 - (void)_searchWithSpotlightFromMenu:(id)sender; 145 - (void)_progressCompleted:(WebFrame *)frame; 146 - (void)_didCommitLoadForFrame:(WebFrame *)frame; 147 - (void)_didFinishLoadForFrame:(WebFrame *)frame; 148 - (void)_didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame; 149 - (void)_didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame; 150 - (void)_willChangeValueForKey:(NSString *)key; 151 - (void)_didChangeValueForKey:(NSString *)key; 152 - (WebBasePluginPackage *)_pluginForMIMEType:(NSString *)MIMEType; 153 - (WebBasePluginPackage *)_pluginForExtension:(NSString *)extension; 154 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) 155 - (WebBasePluginPackage *)_videoProxyPluginForMIMEType:(NSString *)MIMEType; 156 #endif 157 158 - (void)setCurrentNodeHighlight:(WebNodeHighlight *)nodeHighlight; 159 - (WebNodeHighlight *)currentNodeHighlight; 160 161 - (void)addPluginInstanceView:(NSView *)view; 162 - (void)removePluginInstanceView:(NSView *)view; 163 - (void)removePluginInstanceViewsFor:(WebFrame*)webFrame; 164 165 - (void)_addObject:(id)object forIdentifier:(unsigned long)identifier; 166 - (id)_objectForIdentifier:(unsigned long)identifier; 167 - (void)_removeObjectForIdentifier:(unsigned long)identifier; 168 169 - (void)_setZoomMultiplier:(float)multiplier isTextOnly:(BOOL)isTextOnly; 170 - (float)_zoomMultiplier:(BOOL)isTextOnly; 171 - (float)_realZoomMultiplier; 172 - (BOOL)_realZoomMultiplierIsTextOnly; 173 - (BOOL)_canZoomOut:(BOOL)isTextOnly; 174 - (BOOL)_canZoomIn:(BOOL)isTextOnly; 175 - (IBAction)_zoomOut:(id)sender isTextOnly:(BOOL)isTextOnly; 176 - (IBAction)_zoomIn:(id)sender isTextOnly:(BOOL)isTextOnly; 177 - (BOOL)_canResetZoom:(BOOL)isTextOnly; 178 - (IBAction)_resetZoom:(id)sender isTextOnly:(BOOL)isTextOnly; 179 180 - (BOOL)_mustDrawUnionedRect:(NSRect)rect singleRects:(const NSRect *)rects count:(NSInteger)count; 181 182 + (BOOL)_canHandleRequest:(NSURLRequest *)request forMainFrame:(BOOL)forMainFrame; 183 184 - (void)_setInsertionPasteboard:(NSPasteboard *)pasteboard; 185 186 - (void)_preferencesChanged:(WebPreferences *)preferences; 187 188 #if ENABLE(VIDEO) && defined(__cplusplus) 189 - (void)_enterFullscreenForNode:(WebCore::Node*)node; 190 - (void)_exitFullscreen; 191 #endif 192 193 #if ENABLE(FULLSCREEN_API) && defined(__cplusplus) 194 - (BOOL)_supportsFullScreenForElement:(WebCore::Element*)element withKeyboard:(BOOL)withKeyboard; 195 - (void)_enterFullScreenForElement:(WebCore::Element*)element; 196 - (void)_exitFullScreenForElement:(WebCore::Element*)element; 197 - (void)_fullScreenRendererChanged:(WebCore::RenderBox*)renderer; 198 #endif 199 200 @end 201