chromium/extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.h

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

#ifndef EXTENSIONS_BROWSER_API_VIRTUAL_KEYBOARD_PRIVATE_VIRTUAL_KEYBOARD_PRIVATE_API_H_
#define EXTENSIONS_BROWSER_API_VIRTUAL_KEYBOARD_PRIVATE_VIRTUAL_KEYBOARD_PRIVATE_API_H_

#include <memory>
#include <optional>
#include <vector>

#include "base/memory/raw_ptr.h"
#include "base/values.h"
#include "build/chromeos_buildflags.h"
#include "extensions/browser/api/virtual_keyboard_private/virtual_keyboard_delegate.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
#include "extensions/browser/extension_function.h"

namespace ash {
class ClipboardHistoryItem;
}

namespace content {
class BrowserContext;
}

namespace extensions {

class VirtualKeyboardDelegate;

class VirtualKeyboardPrivateFunction : public ExtensionFunction {};

class VirtualKeyboardPrivateInsertTextFunction
    : public VirtualKeyboardPrivateFunction {};

class VirtualKeyboardPrivateSendKeyEventFunction
    : public VirtualKeyboardPrivateFunction {};

class VirtualKeyboardPrivateHideKeyboardFunction
    : public VirtualKeyboardPrivateFunction {};

class VirtualKeyboardPrivateSetHotrodKeyboardFunction
    : public VirtualKeyboardPrivateFunction {};

class VirtualKeyboardPrivateLockKeyboardFunction
    : public VirtualKeyboardPrivateFunction {};

class VirtualKeyboardPrivateKeyboardLoadedFunction
    : public VirtualKeyboardPrivateFunction {};

class VirtualKeyboardPrivateGetKeyboardConfigFunction
    : public VirtualKeyboardPrivateFunction {};

class VirtualKeyboardPrivateOpenSettingsFunction
    : public VirtualKeyboardPrivateFunction {};

class VirtualKeyboardPrivateOpenSuggestionSettingsFunction
    : public VirtualKeyboardPrivateFunction {};

class VirtualKeyboardPrivateSetContainerBehaviorFunction
    : public VirtualKeyboardPrivateFunction {};

class VirtualKeyboardPrivateSetDraggableAreaFunction
    : public VirtualKeyboardPrivateFunction {};

class VirtualKeyboardPrivateSetKeyboardStateFunction
    : public VirtualKeyboardPrivateFunction {};

class VirtualKeyboardPrivateSetOccludedBoundsFunction
    : public VirtualKeyboardPrivateFunction {};

class VirtualKeyboardPrivateSetHitTestBoundsFunction
    : public VirtualKeyboardPrivateFunction {};

class VirtualKeyboardPrivateSetAreaToRemainOnScreenFunction
    : public VirtualKeyboardPrivateFunction {};

class VirtualKeyboardPrivateSetWindowBoundsInScreenFunction
    : public VirtualKeyboardPrivateFunction {};

#if BUILDFLAG(IS_CHROMEOS_ASH)
class VirtualKeyboardPrivateGetClipboardHistoryFunction
    : public VirtualKeyboardPrivateFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("virtualKeyboardPrivate.getClipboardHistory",
                             VIRTUALKEYBOARDPRIVATE_GETCLIPBOARDHISTORY)

 protected:
  ~VirtualKeyboardPrivateGetClipboardHistoryFunction() override;

  // ExtensionFunction:
  ResponseAction Run() override;

 private:
  void OnGetClipboardHistory(
      std::vector<ash::ClipboardHistoryItem> history_items);

  using ClipboardItems =
      std::vector<extensions::api::virtual_keyboard_private::ClipboardItem>;
  void OnClipboardHistoryItemsConverted(std::unique_ptr<ClipboardItems> items);
};

class VirtualKeyboardPrivatePasteClipboardItemFunction
    : public VirtualKeyboardPrivateFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("virtualKeyboardPrivate.pasteClipboardItem",
                             VIRTUALKEYBOARDPRIVATE_PASTECLIPBOARDITEM)

 protected:
  ~VirtualKeyboardPrivatePasteClipboardItemFunction() override;

  // ExtensionFunction:
  ResponseAction Run() override;
};

class VirtualKeyboardPrivateDeleteClipboardItemFunction
    : public VirtualKeyboardPrivateFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("virtualKeyboardPrivate.deleteClipboardItem",
                             VIRTUALKEYBOARDPRIVATE_DELETECLIPBOARDITEM)

 protected:
  ~VirtualKeyboardPrivateDeleteClipboardItemFunction() override;

  // ExtensionFunction:
  ResponseAction Run() override;
};
#endif  // BUILDFLAG(IS_CHROMEOS_ASH)

class VirtualKeyboardDelegate;

class VirtualKeyboardAPI : public BrowserContextKeyedAPI {};

}  // namespace extensions

#endif  // EXTENSIONS_BROWSER_API_VIRTUAL_KEYBOARD_PRIVATE_VIRTUAL_KEYBOARD_PRIVATE_API_H_