OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
| 7 @protocol AutocompleteTextFieldEditorDelegateMethods |
| 8 |
| 9 // Delegate -paste: implementation to the field being edited. If the |
| 10 // delegate returns YES, or does not implement the method, NSTextView |
| 11 // is called to handle the paste. The delegate can block the paste |
| 12 // (or handle it internally) by returning NO. |
| 13 - (BOOL)textShouldPaste:(NSText*)fieldEditor; |
| 14 |
| 15 @end |
| 16 |
7 // Field editor used for the autocomplete field. | 17 // Field editor used for the autocomplete field. |
8 @interface AutocompleteTextFieldEditor : NSTextView { | 18 @interface AutocompleteTextFieldEditor : NSTextView { |
9 } | 19 } |
10 | 20 |
11 // Copy contents of the TextView to the designated clipboard as plain | 21 // Copy contents of the TextView to the designated clipboard as plain |
12 // text. | 22 // text. |
13 - (void)performCopy:(NSPasteboard*)pb; | 23 - (void)performCopy:(NSPasteboard*)pb; |
14 | 24 |
15 // Same as above, note that this calls through to performCopy. | 25 // Same as above, note that this calls through to performCopy. |
16 - (void)performCut:(NSPasteboard*)pb; | 26 - (void)performCut:(NSPasteboard*)pb; |
| 27 |
| 28 // Called by -paste: to decide whether to forward to superclass. |
| 29 // Exposed for unit testing. |
| 30 - (BOOL)shouldPaste; |
| 31 |
17 @end | 32 @end |
OLD | NEW |