OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_SELECTOR_VIEW_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_SELECTOR_VIEW_CONTROLLER_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 #import "ios/chrome/browser/ui/collection_view/collection_view_controller.h" |
| 11 |
| 12 @class PaymentRequestSelectorViewController; |
| 13 @protocol PaymentRequestSelectorViewControllerDataSource; |
| 14 |
| 15 // Delegate protocol for PaymentRequestSelectorViewController. |
| 16 @protocol PaymentRequestSelectorViewControllerDelegate<NSObject> |
| 17 |
| 18 // Notifies the delegate that the user has selected an item at the given index. |
| 19 - (void)paymentRequestSelectorViewController: |
| 20 (PaymentRequestSelectorViewController*)controller |
| 21 didSelectItemAtIndex:(NSUInteger)index; |
| 22 |
| 23 // Notifies the delegate that the user has chosen to add an item. |
| 24 - (void)paymentRequestSelectorViewControllerDidSelectAddItem: |
| 25 (PaymentRequestSelectorViewController*)controller; |
| 26 |
| 27 // Notifies the delegate that the user has chosen to return to the previous |
| 28 // screen without making a selection. |
| 29 - (void)paymentRequestSelectorViewControllerDidFinish: |
| 30 (PaymentRequestSelectorViewController*)controller; |
| 31 |
| 32 @end |
| 33 |
| 34 // View controller responsible for presenting a list of items provided by the |
| 35 // supplied data source for selection by the user and communicating the choice |
| 36 // to the supplied delegate. It displays an optional header item provided by the |
| 37 // data source above the list of selectable items. The list is followed by an |
| 38 // optional button to add an item. |
| 39 @interface PaymentRequestSelectorViewController : CollectionViewController |
| 40 |
| 41 // The delegate to be notified when the user selects an item, returns without |
| 42 // selection, or decides to add an item. |
| 43 @property(nonatomic, weak) id<PaymentRequestSelectorViewControllerDelegate> |
| 44 delegate; |
| 45 |
| 46 // The data source for this view controller. |
| 47 @property(nonatomic, weak) id<PaymentRequestSelectorViewControllerDataSource> |
| 48 dataSource; |
| 49 |
| 50 // Convenience initializer. Initializes this object with the |
| 51 // CollectionViewControllerStyleAppBar style and sets up the leading (back) |
| 52 // button. |
| 53 - (instancetype)init; |
| 54 |
| 55 @end |
| 56 |
| 57 #endif // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_SELECTOR_VIEW_CONTROLLER_
H_ |
OLD | NEW |