// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef IOS_CHROME_BROWSER_SETTINGS_MANAGE_SYNC_UI_MANAGE_SYNC_SETTINGS_CONSUMER_H_
#define IOS_CHROME_BROWSER_SETTINGS_MANAGE_SYNC_UI_MANAGE_SYNC_SETTINGS_CONSUMER_H_

#import <UIKit/UIKit.h>

#import "ios/chrome/browser/shared/ui/table_view/table_view_model.h"

// Consumer protocol for manage sync settings.
@protocol ManageSyncSettingsConsumer <NSObject>

// Returns the table view model.
@property(nonatomic, strong, readonly)
    TableViewModel<TableViewItem*>* tableViewModel;

// Inserts sections at `sections` indexes. Does nothing if the model is not
// loaded yet.
- (void)insertSections:(NSIndexSet*)sections rowAnimation:(BOOL)rowAnimation;

// Deletes sections at `sections` indexes. Does nothing if the model is not
// loaded yet.
- (void)deleteSections:(NSIndexSet*)section rowAnimation:(BOOL)rowAnimation;

// Reloads only a specific `item`. Does nothing if the model is not loaded
// yet.
- (void)reloadItem:(TableViewItem*)item;

// Reloads `sections`. Does nothing if the model is not loaded yet.
- (void)reloadSections:(NSIndexSet*)sections;

// Updates the primary account details. `name` and `managementDescription` can
// be nil, `avatarImage` and `email` can’t.
- (void)updatePrimaryAccountWithAvatarImage:(UIImage*)avatarImage
                                       name:(NSString*)name
                                      email:(NSString*)email
                      managementDescription:(NSString*)managementDescription;

// Shows the managed UI info bubble for the `button`.
- (void)showManagedUIInfoForButton:(UIButton*)button;

// Reloads the table view from the current model state without rebuilding
// the model itself.
- (void)reloadTableData;

@end

#endif  // IOS_CHROME_BROWSER_SETTINGS_MANAGE_SYNC_UI_MANAGE_SYNC_SETTINGS_CONSUMER_H_
