#ifndef ASH_SYSTEM_BLUETOOTH_BLUETOOTH_DETAILED_VIEW_H_
#define ASH_SYSTEM_BLUETOOTH_BLUETOOTH_DETAILED_VIEW_H_
#include <memory>
#include "ash/ash_export.h"
#include "base/memory/raw_ptr.h"
#include "chromeos/ash/services/bluetooth_config/public/mojom/cros_bluetooth_config.mojom.h"
#include "ui/gfx/vector_icon_types.h"
namespace views {
class View;
}
namespace ash {
class BluetoothDeviceListItemView;
class DetailedViewDelegate;
class ASH_EXPORT BluetoothDetailedView {
public:
class Delegate {
public:
Delegate() = default;
virtual ~Delegate() = default;
virtual void OnToggleClicked(bool new_state) = 0;
virtual void OnPairNewDeviceRequested() = 0;
virtual void OnDeviceListItemSelected(
const bluetooth_config::mojom::PairedBluetoothDevicePropertiesPtr&
device) = 0;
};
class Factory {
public:
Factory(const Factory&) = delete;
const Factory& operator=(const Factory&) = delete;
virtual ~Factory() = default;
static std::unique_ptr<BluetoothDetailedView> Create(
DetailedViewDelegate* detailed_view_delegate,
Delegate* delegate);
static void SetFactoryForTesting(Factory* test_factory);
protected:
Factory() = default;
virtual std::unique_ptr<BluetoothDetailedView> CreateForTesting(
Delegate* delegate) = 0;
};
BluetoothDetailedView(const BluetoothDetailedView&) = delete;
BluetoothDetailedView& operator=(const BluetoothDetailedView&) = delete;
virtual ~BluetoothDetailedView() = default;
virtual views::View* GetAsView() = 0;
virtual void UpdateBluetoothEnabledState(
const bluetooth_config::mojom::BluetoothSystemState system_state) = 0;
virtual BluetoothDeviceListItemView* AddDeviceListItem() = 0;
virtual views::View* AddDeviceListSubHeader(const gfx::VectorIcon& icon,
int text_id) = 0;
virtual void NotifyDeviceListChanged() = 0;
virtual views::View* device_list() = 0;
protected:
explicit BluetoothDetailedView(Delegate* delegate);
Delegate* delegate() { return delegate_; }
private:
raw_ptr<Delegate> delegate_;
};
}
#endif