chromium/out/Default/gen/extensions/common/api/bluetooth_socket.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_socket.idl
// by tools/json_schema_compiler.
// DO NOT EDIT.

#ifndef EXTENSIONS_COMMON_API_BLUETOOTH_SOCKET_H__
#define EXTENSIONS_COMMON_API_BLUETOOTH_SOCKET_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_socket {

//
// Types
//

struct SocketProperties {};

struct CreateInfo {};

struct ListenOptions {};

struct SocketInfo {};

struct AcceptInfo {};

enum class AcceptError {};


const char* ToString(AcceptError as_enum);
AcceptError ParseAcceptError(std::string_view as_string);
std::u16string GetAcceptErrorParseError(std::string_view as_string);

struct AcceptErrorInfo {};

struct ReceiveInfo {};

enum class ReceiveError {};


const char* ToString(ReceiveError as_enum);
ReceiveError ParseReceiveError(std::string_view as_string);
std::u16string GetReceiveErrorParseError(std::string_view as_string);

struct ReceiveErrorInfo {};


//
// Functions
//

namespace Create {

struct Params {};

namespace Results {

// The result of the socket creation.
base::Value::List Create(const CreateInfo& create_info);
}  // namespace Results

}  // namespace Create

namespace Update {

struct Params {};

namespace Results {

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

}  // namespace Update

namespace SetPaused {

struct Params {};

namespace Results {

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

}  // namespace SetPaused

namespace ListenUsingRfcomm {

struct Params {};

namespace Results {

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

}  // namespace ListenUsingRfcomm

namespace ListenUsingL2cap {

struct Params {};

namespace Results {

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

}  // namespace ListenUsingL2cap

namespace Connect {

struct Params {};

namespace Results {

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

}  // namespace Connect

namespace Disconnect {

struct Params {};

namespace Results {

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

}  // namespace Disconnect

namespace Close {

struct Params {};

namespace Results {

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

}  // namespace Close

namespace Send {

struct Params {};

namespace Results {

// The number of bytes sent.
base::Value::List Create(int bytes_sent);
}  // namespace Results

}  // namespace Send

namespace GetInfo {

struct Params {};

namespace Results {

// Object containing the socket information.
base::Value::List Create(const SocketInfo& socket_info);
}  // namespace Results

}  // namespace GetInfo

namespace GetSockets {

namespace Results {

base::Value::List Create(const std::vector<SocketInfo>& sockets);
}  // namespace Results

}  // namespace GetSockets

//
// Events
//

namespace OnAccept {

extern const char kEventName[];  // "bluetoothSocket.onAccept"

// The event data.
base::Value::List Create(const AcceptInfo& info);
}  // namespace OnAccept

namespace OnAcceptError {

extern const char kEventName[];  // "bluetoothSocket.onAcceptError"

// The event data.
base::Value::List Create(const AcceptErrorInfo& info);
}  // namespace OnAcceptError

namespace OnReceive {

extern const char kEventName[];  // "bluetoothSocket.onReceive"

// The event data.
base::Value::List Create(const ReceiveInfo& info);
}  // namespace OnReceive

namespace OnReceiveError {

extern const char kEventName[];  // "bluetoothSocket.onReceiveError"

// The event data.
base::Value::List Create(const ReceiveErrorInfo& info);
}  // namespace OnReceiveError

}  // namespace bluetooth_socket
}  // namespace api
}  // namespace extensions

#endif  // EXTENSIONS_COMMON_API_BLUETOOTH_SOCKET_H__