• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 //
5 // ---------------------------------------------------------------------------
6 //
7 // This file was generated by the CEF translator tool. If making changes by
8 // hand only do so within the body of existing method and function
9 // implementations. See the translator.README.txt file in the tools directory
10 // for more information.
11 //
12 // $hash=6de4205143b6855e7ccf54da14a0494db0b4aaa3$
13 //
14 
15 #ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_
16 #define CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_
17 #pragma once
18 
19 #if !defined(WRAPPING_CEF_SHARED)
20 #error This file can be included wrapper-side only
21 #endif
22 
23 #include <vector>
24 #include "include/capi/cef_browser_capi.h"
25 #include "include/capi/cef_client_capi.h"
26 #include "include/cef_browser.h"
27 #include "include/cef_client.h"
28 #include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
29 
30 // Wrap a C structure with a C++ class.
31 // This class may be instantiated and accessed wrapper-side only.
32 class CefBrowserHostCToCpp : public CefCToCppRefCounted<CefBrowserHostCToCpp,
33                                                         CefBrowserHost,
34                                                         cef_browser_host_t> {
35  public:
36   CefBrowserHostCToCpp();
37   virtual ~CefBrowserHostCToCpp();
38 
39   // CefBrowserHost methods.
40   CefRefPtr<CefBrowser> GetBrowser() override;
41   void CloseBrowser(bool force_close) override;
42   bool TryCloseBrowser() override;
43   void SetFocus(bool focus) override;
44   CefWindowHandle GetWindowHandle() override;
45   CefWindowHandle GetOpenerWindowHandle() override;
46   bool HasView() override;
47   CefRefPtr<CefClient> GetClient() override;
48   CefRefPtr<CefRequestContext> GetRequestContext() override;
49   double GetZoomLevel() override;
50   void SetZoomLevel(double zoomLevel) override;
51   void RunFileDialog(FileDialogMode mode,
52                      const CefString& title,
53                      const CefString& default_file_path,
54                      const std::vector<CefString>& accept_filters,
55                      int selected_accept_filter,
56                      CefRefPtr<CefRunFileDialogCallback> callback) override;
57   void StartDownload(const CefString& url) override;
58   void DownloadImage(const CefString& image_url,
59                      bool is_favicon,
60                      uint32 max_image_size,
61                      bool bypass_cache,
62                      CefRefPtr<CefDownloadImageCallback> callback) override;
63   void Print() override;
64   void PrintToPDF(const CefString& path,
65                   const CefPdfPrintSettings& settings,
66                   CefRefPtr<CefPdfPrintCallback> callback) override;
67   void Find(const CefString& searchText,
68             bool forward,
69             bool matchCase,
70             bool findNext) override;
71   void StopFinding(bool clearSelection) override;
72   void ShowDevTools(const CefWindowInfo& windowInfo,
73                     CefRefPtr<CefClient> client,
74                     const CefBrowserSettings& settings,
75                     const CefPoint& inspect_element_at) override;
76   void CloseDevTools() override;
77   bool HasDevTools() override;
78   bool SendDevToolsMessage(const void* message, size_t message_size) override;
79   int ExecuteDevToolsMethod(int message_id,
80                             const CefString& method,
81                             CefRefPtr<CefDictionaryValue> params) override;
82   CefRefPtr<CefRegistration> AddDevToolsMessageObserver(
83       CefRefPtr<CefDevToolsMessageObserver> observer) override;
84   void GetNavigationEntries(CefRefPtr<CefNavigationEntryVisitor> visitor,
85                             bool current_only) override;
86   void ReplaceMisspelling(const CefString& word) override;
87   void AddWordToDictionary(const CefString& word) override;
88   bool IsWindowRenderingDisabled() override;
89   void WasResized() override;
90   void WasHidden(bool hidden) override;
91   void NotifyScreenInfoChanged() override;
92   void Invalidate(PaintElementType type) override;
93   void SendExternalBeginFrame() override;
94   void SendKeyEvent(const CefKeyEvent& event) override;
95   void SendMouseClickEvent(const CefMouseEvent& event,
96                            MouseButtonType type,
97                            bool mouseUp,
98                            int clickCount) override;
99   void SendMouseMoveEvent(const CefMouseEvent& event, bool mouseLeave) override;
100   void SendMouseWheelEvent(const CefMouseEvent& event,
101                            int deltaX,
102                            int deltaY) override;
103   void SendTouchEvent(const CefTouchEvent& event) override;
104   void SendCaptureLostEvent() override;
105   void NotifyMoveOrResizeStarted() override;
106   int GetWindowlessFrameRate() override;
107   void SetWindowlessFrameRate(int frame_rate) override;
108   void ImeSetComposition(const CefString& text,
109                          const std::vector<CefCompositionUnderline>& underlines,
110                          const CefRange& replacement_range,
111                          const CefRange& selection_range) override;
112   void ImeCommitText(const CefString& text,
113                      const CefRange& replacement_range,
114                      int relative_cursor_pos) override;
115   void ImeFinishComposingText(bool keep_selection) override;
116   void ImeCancelComposition() override;
117   void DragTargetDragEnter(CefRefPtr<CefDragData> drag_data,
118                            const CefMouseEvent& event,
119                            DragOperationsMask allowed_ops) override;
120   void DragTargetDragOver(const CefMouseEvent& event,
121                           DragOperationsMask allowed_ops) override;
122   void DragTargetDragLeave() override;
123   void DragTargetDrop(const CefMouseEvent& event) override;
124   void DragSourceEndedAt(int x, int y, DragOperationsMask op) override;
125   void DragSourceSystemDragEnded() override;
126   CefRefPtr<CefNavigationEntry> GetVisibleNavigationEntry() override;
127   void SetAccessibilityState(cef_state_t accessibility_state) override;
128   void SetAutoResizeEnabled(bool enabled,
129                             const CefSize& min_size,
130                             const CefSize& max_size) override;
131   CefRefPtr<CefExtension> GetExtension() override;
132   bool IsBackgroundHost() override;
133   void SetAudioMuted(bool mute) override;
134   bool IsAudioMuted() override;
135 };
136 
137 #endif  // CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_
138