OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_INPUT_FIELD_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_INPUT_FIELD_H_ |
6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_INPUT_FIELD_H_ | 6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_INPUT_FIELD_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 @protocol AutofillInputField; | 10 @protocol AutofillInputField; |
11 | 11 |
12 // Access to cell state for autofill input controls. | 12 // Access to cell state for autofill input controls. |
13 @protocol AutofillInputCell<NSObject> | 13 @protocol AutofillInputCell<NSObject> |
14 | 14 |
15 @property(nonatomic, assign) BOOL invalid; | 15 @property(nonatomic, assign) BOOL invalid; |
16 @property(nonatomic, copy) NSString* fieldValue; | 16 @property(nonatomic, copy) NSString* fieldValue; |
17 @property(nonatomic, copy) NSString* defaultValue; | 17 @property(nonatomic, copy) NSString* defaultValue; |
18 | 18 |
19 @end | 19 @end |
20 | 20 |
21 // Delegate to handle editing events on the AutofillInputFields. | 21 // Delegate to handle editing events on the AutofillInputFields. |
22 @protocol AutofillInputDelegate<NSObject> | 22 @protocol AutofillInputDelegate<NSObject> |
23 | 23 |
| 24 // Indicates if an event should be forwarded on. |
| 25 enum KeyEventHandled { |
| 26 kKeyEventNotHandled, |
| 27 kKeyEventHandled |
| 28 }; |
| 29 |
| 30 // The input field received a key event. This should return kKeyEventHandled if |
| 31 // it handled the event, or kEventNotHandled if it should be forwarded to the |
| 32 // input's super class. |
| 33 - (KeyEventHandled)keyEvent:(NSEvent*)event forInput:(id)sender; |
| 34 |
24 // Input field or its editor received a mouseDown: message. | 35 // Input field or its editor received a mouseDown: message. |
25 - (void)onMouseDown:(NSControl<AutofillInputField>*)sender; | 36 - (void)onMouseDown:(NSControl<AutofillInputField>*)sender; |
26 | 37 |
27 // An input field just became first responder. | 38 // An input field just became first responder. |
28 - (void)fieldBecameFirstResponder:(NSControl<AutofillInputField>*)field; | 39 - (void)fieldBecameFirstResponder:(NSControl<AutofillInputField>*)field; |
29 | 40 |
30 // The user made changes to the value in the field. This is only invoked by | 41 // The user made changes to the value in the field. This is only invoked by |
31 // AutofillTextFields. | 42 // AutofillTextFields. |
32 - (void)didChange:(id)sender; | 43 - (void)didChange:(id)sender; |
33 | 44 |
(...skipping 20 matching lines...) Expand all Loading... |
54 // field, everything else is a message to be displayed to the user when the | 65 // field, everything else is a message to be displayed to the user when the |
55 // field has firstResponder status. | 66 // field has firstResponder status. |
56 @property(nonatomic, copy) NSString* validityMessage; | 67 @property(nonatomic, copy) NSString* validityMessage; |
57 | 68 |
58 // A reflection of the state of the validityMessage described above. | 69 // A reflection of the state of the validityMessage described above. |
59 @property(nonatomic, readonly) BOOL invalid; | 70 @property(nonatomic, readonly) BOOL invalid; |
60 | 71 |
61 @end | 72 @end |
62 | 73 |
63 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_INPUT_FIELD_H_ | 74 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_INPUT_FIELD_H_ |
OLD | NEW |