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_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_ARTICLE_IT
EM_H_ | |
6 #define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_ARTICLE_IT
EM_H_ | |
7 | |
8 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" | |
9 #import "ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion
_identifier.h" | |
10 #import "ios/third_party/material_components_ios/src/components/CollectionCells/
src/MaterialCollectionCells.h" | |
11 | |
12 namespace base { | |
13 class Time; | |
14 } | |
15 | |
16 @class ContentSuggestionsArticleItem; | |
17 class GURL; | |
18 | |
19 // Delegate for a ContentSuggestionsArticleItem. | |
20 @protocol ContentSuggestionsArticleItemDelegate | |
21 | |
22 // Loads the image associated with this item. | |
23 - (void)loadImageForArticleItem:(ContentSuggestionsArticleItem*)articleItem; | |
24 | |
25 @end | |
26 | |
27 // Item for an article in the suggestions. | |
28 @interface ContentSuggestionsArticleItem | |
29 : CollectionViewItem<ContentSuggestionIdentification> | |
30 | |
31 // Initialize an article with a |title|, a |subtitle|, an |image| and the |url| | |
32 // to the full article. |type| is the type of the item. | |
33 - (instancetype)initWithType:(NSInteger)type | |
34 title:(NSString*)title | |
35 subtitle:(NSString*)subtitle | |
36 delegate:(id<ContentSuggestionsArticleItemDelegate>)delegate | |
37 url:(const GURL&)url NS_DESIGNATED_INITIALIZER; | |
38 | |
39 - (instancetype)initWithType:(NSInteger)type NS_UNAVAILABLE; | |
40 | |
41 @property(nonatomic, copy, readonly) NSString* title; | |
42 @property(nonatomic, strong) UIImage* image; | |
43 @property(nonatomic, readonly, assign) GURL articleURL; | |
44 @property(nonatomic, copy) NSString* publisher; | |
45 @property(nonatomic, assign) base::Time publishDate; | |
46 @property(nonatomic, weak) id<ContentSuggestionsArticleItemDelegate> delegate; | |
47 | |
48 @end | |
49 | |
50 // Corresponding cell for an article in the suggestions. | |
51 @interface ContentSuggestionsArticleCell : MDCCollectionViewCell | |
52 | |
53 @property(nonatomic, readonly, strong) UILabel* titleLabel; | |
54 @property(nonatomic, readonly, strong) UILabel* subtitleLabel; | |
55 @property(nonatomic, readonly, strong) UIImageView* imageView; | |
56 | |
57 - (void)setPublisherName:(NSString*)publisherName date:(base::Time)publishDate; | |
58 | |
59 @end | |
60 | |
61 #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_ARTICLE
_ITEM_H_ | |
OLD | NEW |