1 /* 2 * Copyright (C) 2005, 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 * 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 29 // This header contains WebView declarations that can be used anywhere in WebKit, but are neither SPI nor API. 30 31 #import "WebPreferences.h" 32 #import "WebViewPrivate.h" 33 #import "WebTypesInternal.h" 34 35 #ifdef __cplusplus 36 #import <WebCore/WebCoreKeyboardUIMode.h> 37 38 namespace WebCore { 39 class String; 40 class Frame; 41 class KURL; 42 class KeyboardEvent; 43 class Page; 44 } 45 #endif 46 47 @class WebBasePluginPackage; 48 @class WebDownload; 49 @class WebNodeHighlight; 50 51 #ifdef __cplusplus 52 53 @interface WebView (WebViewEditingExtras) 54 - (BOOL)_interceptEditingKeyEvent:(WebCore::KeyboardEvent*)event shouldSaveCommand:(BOOL)shouldSave; 55 - (BOOL)_shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag; 56 @end 57 58 @interface WebView (AllWebViews) 59 + (void)_makeAllWebViewsPerformSelector:(SEL)selector; 60 - (void)_removeFromAllWebViewsSet; 61 - (void)_addToAllWebViewsSet; 62 @end 63 64 @interface WebView (WebViewInternal) 65 66 - (WebCore::Frame*)_mainCoreFrame; 67 68 - (WebCore::String)_userAgentForURL:(const WebCore::KURL&)url; 69 - (WebCore::KeyboardUIMode)_keyboardUIMode; 70 71 - (BOOL)_becomingFirstResponderFromOutside; 72 73 #if ENABLE(ICONDATABASE) 74 - (void)_registerForIconNotification:(BOOL)listen; 75 - (void)_dispatchDidReceiveIconFromWebFrame:(WebFrame *)webFrame; 76 #endif 77 78 - (void)_setMouseDownEvent:(NSEvent *)event; 79 - (void)_cancelUpdateMouseoverTimer; 80 - (void)_stopAutoscrollTimer; 81 - (void)_updateMouseoverWithFakeEvent; 82 - (void)_selectionChanged; 83 - (void)_setToolTip:(NSString *)toolTip; 84 85 #if USE(ACCELERATED_COMPOSITING) 86 - (BOOL)_needsOneShotDrawingSynchronization; 87 - (void)_setNeedsOneShotDrawingSynchronization:(BOOL)needsSynchronization; 88 - (void)_startedAcceleratedCompositingForFrame:(WebFrame*)webFrame; 89 - (void)_stoppedAcceleratedCompositingForFrame:(WebFrame*)webFrame; 90 - (void)_scheduleCompositingLayerSync; 91 #endif 92 93 @end 94 95 #endif 96 97 // FIXME: Temporary way to expose methods that are in the wrong category inside WebView. 98 @interface WebView (WebViewOtherInternal) 99 100 + (void)_setCacheModel:(WebCacheModel)cacheModel; 101 + (WebCacheModel)_cacheModel; 102 103 #ifdef __cplusplus 104 - (WebCore::Page*)page; 105 #endif 106 107 - (NSMenu *)_menuForElement:(NSDictionary *)element defaultItems:(NSArray *)items; 108 - (id)_UIDelegateForwarder; 109 - (id)_editingDelegateForwarder; 110 - (id)_policyDelegateForwarder; 111 - (void)_pushPerformingProgrammaticFocus; 112 - (void)_popPerformingProgrammaticFocus; 113 - (void)_incrementProgressForIdentifier:(id)identifier response:(NSURLResponse *)response; 114 - (void)_incrementProgressForIdentifier:(id)identifier length:(int)length; 115 - (void)_completeProgressForIdentifier:(id)identifer; 116 - (void)_progressStarted:(WebFrame *)frame; 117 - (void)_didStartProvisionalLoadForFrame:(WebFrame *)frame; 118 + (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType; 119 - (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType; 120 + (NSString *)_MIMETypeForFile:(NSString *)path; 121 - (WebDownload *)_downloadURL:(NSURL *)URL; 122 + (NSString *)_generatedMIMETypeForURLScheme:(NSString *)URLScheme; 123 + (BOOL)_representationExistsForURLScheme:(NSString *)URLScheme; 124 - (BOOL)_isPerformingProgrammaticFocus; 125 - (void)_mouseDidMoveOverElement:(NSDictionary *)dictionary modifierFlags:(NSUInteger)modifierFlags; 126 - (WebView *)_openNewWindowWithRequest:(NSURLRequest *)request; 127 - (void)_writeImageForElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard; 128 - (void)_writeLinkElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard; 129 - (void)_openFrameInNewWindowFromMenu:(NSMenuItem *)sender; 130 - (void)_searchWithGoogleFromMenu:(id)sender; 131 - (void)_searchWithSpotlightFromMenu:(id)sender; 132 - (void)_progressCompleted:(WebFrame *)frame; 133 - (void)_didCommitLoadForFrame:(WebFrame *)frame; 134 - (void)_didFinishLoadForFrame:(WebFrame *)frame; 135 - (void)_didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame; 136 - (void)_didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame; 137 - (void)_willChangeValueForKey:(NSString *)key; 138 - (void)_didChangeValueForKey:(NSString *)key; 139 - (WebBasePluginPackage *)_pluginForMIMEType:(NSString *)MIMEType; 140 - (WebBasePluginPackage *)_pluginForExtension:(NSString *)extension; 141 - (BOOL)_isMIMETypeRegisteredAsPlugin:(NSString *)MIMEType; 142 143 - (void)setCurrentNodeHighlight:(WebNodeHighlight *)nodeHighlight; 144 - (WebNodeHighlight *)currentNodeHighlight; 145 146 - (void)addPluginInstanceView:(NSView *)view; 147 - (void)removePluginInstanceView:(NSView *)view; 148 - (void)removePluginInstanceViewsFor:(WebFrame*)webFrame; 149 150 - (void)_addObject:(id)object forIdentifier:(unsigned long)identifier; 151 - (id)_objectForIdentifier:(unsigned long)identifier; 152 - (void)_removeObjectForIdentifier:(unsigned long)identifier; 153 154 - (void)_setZoomMultiplier:(float)multiplier isTextOnly:(BOOL)isTextOnly; 155 - (float)_zoomMultiplier:(BOOL)isTextOnly; 156 - (float)_realZoomMultiplier; 157 - (BOOL)_realZoomMultiplierIsTextOnly; 158 - (BOOL)_canZoomOut:(BOOL)isTextOnly; 159 - (BOOL)_canZoomIn:(BOOL)isTextOnly; 160 - (IBAction)_zoomOut:(id)sender isTextOnly:(BOOL)isTextOnly; 161 - (IBAction)_zoomIn:(id)sender isTextOnly:(BOOL)isTextOnly; 162 - (BOOL)_canResetZoom:(BOOL)isTextOnly; 163 - (IBAction)_resetZoom:(id)sender isTextOnly:(BOOL)isTextOnly; 164 165 - (BOOL)_mustDrawUnionedRect:(NSRect)rect singleRects:(const NSRect *)rects count:(NSInteger)count; 166 167 + (BOOL)_canHandleRequest:(NSURLRequest *)request forMainFrame:(BOOL)forMainFrame; 168 169 - (void)_setInsertionPasteboard:(NSPasteboard *)pasteboard; 170 171 @end 172