tizen beta release
[profile/ivi/webkit-efl.git] / Source / WebKit / mac / WebView / WebViewInternal.h
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/FindOptions.h>
38 #import <WebCore/WebCoreKeyboardUIMode.h>
39
40 #include <wtf/Forward.h>
41
42 namespace WebCore {
43     class Element;
44     class Frame;
45     class HistoryItem;
46     class KURL;
47     class KeyboardEvent;
48     class Page;
49     class RenderBox;
50     class Node;
51 }
52 #endif
53
54 @class WebBasePluginPackage;
55 @class WebDownload;
56 @class WebNodeHighlight;
57
58 #ifdef __cplusplus
59
60 WebCore::FindOptions coreOptions(WebFindOptions options);
61
62 @interface WebView (WebViewEditingExtras)
63 - (BOOL)_shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag;
64 @end
65
66 @interface WebView (AllWebViews)
67 + (void)_makeAllWebViewsPerformSelector:(SEL)selector;
68 - (void)_removeFromAllWebViewsSet;
69 - (void)_addToAllWebViewsSet;
70 @end
71
72 @interface WebView (WebViewInternal)
73
74 + (BOOL)shouldIncludeInWebKitStatistics;
75
76 - (WebCore::Frame*)_mainCoreFrame;
77 - (WebFrame *)_selectedOrMainFrame;
78
79 - (WebCore::KeyboardUIMode)_keyboardUIMode;
80
81 - (BOOL)_becomingFirstResponderFromOutside;
82
83 #if ENABLE(ICONDATABASE)
84 - (void)_registerForIconNotification:(BOOL)listen;
85 - (void)_dispatchDidReceiveIconFromWebFrame:(WebFrame *)webFrame;
86 #endif
87
88 #if USE(ACCELERATED_COMPOSITING)
89 - (BOOL)_needsOneShotDrawingSynchronization;
90 - (void)_setNeedsOneShotDrawingSynchronization:(BOOL)needsSynchronization;
91 - (void)_scheduleCompositingLayerSync;
92 #endif
93
94 #if ENABLE(GLIB_SUPPORT)
95 - (void)_scheduleGlibContextIterations;
96 #endif
97
98 @end
99
100 #endif
101
102 // FIXME: Temporary way to expose methods that are in the wrong category inside WebView.
103 @interface WebView (WebViewOtherInternal)
104
105 + (void)_setCacheModel:(WebCacheModel)cacheModel;
106 + (WebCacheModel)_cacheModel;
107
108 #ifdef __cplusplus
109 - (WebCore::Page*)page;
110 - (void)_setGlobalHistoryItem:(WebCore::HistoryItem*)historyItem;
111 #endif
112
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;
149 #endif
150
151 - (void)setCurrentNodeHighlight:(WebNodeHighlight *)nodeHighlight;
152 - (WebNodeHighlight *)currentNodeHighlight;
153
154 - (void)addPluginInstanceView:(NSView *)view;
155 - (void)removePluginInstanceView:(NSView *)view;
156 - (void)removePluginInstanceViewsFor:(WebFrame*)webFrame;
157
158 - (void)_addObject:(id)object forIdentifier:(unsigned long)identifier;
159 - (id)_objectForIdentifier:(unsigned long)identifier;
160 - (void)_removeObjectForIdentifier:(unsigned long)identifier;
161
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;
172
173 + (BOOL)_canHandleRequest:(NSURLRequest *)request forMainFrame:(BOOL)forMainFrame;
174
175 - (void)_setInsertionPasteboard:(NSPasteboard *)pasteboard;
176
177 - (void)_preferencesChanged:(WebPreferences *)preferences;
178
179 #if ENABLE(VIDEO) && defined(__cplusplus)
180 - (void)_enterFullscreenForNode:(WebCore::Node*)node;
181 - (void)_exitFullscreen;
182 #endif
183
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;
189 #endif
190
191 // Conversion functions between WebCore root view coordinates and web view coordinates.
192 - (NSPoint)_convertPointFromRootView:(NSPoint)point;
193 - (NSRect)_convertRectFromRootView:(NSRect)rect;
194
195 @end