[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

trey trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:23:16 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 9ddb9ac3502473c6492081a5a342fc1452247bd8
Author: trey <trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Feb 1 21:39:40 2003 +0000

    WebCore:
    
    	New plumbing for autofill/autocomplete.  WebBrowser receives controlText delegate
    	messages from our form widgets.  Should result in no behavior change.
    
    	New SPI is exposed over the bridge and KWQTextField passes the text delegate msgs to it.
    
            Reviewed by Richard
    
            * kwq/KWQTextField.mm:  Pass text delegate msgs through new SPI.
            (-[KWQTextField controlTextDidBeginEditing:]):
            (-[KWQTextField controlTextDidEndEditing:]):
            (-[KWQTextField controlTextDidChange:]):
            (-[KWQTextField control:textShouldBeginEditing:]):
            (-[KWQTextField control:textShouldEndEditing:]):
            (-[KWQTextField control:didFailToFormatString:errorDescription:]):
            (-[KWQTextField control:didFailToValidatePartialString:errorDescription:]):
            (-[KWQTextField control:isValidObject:]):
            (-[KWQTextField control:textView:doCommandBySelector:]):
            * kwq/WebCoreBridge.h:  New SPI for passing text delegate msgs.
    
    WebKit:
    
    	New plumbing for autofill/autocomplete.  WebBrowser receives controlText delegate
    	messages from our form widgets.  Should result in no behavior change.
    
    	New private API is exposed for the app to set a WebFormDelegate.
    
            Reviewed by Richard
    
            * WebCoreSupport.subproj/WebBridge.m:  Pass msgs from WC on to the controller's FormDelegate.
            (formDelegate):  Little utility function.
            (-[WebBridge controlTextDidBeginEditing:]):
            (-[WebBridge controlTextDidEndEditing:]):
            (-[WebBridge controlTextDidChange:]):
            (-[WebBridge control:textShouldBeginEditing:]):
            (-[WebBridge control:textShouldEndEditing:]):
            (-[WebBridge control:didFailToFormatString:errorDescription:]):
            (-[WebBridge control:didFailToValidatePartialString:errorDescription:]):
            (-[WebBridge control:isValidObject:]):
            (-[WebBridge control:textView:doCommandBySelector:]):
            * WebKit.exp:  New class exported.
            * WebKit.pbproj/project.pbxproj:  New WebFormDelegate files.
            * WebView.subproj/WebControllerPrivate.h:  API to set/get FormDelegate.
            * WebView.subproj/WebControllerPrivate.m:
            (-[WebController _setFormDelegate:]):  simple setter
            (-[WebController _formDelegate]):  simple getter
            * WebView.subproj/WebFormDelegate.h: Added.
            * WebView.subproj/WebFormDelegate.m: Added.
    	NOP impls for all these delegate methods.
            (-[WebFormDelegate controlTextDidBeginEditing:inFrame:]):
            (-[WebFormDelegate controlTextDidEndEditing:inFrame:]):
            (-[WebFormDelegate controlTextDidChange:inFrame:]):
            (-[WebFormDelegate control:textShouldBeginEditing:inFrame:]):
            (-[WebFormDelegate control:textShouldEndEditing:inFrame:]):
            (-[WebFormDelegate control:didFailToFormatString:errorDescription:inFrame:]):
            (-[WebFormDelegate control:didFailToValidatePartialString:errorDescription:inFrame:]):
            (-[WebFormDelegate control:isValidObject:inFrame:]):
            (-[WebFormDelegate control:textView:doCommandBySelector:inFrame:]):
    
    WebBrowser:
    
    	New plumbing for autofill/autocomplete.  WebBrowser receives controlText delegate
    	messages from our form widgets.  Should result in no behavior change.
    
    	This is mostly using new API, with a couple autocomplete fixes for newly exposed issues.
    
            Reviewed by Richard
    
            * BrowserWindowController.h:  New formDelegate ivar.
            * BrowserWindowController.m:
            (-[BrowserWindowController windowDidLoad]):  Create FormDelegate, an internal
    	helper object to field WebFormDelegate messages.
            (-[BrowserWindowController dealloc]):  Release FormDelegate.
            (-[BrowserWindowController controlTextDidEndEditing:]):
    	Pass msg on to completion controller.
            (-[FormDelegate initWithController:]):  Create CompletionController
    	to do autocomplete (commented out for now).
            (-[FormDelegate controlTextDidBeginEditing:inFrame:]):
    	Pass msg on to completion controller.
            (-[FormDelegate controlTextDidEndEditing:inFrame:]):
    	Pass msg on to completion controller.
            (-[FormDelegate controlTextDidChange:inFrame:]):
    	Pass msg on to completion controller.
            (-[FormDelegate control:textView:doCommandBySelector:inFrame:]):
    	Pass msg on to completion controller.
            * CompletionController.h: Added controlTextDidBeginEditing:
    	Should have been receiving this all along.
            * CompletionController.m:
            (-[CompletionController _buildUI]):  Set TableView font to match the textfield.
            (-[CompletionController _positionWindow]):  Position window relative to
    	TextField, not enclosing ScrollView (bogus code that's a NOP for the locationField).
            (-[CompletionController controlTextDidEndEditing:]):
    	Hide the completion window when we leave the field.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3537 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 696c283..a314ae7 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,24 @@
+2003-01-31  Trey Matteson  <trey at apple.com>
+
+	New plumbing for autofill/autocomplete.  WebBrowser receives controlText delegate
+	messages from our form widgets.  Should result in no behavior change.
+
+	New SPI is exposed over the bridge and KWQTextField passes the text delegate msgs to it.
+
+        Reviewed by Richard
+
+        * kwq/KWQTextField.mm:  Pass text delegate msgs through new SPI.
+        (-[KWQTextField controlTextDidBeginEditing:]):
+        (-[KWQTextField controlTextDidEndEditing:]):
+        (-[KWQTextField controlTextDidChange:]):
+        (-[KWQTextField control:textShouldBeginEditing:]):
+        (-[KWQTextField control:textShouldEndEditing:]):
+        (-[KWQTextField control:didFailToFormatString:errorDescription:]):
+        (-[KWQTextField control:didFailToValidatePartialString:errorDescription:]):
+        (-[KWQTextField control:isValidObject:]):
+        (-[KWQTextField control:textView:doCommandBySelector:]):
+        * kwq/WebCoreBridge.h:  New SPI for passing text delegate msgs.
+
 2003-01-31  David Hyatt  <hyatt at apple.com>
 
 	Fix regression that broke John's site.  RenderInline needs
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 696c283..a314ae7 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,24 @@
+2003-01-31  Trey Matteson  <trey at apple.com>
+
+	New plumbing for autofill/autocomplete.  WebBrowser receives controlText delegate
+	messages from our form widgets.  Should result in no behavior change.
+
+	New SPI is exposed over the bridge and KWQTextField passes the text delegate msgs to it.
+
+        Reviewed by Richard
+
+        * kwq/KWQTextField.mm:  Pass text delegate msgs through new SPI.
+        (-[KWQTextField controlTextDidBeginEditing:]):
+        (-[KWQTextField controlTextDidEndEditing:]):
+        (-[KWQTextField controlTextDidChange:]):
+        (-[KWQTextField control:textShouldBeginEditing:]):
+        (-[KWQTextField control:textShouldEndEditing:]):
+        (-[KWQTextField control:didFailToFormatString:errorDescription:]):
+        (-[KWQTextField control:didFailToValidatePartialString:errorDescription:]):
+        (-[KWQTextField control:isValidObject:]):
+        (-[KWQTextField control:textView:doCommandBySelector:]):
+        * kwq/WebCoreBridge.h:  New SPI for passing text delegate msgs.
+
 2003-01-31  David Hyatt  <hyatt at apple.com>
 
 	Fix regression that broke John's site.  RenderInline needs
diff --git a/WebCore/kwq/KWQTextField.mm b/WebCore/kwq/KWQTextField.mm
index 9488243..bdd1696 100644
--- a/WebCore/kwq/KWQTextField.mm
+++ b/WebCore/kwq/KWQTextField.mm
@@ -29,6 +29,7 @@
 #import "KWQKHTMLPart.h"
 #import "KWQNSViewExtras.h"
 #import "WebCoreFirstResponderChanges.h"
+#import "WebCoreBridge.h"
 
 // KWQTextFieldFormatter enforces a maximum length.
 
@@ -186,12 +187,62 @@
     edited = ed;
 }
 
-- (void)controlTextDidChange:(NSNotification *)aNotification
+- (void)controlTextDidBeginEditing:(NSNotification *)obj
 {
+    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
+    [bridge controlTextDidBeginEditing:obj];
+}
+
+- (void)controlTextDidEndEditing:(NSNotification *)obj
+{
+    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
+    [bridge controlTextDidEndEditing:obj];
+}
+
+- (void)controlTextDidChange:(NSNotification *)obj
+{
+    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
+    [bridge controlTextDidChange:obj];
     edited = true;
     widget->textChanged();
 }
 
+- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor
+{
+    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
+    return [bridge control:control textShouldBeginEditing:fieldEditor];
+}
+
+- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
+{
+    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
+    return [bridge control:control textShouldEndEditing:fieldEditor];
+}
+
+- (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(NSString *)error
+{
+    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
+    return [bridge control:control didFailToFormatString:string errorDescription:error];
+}
+
+- (void)control:(NSControl *)control didFailToValidatePartialString:(NSString *)string errorDescription:(NSString *)error
+{
+    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
+    [bridge control:control didFailToValidatePartialString:string errorDescription:error];
+}
+
+- (BOOL)control:(NSControl *)control isValidObject:(id)obj
+{
+    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
+    return [bridge control:control isValidObject:obj];
+}
+
+- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector
+{
+    WebCoreBridge *bridge = KWQKHTMLPart::bridgeForWidget(widget);
+    return [bridge control:control textView:textView doCommandBySelector:commandSelector];
+}
+
 - (NSString *)stringValue
 {
     if ([secureField superview]) {
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 45ea77c..234d303 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -270,6 +270,17 @@ enum FrameBorderStyle {
 - (int)historyLength;
 - (void)goBackOrForward:(int)distance;
 
+- (void)controlTextDidBeginEditing:(NSNotification *)obj;
+- (void)controlTextDidEndEditing:(NSNotification *)obj;
+- (void)controlTextDidChange:(NSNotification *)obj;
+
+- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor;
+- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
+- (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(NSString *)error;
+- (void)control:(NSControl *)control didFailToValidatePartialString:(NSString *)string errorDescription:(NSString *)error;
+- (BOOL)control:(NSControl *)control isValidObject:(id)obj;
+- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector;
+
 @end
 
 // This interface definition allows those who hold a WebCoreBridge * to call all the methods
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 1648326..61cea40 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,42 @@
+2003-01-31  Trey Matteson  <trey at apple.com>
+
+	New plumbing for autofill/autocomplete.  WebBrowser receives controlText delegate
+	messages from our form widgets.  Should result in no behavior change.
+
+	New private API is exposed for the app to set a WebFormDelegate.
+
+        Reviewed by Richard
+
+        * WebCoreSupport.subproj/WebBridge.m:  Pass msgs from WC on to the controller's FormDelegate.
+        (formDelegate):  Little utility function.
+        (-[WebBridge controlTextDidBeginEditing:]):
+        (-[WebBridge controlTextDidEndEditing:]):
+        (-[WebBridge controlTextDidChange:]):
+        (-[WebBridge control:textShouldBeginEditing:]):
+        (-[WebBridge control:textShouldEndEditing:]):
+        (-[WebBridge control:didFailToFormatString:errorDescription:]):
+        (-[WebBridge control:didFailToValidatePartialString:errorDescription:]):
+        (-[WebBridge control:isValidObject:]):
+        (-[WebBridge control:textView:doCommandBySelector:]):
+        * WebKit.exp:  New class exported.
+        * WebKit.pbproj/project.pbxproj:  New WebFormDelegate files.
+        * WebView.subproj/WebControllerPrivate.h:  API to set/get FormDelegate.
+        * WebView.subproj/WebControllerPrivate.m:
+        (-[WebController _setFormDelegate:]):  simple setter
+        (-[WebController _formDelegate]):  simple getter
+        * WebView.subproj/WebFormDelegate.h: Added.
+        * WebView.subproj/WebFormDelegate.m: Added.
+	NOP impls for all these delegate methods.
+        (-[WebFormDelegate controlTextDidBeginEditing:inFrame:]):
+        (-[WebFormDelegate controlTextDidEndEditing:inFrame:]):
+        (-[WebFormDelegate controlTextDidChange:inFrame:]):
+        (-[WebFormDelegate control:textShouldBeginEditing:inFrame:]):
+        (-[WebFormDelegate control:textShouldEndEditing:inFrame:]):
+        (-[WebFormDelegate control:didFailToFormatString:errorDescription:inFrame:]):
+        (-[WebFormDelegate control:didFailToValidatePartialString:errorDescription:inFrame:]):
+        (-[WebFormDelegate control:isValidObject:inFrame:]):
+        (-[WebFormDelegate control:textView:doCommandBySelector:inFrame:]):
+
 2003-01-31  Chris Blumenberg  <cblu at apple.com>
 
         * English.lproj/StringsNotToBeLocalized.txt: Updated for recent changes.
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 1c6d0fc..b5b8931 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -33,6 +33,7 @@
 #import <WebKit/WebSubresourceClient.h>
 #import <WebKit/WebViewPrivate.h>
 #import <WebKit/WebWindowOperationsDelegate.h>
+#import <WebKit/WebFormDelegate.h>
 
 #import <WebFoundation/WebAssertions.h>
 #import <WebFoundation/WebError.h>
@@ -639,4 +640,55 @@ static BOOL loggedObjectCacheSize = NO;
     }
 }
 
+static id <WebFormDelegate> formDelegate(WebBridge *self)
+{
+    ASSERT(self->frame != nil);
+    return [[self->frame controller] _formDelegate];
+}
+
+- (void)controlTextDidBeginEditing:(NSNotification *)obj
+{
+    [formDelegate(self) controlTextDidBeginEditing:obj inFrame:frame];
+}
+
+- (void)controlTextDidEndEditing:(NSNotification *)obj
+{
+    [formDelegate(self) controlTextDidEndEditing:obj inFrame:frame];
+}
+
+- (void)controlTextDidChange:(NSNotification *)obj
+{
+    [formDelegate(self) controlTextDidChange:obj inFrame:frame];
+}
+
+- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor
+{
+    return [formDelegate(self) control:control textShouldBeginEditing:fieldEditor inFrame:frame];
+}
+
+- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
+{
+    return [formDelegate(self) control:control textShouldEndEditing:fieldEditor inFrame:frame];
+}
+
+- (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(NSString *)error
+{
+    return [formDelegate(self) control:control didFailToFormatString:string errorDescription:error inFrame:frame];
+}
+
+- (void)control:(NSControl *)control didFailToValidatePartialString:(NSString *)string errorDescription:(NSString *)error
+{
+    [formDelegate(self) control:control didFailToValidatePartialString:string errorDescription:error inFrame:frame];
+}
+
+- (BOOL)control:(NSControl *)control isValidObject:(id)obj
+{
+    return [formDelegate(self) control:control isValidObject:obj inFrame:frame];
+}
+
+- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector
+{
+    return [formDelegate(self) control:control textView:textView doCommandBySelector:commandSelector inFrame:frame];
+}
+
 @end
diff --git a/WebKit/WebKit.exp b/WebKit/WebKit.exp
index 193f23d..b8d65c3 100644
--- a/WebKit/WebKit.exp
+++ b/WebKit/WebKit.exp
@@ -8,6 +8,7 @@
 .objc_class_name_WebDebugDOMNode
 .objc_class_name_WebDefaultContextMenuDelegate
 .objc_class_name_WebDefaultPolicyDelegate
+.objc_class_name_WebFormDelegate
 .objc_class_name_WebFrame
 .objc_class_name_WebHTMLView
 .objc_class_name_WebHistory
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index b9a76cf..2ff0661 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -275,6 +275,7 @@
 				5152FAE3033FC50400CA2ACD,
 				35081DAF02B6D4F50ACA2ACA,
 				3944608B020F50ED0ECA1767,
+				2D81DAB403EB0B2D00A80166,
 				39446091020F50ED0ECA1767,
 				9CF0E24B021361B10ECA16EA,
 				35081D9C02B6D4D80ACA2ACA,
@@ -411,6 +412,7 @@
 				394460A6020F50ED0ECA1767,
 				832B2D1703B10990009CF105,
 				84A992C503CE696800CA2ACA,
+				2D81DAB503EB0B2D00A80166,
 			);
 			isa = PBXSourcesBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -569,6 +571,43 @@
 //252
 //253
 //254
+//2D0
+//2D1
+//2D2
+//2D3
+//2D4
+		2D81DAB203EB0B2D00A80166 = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			path = WebFormDelegate.h;
+			refType = 4;
+		};
+		2D81DAB303EB0B2D00A80166 = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			path = WebFormDelegate.m;
+			refType = 4;
+		};
+		2D81DAB403EB0B2D00A80166 = {
+			fileRef = 2D81DAB203EB0B2D00A80166;
+			isa = PBXBuildFile;
+			settings = {
+				ATTRIBUTES = (
+					Private,
+				);
+			};
+		};
+		2D81DAB503EB0B2D00A80166 = {
+			fileRef = 2D81DAB303EB0B2D00A80166;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+//2D0
+//2D1
+//2D2
+//2D3
+//2D4
 //350
 //351
 //352
@@ -2328,6 +2367,8 @@
 				39446077020F50ED0ECA1767,
 				39446079020F50ED0ECA1767,
 				511D5553033FD51000CA2ACD,
+				2D81DAB203EB0B2D00A80166,
+				2D81DAB303EB0B2D00A80166,
 			);
 			isa = PBXGroup;
 			name = WebView;
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.h b/WebKit/WebView.subproj/WebControllerPrivate.h
index ba8c7f9..d828630 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.h
+++ b/WebKit/WebView.subproj/WebControllerPrivate.h
@@ -8,6 +8,7 @@
 
 @class WebError;
 @class WebFrame;
+ at protocol WebFormDelegate;
 
 typedef enum { Safari, MacIE, WinIE } UserAgentStringType;
 enum { NumUserAgentStringTypes = WinIE + 1 };
@@ -23,6 +24,7 @@ enum { NumUserAgentStringTypes = WinIE + 1 };
     id <WebContextMenuDelegate> contextMenuDelegate;
     id <WebControllerPolicyDelegate> policyDelegate;
     id <WebLocationChangeDelegate> locationChangeDelegate;
+    id <WebFormDelegate> formDelegate;
     
     id <WebContextMenuDelegate> defaultContextMenuDelegate;
 
@@ -71,4 +73,9 @@ enum { NumUserAgentStringTypes = WinIE + 1 };
 
 - (void)_mouseDidMoveOverElement:(NSDictionary *)dictionary modifierFlags:(unsigned)modifierFlags;
 
+// May well become public
+- (void)_setFormDelegate: (id<WebFormDelegate>)delegate;
+- (id<WebFormDelegate>)_formDelegate;
+
+
 @end
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.m b/WebKit/WebView.subproj/WebControllerPrivate.m
index 048c9e0..fe8e4bb 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.m
+++ b/WebKit/WebView.subproj/WebControllerPrivate.m
@@ -5,6 +5,7 @@
 
 #import <WebKit/WebBackForwardList.h>
 #import <WebKit/WebContextMenuDelegate.h>
+#import <WebKit/WebFormDelegate.h>
 #import <WebKit/WebControllerPrivate.h>
 #import <WebKit/WebControllerSets.h>
 #import <WebKit/WebDataSourcePrivate.h>
@@ -346,4 +347,14 @@
     }
 }
 
+- (void)_setFormDelegate: (id<WebFormDelegate>)delegate
+{
+    _private->formDelegate = delegate;
+}
+
+- (id<WebFormDelegate>)_formDelegate
+{
+    return _private->formDelegate;
+}
+
 @end
diff --git a/WebKit/WebView.subproj/WebFormDelegate.h b/WebKit/WebView.subproj/WebFormDelegate.h
new file mode 100644
index 0000000..f273faa
--- /dev/null
+++ b/WebKit/WebView.subproj/WebFormDelegate.h
@@ -0,0 +1,46 @@
+/*
+        WebFormDelegate.h
+        Copyright 2001, 2002, Apple Computer, Inc.
+        
+        Public header file.
+*/
+
+#import <AppKit/AppKit.h>
+
+ at class WebFrame;
+
+/*!
+    @protocol  WebFormDelegate
+    @discussion .
+*/
+ at protocol WebFormDelegate <NSObject>
+
+// Various methods send by controls that edit text to their delegates, which are all
+// analogous to similar methods in AppKit/NSControl.h.
+// These methods are forwarded from widgets used in forms to the WebFormDelegate.
+
+- (void)controlTextDidBeginEditing:(NSNotification *)obj inFrame:(WebFrame *)frame;
+- (void)controlTextDidEndEditing:(NSNotification *)obj inFrame:(WebFrame *)frame;
+- (void)controlTextDidChange:(NSNotification *)obj inFrame:(WebFrame *)frame;
+
+- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor inFrame:(WebFrame *)frame;
+- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor inFrame:(WebFrame *)frame;
+- (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(NSString *)error inFrame:(WebFrame *)frame;
+- (void)control:(NSControl *)control didFailToValidatePartialString:(NSString *)string errorDescription:(NSString *)error inFrame:(WebFrame *)frame;
+- (BOOL)control:(NSControl *)control isValidObject:(id)obj inFrame:(WebFrame *)frame;
+
+- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector inFrame:(WebFrame *)frame;
+
+ at end
+
+/*!
+    @class WebFormDelegate
+    @discussion The WebFormDelegate class responds to all WebFormDelegate protocol
+    methods by doing nothing. It's provided for the convenience of clients who only want
+    to implement some of the above methods and ignore others.
+*/
+ at interface WebFormDelegate : NSObject <WebFormDelegate>
+{
+}
+ at end
+
diff --git a/WebKit/WebView.subproj/WebFormDelegate.m b/WebKit/WebView.subproj/WebFormDelegate.m
new file mode 100644
index 0000000..01811ea
--- /dev/null
+++ b/WebKit/WebView.subproj/WebFormDelegate.m
@@ -0,0 +1,46 @@
+/*
+        WebFormDelegate.m
+	Copyright 2003, Apple, Inc. All rights reserved.
+ */
+
+#import "WebFormDelegate.h"
+
+ at implementation WebFormDelegate
+
+- (void)controlTextDidBeginEditing:(NSNotification *)obj inFrame:(WebFrame *)frame { }
+
+- (void)controlTextDidEndEditing:(NSNotification *)obj inFrame:(WebFrame *)frame { }
+
+- (void)controlTextDidChange:(NSNotification *)obj inFrame:(WebFrame *)frame { }
+
+
+- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor inFrame:(WebFrame *)frame
+{
+    return YES;
+}
+
+- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor inFrame:(WebFrame *)frame
+{
+    return YES;
+}
+
+- (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(NSString *)error inFrame:(WebFrame *)frame
+{
+    return YES;
+}
+
+- (void)control:(NSControl *)control didFailToValidatePartialString:(NSString *)string errorDescription:(NSString *)error inFrame:(WebFrame *)frame
+{
+}
+
+- (BOOL)control:(NSControl *)control isValidObject:(id)obj inFrame:(WebFrame *)frame
+{
+    return YES;
+}
+
+- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector inFrame:(WebFrame *)frame
+{
+    return NO;
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index ba8c7f9..d828630 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -8,6 +8,7 @@
 
 @class WebError;
 @class WebFrame;
+ at protocol WebFormDelegate;
 
 typedef enum { Safari, MacIE, WinIE } UserAgentStringType;
 enum { NumUserAgentStringTypes = WinIE + 1 };
@@ -23,6 +24,7 @@ enum { NumUserAgentStringTypes = WinIE + 1 };
     id <WebContextMenuDelegate> contextMenuDelegate;
     id <WebControllerPolicyDelegate> policyDelegate;
     id <WebLocationChangeDelegate> locationChangeDelegate;
+    id <WebFormDelegate> formDelegate;
     
     id <WebContextMenuDelegate> defaultContextMenuDelegate;
 
@@ -71,4 +73,9 @@ enum { NumUserAgentStringTypes = WinIE + 1 };
 
 - (void)_mouseDidMoveOverElement:(NSDictionary *)dictionary modifierFlags:(unsigned)modifierFlags;
 
+// May well become public
+- (void)_setFormDelegate: (id<WebFormDelegate>)delegate;
+- (id<WebFormDelegate>)_formDelegate;
+
+
 @end
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index 048c9e0..fe8e4bb 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -5,6 +5,7 @@
 
 #import <WebKit/WebBackForwardList.h>
 #import <WebKit/WebContextMenuDelegate.h>
+#import <WebKit/WebFormDelegate.h>
 #import <WebKit/WebControllerPrivate.h>
 #import <WebKit/WebControllerSets.h>
 #import <WebKit/WebDataSourcePrivate.h>
@@ -346,4 +347,14 @@
     }
 }
 
+- (void)_setFormDelegate: (id<WebFormDelegate>)delegate
+{
+    _private->formDelegate = delegate;
+}
+
+- (id<WebFormDelegate>)_formDelegate
+{
+    return _private->formDelegate;
+}
+
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list