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

#ifndef CHROME_COMMON_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_H__
#define CHROME_COMMON_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_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 image_writer_private {

//
// Types
//

// <p>The different stages of a write call.</p><p><dl>    <dt>confirmation</dt>
// <dd>The process starts by prompting the user for confirmation.</dd>
// <dt>download</dt>    <dd>The image file is being download if a remote image
// was    requested.</dd>    <dt>verifyDownload</dt>    <dd>The download is
// being verified to match the image hash, if    provided</dd>    <dt>unzip</dt>
// <dd>The image is being extracted from the downloaded zip file</dd>
// <dt>write</dt>    <dd>The image is being written to disk.</dd>
// <dt>verifyWrite</dt>    <dt>The system is verifying that the written image
// matches the    downloaded image.</dd> <dl></p>
enum class Stage {};


const char* ToString(Stage as_enum);
Stage ParseStage(std::string_view as_string);
std::u16string GetStageParseError(std::string_view as_string);

struct UrlWriteOptions {};

struct ProgressInfo {};

struct RemovableStorageDevice {};


//
// Functions
//

namespace WriteFromUrl {

struct Params {};

namespace Results {

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

}  // namespace WriteFromUrl

namespace WriteFromFile {

struct Params {};

namespace Results {

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

}  // namespace WriteFromFile

namespace CancelWrite {

namespace Results {

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

}  // namespace CancelWrite

namespace DestroyPartitions {

struct Params {};

namespace Results {

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

}  // namespace DestroyPartitions

namespace ListRemovableStorageDevices {

namespace Results {

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

}  // namespace ListRemovableStorageDevices

//
// Events
//

namespace OnWriteProgress {

extern const char kEventName[];  // "imageWriterPrivate.onWriteProgress"

base::Value::List Create(const ProgressInfo& info);
}  // namespace OnWriteProgress

namespace OnWriteComplete {

extern const char kEventName[];  // "imageWriterPrivate.onWriteComplete"

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

namespace OnWriteError {

extern const char kEventName[];  // "imageWriterPrivate.onWriteError"

base::Value::List Create(const ProgressInfo& info, const std::string& error);
}  // namespace OnWriteError

namespace OnDeviceInserted {

extern const char kEventName[];  // "imageWriterPrivate.onDeviceInserted"

base::Value::List Create(const RemovableStorageDevice& device);
}  // namespace OnDeviceInserted

namespace OnDeviceRemoved {

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

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

}  // namespace image_writer_private
}  // namespace api
}  // namespace extensions

#endif  // CHROME_COMMON_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_H__