[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:43:54 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit f516bf718604b8496aa82cbe7154117526f80d00
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Sep 24 20:05:27 2002 +0000
Documentation changes. Removal of imports from
some headers required modification of .m.
* Plugins.subproj/WebNullPluginView.m:
* WebCoreSupport.subproj/WebBridge.m:
* WebKit.pbproj/project.pbxproj:
* WebView.subproj/WebController.h:
* WebView.subproj/WebController.m:
* WebView.subproj/WebDataSource.h:
* WebView.subproj/WebDataSourcePrivate.h:
* WebView.subproj/WebDataSourcePrivate.m:
* WebView.subproj/WebDefaultPolicyDelegate.h:
* WebView.subproj/WebDefaultPolicyDelegate.m:
(+[WebDefaultPolicyDelegate defaultURLPolicyForURL:]):
(-[WebDefaultPolicyDelegate URLPolicyForURL:inFrame:]):
* WebView.subproj/WebFramePrivate.m:
* WebView.subproj/WebHTMLViewPrivate.m:
Documentation changes. Removal of imports from
some headers required modification of .m.
* BrowserDocument.m:
* BrowserWebController.m:
(-[BrowserWebController URLPolicyForURL:inFrame:]):
* DownloadMonitor.m:
* DownloadProgressEntry.m:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2144 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 85fe9d3..4e2f1ce 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,23 @@
+2002-09-24 Richard Williamson <rjw at apple.com>
+
+ Documentation changes. Removal of imports from
+ some headers required modification of .m.
+
+ * Plugins.subproj/WebNullPluginView.m:
+ * WebCoreSupport.subproj/WebBridge.m:
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/WebController.h:
+ * WebView.subproj/WebController.m:
+ * WebView.subproj/WebDataSource.h:
+ * WebView.subproj/WebDataSourcePrivate.h:
+ * WebView.subproj/WebDataSourcePrivate.m:
+ * WebView.subproj/WebDefaultPolicyDelegate.h:
+ * WebView.subproj/WebDefaultPolicyDelegate.m:
+ (+[WebDefaultPolicyDelegate defaultURLPolicyForURL:]):
+ (-[WebDefaultPolicyDelegate URLPolicyForURL:inFrame:]):
+ * WebView.subproj/WebFramePrivate.m:
+ * WebView.subproj/WebHTMLViewPrivate.m:
+
2002-09-24 Chris Blumenberg <cblu at apple.com>
Renamed element info keys to WebElement* instead of WebContextMenuElement*
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 85fe9d3..4e2f1ce 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,23 @@
+2002-09-24 Richard Williamson <rjw at apple.com>
+
+ Documentation changes. Removal of imports from
+ some headers required modification of .m.
+
+ * Plugins.subproj/WebNullPluginView.m:
+ * WebCoreSupport.subproj/WebBridge.m:
+ * WebKit.pbproj/project.pbxproj:
+ * WebView.subproj/WebController.h:
+ * WebView.subproj/WebController.m:
+ * WebView.subproj/WebDataSource.h:
+ * WebView.subproj/WebDataSourcePrivate.h:
+ * WebView.subproj/WebDataSourcePrivate.m:
+ * WebView.subproj/WebDefaultPolicyDelegate.h:
+ * WebView.subproj/WebDefaultPolicyDelegate.m:
+ (+[WebDefaultPolicyDelegate defaultURLPolicyForURL:]):
+ (-[WebDefaultPolicyDelegate URLPolicyForURL:inFrame:]):
+ * WebView.subproj/WebFramePrivate.m:
+ * WebView.subproj/WebHTMLViewPrivate.m:
+
2002-09-24 Chris Blumenberg <cblu at apple.com>
Renamed element info keys to WebElement* instead of WebContextMenuElement*
diff --git a/WebKit/Plugins.subproj/WebNullPluginView.m b/WebKit/Plugins.subproj/WebNullPluginView.m
index 62c8fa0..6d0470a 100644
--- a/WebKit/Plugins.subproj/WebNullPluginView.m
+++ b/WebKit/Plugins.subproj/WebNullPluginView.m
@@ -7,6 +7,7 @@
#import <WebKit/WebView.h>
#import <WebKit/WebController.h>
+#import <WebKit/WebControllerPolicyDelegate.h>
#import <WebKit/WebNSViewExtras.h>
#import <WebFoundation/WebNSURLExtras.h>
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index ca5135b..698e7f4 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -14,6 +14,7 @@
#import <WebKit/WebHTMLViewPrivate.h>
#import <WebKit/WebKitStatisticsPrivate.h>
#import <WebKit/WebLoadProgress.h>
+#import <WebKit/WebLocationChangeDelegate.h>
#import <WebKit/WebSubresourceClient.h>
#import <WebKit/WebViewPrivate.h>
#import <WebKit/WebWindowOperationsDelegate.h>
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index 59915de..b4b2501 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -1170,7 +1170,7 @@
isa = PBXBuildFile;
settings = {
ATTRIBUTES = (
- Public,
+ Private,
);
};
};
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index cd89a0a..1913215 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -6,10 +6,6 @@
*/
#import <Cocoa/Cocoa.h>
-#import <Foundation/Foundation.h>
-
-#import <WebKit/WebLocationChangeDelegate.h>
-#import <WebKit/WebControllerPolicyDelegate.h>
@class WebBackForwardList;
@class WebController;
@@ -22,9 +18,11 @@
@class WebResourceHandle;
@class WebView;
- at protocol WebWindowOperationsDelegate;
- at protocol WebResourceProgressDelegate;
@protocol WebContextMenuDelegate;
+ at protocol WebControllerPolicyDelegate;
+ at protocol WebLocationChangeDelegate;
+ at protocol WebResourceProgressDelegate;
+ at protocol WebWindowOperationsDelegate;
// These strings are keys into the element dictionary provided in
// the WebContextMenuDelegate's contextMenuItemsForElement and the WebControllerPolicyDelegate's clickPolicyForElement.
@@ -37,8 +35,46 @@ extern NSString *WebElementFrameKey;
/*!
@class WebController
- WebController manages the interaction between WebViews and WebDataSources.
- WebView and WebDataSource cannot function without a controller.
+ WebController manages the interaction between WebViews and WebDataSources. Modification
+ of the policies and behavior of the WebKit is largely managed by WebControllers and their
+ delegates.
+
+ <p>
+ Typical usage:
+ </p>
+ <pre>
+ WebController *webController;
+ WebDataSource *dataSource;
+ WebFrame *mainFrame;
+
+ webController = [[WebController alloc] initWithView: webView provisionalDataSource: nil];
+ dataSource = [[[WebDataSource alloc] initWithURL:url] autorelease];
+ mainFrame = [webController mainFrame];
+
+ if([mainFrame setProvisionalDataSource: dataSource]){
+ [mainFrame startLoading];
+ }
+ </pre>
+
+ WebControllers have the following delegates: WebWindowOperationsDelegate,
+ WebResourceProgressDelegate, WebContextMenuDelegate, WebLocationChangeDelegate,
+ and WebControllerPolicyDelegate.
+
+ WebKit depends on the WebController's WebWindowOperationsDelegate for all window
+ related management, including opening new windows and controlling the user interface
+ elements in those windows.
+
+ WebResourceProgressDelegate is used to monitor the progress of resources as they are
+ loaded. This delegate may be used to present users with a progress monitor.
+
+ WebController's WebContextMenuDelegate can customize the context menus that appear
+ over content managed by the WebKit.
+
+ The WebLocationChangeDelegate receives messages when the URL in a WebFrame is
+ changed.
+
+ WebController's WebControllerPolicyDelegate can make determinations about how
+ content should be handled, based on the resource's URL and MIME type.
*/
@interface WebController : NSObject
{
@@ -47,202 +83,220 @@ extern NSString *WebElementFrameKey;
}
/*!
- @method
-*/
-+ (WebURLPolicy *)defaultURLPolicyForURL: (NSURL *)URL;
-
-/*!
@method canShowMIMEType:
- @param MIMEType
+ @abstract Checks if the WebKit can show content of a certain MIME type.
+ @param MIMEType The MIME type to check.
+ @result YES if the WebKit can show content with MIMEtype.
*/
+ (BOOL)canShowMIMEType:(NSString *)MIMEType;
/*!
@method canShowFile:
- @param path
+ @abstract Checks if the WebKit can show the content of the file at the specified path.
+ @param path The path of the file to check
+ @result YES if the WebKit can show the content of the file at the specified path.
*/
+ (BOOL)canShowFile:(NSString *)path;
/*!
@method init
@abstract Calls designated initializer with nil arguments.
+ @result returns an initialized WebController.
*/
- init;
/*!
@method initWithView:provisionalDataSource:controllerSetName:
- @abstract Designated initializer.
- @param view
- @param dataSource
- @param name
+ @abstract The designated initializer for WebController.
+ @discussion Initialize a WebController with the supplied parameters. This method
+ will create a main WebFrame with the view and datasource. The frame will be
+ named "_top".
+ @param view The main view to be associated with the controller. May be nil.
+ @param dataSource The main datasource to be associated with the controller. May be nil.
+ @param name The name of the controller set to which this controller will be added. May be nil.
+ @result Returns an initialized WebController.
*/
- initWithView: (WebView *)view provisionalDataSource: (WebDataSource *)dataSource controllerSetName: (NSString *)name;
/*!
@method setWindowOperationsDelegate:
- @param delegate
+ @abstract Set the controller's WebWindowOperationsDelegate.
+ @param delegate The WebWindowOperationsDelegate to set as the delegate.
*/
- (void)setWindowOperationsDelegate: (id<WebWindowOperationsDelegate>)delegate;
/*!
@method windowOperationsDelegate
+ @result Return the controller's WebWindowOperationsDelegate.
*/
- (id<WebWindowOperationsDelegate>)windowOperationsDelegate;
/*!
@method setResourceProgressDelegate:
- @param delegate
+ @abstract Set the controller's WebResourceProgressDelegate.
+ @param delegate The WebResourceProgressDelegate to set as the delegate.
*/
- (void)setResourceProgressDelegate: (id<WebResourceProgressDelegate>)delegate;
/*!
@method resourceProgressDelegate
+ @result Return the controller's WebResourceProgressDelegate.
*/
- (id<WebResourceProgressDelegate>)resourceProgressDelegate;
/*!
@method setDownloadProgressDelegate:
- @param delegate
+ @abstract Set the controller's WebResourceProgressDelegate download delegate.
+ @param delegate The WebResourceProgressDelegate to set as the download delegate.
*/
- (void)setDownloadProgressDelegate: (id<WebResourceProgressDelegate>)delegate;
/*!
@method downloadProgressDelegate
+ @result Return the controller's WebResourceProgressDelegate download delegate.
*/
- (id<WebResourceProgressDelegate>)downloadProgressDelegate;
/*!
@method setContextMenuDelegate:
- @param delegate
+ @abstract Set the controller's WebContextMenuDelegate download delegate.
+ @param delegate The WebContextMenuDelegate to set as the download delegate.
*/
- (void)setContextMenuDelegate: (id<WebContextMenuDelegate>)delegate;
/*!
@method contextMenuDelegate
+ @result Return the controller's WebContextMenuDelegate.
*/
- (id<WebContextMenuDelegate>)contextMenuDelegate;
/*!
@method setLocationChangeDelegate:
- @param delegate
+ @abstract Set the controller's WebLocationChangeDelegate delegate.
+ @param delegate The WebLocationChangeDelegate to set as the delegate.
*/
- (void)setLocationChangeDelegate:(id <WebLocationChangeDelegate>)delegate;
/*!
@method locationChangeDelegate
+ @result Return the controller's WebLocationChangeDelegate.
*/
- (id <WebLocationChangeDelegate>)locationChangeDelegate;
/*!
@method setPolicyDelegate:
- @param delegate
+ @abstract Set the controller's WebControllerPolicyDelegate delegate.
+ @param delegate The WebControllerPolicyDelegate to set as the delegate.
*/
- (void)setPolicyDelegate: (id<WebControllerPolicyDelegate>)delegate;
/*!
@method policyDelegate
+ @result Return the controller's WebControllerPolicyDelegate.
*/
- (id<WebControllerPolicyDelegate>)policyDelegate;
/*!
@method frameNamed:
- Look for a frame named name, recursively.
- @param name
+ @abstract Look for a frame named name, recursively from the main frame.
+ @param name The name of the frame to find.
+ @result Returns the frame with the supplied name, or nil if not found.
*/
- (WebFrame *)frameNamed: (NSString *)name;
/*!
@method mainFrame
- Return the top level frame. Note that even document that are not framesets will have a
+ @abstract Return the top level frame.
+ @discussion Note that even document that are not framesets will have a
mainFrame.
+ @result The main frame.
*/
- (WebFrame *)mainFrame;
/*!
@method frameForDataSource:
- Return the frame associated with the data source. Traverses the
- frame tree to find the data source.
- @param dataSource
+ @abstract Return the frame associated with the data source.
+ @disucssion Traverses the frame tree to find the frame associated
+ with a datasource.
+ @param datasource The datasource to match against each frame.
+ @result The frame that has the associated datasource.
*/
- (WebFrame *)frameForDataSource: (WebDataSource *)dataSource;
/*!
@method frameForView:
- Return the frame associated with the view. Traverses the
- frame tree to find the view.
- @param aView
+ @abstract Return the frame associated with the view.
+ @discussion Traverses the frame tree to find the view.
+ @param aView The view to match against each frame.
+ @result The frame that has the associated view.
*/
- (WebFrame *)frameForView: (WebView *)aView;
/*!
- @method stopAnimatedImages
-*/
-- (void)stopAnimatedImages;
-
-/*!
- @method startAnimatedImages
-*/
-- (void)startAnimatedImages;
-
-/*!
- @method stopAnimatedImageLooping
-*/
-- (void)stopAnimatedImageLooping;
-
-/*!
- @method startAnimatedImageLooping
-*/
-- (void)startAnimatedImageLooping;
-
-/*!
@method backForwardList
+ @result The backforward list for this controller.
*/
- (WebBackForwardList *)backForwardList;
/*!
@method setUseBackForwardList:
+ @abstract Enable or disable the use of a backforward list for this controller.
@param flag turns use of the back forward list on or off
*/
- (void)setUseBackForwardList: (BOOL)flag;
/*!
@method useBackForwardList
+ @result Returns YES if a backforward list is being used by this controller, NO otherwise.
*/
- (BOOL)useBackForwardList;
/*!
@method goBack
+ @abstract Go back to the last URL in the backforward list.
+ @result Returns YES if able to go back in the backforward list, NO otherwise.
*/
- (BOOL)goBack;
/*!
@method goForward
+ @abstract Go forward to the next URL in the backforward list.
+ @result Returns YES if able to go forward in the backforward list, NO otherwise.
*/
- (BOOL)goForward;
/*!
@method setTextSizeMultiplier:
- @param multiplier
+ @abstract Change the size of the text rendering in views managed by this controller.
+ @param multiplier A fractional percentage value, 1.0 is 100%.
*/
-- (void)setTextSizeMultiplier:(float)multiplier; // 1.0 is normal size
+- (void)setTextSizeMultiplier:(float)multiplier;
/*!
@method textSizeMultiplier
+ @result Returns the text size multipler.
*/
- (float)textSizeMultiplier;
/*!
@method setApplicationNameForUserAgent:
- Set the application name. This name will be used in user-agent strings
+ @abstract Set the application name.
+ @discussion This name will be used in user-agent strings
that are chosen for best results in rendering web pages.
@param applicationName the application name
*/
- (void)setApplicationNameForUserAgent:(NSString *)applicationName;
+
+/*!
+ @method applicationNameForUserAgent
+ @result Returns the name of the application as used in the user-agent string.
+*/
- (NSString *)applicationNameForUserAgent;
/*!
@method setUserAgent:
- Set the user agent explicitly. Setting the user-agent string to nil means
+ @abstract Set the user agent.
+ @discussion Setting the user-agent string to nil means
that WebKit should construct the best possible user-agent string for each URL
for best results rendering web pages. Setting it to any string means
that WebKit should use that user-agent string for all purposes until it is set
@@ -250,18 +304,26 @@ extern NSString *WebElementFrameKey;
@param userAgentString the user agent description
*/
- (void)setUserAgent:(NSString *)userAgentString;
+
+/*!
+ @method userAgent
+ @result userAgent Returns the userAgent string.
+*/
- (NSString *)userAgent;
/*!
@method userAgentForURL:
@abstract Get the appropriate user-agent string for a particular URL.
- @param URL
+ @param URL Get the appropriate user-agent string for the URL.
+ @result Returns the user-agent string for the supplied URL.
*/
- (NSString *)userAgentForURL:(NSURL *)URL;
/*!
@method supportsTextEncoding
@abstract Find out if the current web page supports text encodings.
+ @result Returns YES if the document view of the current web page can
+ support different text encodings.
*/
- (BOOL)supportsTextEncoding;
@@ -277,7 +339,14 @@ extern NSString *WebElementFrameKey;
- (void)setCustomTextEncoding:(CFStringEncoding)encoding;
/*!
+ @method customTextEncoding
+ @result Returns the custom text encoding.
+*/
+- (CFStringEncoding)customTextEncoding;
+
+/*!
@method resetTextEncoding
+ @abstract Remove any custom encodings that have been applied and use the default encoding.
*/
- (void)resetTextEncoding;
@@ -285,12 +354,8 @@ extern NSString *WebElementFrameKey;
@method hasCustomTextEncoding
@abstract Determine whether or not a custom text encoding is in use.
@discussion It's an error to call customTextEncoding if hasCustomTextEncoding is NO.
+ @reselt Returns YES if a custom encoding has been set, NO otherwise.
*/
- (BOOL)hasCustomTextEncoding;
-/*!
- @method customTextEncoding
-*/
-- (CFStringEncoding)customTextEncoding;
-
@end
diff --git a/WebKit/WebView.subproj/WebController.m b/WebKit/WebView.subproj/WebController.m
index 038ba15..34eedd8 100644
--- a/WebKit/WebView.subproj/WebController.m
+++ b/WebKit/WebView.subproj/WebController.m
@@ -247,31 +247,6 @@ NSString * WebElementFrameKey = @"WebElementFrame";
}
-+ (WebURLPolicy *)defaultURLPolicyForURL: (NSURL *)URL
-{
- if([WebResourceHandle canInitWithURL:URL]){
- return [WebURLPolicy webPolicyWithURLAction:WebURLPolicyUseContentPolicy];
- }else{
- return [WebURLPolicy webPolicyWithURLAction:WebURLPolicyOpenExternally];
- }
-}
-
-- (void)stopAnimatedImages
-{
-}
-
-- (void)startAnimatedImages
-{
-}
-
-- (void)stopAnimatedImageLooping
-{
-}
-
-- (void)startAnimatedImageLooping
-{
-}
-
+ (BOOL)canShowMIMEType:(NSString *)MIMEType
{
if([WebView _canShowMIMEType:MIMEType] && [WebDataSource _canShowMIMEType:MIMEType]){
diff --git a/WebKit/WebView.subproj/WebDataSource.h b/WebKit/WebView.subproj/WebDataSource.h
index 0ad5677..ab2bfcb 100644
--- a/WebKit/WebView.subproj/WebDataSource.h
+++ b/WebKit/WebView.subproj/WebDataSource.h
@@ -7,10 +7,10 @@
#import <Cocoa/Cocoa.h>
-#import <WebKit/WebController.h>
-
+ at class WebError;
@class WebFrame;
@class WebResourceHandle;
+ at class WebContentPolicy;
@class WebController;
@class WebDataSourcePrivate;
@class WebResourceRequest;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 4862ef6..9385679 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -9,11 +9,13 @@
#import <WebKit/WebDataSource.h>
#import <WebKit/WebBridge.h>
+ at class WebContentPolicy;
@class WebIconLoader;
+ at class WebMainResourceClient;
@class WebResourceHandle;
@class WebResourceRequest;
- at class WebMainResourceClient;
@class WebSubresourceClient;
+
@protocol WebDocumentRepresentation;
@interface WebDataSourcePrivate : NSObject
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index fd697cb..1f981aa 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -8,6 +8,7 @@
#import <WebKit/WebDataSourcePrivate.h>
+#import <WebKit/WebControllerPolicyDelegate.h>
#import <WebKit/WebDocument.h>
#import <WebKit/WebDownloadHandler.h>
#import <WebKit/WebException.h>
diff --git a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.h b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.h
index 8820f38..1686bc8 100644
--- a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.h
+++ b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.h
@@ -4,13 +4,37 @@
Public header file.
*/
+#import <Foundation/Foundation.h>
@class WebController;
+ at class WebURLPolicy;
+/*!
+ @class WebDefaultPolicyDelegate
+ @discussion WebDefaultPolicyDelegate will be used a a WebController's
+ default policy delegate. It can be subclassed to modify policies.
+*/
@interface WebDefaultPolicyDelegate : NSObject <WebControllerPolicyDelegate>
{
WebController *webController;
}
-- initWithWebController: (WebController *)wc;
+
+/*!
+ @method defaultURLPolicyForURL:
+ @abstract Provides the default WebURLPolicy for a URL
+ @discussion WebControllerPolicyDelegates can use this method to
+ implement the standard behavior for -URLPolicyForURL:.
+ @param URL use this URL to determine an appropriate policy
+ @result The WebURLPolicy to use for the URL.
+*/
++ (WebURLPolicy *)defaultURLPolicyForURL: (NSURL *)URL;
+
+
+/*!
+ @method initWithWebController:
+ @param webController The controller that will use this delegate. Note that the controller is not retained.
+ @result An initialized WebDefaultPolicyDelegate
+*/
+- initWithWebController: (WebController *)webController;
@end
diff --git a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
index 4262232..62ffc46 100644
--- a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
@@ -2,13 +2,26 @@
WebDefaultPolicyDelegate.m
Copyright 2002, Apple Computer, Inc.
*/
+#import <WebKit/WebController.h>
+#import <WebKit/WebControllerPolicyDelegate.h>
#import <WebKit/WebDataSource.h>
#import <WebKit/WebDefaultPolicyDelegate.h>
#import <WebKit/WebFrame.h>
+#import <WebFoundation/WebResourceHandle.h>
@implementation WebDefaultPolicyDelegate
++ (WebURLPolicy *)defaultURLPolicyForURL: (NSURL *)URL
+{
+ if([WebResourceHandle canInitWithURL:URL]){
+ return [WebURLPolicy webPolicyWithURLAction:WebURLPolicyUseContentPolicy];
+ }else{
+ return [WebURLPolicy webPolicyWithURLAction:WebURLPolicyOpenExternally];
+ }
+}
+
+
- initWithWebController: (WebController *)wc
{
[super init];
@@ -18,7 +31,7 @@
- (WebURLPolicy *)URLPolicyForURL:(NSURL *)URL inFrame:(WebFrame *)frame
{
- return [WebController defaultURLPolicyForURL:URL];
+ return [WebDefaultPolicyDelegate defaultURLPolicyForURL:URL];
}
- (WebFileURLPolicy *)fileURLPolicyForMIMEType:(NSString *)type inFrame:(WebFrame *)frame isDirectory:(BOOL)isDirectory
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index bcba042..c1a36a5 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -9,6 +9,7 @@
#import <WebKit/WebBackForwardList.h>
#import <WebKit/WebBridge.h>
#import <WebKit/WebController.h>
+#import <WebKit/WebControllerPolicyDelegate.h>
#import <WebKit/WebControllerPrivate.h>
#import <WebKit/WebDataSource.h>
#import <WebKit/WebDataSourcePrivate.h>
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index 0a2f5f4..4c48b8c 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -15,6 +15,7 @@
#import <WebKit/WebBridge.h>
#import <WebKit/WebContextMenuDelegate.h>
#import <WebKit/WebController.h>
+#import <WebKit/WebControllerPolicyDelegate.h>
#import <WebKit/WebControllerPrivate.h>
#import <WebKit/WebDataSourcePrivate.h>
#import <WebKit/WebFramePrivate.h>
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index cd89a0a..1913215 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -6,10 +6,6 @@
*/
#import <Cocoa/Cocoa.h>
-#import <Foundation/Foundation.h>
-
-#import <WebKit/WebLocationChangeDelegate.h>
-#import <WebKit/WebControllerPolicyDelegate.h>
@class WebBackForwardList;
@class WebController;
@@ -22,9 +18,11 @@
@class WebResourceHandle;
@class WebView;
- at protocol WebWindowOperationsDelegate;
- at protocol WebResourceProgressDelegate;
@protocol WebContextMenuDelegate;
+ at protocol WebControllerPolicyDelegate;
+ at protocol WebLocationChangeDelegate;
+ at protocol WebResourceProgressDelegate;
+ at protocol WebWindowOperationsDelegate;
// These strings are keys into the element dictionary provided in
// the WebContextMenuDelegate's contextMenuItemsForElement and the WebControllerPolicyDelegate's clickPolicyForElement.
@@ -37,8 +35,46 @@ extern NSString *WebElementFrameKey;
/*!
@class WebController
- WebController manages the interaction between WebViews and WebDataSources.
- WebView and WebDataSource cannot function without a controller.
+ WebController manages the interaction between WebViews and WebDataSources. Modification
+ of the policies and behavior of the WebKit is largely managed by WebControllers and their
+ delegates.
+
+ <p>
+ Typical usage:
+ </p>
+ <pre>
+ WebController *webController;
+ WebDataSource *dataSource;
+ WebFrame *mainFrame;
+
+ webController = [[WebController alloc] initWithView: webView provisionalDataSource: nil];
+ dataSource = [[[WebDataSource alloc] initWithURL:url] autorelease];
+ mainFrame = [webController mainFrame];
+
+ if([mainFrame setProvisionalDataSource: dataSource]){
+ [mainFrame startLoading];
+ }
+ </pre>
+
+ WebControllers have the following delegates: WebWindowOperationsDelegate,
+ WebResourceProgressDelegate, WebContextMenuDelegate, WebLocationChangeDelegate,
+ and WebControllerPolicyDelegate.
+
+ WebKit depends on the WebController's WebWindowOperationsDelegate for all window
+ related management, including opening new windows and controlling the user interface
+ elements in those windows.
+
+ WebResourceProgressDelegate is used to monitor the progress of resources as they are
+ loaded. This delegate may be used to present users with a progress monitor.
+
+ WebController's WebContextMenuDelegate can customize the context menus that appear
+ over content managed by the WebKit.
+
+ The WebLocationChangeDelegate receives messages when the URL in a WebFrame is
+ changed.
+
+ WebController's WebControllerPolicyDelegate can make determinations about how
+ content should be handled, based on the resource's URL and MIME type.
*/
@interface WebController : NSObject
{
@@ -47,202 +83,220 @@ extern NSString *WebElementFrameKey;
}
/*!
- @method
-*/
-+ (WebURLPolicy *)defaultURLPolicyForURL: (NSURL *)URL;
-
-/*!
@method canShowMIMEType:
- @param MIMEType
+ @abstract Checks if the WebKit can show content of a certain MIME type.
+ @param MIMEType The MIME type to check.
+ @result YES if the WebKit can show content with MIMEtype.
*/
+ (BOOL)canShowMIMEType:(NSString *)MIMEType;
/*!
@method canShowFile:
- @param path
+ @abstract Checks if the WebKit can show the content of the file at the specified path.
+ @param path The path of the file to check
+ @result YES if the WebKit can show the content of the file at the specified path.
*/
+ (BOOL)canShowFile:(NSString *)path;
/*!
@method init
@abstract Calls designated initializer with nil arguments.
+ @result returns an initialized WebController.
*/
- init;
/*!
@method initWithView:provisionalDataSource:controllerSetName:
- @abstract Designated initializer.
- @param view
- @param dataSource
- @param name
+ @abstract The designated initializer for WebController.
+ @discussion Initialize a WebController with the supplied parameters. This method
+ will create a main WebFrame with the view and datasource. The frame will be
+ named "_top".
+ @param view The main view to be associated with the controller. May be nil.
+ @param dataSource The main datasource to be associated with the controller. May be nil.
+ @param name The name of the controller set to which this controller will be added. May be nil.
+ @result Returns an initialized WebController.
*/
- initWithView: (WebView *)view provisionalDataSource: (WebDataSource *)dataSource controllerSetName: (NSString *)name;
/*!
@method setWindowOperationsDelegate:
- @param delegate
+ @abstract Set the controller's WebWindowOperationsDelegate.
+ @param delegate The WebWindowOperationsDelegate to set as the delegate.
*/
- (void)setWindowOperationsDelegate: (id<WebWindowOperationsDelegate>)delegate;
/*!
@method windowOperationsDelegate
+ @result Return the controller's WebWindowOperationsDelegate.
*/
- (id<WebWindowOperationsDelegate>)windowOperationsDelegate;
/*!
@method setResourceProgressDelegate:
- @param delegate
+ @abstract Set the controller's WebResourceProgressDelegate.
+ @param delegate The WebResourceProgressDelegate to set as the delegate.
*/
- (void)setResourceProgressDelegate: (id<WebResourceProgressDelegate>)delegate;
/*!
@method resourceProgressDelegate
+ @result Return the controller's WebResourceProgressDelegate.
*/
- (id<WebResourceProgressDelegate>)resourceProgressDelegate;
/*!
@method setDownloadProgressDelegate:
- @param delegate
+ @abstract Set the controller's WebResourceProgressDelegate download delegate.
+ @param delegate The WebResourceProgressDelegate to set as the download delegate.
*/
- (void)setDownloadProgressDelegate: (id<WebResourceProgressDelegate>)delegate;
/*!
@method downloadProgressDelegate
+ @result Return the controller's WebResourceProgressDelegate download delegate.
*/
- (id<WebResourceProgressDelegate>)downloadProgressDelegate;
/*!
@method setContextMenuDelegate:
- @param delegate
+ @abstract Set the controller's WebContextMenuDelegate download delegate.
+ @param delegate The WebContextMenuDelegate to set as the download delegate.
*/
- (void)setContextMenuDelegate: (id<WebContextMenuDelegate>)delegate;
/*!
@method contextMenuDelegate
+ @result Return the controller's WebContextMenuDelegate.
*/
- (id<WebContextMenuDelegate>)contextMenuDelegate;
/*!
@method setLocationChangeDelegate:
- @param delegate
+ @abstract Set the controller's WebLocationChangeDelegate delegate.
+ @param delegate The WebLocationChangeDelegate to set as the delegate.
*/
- (void)setLocationChangeDelegate:(id <WebLocationChangeDelegate>)delegate;
/*!
@method locationChangeDelegate
+ @result Return the controller's WebLocationChangeDelegate.
*/
- (id <WebLocationChangeDelegate>)locationChangeDelegate;
/*!
@method setPolicyDelegate:
- @param delegate
+ @abstract Set the controller's WebControllerPolicyDelegate delegate.
+ @param delegate The WebControllerPolicyDelegate to set as the delegate.
*/
- (void)setPolicyDelegate: (id<WebControllerPolicyDelegate>)delegate;
/*!
@method policyDelegate
+ @result Return the controller's WebControllerPolicyDelegate.
*/
- (id<WebControllerPolicyDelegate>)policyDelegate;
/*!
@method frameNamed:
- Look for a frame named name, recursively.
- @param name
+ @abstract Look for a frame named name, recursively from the main frame.
+ @param name The name of the frame to find.
+ @result Returns the frame with the supplied name, or nil if not found.
*/
- (WebFrame *)frameNamed: (NSString *)name;
/*!
@method mainFrame
- Return the top level frame. Note that even document that are not framesets will have a
+ @abstract Return the top level frame.
+ @discussion Note that even document that are not framesets will have a
mainFrame.
+ @result The main frame.
*/
- (WebFrame *)mainFrame;
/*!
@method frameForDataSource:
- Return the frame associated with the data source. Traverses the
- frame tree to find the data source.
- @param dataSource
+ @abstract Return the frame associated with the data source.
+ @disucssion Traverses the frame tree to find the frame associated
+ with a datasource.
+ @param datasource The datasource to match against each frame.
+ @result The frame that has the associated datasource.
*/
- (WebFrame *)frameForDataSource: (WebDataSource *)dataSource;
/*!
@method frameForView:
- Return the frame associated with the view. Traverses the
- frame tree to find the view.
- @param aView
+ @abstract Return the frame associated with the view.
+ @discussion Traverses the frame tree to find the view.
+ @param aView The view to match against each frame.
+ @result The frame that has the associated view.
*/
- (WebFrame *)frameForView: (WebView *)aView;
/*!
- @method stopAnimatedImages
-*/
-- (void)stopAnimatedImages;
-
-/*!
- @method startAnimatedImages
-*/
-- (void)startAnimatedImages;
-
-/*!
- @method stopAnimatedImageLooping
-*/
-- (void)stopAnimatedImageLooping;
-
-/*!
- @method startAnimatedImageLooping
-*/
-- (void)startAnimatedImageLooping;
-
-/*!
@method backForwardList
+ @result The backforward list for this controller.
*/
- (WebBackForwardList *)backForwardList;
/*!
@method setUseBackForwardList:
+ @abstract Enable or disable the use of a backforward list for this controller.
@param flag turns use of the back forward list on or off
*/
- (void)setUseBackForwardList: (BOOL)flag;
/*!
@method useBackForwardList
+ @result Returns YES if a backforward list is being used by this controller, NO otherwise.
*/
- (BOOL)useBackForwardList;
/*!
@method goBack
+ @abstract Go back to the last URL in the backforward list.
+ @result Returns YES if able to go back in the backforward list, NO otherwise.
*/
- (BOOL)goBack;
/*!
@method goForward
+ @abstract Go forward to the next URL in the backforward list.
+ @result Returns YES if able to go forward in the backforward list, NO otherwise.
*/
- (BOOL)goForward;
/*!
@method setTextSizeMultiplier:
- @param multiplier
+ @abstract Change the size of the text rendering in views managed by this controller.
+ @param multiplier A fractional percentage value, 1.0 is 100%.
*/
-- (void)setTextSizeMultiplier:(float)multiplier; // 1.0 is normal size
+- (void)setTextSizeMultiplier:(float)multiplier;
/*!
@method textSizeMultiplier
+ @result Returns the text size multipler.
*/
- (float)textSizeMultiplier;
/*!
@method setApplicationNameForUserAgent:
- Set the application name. This name will be used in user-agent strings
+ @abstract Set the application name.
+ @discussion This name will be used in user-agent strings
that are chosen for best results in rendering web pages.
@param applicationName the application name
*/
- (void)setApplicationNameForUserAgent:(NSString *)applicationName;
+
+/*!
+ @method applicationNameForUserAgent
+ @result Returns the name of the application as used in the user-agent string.
+*/
- (NSString *)applicationNameForUserAgent;
/*!
@method setUserAgent:
- Set the user agent explicitly. Setting the user-agent string to nil means
+ @abstract Set the user agent.
+ @discussion Setting the user-agent string to nil means
that WebKit should construct the best possible user-agent string for each URL
for best results rendering web pages. Setting it to any string means
that WebKit should use that user-agent string for all purposes until it is set
@@ -250,18 +304,26 @@ extern NSString *WebElementFrameKey;
@param userAgentString the user agent description
*/
- (void)setUserAgent:(NSString *)userAgentString;
+
+/*!
+ @method userAgent
+ @result userAgent Returns the userAgent string.
+*/
- (NSString *)userAgent;
/*!
@method userAgentForURL:
@abstract Get the appropriate user-agent string for a particular URL.
- @param URL
+ @param URL Get the appropriate user-agent string for the URL.
+ @result Returns the user-agent string for the supplied URL.
*/
- (NSString *)userAgentForURL:(NSURL *)URL;
/*!
@method supportsTextEncoding
@abstract Find out if the current web page supports text encodings.
+ @result Returns YES if the document view of the current web page can
+ support different text encodings.
*/
- (BOOL)supportsTextEncoding;
@@ -277,7 +339,14 @@ extern NSString *WebElementFrameKey;
- (void)setCustomTextEncoding:(CFStringEncoding)encoding;
/*!
+ @method customTextEncoding
+ @result Returns the custom text encoding.
+*/
+- (CFStringEncoding)customTextEncoding;
+
+/*!
@method resetTextEncoding
+ @abstract Remove any custom encodings that have been applied and use the default encoding.
*/
- (void)resetTextEncoding;
@@ -285,12 +354,8 @@ extern NSString *WebElementFrameKey;
@method hasCustomTextEncoding
@abstract Determine whether or not a custom text encoding is in use.
@discussion It's an error to call customTextEncoding if hasCustomTextEncoding is NO.
+ @reselt Returns YES if a custom encoding has been set, NO otherwise.
*/
- (BOOL)hasCustomTextEncoding;
-/*!
- @method customTextEncoding
-*/
-- (CFStringEncoding)customTextEncoding;
-
@end
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 038ba15..34eedd8 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -247,31 +247,6 @@ NSString * WebElementFrameKey = @"WebElementFrame";
}
-+ (WebURLPolicy *)defaultURLPolicyForURL: (NSURL *)URL
-{
- if([WebResourceHandle canInitWithURL:URL]){
- return [WebURLPolicy webPolicyWithURLAction:WebURLPolicyUseContentPolicy];
- }else{
- return [WebURLPolicy webPolicyWithURLAction:WebURLPolicyOpenExternally];
- }
-}
-
-- (void)stopAnimatedImages
-{
-}
-
-- (void)startAnimatedImages
-{
-}
-
-- (void)stopAnimatedImageLooping
-{
-}
-
-- (void)startAnimatedImageLooping
-{
-}
-
+ (BOOL)canShowMIMEType:(NSString *)MIMEType
{
if([WebView _canShowMIMEType:MIMEType] && [WebDataSource _canShowMIMEType:MIMEType]){
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list