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_UI_COLLECTION_VIEW_CELLS_COLLECTION_VIEW_ITEM_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_CELLS_COLLECTION_VIEW_ITEM_H_ |
6 #define IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_CELLS_COLLECTION_VIEW_ITEM_H_ | 6 #define IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_CELLS_COLLECTION_VIEW_ITEM_H_ |
7 | 7 |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 @class MDCCollectionViewCell; | 10 #import "ios/third_party/material_components_ios/src/components/CollectionCells/
src/MaterialCollectionCells.h" |
11 | 11 |
12 // CollectionViewItem holds the model data for a given collection view item. | 12 // CollectionViewItem holds the model data for a given collection view item. |
13 @interface CollectionViewItem : NSObject<UIAccessibilityIdentification> | 13 @interface CollectionViewItem : NSObject<UIAccessibilityIdentification> |
14 | 14 |
| 15 // The accessory type for the cell. |
| 16 @property(nonatomic) MDCCollectionViewCellAccessoryType accessoryType; |
| 17 |
15 // A client-defined value. It should be unique among items of a given collection | 18 // A client-defined value. It should be unique among items of a given collection |
16 // view model. | 19 // view model. |
17 @property(nonatomic, readonly, assign) NSInteger type; | 20 @property(nonatomic, readonly, assign) NSInteger type; |
18 | 21 |
19 // The cell class to use in conjunction with this item. Must be a subclass of | 22 // The cell class to use in conjunction with this item. Must be a subclass of |
20 // MDCCollectionViewCell. The default is MDCCollectionViewCell. | 23 // MDCCollectionViewCell. The default is MDCCollectionViewCell. |
21 @property(nonatomic, assign) Class cellClass; | 24 @property(nonatomic, assign) Class cellClass; |
22 | 25 |
23 - (instancetype)initWithType:(NSInteger)type NS_DESIGNATED_INITIALIZER; | 26 - (instancetype)initWithType:(NSInteger)type NS_DESIGNATED_INITIALIZER; |
24 - (instancetype)init NS_UNAVAILABLE; | 27 - (instancetype)init NS_UNAVAILABLE; |
25 | 28 |
26 // Configures the given cell with the item's information. Override this method | 29 // Configures the given cell with the item's information. Override this method |
27 // to specialize. At this level, only accessibility properties are ported from | 30 // to specialize. At this level, only accessibility properties are ported from |
28 // the item to the cell. | 31 // the item to the cell. |
29 // The cell's class must match cellClass for the given instance. | 32 // The cell's class must match cellClass for the given instance. |
30 - (void)configureCell:(MDCCollectionViewCell*)cell NS_REQUIRES_SUPER; | 33 - (void)configureCell:(MDCCollectionViewCell*)cell NS_REQUIRES_SUPER; |
31 | 34 |
32 @end | 35 @end |
33 | 36 |
34 #endif // IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_CELLS_COLLECTION_VIEW_ITEM_H_ | 37 #endif // IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_CELLS_COLLECTION_VIEW_ITEM_H_ |
OLD | NEW |