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_IDENTIFIER_CONTENT_SUGGESTIONS
_SECTION_INFORMATION_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_IDENTIFIER_CONTENT_SUGGESTIONS
_SECTION_INFORMATION_H_ |
6 #define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_IDENTIFIER_CONTENT_SUGGESTIONS
_SECTION_INFORMATION_H_ | 6 #define IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_IDENTIFIER_CONTENT_SUGGESTIONS
_SECTION_INFORMATION_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 // Layout for the section and its items. | 10 // Layout for the section and its items. |
11 typedef NS_ENUM(NSInteger, ContentSuggestionsSectionLayout) { | 11 typedef NS_ENUM(NSInteger, ContentSuggestionsSectionLayout) { |
12 // Follows the card layout. | 12 // Follows the card layout. |
13 ContentSuggestionsSectionLayoutCard, | 13 ContentSuggestionsSectionLayoutCard, |
14 // No specific layout. | 14 // No specific layout. |
15 ContentSuggestionsSectionLayoutCustom, | 15 ContentSuggestionsSectionLayoutCustom, |
16 }; | 16 }; |
17 | 17 |
18 // This enum is used for ordering the sections and as ID for the section. Make | 18 // This enum is used for ordering the sections and as ID for the section. Make |
19 // all sections in the same collection have different ID. | 19 // all sections in the same collection have different ID. |
20 // When adding a new kind of suggestions, add a new corresponding section. The | 20 // When adding a new kind of suggestions, add a new corresponding section. The |
21 // ordering is not persisted between launch, reordering is possible. | 21 // ordering is not persisted between launch, reordering is possible. |
22 typedef NS_ENUM(NSInteger, ContentSuggestionsSectionID) { | 22 typedef NS_ENUM(NSInteger, ContentSuggestionsSectionID) { |
23 ContentSuggestionsSectionBookmarks = 0, | 23 ContentSuggestionsSectionArticles = 0, |
24 ContentSuggestionsSectionArticles = 1, | 24 ContentSuggestionsSectionReadingList, |
25 ContentSuggestionsSectionReadingList = 2, | |
26 | 25 |
27 // Do not use this. It will trigger a DCHECK. | 26 // Do not use this. It will trigger a DCHECK. |
28 // Do not add value after this one. | 27 // Do not add value after this one. |
29 ContentSuggestionsSectionUnknown | 28 ContentSuggestionsSectionUnknown |
30 }; | 29 }; |
31 | 30 |
32 // Contains the information needed to display the section. | 31 // Contains the information needed to display the section. |
33 @interface ContentSuggestionsSectionInformation : NSObject | 32 @interface ContentSuggestionsSectionInformation : NSObject |
34 | 33 |
35 - (instancetype)initWithSectionID:(ContentSuggestionsSectionID)sectionID | 34 - (instancetype)initWithSectionID:(ContentSuggestionsSectionID)sectionID |
(...skipping 11 matching lines...) Expand all Loading... |
47 // Text to be displayed when the section is empty. | 46 // Text to be displayed when the section is empty. |
48 @property(nonatomic, copy) NSString* emptyText; | 47 @property(nonatomic, copy) NSString* emptyText; |
49 // If the section should be shown when empty at loading. If the section becomes | 48 // If the section should be shown when empty at loading. If the section becomes |
50 // empty because the user dismissed suggestions, the |emptyText| must be shown | 49 // empty because the user dismissed suggestions, the |emptyText| must be shown |
51 // in both cases. | 50 // in both cases. |
52 @property(nonatomic, assign) BOOL showIfEmpty; | 51 @property(nonatomic, assign) BOOL showIfEmpty; |
53 | 52 |
54 @end | 53 @end |
55 | 54 |
56 #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_IDENTIFIER_CONTENT_SUGGESTI
ONS_SECTION_INFORMATION_H_ | 55 #endif // IOS_CHROME_BROWSER_UI_CONTENT_SUGGESTIONS_IDENTIFIER_CONTENT_SUGGESTI
ONS_SECTION_INFORMATION_H_ |
OLD | NEW |