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
38namespace WebCore {
39    class String;
40    class Frame;
41    class KURL;
42    class KeyboardEvent;
43    class Page;
44    class Node;
45}
46#endif
47
48@class WebBasePluginPackage;
49@class WebDownload;
50@class WebNodeHighlight;
51
52#ifdef __cplusplus
53
54@interface WebView (WebViewEditingExtras)
55- (BOOL)_interceptEditingKeyEvent:(WebCore::KeyboardEvent*)event shouldSaveCommand:(BOOL)shouldSave;
56- (BOOL)_shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag;
57@end
58
59@interface WebView (AllWebViews)
60+ (void)_makeAllWebViewsPerformSelector:(SEL)selector;
61- (void)_removeFromAllWebViewsSet;
62- (void)_addToAllWebViewsSet;
63@end
64
65@interface WebView (WebViewInternal)
66
67- (WebCore::Frame*)_mainCoreFrame;
68- (WebFrame *)_selectedOrMainFrame;
69
70- (WebCore::KeyboardUIMode)_keyboardUIMode;
71
72- (BOOL)_becomingFirstResponderFromOutside;
73
74#if ENABLE(ICONDATABASE)
75- (void)_registerForIconNotification:(BOOL)listen;
76- (void)_dispatchDidReceiveIconFromWebFrame:(WebFrame *)webFrame;
77#endif
78
79- (void)_selectionChanged;
80
81#if USE(ACCELERATED_COMPOSITING)
82- (BOOL)_needsOneShotDrawingSynchronization;
83- (void)_setNeedsOneShotDrawingSynchronization:(BOOL)needsSynchronization;
84- (void)_scheduleCompositingLayerSync;
85#endif
86
87@end
88
89#endif
90
91@interface WebView (WebViewEventHandling)
92- (void)_closingEventHandling;
93- (void)_updateMouseoverWithFakeEvent;
94- (void)_cancelUpdateMouseoverTimer;
95- (void)_stopAutoscrollTimer;
96- (void)_setToolTip:(NSString *)toolTip;
97@end
98
99// FIXME: Temporary way to expose methods that are in the wrong category inside WebView.
100@interface WebView (WebViewOtherInternal)
101
102+ (void)_setCacheModel:(WebCacheModel)cacheModel;
103+ (WebCacheModel)_cacheModel;
104
105#ifdef __cplusplus
106- (WebCore::Page*)page;
107#endif
108
109- (NSMenu *)_menuForElement:(NSDictionary *)element defaultItems:(NSArray *)items;
110- (id)_UIDelegateForwarder;
111- (id)_editingDelegateForwarder;
112- (id)_policyDelegateForwarder;
113- (void)_pushPerformingProgrammaticFocus;
114- (void)_popPerformingProgrammaticFocus;
115- (void)_didStartProvisionalLoadForFrame:(WebFrame *)frame;
116+ (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType allowingPlugins:(BOOL)allowPlugins;
117- (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType;
118+ (BOOL)_canShowMIMEType:(NSString *)MIMEType allowingPlugins:(BOOL)allowPlugins;
119- (BOOL)_canShowMIMEType:(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
142- (void)setCurrentNodeHighlight:(WebNodeHighlight *)nodeHighlight;
143- (WebNodeHighlight *)currentNodeHighlight;
144
145- (void)addPluginInstanceView:(NSView *)view;
146- (void)removePluginInstanceView:(NSView *)view;
147- (void)removePluginInstanceViewsFor:(WebFrame*)webFrame;
148
149- (void)_addObject:(id)object forIdentifier:(unsigned long)identifier;
150- (id)_objectForIdentifier:(unsigned long)identifier;
151- (void)_removeObjectForIdentifier:(unsigned long)identifier;
152
153- (void)_setZoomMultiplier:(float)multiplier isTextOnly:(BOOL)isTextOnly;
154- (float)_zoomMultiplier:(BOOL)isTextOnly;
155- (float)_realZoomMultiplier;
156- (BOOL)_realZoomMultiplierIsTextOnly;
157- (BOOL)_canZoomOut:(BOOL)isTextOnly;
158- (BOOL)_canZoomIn:(BOOL)isTextOnly;
159- (IBAction)_zoomOut:(id)sender isTextOnly:(BOOL)isTextOnly;
160- (IBAction)_zoomIn:(id)sender isTextOnly:(BOOL)isTextOnly;
161- (BOOL)_canResetZoom:(BOOL)isTextOnly;
162- (IBAction)_resetZoom:(id)sender isTextOnly:(BOOL)isTextOnly;
163
164- (BOOL)_mustDrawUnionedRect:(NSRect)rect singleRects:(const NSRect *)rects count:(NSInteger)count;
165
166+ (BOOL)_canHandleRequest:(NSURLRequest *)request forMainFrame:(BOOL)forMainFrame;
167
168- (void)_setInsertionPasteboard:(NSPasteboard *)pasteboard;
169
170#if ENABLE(VIDEO) && defined(__cplusplus)
171- (void)_enterFullscreenForNode:(WebCore::Node*)node;
172- (void)_exitFullscreen;
173#endif
174
175@end
176