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

#ifndef EXTENSIONS_COMMON_API_HID_H__
#define EXTENSIONS_COMMON_API_HID_H__

#include <stdint.h>

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

#include "base/values.h"

namespace extensions {
namespace api {
namespace hid {

//
// Types
//

struct HidCollectionInfo {};

struct HidDeviceInfo {};

struct HidConnectInfo {};

struct DeviceFilter {};

struct GetDevicesOptions {};


//
// Functions
//

namespace GetDevices {

struct Params {};

namespace Results {

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

}  // namespace GetDevices

namespace Connect {

struct Params {};

namespace Results {

base::Value::List Create(const HidConnectInfo& connection);
}  // namespace Results

}  // namespace Connect

namespace Disconnect {

struct Params {};

namespace Results {

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

}  // namespace Disconnect

namespace Receive {

struct Params {};

namespace Results {

// The report ID or <code>0</code> if none.
// The report data, the report ID prefix (if present) is removed.
base::Value::List Create(int report_id, const std::vector<uint8_t>& data);
}  // namespace Results

}  // namespace Receive

namespace Send {

struct Params {};

namespace Results {

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

}  // namespace Send

namespace ReceiveFeatureReport {

struct Params {};

namespace Results {

// The report data, including a report ID prefix if one is sent by the device.
base::Value::List Create(const std::vector<uint8_t>& data);
}  // namespace Results

}  // namespace ReceiveFeatureReport

namespace SendFeatureReport {

struct Params {};

namespace Results {

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

}  // namespace SendFeatureReport

//
// Events
//

namespace OnDeviceAdded {

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

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

namespace OnDeviceRemoved {

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

// The <code>deviceId</code> property of the device passed to
// $(ref:onDeviceAdded).
base::Value::List Create(int device_id);
}  // namespace OnDeviceRemoved

}  // namespace hid
}  // namespace api
}  // namespace extensions

#endif  // EXTENSIONS_COMMON_API_HID_H__