1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45

content / shell / browser / bluetooth / ios / shell_bluetooth_device_list_view_controller.h [blame]

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

#ifndef CONTENT_SHELL_BROWSER_BLUETOOTH_IOS_SHELL_BLUETOOTH_DEVICE_LIST_VIEW_CONTROLLER_H_
#define CONTENT_SHELL_BROWSER_BLUETOOTH_IOS_SHELL_BLUETOOTH_DEVICE_LIST_VIEW_CONTROLLER_H_

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#import "content/shell/browser/bluetooth/ios/shell_bluetooth_device_list_consumer.h"

@class DeviceInfo;

@protocol ShellBluetoothDeviceListDelegate;

// The ViewController that has UITableView to show the bluetooth device list.
@interface ShellDeviceListViewController
    : UITableViewController <ShellBluetoothDeviceListConsumer,
                             UIPopoverPresentationControllerDelegate>

// The view controller this coordinator was initialized with.
@property(weak, nonatomic, readonly) UIViewController* baseViewController;

// Has device IDs according to cell index. It's used to get a device ID when a
// cell index is known.
@property(nonatomic, strong) NSMutableArray<NSString*>* deviceIDs;

// Has device information. It's used to get a device information such as a
// device name when a device ID is known.
@property(nonatomic, strong)
    NSMutableDictionary<NSString*, DeviceInfo*>* deviceInfos;

@property(nonatomic, assign) NSInteger selectedRowIndex;

@property(nonatomic, copy) NSString* listTitle;

// Delegate used to handle the device list.
@property(nonatomic, weak) id<ShellBluetoothDeviceListDelegate> listDelegate;

- (instancetype)initWithTitle:(NSString*)title;

- (void)updateSelectedInformation:(bool)selected;
@end
#endif  // CONTENT_SHELL_BROWSER_BLUETOOTH_IOS_SHELL_BLUETOOTH_DEVICE_LIST_VIEW_CONTROLLER_H_