[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 05:52:54 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 77cd16af4ef2537b85606ff9840a1ffb0a0a4f8a
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Dec 8 02:20:56 2001 +0000

    New API described in headers.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@483 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 56620b7..e03a4e2 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,11 +1,18 @@
 2001-12-07  Richard Williamson  <richwill at richwill.com>
 
-        First pass at API for WKWebPageView and WKWebPageDataSource.  Note
-        that we have to change names from NS to WK!  The new API is conditionally
-        excluded #ifdef READY_FOR_PRIMETIME
 	* WebView.subproj/NSWebPageDataSource.h:
 	* WebView.subproj/NSWebPageDataSourcePrivate.h:
 	* WebView.subproj/NSWebPageView.h:
+        
+        First pass at API for WKWebView and WKWebDataSource.  Note
+        that we have to change names from NS to WK!  The new API is conditionally
+        excluded #ifdef READY_FOR_PRIMETIME
+        
+        Added these files:
+        
+	* WebView.subproj/WKWebDataSource.h:
+	* WebView.subproj/WKWebView.h:
+	* WebView.subproj/WKWebController.h:
 
 2001-12-06  Maciej Stachowiak  <mjs at apple.com>
 
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 56620b7..e03a4e2 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,11 +1,18 @@
 2001-12-07  Richard Williamson  <richwill at richwill.com>
 
-        First pass at API for WKWebPageView and WKWebPageDataSource.  Note
-        that we have to change names from NS to WK!  The new API is conditionally
-        excluded #ifdef READY_FOR_PRIMETIME
 	* WebView.subproj/NSWebPageDataSource.h:
 	* WebView.subproj/NSWebPageDataSourcePrivate.h:
 	* WebView.subproj/NSWebPageView.h:
+        
+        First pass at API for WKWebView and WKWebDataSource.  Note
+        that we have to change names from NS to WK!  The new API is conditionally
+        excluded #ifdef READY_FOR_PRIMETIME
+        
+        Added these files:
+        
+	* WebView.subproj/WKWebDataSource.h:
+	* WebView.subproj/WKWebView.h:
+	* WebView.subproj/WKWebController.h:
 
 2001-12-06  Maciej Stachowiak  <mjs at apple.com>
 
diff --git a/WebKit/WebView.subproj/IFWebController.h b/WebKit/WebView.subproj/IFWebController.h
new file mode 100644
index 0000000..d57639d
--- /dev/null
+++ b/WebKit/WebView.subproj/IFWebController.h
@@ -0,0 +1,109 @@
+/*	
+        WKWebController.h
+	Copyright 2001, Apple, Inc. All rights reserved.
+
+        Public header file.
+*/
+#import <Cocoa/Cocoa.h>
+
+ at interface WKWebController : NSObject <WKLoadHandler, WKScriptContextHandler, WKFrameSetHandler, WKCredentialsHandler, WKLocationChangeHandler, WKContextMenuHandler>
+ at end
+
+// See the comments in WKWebPageView above for more description about this protocol.
+ at protocol WKLocationChangeHandler
+- (BOOL)locationWillChange;
+- (void)loadingCancelled;
+- (void)loadingStopped;
+- (void)loadingFinished;
+- (void)loadingStarted;
+ at end
+
+
+
+ at protocol WKContextMenuHandler
+/*
+    We decided to implement this in terms of a fixed set of types rather
+    than per node.
+    
+    What items should be supported in the default context menus?
+*/
+ at end
+
+/*
+*/
+ at protocol WKCredentialsHandler
+// Ken will come up with a proposal for this.  We decided not have a generic API,
+// rather we'll have an API that explicitly knows about the authentication
+// attributes needed.
+// Client should use this API to collect information necessary to authenticate,
+// usually by putting up a dialog.
+// Do we provide a default dialog.
+ at end
+
+
+/*
+    Implementors of this protocol will receive messages indicating
+    data as it arrive.
+    
+    This method will be called even if the data source
+    is initialized with something other than a URL.
+*/
+ at protocol  WKLoadHandler
+
+/*
+    A new chunk of data has been received.  This could be partial load
+    of a url.  It may be useful to do incremental layout, although
+    typically for non-base URLs this should be done after a URL (i.e. image)
+    has been completed downloaded.
+*/
+- (void)receivedDataForLocation: (WKLoadProgress *)progress;
+
+ at end
+
+
+
+/*
+    A WKLoadProgress capture the state associated with a load progress
+    indication.  Should we use a struct?
+*/
+ at interface WKLoadProgress 
+{
+    int bytesSoFar;	// 0 if this is the start of load
+    int totalLoaded;	// -1 if this is not known.
+                        // bytesSoFar == totalLoaded when complete
+    NSString *location; // Needs to be a string, not URL.
+    LOAD_TYPES type;	// load types, either image, css, jscript, or html
+}
+ at end
+
+
+
+/*
+    A class that implements WKScriptContextHandler provides all the state information
+    that may be used by Javascript (AppleScript?).
+    
+*/
+ at protocol WKScriptContextHandler
+
+- (void)setStatusText: (NSString *)text;
+- (NSString *)statusText;
+
+// Need API for things like window size and position, window ids,
+// screen goemetry.  Essentially all the 'view' items that are
+// accessible from Javascript.
+
+ at end
+
+
+/*
+*/
+ at protocol WKFrameSetHandler
+- (NSArray *)frameNames;
+- (WKFrame *)findFrameNamed: (NSString *)name;
+- (BOOL)frameExists: (NSString *)name;
+- (BOOL)openURLInFrame: (WKFrame *)aFrame url: (NSURL *)url;
+ at end
+
+ at protocol WKFrame
+//
+ at end
diff --git a/WebKit/WebView.subproj/NSWebPageDataSource.h b/WebKit/WebView.subproj/IFWebDataSource.h
similarity index 63%
copy from WebKit/WebView.subproj/NSWebPageDataSource.h
copy to WebKit/WebView.subproj/IFWebDataSource.h
index e8ff602..190fab9 100644
--- a/WebKit/WebView.subproj/NSWebPageDataSource.h
+++ b/WebKit/WebView.subproj/IFWebDataSource.h
@@ -1,29 +1,40 @@
-/*	NSWebPageDataSource.h
+/*	
+        WKWebDataSource.h
 	Copyright 2001, Apple, Inc. All rights reserved.
 
         Public header file.
 */
 #import <Cocoa/Cocoa.h>
 
+#import <WebKit/WKWebController.h>
+
 /*
-    A NSWebPageDataSource represents all the state associated
-    with a web page.  It is typicallly instantiated withe a URL, but
+    A WKWebDataSource represents all the state associated
+    with a web page.  It is typicallly initialized with a URL, but
     may also be initialized with an NSString or NSData that hold
-    HTML content.
+    HTML (?also other, i.e. image data?) content.
     
     Typical usage of a WKWebDataSource.
     
-    WKWebPageDataSource *dataSource = [[WKWebPageDataSource alloc] initWithURL: url];
-    [dataSource setFrameSetManager: (WKFrameSetManagement *)myManager];
-    [dataSource setScriptExecutionContext: (WKScriptContext *)myContext];
+    WKWebDataSource *dataSource = [[WKWebDataSource alloc] initWithURL: url];
     
-    Although, usually a WKWebView is the owner and user of data source, and it
-    becomes the WKScriptContext and WKFrameSetManagement for a data source.
+    [dataSource setFrameSetHandler: (WKFrameSetHandler *)myManager];
+    [dataSource setScriptContextHandler: (WKScriptContextHandler *)myContext];
+    [dataSource setLoadHandler: (WKLoadHandler *)loadHandler];
+    [dataSource setCredentialsHandler: (WKCredentialsHandler *)credentialsHandler];
+    ...
+    or
+    ...
+    [dataSource setController: (WKWebController *)myController];
+        
+    Questions:  
+        Multiple protocols or controller?
+        Should we use CF XML data types, or our own?
 */
 
 #ifdef READY_FOR_PRIMETIME
 
- at interface NSWebPageDataSource : NSObject
+ at interface WKWebDataSource : NSObject
 {
 @private
     id _dataSourcePrivate;
@@ -43,6 +54,9 @@
 // ?? We don't have a NS streams API!!
 - initWithStream: (NSStream *)stream
 
+// May return nil if not initialized with a URL.
+- (NSURL *)url;
+
 // Start actually getting (if initialized with a URL) and parsing data.
 - (void)startLoading;
 
@@ -86,9 +100,13 @@
 - (BOOL)hasSelection;
 - (void)selectAll;
 
-- (void)setFrameSetManager: (WKFrameSetManagement *)fmanager;
-
-- (void)setScriptExecutionContext: (WKScriptContext *)context;
+#ifdef HAVE_WKCONTROLLER
+- (void)setController: (WKWebController *)controller;
+#else
+- (void)setLoadHandler: (WKLoadHandler *)fmanager;
+- (void)setFrameSetHandler: (WKFrameSetHandler *)fmanager;
+- (void)setScriptContextHandler: (WKScriptContextHandler *)context;
+#endif
 
 - executeScript: (NSString *)string;
 // Same as above expect uses the node as 'this' value
@@ -100,8 +118,15 @@
 
 
 // a.k.a shortcut icons, http://msdn.microsoft.com/workshop/Author/dhtml/howto/ShortcutIcon.asp.
-- (NSImage *)pageImage;
+// This may be removed to a category to prevent unnecessary linkage to the AppKit.  Note, however
+// that this means WebCore, specifically KWQ, also doesn't have dependencies on the AppKit.
+- (NSImage *)icon;
 
+// Is page secure, i.e. https, ftps
+// Should this perhap be on the URL?
+// This would the be implemented like this
+// return [[self url] isSecure];
+- (BOOL)isPageSecure;
 
 // ---------------------- Convience methods ----------------------
 - (NSString *)pageTitle;
@@ -135,56 +160,6 @@
 @end
 
 
-/*
-    Implementors of this protocol will received messages indicating
-    data streaming.  These methods will be called even if the data source
-    is initialized with something other than a URL.
-*/
- at protocol  WKWebDataSourceClient
-
-// A new chunk of data has been received.  This could be partial load
-// of a url.  It may be useful to do incremental layout, although
-// typically for non-base URLs this should be done after a URL (i.e. image)
-// has been completed downloaded.
-// ? Should we also provide data?  I think perhaps not, as all access to the
-// document should be via the DOM.
-- (void)receivedDataForURL: (NSURL *)url;
-
-// A URL has completed loading.  This could be used to perform layout.
-- (void)finishedReceivingDataForURL: (NSURL *)url;
-
-//  Called when all the resources associated with a document have been loaded.
-- documentReceived;
-
- at end
-
-
-/*
-    A class that implements WKScriptContext provides all the state information
-    that may be used by Javascript (AppleScript?).  This includes quirky methods nad
-    
-*/
- at protocol WKScriptContext
-
-- (void)setStatusText: (NSString *)text;
-- (NSString *)statusText;
-
-// Need API for things like window size and position, window ids,
-// screen goemetry.  Essentially all the 'view' items that are
-// accessible from Javascript.
-
- at end
-
-
-/*
-*/
- at protocol WKFrameSetManagement
-- (NSArray *)frameNames;
-- (id)findFrameNamed: (NSString *)name;
-- (BOOL)frameExists: (NSString *)name;
-- (BOOL)openURLInFrame: (id)aFrame url: (NSURL *)url;
- at end
-
 
 /*
     The class provide a cover for URL based preference items. 
@@ -216,19 +191,16 @@
 - (void)setAutoloadImages: (BOOL)flag;
 - (BOOL)autoloadImages;
 
-// Should only allow local references (i.e. help view?)
+/*
+    Specify whether only local references ( stylesheets, images, scripts, subdocuments )
+    should be loaded. ( default false - everything is loaded, if the more specific
+    options allow )
+    This is carried over from KDE.
+*/
 - (void)setOnlyLocalReferences: (BOOL)flag;
 - (BOOL)onlyLocalReferences;
 
 @end
 
-#else
- at interface NSWebPageDataSource : NSObject
-{
- at private
-    id _dataSourcePrivate;
-}
-
- at end
 #endif
 
diff --git a/WebKit/WebView.subproj/NSWebPageView.h b/WebKit/WebView.subproj/IFWebView.h
similarity index 57%
copy from WebKit/WebView.subproj/NSWebPageView.h
copy to WebKit/WebView.subproj/IFWebView.h
index 76f5f95..84abe65 100644
--- a/WebKit/WebView.subproj/NSWebPageView.h
+++ b/WebKit/WebView.subproj/IFWebView.h
@@ -1,42 +1,41 @@
-/*	NSWebPageView.h
+/*	
+        WKWebView.h
 	Copyright 2001, Apple, Inc. All rights reserved.
         
         Public header file.
 */
 #import <Cocoa/Cocoa.h>
 
-#import <WebKit/NSWebPageDataSource.h>
+#import <WebKit/WKWebDataSource.h>
+#import <WebKit/WKWebController.h>
 
 #ifdef READY_FOR_PRIMETIME
 /*
-    Typical usage of an WKWebPageView.
+    Typical usage of an WKWebView.
     
     NSURL *url = [NSURL URLWithString: @"http://www.apple.com"];
     ...
-    WKWebPageDataSource *dataSource = [[WKWebPageDataSource alloc] initWithURL: url];
-    WKWebPageView *view = [[WKWebPageView alloc] initWithFrame: myFrame];
-    [view setClient: (WKWebClient *)myClient];
+    WKWebDataSource *dataSource = [[WKWebDataSource alloc] initWithURL: url];
+    WKWebView *view = [[WKWebView alloc] initWithFrame: myFrame];
     [view setDataSource: dataSource];
     [[view dataSource] startLoading];
     ...
     or
     ...
-    WKWebPageDataSource *dataSource = [[WKWebPageDataSource alloc] initWithURL: url];
-    WKWebPageView *view = [[WKWebPageView alloc] initWithFrame: myFrame DataSource: url];
-    [view setClient: (WKWebClient *)myClient];
+    WKWebDataSource *dataSource = [[WKWebDataSource alloc] initWithURL: url];
+    WKWebView *view = [[WKWebView alloc] initWithFrame: myFrame DataSource: url];
     [[view dataSource] startLoading];
     ...
     or
     ...
-    WKWebPageView *view = [[WKWebPageView alloc] initWithFrame: myFrame url: url];
-    [view setClient: (WKWebClient *)myClient];
+    WKWebView *view = [[WKWebView alloc] initWithFrame: myFrame url: url];
     [[view dataSource] startLoading];
     
     What is the behaviour of the view after it has been initialized and -startLoading is called?
     
         1.  When the data source is set during (i.e. -setDataSource:) -locationWillChange will be sent
-            to the view's client.  It may veto by returning NO.  Note that if the convience initializers
-            are used no client will have been set, and thus no chance to veto will be provided.
+            to the view's controller.  It may veto by returning NO.  Note that if the convience initializers
+            are used no controller will have been set, and thus no chance to veto will be provided.
             
         2.  The view will do nothing until receipt of it's first -receivedDataForURL: message
             from it's data source.  Thus the view will not change it's content before users have
@@ -45,11 +44,10 @@
             During this time, if -stopLoading is called on the data source, loading will 
             abort.  If the loading is stopped the contents of the window will be unchanged.
             [This implies that the data source should revert to the previous data source.
-            Will that be problematic?.]  The client will receive a -loadingCancelled message
+            Will that be problematic?.]  The controller will receive a -loadingCancelled message
             if the load is aborted during this period.
             
-            Client should initiate progress indicators at this point (how?).
-            
+            Controllers should initiate progress indicators at this point (how?).
         
         3.  After receipt of it first -receivedDataForURL: it will clear it's contents
             and perform it's first layout.  At this point a loadingStarted message will
@@ -60,25 +58,28 @@
             on the interval the messages are received.  During this time the load may
             be stopped.  The layout may be incomplete if the load is stopped before all
             the referenced documents are loaded.  If the layout is stopped during this
-            period the client will received a -loadingStopped message.
+            period the controller will received a -loadingStopped message.
             
         5.  When -documentReceived is received the loading and initial layout is complete.
-            Clients should terminate progress indicators at this point.  At this point
-            clients will receive a -loadingFinished message.
+            Controllers should terminate progress indicators at this point.  At this point
+            controller will receive a -loadingFinished message.
 
     What is the behavior of the view when a link is clicked?
     
-        0.  See above.  The behavior is exactly as above.  
+        See above.  The behavior is exactly as above.  
         
         
    ***
   
-   The control behavior and view/model interdependencies of a WK is manifested by several 
-   protocols (so far: WKWebDataSourceClient, WKScriptContext, WKFrameSetManagement).  This 
-   behavior could be encapsulated in a WKController class, or it could be implemented by the 
-   WKWebView.
+   The control behavior and view/model interdependencies of WK are manifested by several 
+   protocols (so far: WKLoadHandler, WKScriptContextHandler, WKFrameSetHandler).  This 
+   behavior is encapsulated in a WKWebController class.  Behavior that may be extended/overriden 
+   is described with several protocols:  WKLocationChangeHandler and WKContextMenuHandler.
+   WKWebController also implements these protocols.
+   
+   ***   
 */
- at interface NSWebPageView : NSView <WKWebDataSourceClient, WKScriptContext, WKFrameSetManagement>
+ at interface WKWebView : NSView
 {
 @private
     id _viewPrivate;
@@ -117,51 +118,39 @@
 - (void)setDragToEnabled: (BOOL)flag;
 - (BOOL)dragToEnabled;
 
-- (void)setClient: (WKWebViewClient *)client;
+#ifdef HAVE_WKCONTROLLER
+- (void)setController: (WKWebController *)controller;
+#else
+- (void)setLocationChangeHandler: (WKLocationChangeHandler *)client;
+- (void)setContextMenuHandler: (WKContextMenuHandler *)handler;
+#endif
+
+- (void)setEnableContextMenus: (BOOL)flag;
+- (BOOL)contextMenusEnabled;
+- (void)setDefaultContextMenu: (NSMenu *)menu;
+- (NSMenu *)defaultContextMenu;
 
 // MCJ thinks we need high level find API.
 @end
 
 
- at protocol WKWebViewClient
-- (BOOL)locationWillChange;
-- (void)loadingCancelled;
-- (void)loadingStopped;
-- (void)loadingFinished;
-- (void)loadingStarted;
-
-// These reflect the WKWebDataSourceClient protocol
-- (void)receivedDataForURL: (NSURL *)url;
-- (void)finishedReceivingDataForURL: (NSURL *)url;
-- documentReceived;
-
- at end
 
 /*
     Other areas still to consider:
 
-		tool tips for ALT image text and link URLs
-		
-		node events
+        ALT image text and link URLs
+            Should this be built-in?  or able to be overriden?
+            
+        node events
 		
-		context menus
-
-		client access to form elements
-		   for auto-completion, passwords
-
-		authentication dialog
-
-		authentication/security state (is page secure)
+	client access to form elements for auto-completion, passwords
+        
+        selection
+            Selection on data source is reflected in view.
+            Does the view also need a cover selection API?
+            
+        subclassing of WKWebView
 */
 
-
-
-#else
- at interface NSWebPageView : NSView 
-{
- at private
-    id _viewPrivate;
-}
- at end
 #endif
 
diff --git a/WebKit/WebView.subproj/NSWebPageDataSource.h b/WebKit/WebView.subproj/NSWebPageDataSource.h
index e8ff602..3993e16 100644
--- a/WebKit/WebView.subproj/NSWebPageDataSource.h
+++ b/WebKit/WebView.subproj/NSWebPageDataSource.h
@@ -1,228 +1,11 @@
-/*	NSWebPageDataSource.h
+/*	
+        WKWebPageDataSource.h
 	Copyright 2001, Apple, Inc. All rights reserved.
 
         Public header file.
 */
 #import <Cocoa/Cocoa.h>
 
-/*
-    A NSWebPageDataSource represents all the state associated
-    with a web page.  It is typicallly instantiated withe a URL, but
-    may also be initialized with an NSString or NSData that hold
-    HTML content.
-    
-    Typical usage of a WKWebDataSource.
-    
-    WKWebPageDataSource *dataSource = [[WKWebPageDataSource alloc] initWithURL: url];
-    [dataSource setFrameSetManager: (WKFrameSetManagement *)myManager];
-    [dataSource setScriptExecutionContext: (WKScriptContext *)myContext];
-    
-    Although, usually a WKWebView is the owner and user of data source, and it
-    becomes the WKScriptContext and WKFrameSetManagement for a data source.
-*/
-
-#ifdef READY_FOR_PRIMETIME
-
- at interface NSWebPageDataSource : NSObject
-{
- at private
-    id _dataSourcePrivate;
-}
-
-
-// Can these init methods return nil? i.e. if URL is invalid, or should they
-// throw expections?
-- initWithURL: (NSURL *)url;
-- initWithData: (NSData *)data;
-- initWithString: (NSString *)string;
-
-// ?? How do you create subclasses of WKURILoader, how is this
-// expected to be used?
-- initWithLoader: (WKURILoader *)loader;
-
-// ?? We don't have a NS streams API!!
-- initWithStream: (NSStream *)stream
-
-// Start actually getting (if initialized with a URL) and parsing data.
-- (void)startLoading;
-
-// Cancel and pending loads.
-- (BOOL)stopLoading;
-
-// Get DOM access to the document.
-- (WKDOMDocument *)document;
-
-// Get the actual source of the docment.
-- (NSString *)documentText;
-
-// Get a 'pretty' version of the document, created by traversal of the DOM.
-- (NSString *)formattedDocumentText;
-
-// Get the currently focused node.  Is this appropriate for the model, or
-// should this be handled by the view?
-- (WKDOMNode *)activeNode;
-
-// URL reference point, these should problably not be public for 1.0.
-- setBase: (NSURL *)url;
-- (NSURL *)base;
-- setBaseTarget: (NSURL *)url;
-- (NSURL *)baseTarget;
-
-- (NSString *)encoding;
-
-// Style sheet
-- (void)setUserStyleSheet: (NSURL *)url;
-- (void)setUserStyleSheet: (NSString *)sheet;
-
-// Searching, to support find in clients.  regular expressions?
-- (WKSearchState *)findTextBegin;
-- (NSString *)findTextNext: (WKRegularExpression *)exp direction: (BOOL)forward state: (WKSearchState *)state;
-- (NSString *)findTextNext: (NSString *)string direction: (BOOL)forward caseSensitive: (BOOL)case state: (WKSearchState *)state;
-
-// Selection
-- (NSString *)selectedText;
-- (WKDOMRange *)selectedRange;
-- (void)setSelection: (WKDOMRange *range);
-- (BOOL)hasSelection;
-- (void)selectAll;
-
-- (void)setFrameSetManager: (WKFrameSetManagement *)fmanager;
-
-- (void)setScriptExecutionContext: (WKScriptContext *)context;
-
-- executeScript: (NSString *)string;
-// Same as above expect uses the node as 'this' value
-- executeScript: (NSString *)string withNode: (WKDOMNode *)node;
-
-// This API reflects the KDE API, but is it sufficient?
-- (BOOL)scheduleScript: (NSString *)string withNode: (WKDOMNode *)node 
-- executeScheduledScript;
-
-
-// a.k.a shortcut icons, http://msdn.microsoft.com/workshop/Author/dhtml/howto/ShortcutIcon.asp.
-- (NSImage *)pageImage;
-
-
-// ---------------------- Convience methods ----------------------
-- (NSString *)pageTitle;
-// ---------------------------------------------------------------
-
-
-/*
-    Notifications?
-        In general, how often should we notify?  We should use notifications
-        if we anticipate multiple clients, no return types, and generally
-        asynchronous or indirect behaviour.
-        
-        notifications:
-            WKSelectionChangedNotification
-            WKNodeActivatedNotification
-            WKDocumentChangedNotification
-    
-    Error handling:
-        exceptions?
-        nil returns?
-        errors by notification?
-        
-        error conditions:
-            timeout
-            unrecognized/handled mime-type
-            javascript errors
-            invalid url
-            parsing errors
-            
-*/
- at end
-
-
-/*
-    Implementors of this protocol will received messages indicating
-    data streaming.  These methods will be called even if the data source
-    is initialized with something other than a URL.
-*/
- at protocol  WKWebDataSourceClient
-
-// A new chunk of data has been received.  This could be partial load
-// of a url.  It may be useful to do incremental layout, although
-// typically for non-base URLs this should be done after a URL (i.e. image)
-// has been completed downloaded.
-// ? Should we also provide data?  I think perhaps not, as all access to the
-// document should be via the DOM.
-- (void)receivedDataForURL: (NSURL *)url;
-
-// A URL has completed loading.  This could be used to perform layout.
-- (void)finishedReceivingDataForURL: (NSURL *)url;
-
-//  Called when all the resources associated with a document have been loaded.
-- documentReceived;
-
- at end
-
-
-/*
-    A class that implements WKScriptContext provides all the state information
-    that may be used by Javascript (AppleScript?).  This includes quirky methods nad
-    
-*/
- at protocol WKScriptContext
-
-- (void)setStatusText: (NSString *)text;
-- (NSString *)statusText;
-
-// Need API for things like window size and position, window ids,
-// screen goemetry.  Essentially all the 'view' items that are
-// accessible from Javascript.
-
- at end
-
-
-/*
-*/
- at protocol WKFrameSetManagement
-- (NSArray *)frameNames;
-- (id)findFrameNamed: (NSString *)name;
-- (BOOL)frameExists: (NSString *)name;
-- (BOOL)openURLInFrame: (id)aFrame url: (NSURL *)url;
- at end
-
-
-/*
-    The class provide a cover for URL based preference items. 
-*/
- at interface WKPreferences
-+ getPreferencesForURL: (NSURL *)url;
-
-// Encoding that will be used in none specified on page? or in header?
-+ setEncoding: (NSString *)encoding;
-+ (NSString *)encoding;
-
-// Javascript preferences
-- (void)setJScriptEnabled: (BOOL)flag;
-- (BOOL)jScriptEnabled;
-
-// Java preferences
-- (void)setJavaEnabled: (BOOL)flag
-- (BOOL)javaEnabled;
-
-// Document refreshes allowed
-- setRefreshEnabled: (BOOL)flag;
-- (BOOL)refreshEnabled;
-
-// Plugins
-- (void)setPluginsEnabled: (BOOL)flag;
-- (BOOL)pluginEnabled;
-
-// Should images be loaded.
-- (void)setAutoloadImages: (BOOL)flag;
-- (BOOL)autoloadImages;
-
-// Should only allow local references (i.e. help view?)
-- (void)setOnlyLocalReferences: (BOOL)flag;
-- (BOOL)onlyLocalReferences;
-
- at end
-
-#else
 @interface NSWebPageDataSource : NSObject
 {
 @private
@@ -230,5 +13,4 @@
 }
 
 @end
-#endif
 
diff --git a/WebKit/WebView.subproj/NSWebPageView.h b/WebKit/WebView.subproj/NSWebPageView.h
index 76f5f95..3ab3360 100644
--- a/WebKit/WebView.subproj/NSWebPageView.h
+++ b/WebKit/WebView.subproj/NSWebPageView.h
@@ -1,4 +1,5 @@
-/*	NSWebPageView.h
+/*	
+        WKWebPageView.h
 	Copyright 2001, Apple, Inc. All rights reserved.
         
         Public header file.
@@ -7,161 +8,10 @@
 
 #import <WebKit/NSWebPageDataSource.h>
 
-#ifdef READY_FOR_PRIMETIME
-/*
-    Typical usage of an WKWebPageView.
-    
-    NSURL *url = [NSURL URLWithString: @"http://www.apple.com"];
-    ...
-    WKWebPageDataSource *dataSource = [[WKWebPageDataSource alloc] initWithURL: url];
-    WKWebPageView *view = [[WKWebPageView alloc] initWithFrame: myFrame];
-    [view setClient: (WKWebClient *)myClient];
-    [view setDataSource: dataSource];
-    [[view dataSource] startLoading];
-    ...
-    or
-    ...
-    WKWebPageDataSource *dataSource = [[WKWebPageDataSource alloc] initWithURL: url];
-    WKWebPageView *view = [[WKWebPageView alloc] initWithFrame: myFrame DataSource: url];
-    [view setClient: (WKWebClient *)myClient];
-    [[view dataSource] startLoading];
-    ...
-    or
-    ...
-    WKWebPageView *view = [[WKWebPageView alloc] initWithFrame: myFrame url: url];
-    [view setClient: (WKWebClient *)myClient];
-    [[view dataSource] startLoading];
-    
-    What is the behaviour of the view after it has been initialized and -startLoading is called?
-    
-        1.  When the data source is set during (i.e. -setDataSource:) -locationWillChange will be sent
-            to the view's client.  It may veto by returning NO.  Note that if the convience initializers
-            are used no client will have been set, and thus no chance to veto will be provided.
-            
-        2.  The view will do nothing until receipt of it's first -receivedDataForURL: message
-            from it's data source.  Thus the view will not change it's content before users have
-            a chance to cancel slow URLs.  
-                        
-            During this time, if -stopLoading is called on the data source, loading will 
-            abort.  If the loading is stopped the contents of the window will be unchanged.
-            [This implies that the data source should revert to the previous data source.
-            Will that be problematic?.]  The client will receive a -loadingCancelled message
-            if the load is aborted during this period.
-            
-            Client should initiate progress indicators at this point (how?).
-            
-        
-        3.  After receipt of it first -receivedDataForURL: it will clear it's contents
-            and perform it's first layout.  At this point a loadingStarted message will
-            be sent to the client.
-            
-        4.  Upon every subsequent receipts of -finishedReceivingDataForURL: messages it
-            will perform additional layouts.  Note that these may be coalesced, depending
-            on the interval the messages are received.  During this time the load may
-            be stopped.  The layout may be incomplete if the load is stopped before all
-            the referenced documents are loaded.  If the layout is stopped during this
-            period the client will received a -loadingStopped message.
-            
-        5.  When -documentReceived is received the loading and initial layout is complete.
-            Clients should terminate progress indicators at this point.  At this point
-            clients will receive a -loadingFinished message.
-
-    What is the behavior of the view when a link is clicked?
-    
-        0.  See above.  The behavior is exactly as above.  
-        
-        
-   ***
-  
-   The control behavior and view/model interdependencies of a WK is manifested by several 
-   protocols (so far: WKWebDataSourceClient, WKScriptContext, WKFrameSetManagement).  This 
-   behavior could be encapsulated in a WKController class, or it could be implemented by the 
-   WKWebView.
-*/
- at interface NSWebPageView : NSView <WKWebDataSourceClient, WKScriptContext, WKFrameSetManagement>
-{
- at private
-    id _viewPrivate;
-}
-
-- initWithFrame: (NSRect)frame;
-- initWithFrame: (NSRect)frame dataSource: (NSWebPageDataSource *)dataSource;
-- initWithFrame: (NSRect)frame url: (NSURL *)url;
-
-- (NSWebPageDataSource *)dataSource;
-- (void)setDataSource: (NSWebPageDataSource *)ds;
-
-// Either creates a new datasource or reuses the same datasource for
-// URLs that are qualified, i.e. URLs with an anchor target.
-- (BOOL)setURL: (NSURL *)url;
-
-// This method should not be public until we have a more completely
-// understood way to subclass WKWebView.
-- (void)layout;
-
-- (void)stopAnimations;
-
-// Font API
-- (void)setFontSizes: (NSArray *)sizes;
-- (NSArray *)fontSize;
-- (void)resetFontSizes;
-- (void)setStandardFont: (NSSFont *)font;
-- (NSFont *)standardFont;
-- (void)setFixedFont: (NSSFont *)font;
-- (NSFont *)fixedFont;
-
-// Drag and drop links and images.  Others?
-- (void)setDragFromEnabled: (BOOL)flag;
-- (BOOL)dragFromEnabled;
-
-- (void)setDragToEnabled: (BOOL)flag;
-- (BOOL)dragToEnabled;
-
-- (void)setClient: (WKWebViewClient *)client;
-
-// MCJ thinks we need high level find API.
- at end
-
-
- at protocol WKWebViewClient
-- (BOOL)locationWillChange;
-- (void)loadingCancelled;
-- (void)loadingStopped;
-- (void)loadingFinished;
-- (void)loadingStarted;
-
-// These reflect the WKWebDataSourceClient protocol
-- (void)receivedDataForURL: (NSURL *)url;
-- (void)finishedReceivingDataForURL: (NSURL *)url;
-- documentReceived;
-
- at end
-
-/*
-    Other areas still to consider:
-
-		tool tips for ALT image text and link URLs
-		
-		node events
-		
-		context menus
-
-		client access to form elements
-		   for auto-completion, passwords
-
-		authentication dialog
-
-		authentication/security state (is page secure)
-*/
-
-
-
-#else
 @interface NSWebPageView : NSView 
 {
 @private
     id _viewPrivate;
 }
 @end
-#endif
 
diff --git a/WebKit/WebView.subproj/WKWebController.h b/WebKit/WebView.subproj/WKWebController.h
new file mode 100644
index 0000000..d57639d
--- /dev/null
+++ b/WebKit/WebView.subproj/WKWebController.h
@@ -0,0 +1,109 @@
+/*	
+        WKWebController.h
+	Copyright 2001, Apple, Inc. All rights reserved.
+
+        Public header file.
+*/
+#import <Cocoa/Cocoa.h>
+
+ at interface WKWebController : NSObject <WKLoadHandler, WKScriptContextHandler, WKFrameSetHandler, WKCredentialsHandler, WKLocationChangeHandler, WKContextMenuHandler>
+ at end
+
+// See the comments in WKWebPageView above for more description about this protocol.
+ at protocol WKLocationChangeHandler
+- (BOOL)locationWillChange;
+- (void)loadingCancelled;
+- (void)loadingStopped;
+- (void)loadingFinished;
+- (void)loadingStarted;
+ at end
+
+
+
+ at protocol WKContextMenuHandler
+/*
+    We decided to implement this in terms of a fixed set of types rather
+    than per node.
+    
+    What items should be supported in the default context menus?
+*/
+ at end
+
+/*
+*/
+ at protocol WKCredentialsHandler
+// Ken will come up with a proposal for this.  We decided not have a generic API,
+// rather we'll have an API that explicitly knows about the authentication
+// attributes needed.
+// Client should use this API to collect information necessary to authenticate,
+// usually by putting up a dialog.
+// Do we provide a default dialog.
+ at end
+
+
+/*
+    Implementors of this protocol will receive messages indicating
+    data as it arrive.
+    
+    This method will be called even if the data source
+    is initialized with something other than a URL.
+*/
+ at protocol  WKLoadHandler
+
+/*
+    A new chunk of data has been received.  This could be partial load
+    of a url.  It may be useful to do incremental layout, although
+    typically for non-base URLs this should be done after a URL (i.e. image)
+    has been completed downloaded.
+*/
+- (void)receivedDataForLocation: (WKLoadProgress *)progress;
+
+ at end
+
+
+
+/*
+    A WKLoadProgress capture the state associated with a load progress
+    indication.  Should we use a struct?
+*/
+ at interface WKLoadProgress 
+{
+    int bytesSoFar;	// 0 if this is the start of load
+    int totalLoaded;	// -1 if this is not known.
+                        // bytesSoFar == totalLoaded when complete
+    NSString *location; // Needs to be a string, not URL.
+    LOAD_TYPES type;	// load types, either image, css, jscript, or html
+}
+ at end
+
+
+
+/*
+    A class that implements WKScriptContextHandler provides all the state information
+    that may be used by Javascript (AppleScript?).
+    
+*/
+ at protocol WKScriptContextHandler
+
+- (void)setStatusText: (NSString *)text;
+- (NSString *)statusText;
+
+// Need API for things like window size and position, window ids,
+// screen goemetry.  Essentially all the 'view' items that are
+// accessible from Javascript.
+
+ at end
+
+
+/*
+*/
+ at protocol WKFrameSetHandler
+- (NSArray *)frameNames;
+- (WKFrame *)findFrameNamed: (NSString *)name;
+- (BOOL)frameExists: (NSString *)name;
+- (BOOL)openURLInFrame: (WKFrame *)aFrame url: (NSURL *)url;
+ at end
+
+ at protocol WKFrame
+//
+ at end
diff --git a/WebKit/WebView.subproj/NSWebPageDataSource.h b/WebKit/WebView.subproj/WKWebDataSource.h
similarity index 63%
copy from WebKit/WebView.subproj/NSWebPageDataSource.h
copy to WebKit/WebView.subproj/WKWebDataSource.h
index e8ff602..190fab9 100644
--- a/WebKit/WebView.subproj/NSWebPageDataSource.h
+++ b/WebKit/WebView.subproj/WKWebDataSource.h
@@ -1,29 +1,40 @@
-/*	NSWebPageDataSource.h
+/*	
+        WKWebDataSource.h
 	Copyright 2001, Apple, Inc. All rights reserved.
 
         Public header file.
 */
 #import <Cocoa/Cocoa.h>
 
+#import <WebKit/WKWebController.h>
+
 /*
-    A NSWebPageDataSource represents all the state associated
-    with a web page.  It is typicallly instantiated withe a URL, but
+    A WKWebDataSource represents all the state associated
+    with a web page.  It is typicallly initialized with a URL, but
     may also be initialized with an NSString or NSData that hold
-    HTML content.
+    HTML (?also other, i.e. image data?) content.
     
     Typical usage of a WKWebDataSource.
     
-    WKWebPageDataSource *dataSource = [[WKWebPageDataSource alloc] initWithURL: url];
-    [dataSource setFrameSetManager: (WKFrameSetManagement *)myManager];
-    [dataSource setScriptExecutionContext: (WKScriptContext *)myContext];
+    WKWebDataSource *dataSource = [[WKWebDataSource alloc] initWithURL: url];
     
-    Although, usually a WKWebView is the owner and user of data source, and it
-    becomes the WKScriptContext and WKFrameSetManagement for a data source.
+    [dataSource setFrameSetHandler: (WKFrameSetHandler *)myManager];
+    [dataSource setScriptContextHandler: (WKScriptContextHandler *)myContext];
+    [dataSource setLoadHandler: (WKLoadHandler *)loadHandler];
+    [dataSource setCredentialsHandler: (WKCredentialsHandler *)credentialsHandler];
+    ...
+    or
+    ...
+    [dataSource setController: (WKWebController *)myController];
+        
+    Questions:  
+        Multiple protocols or controller?
+        Should we use CF XML data types, or our own?
 */
 
 #ifdef READY_FOR_PRIMETIME
 
- at interface NSWebPageDataSource : NSObject
+ at interface WKWebDataSource : NSObject
 {
 @private
     id _dataSourcePrivate;
@@ -43,6 +54,9 @@
 // ?? We don't have a NS streams API!!
 - initWithStream: (NSStream *)stream
 
+// May return nil if not initialized with a URL.
+- (NSURL *)url;
+
 // Start actually getting (if initialized with a URL) and parsing data.
 - (void)startLoading;
 
@@ -86,9 +100,13 @@
 - (BOOL)hasSelection;
 - (void)selectAll;
 
-- (void)setFrameSetManager: (WKFrameSetManagement *)fmanager;
-
-- (void)setScriptExecutionContext: (WKScriptContext *)context;
+#ifdef HAVE_WKCONTROLLER
+- (void)setController: (WKWebController *)controller;
+#else
+- (void)setLoadHandler: (WKLoadHandler *)fmanager;
+- (void)setFrameSetHandler: (WKFrameSetHandler *)fmanager;
+- (void)setScriptContextHandler: (WKScriptContextHandler *)context;
+#endif
 
 - executeScript: (NSString *)string;
 // Same as above expect uses the node as 'this' value
@@ -100,8 +118,15 @@
 
 
 // a.k.a shortcut icons, http://msdn.microsoft.com/workshop/Author/dhtml/howto/ShortcutIcon.asp.
-- (NSImage *)pageImage;
+// This may be removed to a category to prevent unnecessary linkage to the AppKit.  Note, however
+// that this means WebCore, specifically KWQ, also doesn't have dependencies on the AppKit.
+- (NSImage *)icon;
 
+// Is page secure, i.e. https, ftps
+// Should this perhap be on the URL?
+// This would the be implemented like this
+// return [[self url] isSecure];
+- (BOOL)isPageSecure;
 
 // ---------------------- Convience methods ----------------------
 - (NSString *)pageTitle;
@@ -135,56 +160,6 @@
 @end
 
 
-/*
-    Implementors of this protocol will received messages indicating
-    data streaming.  These methods will be called even if the data source
-    is initialized with something other than a URL.
-*/
- at protocol  WKWebDataSourceClient
-
-// A new chunk of data has been received.  This could be partial load
-// of a url.  It may be useful to do incremental layout, although
-// typically for non-base URLs this should be done after a URL (i.e. image)
-// has been completed downloaded.
-// ? Should we also provide data?  I think perhaps not, as all access to the
-// document should be via the DOM.
-- (void)receivedDataForURL: (NSURL *)url;
-
-// A URL has completed loading.  This could be used to perform layout.
-- (void)finishedReceivingDataForURL: (NSURL *)url;
-
-//  Called when all the resources associated with a document have been loaded.
-- documentReceived;
-
- at end
-
-
-/*
-    A class that implements WKScriptContext provides all the state information
-    that may be used by Javascript (AppleScript?).  This includes quirky methods nad
-    
-*/
- at protocol WKScriptContext
-
-- (void)setStatusText: (NSString *)text;
-- (NSString *)statusText;
-
-// Need API for things like window size and position, window ids,
-// screen goemetry.  Essentially all the 'view' items that are
-// accessible from Javascript.
-
- at end
-
-
-/*
-*/
- at protocol WKFrameSetManagement
-- (NSArray *)frameNames;
-- (id)findFrameNamed: (NSString *)name;
-- (BOOL)frameExists: (NSString *)name;
-- (BOOL)openURLInFrame: (id)aFrame url: (NSURL *)url;
- at end
-
 
 /*
     The class provide a cover for URL based preference items. 
@@ -216,19 +191,16 @@
 - (void)setAutoloadImages: (BOOL)flag;
 - (BOOL)autoloadImages;
 
-// Should only allow local references (i.e. help view?)
+/*
+    Specify whether only local references ( stylesheets, images, scripts, subdocuments )
+    should be loaded. ( default false - everything is loaded, if the more specific
+    options allow )
+    This is carried over from KDE.
+*/
 - (void)setOnlyLocalReferences: (BOOL)flag;
 - (BOOL)onlyLocalReferences;
 
 @end
 
-#else
- at interface NSWebPageDataSource : NSObject
-{
- at private
-    id _dataSourcePrivate;
-}
-
- at end
 #endif
 
diff --git a/WebKit/WebView.subproj/NSWebPageView.h b/WebKit/WebView.subproj/WKWebView.h
similarity index 57%
copy from WebKit/WebView.subproj/NSWebPageView.h
copy to WebKit/WebView.subproj/WKWebView.h
index 76f5f95..84abe65 100644
--- a/WebKit/WebView.subproj/NSWebPageView.h
+++ b/WebKit/WebView.subproj/WKWebView.h
@@ -1,42 +1,41 @@
-/*	NSWebPageView.h
+/*	
+        WKWebView.h
 	Copyright 2001, Apple, Inc. All rights reserved.
         
         Public header file.
 */
 #import <Cocoa/Cocoa.h>
 
-#import <WebKit/NSWebPageDataSource.h>
+#import <WebKit/WKWebDataSource.h>
+#import <WebKit/WKWebController.h>
 
 #ifdef READY_FOR_PRIMETIME
 /*
-    Typical usage of an WKWebPageView.
+    Typical usage of an WKWebView.
     
     NSURL *url = [NSURL URLWithString: @"http://www.apple.com"];
     ...
-    WKWebPageDataSource *dataSource = [[WKWebPageDataSource alloc] initWithURL: url];
-    WKWebPageView *view = [[WKWebPageView alloc] initWithFrame: myFrame];
-    [view setClient: (WKWebClient *)myClient];
+    WKWebDataSource *dataSource = [[WKWebDataSource alloc] initWithURL: url];
+    WKWebView *view = [[WKWebView alloc] initWithFrame: myFrame];
     [view setDataSource: dataSource];
     [[view dataSource] startLoading];
     ...
     or
     ...
-    WKWebPageDataSource *dataSource = [[WKWebPageDataSource alloc] initWithURL: url];
-    WKWebPageView *view = [[WKWebPageView alloc] initWithFrame: myFrame DataSource: url];
-    [view setClient: (WKWebClient *)myClient];
+    WKWebDataSource *dataSource = [[WKWebDataSource alloc] initWithURL: url];
+    WKWebView *view = [[WKWebView alloc] initWithFrame: myFrame DataSource: url];
     [[view dataSource] startLoading];
     ...
     or
     ...
-    WKWebPageView *view = [[WKWebPageView alloc] initWithFrame: myFrame url: url];
-    [view setClient: (WKWebClient *)myClient];
+    WKWebView *view = [[WKWebView alloc] initWithFrame: myFrame url: url];
     [[view dataSource] startLoading];
     
     What is the behaviour of the view after it has been initialized and -startLoading is called?
     
         1.  When the data source is set during (i.e. -setDataSource:) -locationWillChange will be sent
-            to the view's client.  It may veto by returning NO.  Note that if the convience initializers
-            are used no client will have been set, and thus no chance to veto will be provided.
+            to the view's controller.  It may veto by returning NO.  Note that if the convience initializers
+            are used no controller will have been set, and thus no chance to veto will be provided.
             
         2.  The view will do nothing until receipt of it's first -receivedDataForURL: message
             from it's data source.  Thus the view will not change it's content before users have
@@ -45,11 +44,10 @@
             During this time, if -stopLoading is called on the data source, loading will 
             abort.  If the loading is stopped the contents of the window will be unchanged.
             [This implies that the data source should revert to the previous data source.
-            Will that be problematic?.]  The client will receive a -loadingCancelled message
+            Will that be problematic?.]  The controller will receive a -loadingCancelled message
             if the load is aborted during this period.
             
-            Client should initiate progress indicators at this point (how?).
-            
+            Controllers should initiate progress indicators at this point (how?).
         
         3.  After receipt of it first -receivedDataForURL: it will clear it's contents
             and perform it's first layout.  At this point a loadingStarted message will
@@ -60,25 +58,28 @@
             on the interval the messages are received.  During this time the load may
             be stopped.  The layout may be incomplete if the load is stopped before all
             the referenced documents are loaded.  If the layout is stopped during this
-            period the client will received a -loadingStopped message.
+            period the controller will received a -loadingStopped message.
             
         5.  When -documentReceived is received the loading and initial layout is complete.
-            Clients should terminate progress indicators at this point.  At this point
-            clients will receive a -loadingFinished message.
+            Controllers should terminate progress indicators at this point.  At this point
+            controller will receive a -loadingFinished message.
 
     What is the behavior of the view when a link is clicked?
     
-        0.  See above.  The behavior is exactly as above.  
+        See above.  The behavior is exactly as above.  
         
         
    ***
   
-   The control behavior and view/model interdependencies of a WK is manifested by several 
-   protocols (so far: WKWebDataSourceClient, WKScriptContext, WKFrameSetManagement).  This 
-   behavior could be encapsulated in a WKController class, or it could be implemented by the 
-   WKWebView.
+   The control behavior and view/model interdependencies of WK are manifested by several 
+   protocols (so far: WKLoadHandler, WKScriptContextHandler, WKFrameSetHandler).  This 
+   behavior is encapsulated in a WKWebController class.  Behavior that may be extended/overriden 
+   is described with several protocols:  WKLocationChangeHandler and WKContextMenuHandler.
+   WKWebController also implements these protocols.
+   
+   ***   
 */
- at interface NSWebPageView : NSView <WKWebDataSourceClient, WKScriptContext, WKFrameSetManagement>
+ at interface WKWebView : NSView
 {
 @private
     id _viewPrivate;
@@ -117,51 +118,39 @@
 - (void)setDragToEnabled: (BOOL)flag;
 - (BOOL)dragToEnabled;
 
-- (void)setClient: (WKWebViewClient *)client;
+#ifdef HAVE_WKCONTROLLER
+- (void)setController: (WKWebController *)controller;
+#else
+- (void)setLocationChangeHandler: (WKLocationChangeHandler *)client;
+- (void)setContextMenuHandler: (WKContextMenuHandler *)handler;
+#endif
+
+- (void)setEnableContextMenus: (BOOL)flag;
+- (BOOL)contextMenusEnabled;
+- (void)setDefaultContextMenu: (NSMenu *)menu;
+- (NSMenu *)defaultContextMenu;
 
 // MCJ thinks we need high level find API.
 @end
 
 
- at protocol WKWebViewClient
-- (BOOL)locationWillChange;
-- (void)loadingCancelled;
-- (void)loadingStopped;
-- (void)loadingFinished;
-- (void)loadingStarted;
-
-// These reflect the WKWebDataSourceClient protocol
-- (void)receivedDataForURL: (NSURL *)url;
-- (void)finishedReceivingDataForURL: (NSURL *)url;
-- documentReceived;
-
- at end
 
 /*
     Other areas still to consider:
 
-		tool tips for ALT image text and link URLs
-		
-		node events
+        ALT image text and link URLs
+            Should this be built-in?  or able to be overriden?
+            
+        node events
 		
-		context menus
-
-		client access to form elements
-		   for auto-completion, passwords
-
-		authentication dialog
-
-		authentication/security state (is page secure)
+	client access to form elements for auto-completion, passwords
+        
+        selection
+            Selection on data source is reflected in view.
+            Does the view also need a cover selection API?
+            
+        subclassing of WKWebView
 */
 
-
-
-#else
- at interface NSWebPageView : NSView 
-{
- at private
-    id _viewPrivate;
-}
- at end
 #endif
 
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
new file mode 100644
index 0000000..d57639d
--- /dev/null
+++ b/WebKit/WebView.subproj/WebController.h
@@ -0,0 +1,109 @@
+/*	
+        WKWebController.h
+	Copyright 2001, Apple, Inc. All rights reserved.
+
+        Public header file.
+*/
+#import <Cocoa/Cocoa.h>
+
+ at interface WKWebController : NSObject <WKLoadHandler, WKScriptContextHandler, WKFrameSetHandler, WKCredentialsHandler, WKLocationChangeHandler, WKContextMenuHandler>
+ at end
+
+// See the comments in WKWebPageView above for more description about this protocol.
+ at protocol WKLocationChangeHandler
+- (BOOL)locationWillChange;
+- (void)loadingCancelled;
+- (void)loadingStopped;
+- (void)loadingFinished;
+- (void)loadingStarted;
+ at end
+
+
+
+ at protocol WKContextMenuHandler
+/*
+    We decided to implement this in terms of a fixed set of types rather
+    than per node.
+    
+    What items should be supported in the default context menus?
+*/
+ at end
+
+/*
+*/
+ at protocol WKCredentialsHandler
+// Ken will come up with a proposal for this.  We decided not have a generic API,
+// rather we'll have an API that explicitly knows about the authentication
+// attributes needed.
+// Client should use this API to collect information necessary to authenticate,
+// usually by putting up a dialog.
+// Do we provide a default dialog.
+ at end
+
+
+/*
+    Implementors of this protocol will receive messages indicating
+    data as it arrive.
+    
+    This method will be called even if the data source
+    is initialized with something other than a URL.
+*/
+ at protocol  WKLoadHandler
+
+/*
+    A new chunk of data has been received.  This could be partial load
+    of a url.  It may be useful to do incremental layout, although
+    typically for non-base URLs this should be done after a URL (i.e. image)
+    has been completed downloaded.
+*/
+- (void)receivedDataForLocation: (WKLoadProgress *)progress;
+
+ at end
+
+
+
+/*
+    A WKLoadProgress capture the state associated with a load progress
+    indication.  Should we use a struct?
+*/
+ at interface WKLoadProgress 
+{
+    int bytesSoFar;	// 0 if this is the start of load
+    int totalLoaded;	// -1 if this is not known.
+                        // bytesSoFar == totalLoaded when complete
+    NSString *location; // Needs to be a string, not URL.
+    LOAD_TYPES type;	// load types, either image, css, jscript, or html
+}
+ at end
+
+
+
+/*
+    A class that implements WKScriptContextHandler provides all the state information
+    that may be used by Javascript (AppleScript?).
+    
+*/
+ at protocol WKScriptContextHandler
+
+- (void)setStatusText: (NSString *)text;
+- (NSString *)statusText;
+
+// Need API for things like window size and position, window ids,
+// screen goemetry.  Essentially all the 'view' items that are
+// accessible from Javascript.
+
+ at end
+
+
+/*
+*/
+ at protocol WKFrameSetHandler
+- (NSArray *)frameNames;
+- (WKFrame *)findFrameNamed: (NSString *)name;
+- (BOOL)frameExists: (NSString *)name;
+- (BOOL)openURLInFrame: (WKFrame *)aFrame url: (NSURL *)url;
+ at end
+
+ at protocol WKFrame
+//
+ at end
diff --git a/WebKit/WebView.subproj/NSWebPageDataSource.h b/WebKit/WebView.subproj/WebDataSource.h
similarity index 63%
copy from WebKit/WebView.subproj/NSWebPageDataSource.h
copy to WebKit/WebView.subproj/WebDataSource.h
index e8ff602..190fab9 100644
--- a/WebKit/WebView.subproj/NSWebPageDataSource.h
+++ b/WebKit/WebView.subproj/WebDataSource.h
@@ -1,29 +1,40 @@
-/*	NSWebPageDataSource.h
+/*	
+        WKWebDataSource.h
 	Copyright 2001, Apple, Inc. All rights reserved.
 
         Public header file.
 */
 #import <Cocoa/Cocoa.h>
 
+#import <WebKit/WKWebController.h>
+
 /*
-    A NSWebPageDataSource represents all the state associated
-    with a web page.  It is typicallly instantiated withe a URL, but
+    A WKWebDataSource represents all the state associated
+    with a web page.  It is typicallly initialized with a URL, but
     may also be initialized with an NSString or NSData that hold
-    HTML content.
+    HTML (?also other, i.e. image data?) content.
     
     Typical usage of a WKWebDataSource.
     
-    WKWebPageDataSource *dataSource = [[WKWebPageDataSource alloc] initWithURL: url];
-    [dataSource setFrameSetManager: (WKFrameSetManagement *)myManager];
-    [dataSource setScriptExecutionContext: (WKScriptContext *)myContext];
+    WKWebDataSource *dataSource = [[WKWebDataSource alloc] initWithURL: url];
     
-    Although, usually a WKWebView is the owner and user of data source, and it
-    becomes the WKScriptContext and WKFrameSetManagement for a data source.
+    [dataSource setFrameSetHandler: (WKFrameSetHandler *)myManager];
+    [dataSource setScriptContextHandler: (WKScriptContextHandler *)myContext];
+    [dataSource setLoadHandler: (WKLoadHandler *)loadHandler];
+    [dataSource setCredentialsHandler: (WKCredentialsHandler *)credentialsHandler];
+    ...
+    or
+    ...
+    [dataSource setController: (WKWebController *)myController];
+        
+    Questions:  
+        Multiple protocols or controller?
+        Should we use CF XML data types, or our own?
 */
 
 #ifdef READY_FOR_PRIMETIME
 
- at interface NSWebPageDataSource : NSObject
+ at interface WKWebDataSource : NSObject
 {
 @private
     id _dataSourcePrivate;
@@ -43,6 +54,9 @@
 // ?? We don't have a NS streams API!!
 - initWithStream: (NSStream *)stream
 
+// May return nil if not initialized with a URL.
+- (NSURL *)url;
+
 // Start actually getting (if initialized with a URL) and parsing data.
 - (void)startLoading;
 
@@ -86,9 +100,13 @@
 - (BOOL)hasSelection;
 - (void)selectAll;
 
-- (void)setFrameSetManager: (WKFrameSetManagement *)fmanager;
-
-- (void)setScriptExecutionContext: (WKScriptContext *)context;
+#ifdef HAVE_WKCONTROLLER
+- (void)setController: (WKWebController *)controller;
+#else
+- (void)setLoadHandler: (WKLoadHandler *)fmanager;
+- (void)setFrameSetHandler: (WKFrameSetHandler *)fmanager;
+- (void)setScriptContextHandler: (WKScriptContextHandler *)context;
+#endif
 
 - executeScript: (NSString *)string;
 // Same as above expect uses the node as 'this' value
@@ -100,8 +118,15 @@
 
 
 // a.k.a shortcut icons, http://msdn.microsoft.com/workshop/Author/dhtml/howto/ShortcutIcon.asp.
-- (NSImage *)pageImage;
+// This may be removed to a category to prevent unnecessary linkage to the AppKit.  Note, however
+// that this means WebCore, specifically KWQ, also doesn't have dependencies on the AppKit.
+- (NSImage *)icon;
 
+// Is page secure, i.e. https, ftps
+// Should this perhap be on the URL?
+// This would the be implemented like this
+// return [[self url] isSecure];
+- (BOOL)isPageSecure;
 
 // ---------------------- Convience methods ----------------------
 - (NSString *)pageTitle;
@@ -135,56 +160,6 @@
 @end
 
 
-/*
-    Implementors of this protocol will received messages indicating
-    data streaming.  These methods will be called even if the data source
-    is initialized with something other than a URL.
-*/
- at protocol  WKWebDataSourceClient
-
-// A new chunk of data has been received.  This could be partial load
-// of a url.  It may be useful to do incremental layout, although
-// typically for non-base URLs this should be done after a URL (i.e. image)
-// has been completed downloaded.
-// ? Should we also provide data?  I think perhaps not, as all access to the
-// document should be via the DOM.
-- (void)receivedDataForURL: (NSURL *)url;
-
-// A URL has completed loading.  This could be used to perform layout.
-- (void)finishedReceivingDataForURL: (NSURL *)url;
-
-//  Called when all the resources associated with a document have been loaded.
-- documentReceived;
-
- at end
-
-
-/*
-    A class that implements WKScriptContext provides all the state information
-    that may be used by Javascript (AppleScript?).  This includes quirky methods nad
-    
-*/
- at protocol WKScriptContext
-
-- (void)setStatusText: (NSString *)text;
-- (NSString *)statusText;
-
-// Need API for things like window size and position, window ids,
-// screen goemetry.  Essentially all the 'view' items that are
-// accessible from Javascript.
-
- at end
-
-
-/*
-*/
- at protocol WKFrameSetManagement
-- (NSArray *)frameNames;
-- (id)findFrameNamed: (NSString *)name;
-- (BOOL)frameExists: (NSString *)name;
-- (BOOL)openURLInFrame: (id)aFrame url: (NSURL *)url;
- at end
-
 
 /*
     The class provide a cover for URL based preference items. 
@@ -216,19 +191,16 @@
 - (void)setAutoloadImages: (BOOL)flag;
 - (BOOL)autoloadImages;
 
-// Should only allow local references (i.e. help view?)
+/*
+    Specify whether only local references ( stylesheets, images, scripts, subdocuments )
+    should be loaded. ( default false - everything is loaded, if the more specific
+    options allow )
+    This is carried over from KDE.
+*/
 - (void)setOnlyLocalReferences: (BOOL)flag;
 - (BOOL)onlyLocalReferences;
 
 @end
 
-#else
- at interface NSWebPageDataSource : NSObject
-{
- at private
-    id _dataSourcePrivate;
-}
-
- at end
 #endif
 
diff --git a/WebKit/WebView.subproj/NSWebPageView.h b/WebKit/WebView.subproj/WebFrameView.h
similarity index 57%
copy from WebKit/WebView.subproj/NSWebPageView.h
copy to WebKit/WebView.subproj/WebFrameView.h
index 76f5f95..84abe65 100644
--- a/WebKit/WebView.subproj/NSWebPageView.h
+++ b/WebKit/WebView.subproj/WebFrameView.h
@@ -1,42 +1,41 @@
-/*	NSWebPageView.h
+/*	
+        WKWebView.h
 	Copyright 2001, Apple, Inc. All rights reserved.
         
         Public header file.
 */
 #import <Cocoa/Cocoa.h>
 
-#import <WebKit/NSWebPageDataSource.h>
+#import <WebKit/WKWebDataSource.h>
+#import <WebKit/WKWebController.h>
 
 #ifdef READY_FOR_PRIMETIME
 /*
-    Typical usage of an WKWebPageView.
+    Typical usage of an WKWebView.
     
     NSURL *url = [NSURL URLWithString: @"http://www.apple.com"];
     ...
-    WKWebPageDataSource *dataSource = [[WKWebPageDataSource alloc] initWithURL: url];
-    WKWebPageView *view = [[WKWebPageView alloc] initWithFrame: myFrame];
-    [view setClient: (WKWebClient *)myClient];
+    WKWebDataSource *dataSource = [[WKWebDataSource alloc] initWithURL: url];
+    WKWebView *view = [[WKWebView alloc] initWithFrame: myFrame];
     [view setDataSource: dataSource];
     [[view dataSource] startLoading];
     ...
     or
     ...
-    WKWebPageDataSource *dataSource = [[WKWebPageDataSource alloc] initWithURL: url];
-    WKWebPageView *view = [[WKWebPageView alloc] initWithFrame: myFrame DataSource: url];
-    [view setClient: (WKWebClient *)myClient];
+    WKWebDataSource *dataSource = [[WKWebDataSource alloc] initWithURL: url];
+    WKWebView *view = [[WKWebView alloc] initWithFrame: myFrame DataSource: url];
     [[view dataSource] startLoading];
     ...
     or
     ...
-    WKWebPageView *view = [[WKWebPageView alloc] initWithFrame: myFrame url: url];
-    [view setClient: (WKWebClient *)myClient];
+    WKWebView *view = [[WKWebView alloc] initWithFrame: myFrame url: url];
     [[view dataSource] startLoading];
     
     What is the behaviour of the view after it has been initialized and -startLoading is called?
     
         1.  When the data source is set during (i.e. -setDataSource:) -locationWillChange will be sent
-            to the view's client.  It may veto by returning NO.  Note that if the convience initializers
-            are used no client will have been set, and thus no chance to veto will be provided.
+            to the view's controller.  It may veto by returning NO.  Note that if the convience initializers
+            are used no controller will have been set, and thus no chance to veto will be provided.
             
         2.  The view will do nothing until receipt of it's first -receivedDataForURL: message
             from it's data source.  Thus the view will not change it's content before users have
@@ -45,11 +44,10 @@
             During this time, if -stopLoading is called on the data source, loading will 
             abort.  If the loading is stopped the contents of the window will be unchanged.
             [This implies that the data source should revert to the previous data source.
-            Will that be problematic?.]  The client will receive a -loadingCancelled message
+            Will that be problematic?.]  The controller will receive a -loadingCancelled message
             if the load is aborted during this period.
             
-            Client should initiate progress indicators at this point (how?).
-            
+            Controllers should initiate progress indicators at this point (how?).
         
         3.  After receipt of it first -receivedDataForURL: it will clear it's contents
             and perform it's first layout.  At this point a loadingStarted message will
@@ -60,25 +58,28 @@
             on the interval the messages are received.  During this time the load may
             be stopped.  The layout may be incomplete if the load is stopped before all
             the referenced documents are loaded.  If the layout is stopped during this
-            period the client will received a -loadingStopped message.
+            period the controller will received a -loadingStopped message.
             
         5.  When -documentReceived is received the loading and initial layout is complete.
-            Clients should terminate progress indicators at this point.  At this point
-            clients will receive a -loadingFinished message.
+            Controllers should terminate progress indicators at this point.  At this point
+            controller will receive a -loadingFinished message.
 
     What is the behavior of the view when a link is clicked?
     
-        0.  See above.  The behavior is exactly as above.  
+        See above.  The behavior is exactly as above.  
         
         
    ***
   
-   The control behavior and view/model interdependencies of a WK is manifested by several 
-   protocols (so far: WKWebDataSourceClient, WKScriptContext, WKFrameSetManagement).  This 
-   behavior could be encapsulated in a WKController class, or it could be implemented by the 
-   WKWebView.
+   The control behavior and view/model interdependencies of WK are manifested by several 
+   protocols (so far: WKLoadHandler, WKScriptContextHandler, WKFrameSetHandler).  This 
+   behavior is encapsulated in a WKWebController class.  Behavior that may be extended/overriden 
+   is described with several protocols:  WKLocationChangeHandler and WKContextMenuHandler.
+   WKWebController also implements these protocols.
+   
+   ***   
 */
- at interface NSWebPageView : NSView <WKWebDataSourceClient, WKScriptContext, WKFrameSetManagement>
+ at interface WKWebView : NSView
 {
 @private
     id _viewPrivate;
@@ -117,51 +118,39 @@
 - (void)setDragToEnabled: (BOOL)flag;
 - (BOOL)dragToEnabled;
 
-- (void)setClient: (WKWebViewClient *)client;
+#ifdef HAVE_WKCONTROLLER
+- (void)setController: (WKWebController *)controller;
+#else
+- (void)setLocationChangeHandler: (WKLocationChangeHandler *)client;
+- (void)setContextMenuHandler: (WKContextMenuHandler *)handler;
+#endif
+
+- (void)setEnableContextMenus: (BOOL)flag;
+- (BOOL)contextMenusEnabled;
+- (void)setDefaultContextMenu: (NSMenu *)menu;
+- (NSMenu *)defaultContextMenu;
 
 // MCJ thinks we need high level find API.
 @end
 
 
- at protocol WKWebViewClient
-- (BOOL)locationWillChange;
-- (void)loadingCancelled;
-- (void)loadingStopped;
-- (void)loadingFinished;
-- (void)loadingStarted;
-
-// These reflect the WKWebDataSourceClient protocol
-- (void)receivedDataForURL: (NSURL *)url;
-- (void)finishedReceivingDataForURL: (NSURL *)url;
-- documentReceived;
-
- at end
 
 /*
     Other areas still to consider:
 
-		tool tips for ALT image text and link URLs
-		
-		node events
+        ALT image text and link URLs
+            Should this be built-in?  or able to be overriden?
+            
+        node events
 		
-		context menus
-
-		client access to form elements
-		   for auto-completion, passwords
-
-		authentication dialog
-
-		authentication/security state (is page secure)
+	client access to form elements for auto-completion, passwords
+        
+        selection
+            Selection on data source is reflected in view.
+            Does the view also need a cover selection API?
+            
+        subclassing of WKWebView
 */
 
-
-
-#else
- at interface NSWebPageView : NSView 
-{
- at private
-    id _viewPrivate;
-}
- at end
 #endif
 
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
new file mode 100644
index 0000000..d57639d
--- /dev/null
+++ b/WebKit/WebView.subproj/WebView.h
@@ -0,0 +1,109 @@
+/*	
+        WKWebController.h
+	Copyright 2001, Apple, Inc. All rights reserved.
+
+        Public header file.
+*/
+#import <Cocoa/Cocoa.h>
+
+ at interface WKWebController : NSObject <WKLoadHandler, WKScriptContextHandler, WKFrameSetHandler, WKCredentialsHandler, WKLocationChangeHandler, WKContextMenuHandler>
+ at end
+
+// See the comments in WKWebPageView above for more description about this protocol.
+ at protocol WKLocationChangeHandler
+- (BOOL)locationWillChange;
+- (void)loadingCancelled;
+- (void)loadingStopped;
+- (void)loadingFinished;
+- (void)loadingStarted;
+ at end
+
+
+
+ at protocol WKContextMenuHandler
+/*
+    We decided to implement this in terms of a fixed set of types rather
+    than per node.
+    
+    What items should be supported in the default context menus?
+*/
+ at end
+
+/*
+*/
+ at protocol WKCredentialsHandler
+// Ken will come up with a proposal for this.  We decided not have a generic API,
+// rather we'll have an API that explicitly knows about the authentication
+// attributes needed.
+// Client should use this API to collect information necessary to authenticate,
+// usually by putting up a dialog.
+// Do we provide a default dialog.
+ at end
+
+
+/*
+    Implementors of this protocol will receive messages indicating
+    data as it arrive.
+    
+    This method will be called even if the data source
+    is initialized with something other than a URL.
+*/
+ at protocol  WKLoadHandler
+
+/*
+    A new chunk of data has been received.  This could be partial load
+    of a url.  It may be useful to do incremental layout, although
+    typically for non-base URLs this should be done after a URL (i.e. image)
+    has been completed downloaded.
+*/
+- (void)receivedDataForLocation: (WKLoadProgress *)progress;
+
+ at end
+
+
+
+/*
+    A WKLoadProgress capture the state associated with a load progress
+    indication.  Should we use a struct?
+*/
+ at interface WKLoadProgress 
+{
+    int bytesSoFar;	// 0 if this is the start of load
+    int totalLoaded;	// -1 if this is not known.
+                        // bytesSoFar == totalLoaded when complete
+    NSString *location; // Needs to be a string, not URL.
+    LOAD_TYPES type;	// load types, either image, css, jscript, or html
+}
+ at end
+
+
+
+/*
+    A class that implements WKScriptContextHandler provides all the state information
+    that may be used by Javascript (AppleScript?).
+    
+*/
+ at protocol WKScriptContextHandler
+
+- (void)setStatusText: (NSString *)text;
+- (NSString *)statusText;
+
+// Need API for things like window size and position, window ids,
+// screen goemetry.  Essentially all the 'view' items that are
+// accessible from Javascript.
+
+ at end
+
+
+/*
+*/
+ at protocol WKFrameSetHandler
+- (NSArray *)frameNames;
+- (WKFrame *)findFrameNamed: (NSString *)name;
+- (BOOL)frameExists: (NSString *)name;
+- (BOOL)openURLInFrame: (WKFrame *)aFrame url: (NSURL *)url;
+ at end
+
+ at protocol WKFrame
+//
+ at end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list