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_SELECTOR_VIEW_CONTROLLER_
DATA_SOURCE_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_SELECTOR_VIEW_CONTROLLER_
DATA_SOURCE_H_ |
6 #define IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_SELECTOR_VIEW_CONTROLLER_
DATA_SOURCE_H_ | 6 #define IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_SELECTOR_VIEW_CONTROLLER_
DATA_SOURCE_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 #import "ios/chrome/browser/ui/payments/cells/payments_has_accessory_type.h" | 10 #import "ios/chrome/browser/ui/payments/cells/payments_has_accessory_type.h" |
11 | 11 |
12 @class CollectionViewItem; | 12 @class CollectionViewItem; |
13 | 13 |
14 // The possible states the view controller can be in. | 14 // The possible states the view controller can be in. |
15 typedef NS_ENUM(NSUInteger, PaymentRequestSelectorState) { | 15 typedef NS_ENUM(NSUInteger, PaymentRequestSelectorState) { |
16 // The view controller is in normal state. | 16 // The view controller is in normal state. |
17 PaymentRequestSelectorStateNormal, | 17 PaymentRequestSelectorStateNormal, |
| 18 // The view controller is in edit state. |
| 19 PaymentRequestSelectorStateEdit, |
18 // The view controller is in pending state. | 20 // The view controller is in pending state. |
19 PaymentRequestSelectorStatePending, | 21 PaymentRequestSelectorStatePending, |
20 // The view controller is in error state. | 22 // The view controller is in error state. |
21 PaymentRequestSelectorStateError, | 23 PaymentRequestSelectorStateError, |
22 }; | 24 }; |
23 | 25 |
24 // The data source for the PaymentRequestSelectorViewController. The data | 26 // The data source for the PaymentRequestSelectorViewController. The data |
25 // source provides the UI models for the PaymentRequestSelectorViewController | 27 // source provides the UI models for the PaymentRequestSelectorViewController |
26 // to display and keeps track of the selected UI model, if any. | 28 // to display and keeps track of the selected UI model, if any. |
27 @protocol PaymentRequestSelectorViewControllerDataSource<NSObject> | 29 @protocol PaymentRequestSelectorViewControllerDataSource<NSObject> |
28 | 30 |
29 // The current state of the view controller. | 31 // The current state of the view controller. |
30 @property(nonatomic, readonly) PaymentRequestSelectorState state; | 32 @property(nonatomic, readonly) PaymentRequestSelectorState state; |
31 | 33 |
32 // Index for the currently selected item or NSUIntegerMax if there is none. | 34 // Index for the currently selected item or NSUIntegerMax if there is none. |
33 @property(nonatomic, readonly) NSUInteger selectedItemIndex; | 35 @property(nonatomic, readonly) NSUInteger selectedItemIndex; |
34 | 36 |
| 37 // Whether or not the view controller supports edit mode. |
| 38 - (BOOL)allowsEditMode; |
| 39 |
35 // The header item to display in the collection, if any. | 40 // The header item to display in the collection, if any. |
36 - (CollectionViewItem*)headerItem; | 41 - (CollectionViewItem*)headerItem; |
37 | 42 |
38 // The selectable items to display in the collection. | 43 // The selectable items to display in the collection. |
39 - (NSArray<CollectionViewItem<PaymentsHasAccessoryType>*>*)selectableItems; | 44 - (NSArray<CollectionViewItem<PaymentsHasAccessoryType>*>*)selectableItems; |
40 | 45 |
41 // The "Add" button item, if any. | 46 // The "Add" button item, if any. |
42 - (CollectionViewItem*)addButtonItem; | 47 - (CollectionViewItem*)addButtonItem; |
43 | 48 |
44 @end | 49 @end |
45 | 50 |
46 #endif // IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_SELECTOR_VIEW_CONTROLL
ER_DATA_SOURCE_H_ | 51 #endif // IOS_CHROME_BROWSER_UI_PAYMENTS_PAYMENT_REQUEST_SELECTOR_VIEW_CONTROLL
ER_DATA_SOURCE_H_ |
OLD | NEW |