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