cef/libcef_dll/ctocpp/browser_host_ctocpp.h

140 lines
6.3 KiB
C
Raw Normal View History

// Copyright (c) 2021 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=95928a6e1311ff0406b502076defccc441d0b57c$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_
#define CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_
#pragma once
#if !defined(WRAPPING_CEF_SHARED)
#error This file can be included wrapper-side only
#endif
#include <vector>
#include "include/capi/cef_browser_capi.h"
#include "include/capi/cef_client_capi.h"
#include "include/cef_browser.h"
#include "include/cef_client.h"
#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefBrowserHostCToCpp : public CefCToCppRefCounted<CefBrowserHostCToCpp,
CefBrowserHost,
cef_browser_host_t> {
public:
CefBrowserHostCToCpp();
virtual ~CefBrowserHostCToCpp();
// CefBrowserHost methods.
CefRefPtr<CefBrowser> GetBrowser() OVERRIDE;
void CloseBrowser(bool force_close) OVERRIDE;
Implement Views framework on Windows and Linux (issue #1749). - Add Views header files in a new include/views directory. - Add initial top-level window (CefWindow), control (CefBrowserView, CefLabelButton, CefMenuButton, CefPanel, CefScrollView, CefTextfield) and layout (CefBoxLayout, CefFlowLayout) support. See libcef/browser/views/view_impl.h comments for implementation details. - Add Views example usage in cefclient and cefsimple and Views unit tests in cef_unittests. Pass the `--use-views` command-line flag to cefclient, cefsimple and cef_unittests to run using the Views framework instead of platform APIs. For cefclient and cefsimple this will create the browser window and all related functionality using the Views framework. For cef_unittests this will run all tests (except OSR tests) in a Views-based browser window. Views- specific unit tests (`--gtest_filter=Views*`) will be run even if the the `--use-views` flag is not specified. - Pass the `--hide-frame` command-line flag to cefclient to demo a frameless Views-based browser window. - Pass the `--hide-controls` command-line flag to cefclient to demo a browser window without top controls. This also works in non-Views mode. - Pass the `--enable-high-dpi-support` command-line flag to cef_unittests on Windows to test high-DPI support on a display that supports it. - Add CefImage for reading/writing image file formats. - Add CefBrowser::DownloadImage() for downloading image URLs as a CefImage representation. This is primarily for loading favicons. - Add CefMenuModel::CreateMenuModel() and CefMenuModelDelegate for creating custom menus. This is primarily for use with CefMenuButton. - Add CefBrowser::TryCloseBrowser() helper for closing a browser. Also improve related documentation in cef_life_span_handler.h. - Rename cef_page_range_t to cef_range_t. It is now also used by CefTextfield. - Remove CefLifeSpanHandler::RunModal() which is never called. - Add draggable regions example to cefclient.
2016-01-19 21:09:01 +01:00
bool TryCloseBrowser() OVERRIDE;
void SetFocus(bool focus) OVERRIDE;
CefWindowHandle GetWindowHandle() OVERRIDE;
CefWindowHandle GetOpenerWindowHandle() OVERRIDE;
Implement Views framework on Windows and Linux (issue #1749). - Add Views header files in a new include/views directory. - Add initial top-level window (CefWindow), control (CefBrowserView, CefLabelButton, CefMenuButton, CefPanel, CefScrollView, CefTextfield) and layout (CefBoxLayout, CefFlowLayout) support. See libcef/browser/views/view_impl.h comments for implementation details. - Add Views example usage in cefclient and cefsimple and Views unit tests in cef_unittests. Pass the `--use-views` command-line flag to cefclient, cefsimple and cef_unittests to run using the Views framework instead of platform APIs. For cefclient and cefsimple this will create the browser window and all related functionality using the Views framework. For cef_unittests this will run all tests (except OSR tests) in a Views-based browser window. Views- specific unit tests (`--gtest_filter=Views*`) will be run even if the the `--use-views` flag is not specified. - Pass the `--hide-frame` command-line flag to cefclient to demo a frameless Views-based browser window. - Pass the `--hide-controls` command-line flag to cefclient to demo a browser window without top controls. This also works in non-Views mode. - Pass the `--enable-high-dpi-support` command-line flag to cef_unittests on Windows to test high-DPI support on a display that supports it. - Add CefImage for reading/writing image file formats. - Add CefBrowser::DownloadImage() for downloading image URLs as a CefImage representation. This is primarily for loading favicons. - Add CefMenuModel::CreateMenuModel() and CefMenuModelDelegate for creating custom menus. This is primarily for use with CefMenuButton. - Add CefBrowser::TryCloseBrowser() helper for closing a browser. Also improve related documentation in cef_life_span_handler.h. - Rename cef_page_range_t to cef_range_t. It is now also used by CefTextfield. - Remove CefLifeSpanHandler::RunModal() which is never called. - Add draggable regions example to cefclient.
2016-01-19 21:09:01 +01:00
bool HasView() OVERRIDE;
CefRefPtr<CefClient> GetClient() OVERRIDE;
CefRefPtr<CefRequestContext> GetRequestContext() OVERRIDE;
double GetZoomLevel() OVERRIDE;
void SetZoomLevel(double zoomLevel) OVERRIDE;
void RunFileDialog(FileDialogMode mode,
const CefString& title,
const CefString& default_file_path,
const std::vector<CefString>& accept_filters,
int selected_accept_filter,
CefRefPtr<CefRunFileDialogCallback> callback) OVERRIDE;
void StartDownload(const CefString& url) OVERRIDE;
void DownloadImage(const CefString& image_url,
bool is_favicon,
uint32 max_image_size,
bool bypass_cache,
CefRefPtr<CefDownloadImageCallback> callback) OVERRIDE;
void Print() OVERRIDE;
void PrintToPDF(const CefString& path,
const CefPdfPrintSettings& settings,
CefRefPtr<CefPdfPrintCallback> callback) OVERRIDE;
void Find(int identifier,
const CefString& searchText,
bool forward,
bool matchCase,
bool findNext) OVERRIDE;
void StopFinding(bool clearSelection) OVERRIDE;
void ShowDevTools(const CefWindowInfo& windowInfo,
CefRefPtr<CefClient> client,
const CefBrowserSettings& settings,
const CefPoint& inspect_element_at) OVERRIDE;
void CloseDevTools() OVERRIDE;
bool HasDevTools() OVERRIDE;
Add support for direct DevTools protocol messaging (fixes issue #2961). This change allows the client to directly send and receive DevTools protocol messages (send method calls, and receive method results and events) without requiring a DevTools front-end or remote-debugging session. This change includes additional supporting changes: - Add a new CefRequestHandler::OnDocumentAvailableInMainFrame callback (see issue #1454). - Add a CefParseJSON variant that accepts a UTF8-encoded buffer. - Add a `--devtools-protocol-log-file=<path>` command-line flag for logging protocol messages sent to/from the DevTools front-end while it is displayed. This is useful for understanding existing DevTools protocol usage. - Add a new "libcef_static_unittests" executable target to support light-weight unit tests of libcef_static internals (e.g. without requiring exposure via the CEF API). Files to be unittested are placed in the new "libcef_static_unittested" source_set which is then included by both the existing libcef_static library and the new unittests executable target. - Linux: Remove use_bundled_fontconfig=false, which is no longer required and causes unittest build errors (see issue #2424). This change also adds a cefclient demo for configuring offline mode using the DevTools protocol (fixes issue #245). This is controlled by the "Offline mode" context menu option and the `--offline` command-line switch which will launch cefclient in offline mode. When cefclient is offline all network requests will fail with ERR_INTERNET_DISCONNECTED and navigator.onLine will return false when called from JavaScript in any frame. This mode is per-browser so newly created browser windows will have the default mode. Note that configuring offline mode in this way will not update the Network tab UI ("Throtting" option) in a displayed DevTools front-end instance.
2020-06-13 02:54:08 +02:00
bool SendDevToolsMessage(const void* message, size_t message_size) OVERRIDE;
int ExecuteDevToolsMethod(int message_id,
const CefString& method,
CefRefPtr<CefDictionaryValue> params) OVERRIDE;
CefRefPtr<CefRegistration> AddDevToolsMessageObserver(
CefRefPtr<CefDevToolsMessageObserver> observer) OVERRIDE;
void GetNavigationEntries(CefRefPtr<CefNavigationEntryVisitor> visitor,
bool current_only) OVERRIDE;
void ReplaceMisspelling(const CefString& word) OVERRIDE;
void AddWordToDictionary(const CefString& word) OVERRIDE;
bool IsWindowRenderingDisabled() OVERRIDE;
void WasResized() OVERRIDE;
void WasHidden(bool hidden) OVERRIDE;
void NotifyScreenInfoChanged() OVERRIDE;
void Invalidate(PaintElementType type) OVERRIDE;
void SendExternalBeginFrame() OVERRIDE;
void SendKeyEvent(const CefKeyEvent& event) OVERRIDE;
void SendMouseClickEvent(const CefMouseEvent& event,
MouseButtonType type,
bool mouseUp,
int clickCount) OVERRIDE;
void SendMouseMoveEvent(const CefMouseEvent& event, bool mouseLeave) OVERRIDE;
void SendMouseWheelEvent(const CefMouseEvent& event,
int deltaX,
int deltaY) OVERRIDE;
void SendTouchEvent(const CefTouchEvent& event) OVERRIDE;
void SendFocusEvent(bool setFocus) OVERRIDE;
void SendCaptureLostEvent() OVERRIDE;
void NotifyMoveOrResizeStarted() OVERRIDE;
int GetWindowlessFrameRate() OVERRIDE;
void SetWindowlessFrameRate(int frame_rate) OVERRIDE;
void ImeSetComposition(const CefString& text,
const std::vector<CefCompositionUnderline>& underlines,
const CefRange& replacement_range,
const CefRange& selection_range) OVERRIDE;
void ImeCommitText(const CefString& text,
const CefRange& replacement_range,
int relative_cursor_pos) OVERRIDE;
void ImeFinishComposingText(bool keep_selection) OVERRIDE;
void ImeCancelComposition() OVERRIDE;
void DragTargetDragEnter(CefRefPtr<CefDragData> drag_data,
const CefMouseEvent& event,
DragOperationsMask allowed_ops) OVERRIDE;
void DragTargetDragOver(const CefMouseEvent& event,
DragOperationsMask allowed_ops) OVERRIDE;
void DragTargetDragLeave() OVERRIDE;
void DragTargetDrop(const CefMouseEvent& event) OVERRIDE;
void DragSourceEndedAt(int x, int y, DragOperationsMask op) OVERRIDE;
void DragSourceSystemDragEnded() OVERRIDE;
CefRefPtr<CefNavigationEntry> GetVisibleNavigationEntry() OVERRIDE;
void SetAccessibilityState(cef_state_t accessibility_state) OVERRIDE;
void SetAutoResizeEnabled(bool enabled,
const CefSize& min_size,
const CefSize& max_size) OVERRIDE;
CefRefPtr<CefExtension> GetExtension() OVERRIDE;
bool IsBackgroundHost() OVERRIDE;
void SetAudioMuted(bool mute) OVERRIDE;
bool IsAudioMuted() OVERRIDE;
};
#endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_