1 // Copyright 2018 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_AUTHENTICATION_CELLS_TABLE_VIEW_ACCOUNT_ITEM_H_
6 #define IOS_CHROME_BROWSER_UI_AUTHENTICATION_CELLS_TABLE_VIEW_ACCOUNT_ITEM_H_
7 
8 #import <UIKit/UIKit.h>
9 
10 #import "ios/chrome/browser/ui/table_view/cells/table_view_item.h"
11 
12 @class ChromeIdentity;
13 
14 typedef NS_ENUM(NSInteger, TableViewAccountMode) {
15   // The cell can be tappable, and the colors are not dimmed.
16   TableViewAccountModeEnabled,
17   // The cell is not tappable, and the colors are not dimmed.
18   TableViewAccountModeNonTappable,
19   // The cell is not tappable, and the colors are dimmed.
20   TableViewAccountModeDisabled,
21 };
22 
23 // Item for account avatar, used everywhere an account cell is shown.
24 @interface TableViewAccountItem : TableViewItem
25 
26 @property(nonatomic, strong) UIImage* image;
27 @property(nonatomic, copy) NSString* text;
28 @property(nonatomic, copy) NSString* detailText;
29 @property(nonatomic, assign) BOOL shouldDisplayError;
30 @property(nonatomic, strong) ChromeIdentity* chromeIdentity;
31 // The default value is TableViewAccountModeEnabled.
32 @property(nonatomic, assign) TableViewAccountMode mode;
33 
34 @end
35 
36 // Cell for account avatar with a leading avatar imageView, title text label,
37 // and detail text label. This looks very similar to the
38 // TableViewDetailCell, except that it applies a circular mask to the
39 // imageView. The imageView is vertical-centered and leading aligned.
40 // If item/cell is disabled the image and text alpha will be set to 0.5 and
41 // user interaction will be disabled.
42 @interface TableViewAccountCell : TableViewCell
43 
44 // Rounded image used for the account user picture.
45 @property(nonatomic, readonly, strong) UIImageView* imageView;
46 // Cell title.
47 @property(nonatomic, readonly, strong) UILabel* textLabel;
48 // Cell subtitle.
49 @property(nonatomic, readonly, strong) UILabel* detailTextLabel;
50 // Error icon that will be displayed on the left side of the cell.
51 @property(nonatomic, readonly, strong) UIImageView* errorIcon;
52 
53 @end
54 
55 #endif  // IOS_CHROME_BROWSER_UI_AUTHENTICATION_CELLS_TABLE_VIEW_ACCOUNT_ITEM_H_
56