2 * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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.
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.
29 // This header contains the WebFrame SPI.
31 // But it also contains a bunch of internal stuff that should be moved to WebFrameInternal.h
33 #import <WebKit/WebFrame.h>
34 #import <WebKit/WebPolicyDelegatePrivate.h>
39 @class NSMutableURLRequest;
42 @class WebFrameBridge;
44 @class WebFrameBridge;
46 @class WebHistoryItem;
47 @class WebPolicyDecisionListener;
48 @class WebScriptDebugger;
51 // Keys for accessing the values in the page cache dictionary.
52 extern NSString *WebPageCacheEntryDateKey;
53 extern NSString *WebPageCacheDataSourceKey;
54 extern NSString *WebPageCacheDocumentViewKey;
57 WebFrameLoadTypeStandard,
59 WebFrameLoadTypeForward,
60 WebFrameLoadTypeIndexedBackForward, // a multi-item hop in the backforward list
61 WebFrameLoadTypeReload,
62 WebFrameLoadTypeReloadAllowingStaleData,
63 WebFrameLoadTypeSame, // user loads same URL again (but not reload button)
64 WebFrameLoadTypeInternal,
65 WebFrameLoadTypeReplace
68 @interface WebFrame (WebPrivate)
70 // Other private methods
71 - (NSURLRequest *)_webDataRequestForData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)URL unreachableURL:(NSURL *)unreachableURL;
73 - (void)_detachFromParent;
74 - (void)_detachChildren;
75 - (void)_closeOldDataSources;
76 - (void)_commitProvisionalLoad:(NSDictionary *)pageCache;
77 - (void)_checkLoadCompleteForThisFrame;
78 - (void)_handledOnloadEvents;
79 - (void)_checkLoadComplete;
80 - (WebFrameBridge *)_bridge;
81 - (WebFrameLoadType)_loadType;
83 - (void)_goToItem:(WebHistoryItem *)item withLoadType:(WebFrameLoadType)type;
84 - (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer loadType:(WebFrameLoadType)loadType target:(NSString *)target triggeringEvent:(NSEvent *)event form:(DOMElement *)form formValues:(NSDictionary *)values;
85 - (void)_loadURL:(NSURL *)URL referrer:(NSString *)referrer intoChild:(WebFrame *)childFrame;
86 - (void)_postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSArray *)postData contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(DOMElement *)form formValues:(NSDictionary *)values;
88 - (void)_loadRequest:(NSURLRequest *)request inFrameNamed:(NSString *)frameName;
90 - (void)_clientRedirectedTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction;
91 - (void)_clientRedirectCancelledOrFinished:(BOOL)cancelWithLoadInProgress;
93 - (void)_defersCallbacksChanged;
95 - (void)_viewWillMoveToHostWindow:(NSWindow *)hostWindow;
96 - (void)_viewDidMoveToHostWindow;
98 - (void)_addChild:(WebFrame *)child;
100 - (NSDictionary *)_actionInformationForNavigationType:(WebNavigationType)navigationType event:(NSEvent *)event originalURL:(NSURL *)URL;
102 - (WebHistoryItem *)_itemForSavingDocState;
103 - (WebHistoryItem *)_itemForRestoringDocState;
105 - (void)_saveDocumentAndScrollState;
107 - (void)_setTitle:(NSString *)title;
109 - (void)_receivedMainResourceError:(NSError *)error;
111 + (CFAbsoluteTime)_timeOfLastCompletedLoad;
112 - (BOOL)_canCachePage;
113 - (void)_purgePageCache;
116 // used to decide to use loadType=Same
117 - (BOOL)_shouldTreatURLAsSameAsCurrent:(NSURL *)URL;
119 - (WebFrame *)_nextFrameWithWrap:(BOOL)wrapFlag;
120 - (WebFrame *)_previousFrameWithWrap:(BOOL)wrapFlag;
122 - (void)_setShouldCreateRenderers:(BOOL)f;
123 - (BOOL)_shouldCreateRenderers;
125 - (int)_numPendingOrLoadingRequests:(BOOL)recurse;
127 - (NSColor *)_bodyBackgroundColor;
129 - (void)_reloadForPluginChanges;
131 - (BOOL)_isDescendantOfFrame:(WebFrame *)frame;
134 - (void)_attachScriptDebugger;
135 - (void)_detachScriptDebugger;
137 - (void)_recursive_pauseNullEventsForAllNetscapePlugins;
138 - (void)_recursive_resumeNullEventsForAllNetscapePlugins;
140 - (BOOL)_firstLayoutDone;