chromium/out/Default/gen/extensions/common/api/bluetooth.h

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

// GENERATED FROM THE API DEFINITION IN
//   extensions/common/api/bluetooth.idl
// by tools/json_schema_compiler.
// DO NOT EDIT.

#ifndef EXTENSIONS_COMMON_API_BLUETOOTH_H__
#define EXTENSIONS_COMMON_API_BLUETOOTH_H__

#include <stdint.h>

#include <map>
#include <memory>
#include <optional>
#include <string>
#include <vector>

#include "base/values.h"
#include <string_view>


namespace extensions {
namespace api {
namespace bluetooth {

//
// Types
//

// Allocation authorities for Vendor IDs.
enum class VendorIdSource {};


const char* ToString(VendorIdSource as_enum);
VendorIdSource ParseVendorIdSource(std::string_view as_string);
std::u16string GetVendorIdSourceParseError(std::string_view as_string);

// Common device types recognized by Chrome.
enum class DeviceType {};


const char* ToString(DeviceType as_enum);
DeviceType ParseDeviceType(std::string_view as_string);
std::u16string GetDeviceTypeParseError(std::string_view as_string);

// Types for filtering bluetooth devices.
enum class FilterType {};


const char* ToString(FilterType as_enum);
FilterType ParseFilterType(std::string_view as_string);
std::u16string GetFilterTypeParseError(std::string_view as_string);

// Transport type of the bluetooth device.
enum class Transport {};


const char* ToString(Transport as_enum);
Transport ParseTransport(std::string_view as_string);
std::u16string GetTransportParseError(std::string_view as_string);

struct AdapterState {};

struct Device {};

struct BluetoothFilter {};


//
// Functions
//

namespace GetAdapterState {

namespace Results {

// Object containing the adapter information.
base::Value::List Create(const AdapterState& adapter_info);
}  // namespace Results

}  // namespace GetAdapterState

namespace GetDevice {

struct Params {};

namespace Results {

// Object containing the device information.
base::Value::List Create(const Device& device_info);
}  // namespace Results

}  // namespace GetDevice

namespace GetDevices {

struct Params {};

namespace Results {

// Array of object containing device information.
base::Value::List Create(const std::vector<Device>& device_infos);
}  // namespace Results

}  // namespace GetDevices

namespace StartDiscovery {

namespace Results {

base::Value::List Create();
}  // namespace Results

}  // namespace StartDiscovery

namespace StopDiscovery {

namespace Results {

base::Value::List Create();
}  // namespace Results

}  // namespace StopDiscovery

//
// Events
//

namespace OnAdapterStateChanged {

extern const char kEventName[];  // "bluetooth.onAdapterStateChanged"

// The new state of the adapter.
base::Value::List Create(const AdapterState& state);
}  // namespace OnAdapterStateChanged

namespace OnDeviceAdded {

extern const char kEventName[];  // "bluetooth.onDeviceAdded"

base::Value::List Create(const Device& device);
}  // namespace OnDeviceAdded

namespace OnDeviceChanged {

extern const char kEventName[];  // "bluetooth.onDeviceChanged"

base::Value::List Create(const Device& device);
}  // namespace OnDeviceChanged

namespace OnDeviceRemoved {

extern const char kEventName[];  // "bluetooth.onDeviceRemoved"

base::Value::List Create(const Device& device);
}  // namespace OnDeviceRemoved

}  // namespace bluetooth
}  // namespace api
}  // namespace extensions

#endif  // EXTENSIONS_COMMON_API_BLUETOOTH_H__