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

#ifndef CHROME_COMMON_EXTENSIONS_API_WINDOWS_H__
#define CHROME_COMMON_EXTENSIONS_API_WINDOWS_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 tabs {
struct Tab;
}  // namespace tabs
}  // namespace api
}  // namespace extensions

namespace extensions {
namespace api {
namespace windows {

//
// Properties
//

// The windowId value that represents the absence of a Chrome browser window.
extern const int WINDOW_ID_NONE;

// The windowId value that represents the <a href='#the_current_window'>current
// window</a>.
extern const int WINDOW_ID_CURRENT;

//
// Types
//

// The type of browser window this is. In some circumstances a window may not be
// assigned a <code>type</code> property; for example, when querying closed
// windows from the $(ref:sessions) API.
enum class WindowType {};


const char* ToString(WindowType as_enum);
WindowType ParseWindowType(std::string_view as_string);
std::u16string GetWindowTypeParseError(std::string_view as_string);

// The state of this browser window. In some circumstances a window may not be
// assigned a <code>state</code> property; for example, when querying closed
// windows from the $(ref:sessions) API.
enum class WindowState {};


const char* ToString(WindowState as_enum);
WindowState ParseWindowState(std::string_view as_string);
std::u16string GetWindowStateParseError(std::string_view as_string);

struct Window {};

// Specifies what type of browser window to create. 'panel' is deprecated and is
// available only to existing allowlisted extensions on Chrome OS.
enum class CreateType {};


const char* ToString(CreateType as_enum);
CreateType ParseCreateType(std::string_view as_string);
std::u16string GetCreateTypeParseError(std::string_view as_string);

struct QueryOptions {};


//
// Functions
//

namespace Get {

struct Params {};

namespace Results {

base::Value::List Create(const Window& window);
}  // namespace Results

}  // namespace Get

namespace GetCurrent {

struct Params {};

namespace Results {

base::Value::List Create(const Window& window);
}  // namespace Results

}  // namespace GetCurrent

namespace GetLastFocused {

struct Params {};

namespace Results {

base::Value::List Create(const Window& window);
}  // namespace Results

}  // namespace GetLastFocused

namespace GetAll {

struct Params {};

namespace Results {

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

}  // namespace GetAll

namespace Create {

struct Params {};

namespace Results {

// Contains details about the created window.
base::Value::List Create(const Window& window);
}  // namespace Results

}  // namespace Create

namespace Update {

struct Params {};

namespace Results {

base::Value::List Create(const Window& window);
}  // namespace Results

}  // namespace Update

namespace Remove {

struct Params {};

namespace Results {

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

}  // namespace Remove

//
// Events
//

namespace OnCreated {

extern const char kEventName[];  // "windows.onCreated"

// Details of the created window.
base::Value::List Create(const Window& window);
}  // namespace OnCreated

namespace OnRemoved {

extern const char kEventName[];  // "windows.onRemoved"

// ID of the removed window.
base::Value::List Create(int window_id);
}  // namespace OnRemoved

namespace OnFocusChanged {

extern const char kEventName[];  // "windows.onFocusChanged"

// ID of the newly-focused window.
base::Value::List Create(int window_id);
}  // namespace OnFocusChanged

namespace OnBoundsChanged {

extern const char kEventName[];  // "windows.onBoundsChanged"

// Details of the window. The tabs will not be populated for the window.
base::Value::List Create(const Window& window);
}  // namespace OnBoundsChanged

}  // namespace windows
}  // namespace api
}  // namespace extensions

#endif  // CHROME_COMMON_EXTENSIONS_API_WINDOWS_H__