| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_PAYMENTS_CELLS_PAYMENT_METHOD_ITEM_H_ | 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_CELLS_PAYMENT_METHOD_ITEM_H_ |
| 6 #define IOS_CHROME_BROWSER_PAYMENTS_CELLS_PAYMENT_METHOD_ITEM_H_ | 6 #define IOS_CHROME_BROWSER_PAYMENTS_CELLS_PAYMENT_METHOD_ITEM_H_ |
| 7 | 7 |
| 8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
| 9 | 9 |
| 10 #import "ios/chrome/browser/payments/cells/payments_has_accessory_type.h" |
| 10 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" | 11 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" |
| 11 #import "ios/third_party/material_components_ios/src/components/CollectionCells/
src/MaterialCollectionCells.h" | 12 #import "ios/third_party/material_components_ios/src/components/CollectionCells/
src/MaterialCollectionCells.h" |
| 12 | 13 |
| 13 // PaymentMethodItem is the model class corresponding to PaymentMethodCell. | 14 // PaymentMethodItem is the model class corresponding to PaymentMethodCell. |
| 14 @interface PaymentMethodItem : CollectionViewItem | 15 @interface PaymentMethodItem : CollectionViewItem<PaymentsHasAccessoryType> |
| 15 | 16 |
| 16 // A unique identifier for the payment method (for example, the type and last 4 | 17 // A unique identifier for the payment method (for example, the type and last 4 |
| 17 // digits of a credit card). | 18 // digits of a credit card). |
| 18 @property(nonatomic, copy) NSString* methodID; | 19 @property(nonatomic, copy) NSString* methodID; |
| 19 | 20 |
| 20 // Additional details about the payment method (for example, the name of the | 21 // Additional details about the payment method (for example, the name of the |
| 21 // credit card holder). | 22 // credit card holder). |
| 22 @property(nonatomic, copy) NSString* methodDetail; | 23 @property(nonatomic, copy) NSString* methodDetail; |
| 23 | 24 |
| 24 // The address associated with the the payment method (for example, credit | 25 // The address associated with the the payment method (for example, credit |
| 25 // card's billing address). | 26 // card's billing address). |
| 26 @property(nonatomic, copy) NSString* methodAddress; | 27 @property(nonatomic, copy) NSString* methodAddress; |
| 27 | 28 |
| 28 // The notification message. | 29 // The notification message. |
| 29 @property(nonatomic, copy) NSString* notification; | 30 @property(nonatomic, copy) NSString* notification; |
| 30 | 31 |
| 31 // An image corresponding to the type of the payment method. | 32 // An image corresponding to the type of the payment method. |
| 32 @property(nonatomic, strong) UIImage* methodTypeIcon; | 33 @property(nonatomic, strong) UIImage* methodTypeIcon; |
| 33 | 34 |
| 34 // If YES, reserves room for the accessory type view regardless of whether the | 35 // If YES, reserves room for the accessory type view regardless of whether the |
| 35 // item has an accessory type. This is used to ensure the content area always | 36 // item has an accessory type. This is used to ensure the content area always |
| 36 // has the same size regardless of whether the accessory type is set. | 37 // has the same size regardless of whether the accessory type is set. |
| 37 @property(nonatomic, assign) BOOL reserveRoomForAccessoryType; | 38 @property(nonatomic, assign) BOOL reserveRoomForAccessoryType; |
| 38 | 39 |
| 39 // The accessory type to be shown in the cell. | |
| 40 @property(nonatomic) MDCCollectionViewCellAccessoryType accessoryType; | |
| 41 | |
| 42 @end | 40 @end |
| 43 | 41 |
| 44 // PaymentMethodCell implements an MDCCollectionViewCell subclass containing | 42 // PaymentMethodCell implements an MDCCollectionViewCell subclass containing |
| 45 // four optional text labels identifying and providing details about a payment | 43 // four optional text labels identifying and providing details about a payment |
| 46 // method and an image view displaying an icon representing the payment method's | 44 // method and an image view displaying an icon representing the payment method's |
| 47 // type. The image is laid out on the trailing edge of the cell while the labels | 45 // type. The image is laid out on the trailing edge of the cell while the labels |
| 48 // are laid out on the leading edge of the cell up to the leading edge of the | 46 // are laid out on the leading edge of the cell up to the leading edge of the |
| 49 // image view. The labels are truncated if necessary. | 47 // image view. The labels are truncated if necessary. |
| 50 @interface PaymentMethodCell : MDCCollectionViewCell | 48 @interface PaymentMethodCell : MDCCollectionViewCell |
| 51 | 49 |
| 52 // UILabels corresponding to |methodID|, |methodDetail|, |methodAddress|, and | 50 // UILabels corresponding to |methodID|, |methodDetail|, |methodAddress|, and |
| 53 // |notification|. | 51 // |notification|. |
| 54 @property(nonatomic, readonly, strong) UILabel* methodIDLabel; | 52 @property(nonatomic, readonly, strong) UILabel* methodIDLabel; |
| 55 @property(nonatomic, readonly, strong) UILabel* methodDetailLabel; | 53 @property(nonatomic, readonly, strong) UILabel* methodDetailLabel; |
| 56 @property(nonatomic, readonly, strong) UILabel* methodAddressLabel; | 54 @property(nonatomic, readonly, strong) UILabel* methodAddressLabel; |
| 57 @property(nonatomic, readonly, strong) UILabel* notificationLabel; | 55 @property(nonatomic, readonly, strong) UILabel* notificationLabel; |
| 58 | 56 |
| 59 @property(nonatomic, assign) BOOL reserveRoomForAccessoryType; | 57 @property(nonatomic, assign) BOOL reserveRoomForAccessoryType; |
| 60 | 58 |
| 61 // UIImageView containing the payment method type icon. | 59 // UIImageView containing the payment method type icon. |
| 62 @property(nonatomic, readonly, strong) UIImageView* methodTypeIconView; | 60 @property(nonatomic, readonly, strong) UIImageView* methodTypeIconView; |
| 63 | 61 |
| 64 @end | 62 @end |
| 65 | 63 |
| 66 #endif // IOS_CHROME_BROWSER_PAYMENTS_CELLS_PAYMENT_METHOD_ITEM_H_ | 64 #endif // IOS_CHROME_BROWSER_PAYMENTS_CELLS_PAYMENT_METHOD_ITEM_H_ |
| OLD | NEW |