2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Igalia S.L
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
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.
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.
30 // This header contains WebView declarations that can be used anywhere in WebKit, but are neither SPI nor API.
32 #import "WebPreferences.h"
33 #import "WebViewPrivate.h"
34 #import "WebTypesInternal.h"
37 #import <WebCore/FindOptions.h>
38 #import <WebCore/WebCoreKeyboardUIMode.h>
40 #include <wtf/Forward.h>
54 @class WebBasePluginPackage;
56 @class WebNodeHighlight;
60 WebCore::FindOptions coreOptions(WebFindOptions options);
62 @interface WebView (WebViewEditingExtras)
63 - (BOOL)_shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag;
66 @interface WebView (AllWebViews)
67 + (void)_makeAllWebViewsPerformSelector:(SEL)selector;
68 - (void)_removeFromAllWebViewsSet;
69 - (void)_addToAllWebViewsSet;
72 @interface WebView (WebViewInternal)
74 + (BOOL)shouldIncludeInWebKitStatistics;
76 - (WebCore::Frame*)_mainCoreFrame;
77 - (WebFrame *)_selectedOrMainFrame;
79 - (WebCore::KeyboardUIMode)_keyboardUIMode;
81 - (BOOL)_becomingFirstResponderFromOutside;
83 #if ENABLE(ICONDATABASE)
84 - (void)_registerForIconNotification:(BOOL)listen;
85 - (void)_dispatchDidReceiveIconFromWebFrame:(WebFrame *)webFrame;
88 #if USE(ACCELERATED_COMPOSITING)
89 - (BOOL)_needsOneShotDrawingSynchronization;
90 - (void)_setNeedsOneShotDrawingSynchronization:(BOOL)needsSynchronization;
91 - (void)_scheduleCompositingLayerSync;
94 #if ENABLE(GLIB_SUPPORT)
95 - (void)_scheduleGlibContextIterations;
102 // FIXME: Temporary way to expose methods that are in the wrong category inside WebView.
103 @interface WebView (WebViewOtherInternal)
105 + (void)_setCacheModel:(WebCacheModel)cacheModel;
106 + (WebCacheModel)_cacheModel;
109 - (WebCore::Page*)page;
110 - (void)_setGlobalHistoryItem:(WebCore::HistoryItem*)historyItem;
113 - (NSMenu *)_menuForElement:(NSDictionary *)element defaultItems:(NSArray *)items;
114 - (id)_UIDelegateForwarder;
115 - (id)_editingDelegateForwarder;
116 - (id)_policyDelegateForwarder;
117 - (void)_pushPerformingProgrammaticFocus;
118 - (void)_popPerformingProgrammaticFocus;
119 - (void)_didStartProvisionalLoadForFrame:(WebFrame *)frame;
120 + (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType allowingPlugins:(BOOL)allowPlugins;
121 - (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType;
122 + (void)_registerPluginMIMEType:(NSString *)MIMEType;
123 + (void)_unregisterPluginMIMEType:(NSString *)MIMEType;
124 + (BOOL)_canShowMIMEType:(NSString *)MIMEType allowingPlugins:(BOOL)allowPlugins;
125 - (BOOL)_canShowMIMEType:(NSString *)MIMEType;
126 + (NSString *)_MIMETypeForFile:(NSString *)path;
127 - (WebDownload *)_downloadURL:(NSURL *)URL;
128 + (NSString *)_generatedMIMETypeForURLScheme:(NSString *)URLScheme;
129 + (BOOL)_representationExistsForURLScheme:(NSString *)URLScheme;
130 - (BOOL)_isPerformingProgrammaticFocus;
131 - (void)_mouseDidMoveOverElement:(NSDictionary *)dictionary modifierFlags:(NSUInteger)modifierFlags;
132 - (WebView *)_openNewWindowWithRequest:(NSURLRequest *)request;
133 - (void)_writeImageForElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard;
134 - (void)_writeLinkElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard;
135 - (void)_openFrameInNewWindowFromMenu:(NSMenuItem *)sender;
136 - (void)_searchWithGoogleFromMenu:(id)sender;
137 - (void)_searchWithSpotlightFromMenu:(id)sender;
138 - (void)_progressCompleted:(WebFrame *)frame;
139 - (void)_didCommitLoadForFrame:(WebFrame *)frame;
140 - (void)_didFinishLoadForFrame:(WebFrame *)frame;
141 - (void)_didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
142 - (void)_didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
143 - (void)_willChangeValueForKey:(NSString *)key;
144 - (void)_didChangeValueForKey:(NSString *)key;
145 - (WebBasePluginPackage *)_pluginForMIMEType:(NSString *)MIMEType;
146 - (WebBasePluginPackage *)_pluginForExtension:(NSString *)extension;
147 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
148 - (WebBasePluginPackage *)_videoProxyPluginForMIMEType:(NSString *)MIMEType;
151 - (void)setCurrentNodeHighlight:(WebNodeHighlight *)nodeHighlight;
152 - (WebNodeHighlight *)currentNodeHighlight;
154 - (void)addPluginInstanceView:(NSView *)view;
155 - (void)removePluginInstanceView:(NSView *)view;
156 - (void)removePluginInstanceViewsFor:(WebFrame*)webFrame;
158 - (void)_addObject:(id)object forIdentifier:(unsigned long)identifier;
159 - (id)_objectForIdentifier:(unsigned long)identifier;
160 - (void)_removeObjectForIdentifier:(unsigned long)identifier;
162 - (void)_setZoomMultiplier:(float)multiplier isTextOnly:(BOOL)isTextOnly;
163 - (float)_zoomMultiplier:(BOOL)isTextOnly;
164 - (float)_realZoomMultiplier;
165 - (BOOL)_realZoomMultiplierIsTextOnly;
166 - (BOOL)_canZoomOut:(BOOL)isTextOnly;
167 - (BOOL)_canZoomIn:(BOOL)isTextOnly;
168 - (IBAction)_zoomOut:(id)sender isTextOnly:(BOOL)isTextOnly;
169 - (IBAction)_zoomIn:(id)sender isTextOnly:(BOOL)isTextOnly;
170 - (BOOL)_canResetZoom:(BOOL)isTextOnly;
171 - (IBAction)_resetZoom:(id)sender isTextOnly:(BOOL)isTextOnly;
173 + (BOOL)_canHandleRequest:(NSURLRequest *)request forMainFrame:(BOOL)forMainFrame;
175 - (void)_setInsertionPasteboard:(NSPasteboard *)pasteboard;
177 - (void)_preferencesChanged:(WebPreferences *)preferences;
179 #if ENABLE(VIDEO) && defined(__cplusplus)
180 - (void)_enterFullscreenForNode:(WebCore::Node*)node;
181 - (void)_exitFullscreen;
184 #if ENABLE(FULLSCREEN_API) && defined(__cplusplus)
185 - (BOOL)_supportsFullScreenForElement:(WebCore::Element*)element withKeyboard:(BOOL)withKeyboard;
186 - (void)_enterFullScreenForElement:(WebCore::Element*)element;
187 - (void)_exitFullScreenForElement:(WebCore::Element*)element;
188 - (void)_fullScreenRendererChanged:(WebCore::RenderBox*)renderer;
191 // Conversion functions between WebCore root view coordinates and web view coordinates.
192 - (NSPoint)_convertPointFromRootView:(NSPoint)point;
193 - (NSRect)_convertRectFromRootView:(NSRect)rect;