blob: 7f229582b4c50830f69a1fba59df9c90eae346ee [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/ui/popup_menu/public/popup_menu_consumer.h"
#import "ios/chrome/browser/ui/table_view/chrome_table_view_controller.h"
@protocol PopupMenuItem;
@protocol PopupMenuTableViewControllerDelegate;
// TableViewController for the popup menu.
@interface PopupMenuTableViewController
: ChromeTableViewController <PopupMenuConsumer>
// Delegate for this consumer.
@property(nonatomic, weak) id<PopupMenuTableViewControllerDelegate> delegate;
// The model of this controller.
@property(nonatomic, readonly, strong)
TableViewModel<TableViewItem<PopupMenuItem>*>* tableViewModel;
// Presenting ViewController for the ViewController needing to be presented as
// result of an interaction with the popup.
@property(nonatomic, weak) UIViewController* baseViewController;
// Initializers.
- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithTableViewStyle:(UITableViewStyle)style
// Selects the row at |point|. This is the same as tapping the row. Point must
// be in window base coordinates.
- (void)selectRowAtPoint:(CGPoint)point;
// Focuses the row at |point|. This adds an highlight to the row. Point must be
// in window base coordinates.
- (void)focusRowAtPoint:(CGPoint)point;