OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_EDIT_VIEW_CONTROLLER_INTE
RNAL_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_EDIT_VIEW_CONTROLLER_INTE
RNAL_H_ |
6 #define IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_EDIT_VIEW_CONTROLLER_INTE
RNAL_H_ | 6 #define IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_EDIT_VIEW_CONTROLLER_INTE
RNAL_H_ |
7 | 7 |
8 #import "ios/chrome/browser/ui/payments/payment_request_edit_view_controller.h" | 8 #import "ios/chrome/browser/ui/payments/payment_request_edit_view_controller.h" |
9 | 9 |
10 // Use these as the starting values for section identifier and item type enums | 10 // Use these as the starting values for section identifier and item type enums |
11 // in subclasses. These values are chosen to prevent overlapping with the | 11 // in subclasses. These values are chosen to prevent overlapping with the |
12 // section identifier and item type enums of this class. | 12 // section identifier and item type enums of this class. |
13 const NSInteger kSectionIdentifierEnumStart = kSectionIdentifierEnumZero + 20; | 13 const NSInteger kSectionIdentifierEnumStart = kSectionIdentifierEnumZero + 20; |
14 const NSInteger kItemTypeEnumStart = kItemTypeEnumZero + 100; | 14 const NSInteger kItemTypeEnumStart = kItemTypeEnumZero + 100; |
15 | 15 |
16 // Internal API for subclasses of PaymentRequestEditViewController. | 16 // Internal API for subclasses of PaymentRequestEditViewController. |
17 @interface PaymentRequestEditViewController (Internal) | 17 @interface PaymentRequestEditViewController (Internal) |
18 | 18 |
19 // Validates each field. If there is a validation error, displays an error | 19 // Validates each field. If there is a validation error, displays an error |
20 // message item in the same section as the field and returns NO. Otherwise | 20 // message item in the same section as the field and returns NO. Otherwise |
21 // removes the error message item in that section if one exists and sets the | 21 // removes the error message item in that section if one exists and sets the |
22 // value on the field. Returns YES if all the fields are validated successfully. | 22 // value on the field. Returns YES if all the fields are validated successfully. |
23 - (BOOL)validateForm; | 23 - (BOOL)validateForm; |
24 | 24 |
25 // Called before the editor field items are added to the the collection view | |
26 // model. Subclasses override this method to add items before the editor fields. | |
27 - (void)loadHeaderItems; | |
28 | |
29 // Called after the editor field items have been added to the the collection | 25 // Called after the editor field items have been added to the the collection |
30 // view model. Subclasses override this method to add items after the editor | 26 // view model. Subclasses override this method to add items after the editor |
31 // fields. | 27 // fields. |
32 - (void)loadFooterItems; | 28 - (void)loadFooterItems; |
33 | 29 |
34 // Returns the index path for the cell associated with the currently focused | 30 // Returns the index path for the cell associated with the currently focused |
35 // text field. | 31 // text field. |
36 - (NSIndexPath*)indexPathForCurrentTextField; | 32 - (NSIndexPath*)indexPathForCurrentTextField; |
37 | 33 |
38 // Adds an error message item in the section |sectionIdentifier| if | |
39 // |errorMessage| is non-empty. Otherwise removes such an item if one exists. | |
40 - (void)addOrRemoveErrorMessage:(NSString*)errorMessage | |
41 inSectionWithIdentifier:(NSInteger)sectionIdentifier; | |
42 | |
43 @end | 34 @end |
44 | 35 |
45 #endif // IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_EDIT_VIEW_CONTROLLER_I
NTERNAL_H_ | 36 #endif // IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_EDIT_VIEW_CONTROLLER_I
NTERNAL_H_ |
OLD | NEW |