• 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=5afd032b23745d114bc95d45139cf5d92a82f89a$
13 //
14 
15 #ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_CTOCPP_H_
16 #define CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_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/views/cef_window_capi.h"
25 #include "include/views/cef_window.h"
26 #include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
27 
28 // Wrap a C structure with a C++ class.
29 // This class may be instantiated and accessed wrapper-side only.
30 class CefWindowCToCpp
31     : public CefCToCppRefCounted<CefWindowCToCpp, CefWindow, cef_window_t> {
32  public:
33   CefWindowCToCpp();
34   virtual ~CefWindowCToCpp();
35 
36   // CefWindow methods.
37   void Show() override;
38   void Hide() override;
39   void CenterWindow(const CefSize& size) override;
40   void Close() override;
41   bool IsClosed() override;
42   void Activate() override;
43   void Deactivate() override;
44   bool IsActive() override;
45   void BringToTop() override;
46   void SetAlwaysOnTop(bool on_top) override;
47   bool IsAlwaysOnTop() override;
48   void Maximize() override;
49   void Minimize() override;
50   void Restore() override;
51   void SetFullscreen(bool fullscreen) override;
52   bool IsMaximized() override;
53   bool IsMinimized() override;
54   bool IsFullscreen() override;
55   void SetTitle(const CefString& title) override;
56   CefString GetTitle() override;
57   void SetWindowIcon(CefRefPtr<CefImage> image) override;
58   CefRefPtr<CefImage> GetWindowIcon() override;
59   void SetWindowAppIcon(CefRefPtr<CefImage> image) override;
60   CefRefPtr<CefImage> GetWindowAppIcon() override;
61   CefRefPtr<CefOverlayController> AddOverlayView(
62       CefRefPtr<CefView> view,
63       cef_docking_mode_t docking_mode) override;
64   void ShowMenu(CefRefPtr<CefMenuModel> menu_model,
65                 const CefPoint& screen_point,
66                 cef_menu_anchor_position_t anchor_position) override;
67   void CancelMenu() override;
68   CefRefPtr<CefDisplay> GetDisplay() override;
69   CefRect GetClientAreaBoundsInScreen() override;
70   void SetDraggableRegions(
71       const std::vector<CefDraggableRegion>& regions) override;
72   CefWindowHandle GetWindowHandle() override;
73   void SendKeyPress(int key_code, uint32 event_flags) override;
74   void SendMouseMove(int screen_x, int screen_y) override;
75   void SendMouseEvents(cef_mouse_button_type_t button,
76                        bool mouse_down,
77                        bool mouse_up) override;
78   void SetAccelerator(int command_id,
79                       int key_code,
80                       bool shift_pressed,
81                       bool ctrl_pressed,
82                       bool alt_pressed) override;
83   void RemoveAccelerator(int command_id) override;
84   void RemoveAllAccelerators() override;
85 
86   // CefPanel methods.
87   CefRefPtr<CefWindow> AsWindow() override;
88   CefRefPtr<CefFillLayout> SetToFillLayout() override;
89   CefRefPtr<CefBoxLayout> SetToBoxLayout(
90       const CefBoxLayoutSettings& settings) override;
91   CefRefPtr<CefLayout> GetLayout() override;
92   void Layout() override;
93   void AddChildView(CefRefPtr<CefView> view) override;
94   void AddChildViewAt(CefRefPtr<CefView> view, int index) override;
95   void ReorderChildView(CefRefPtr<CefView> view, int index) override;
96   void RemoveChildView(CefRefPtr<CefView> view) override;
97   void RemoveAllChildViews() override;
98   size_t GetChildViewCount() override;
99   CefRefPtr<CefView> GetChildViewAt(int index) override;
100 
101   // CefView methods.
102   CefRefPtr<CefBrowserView> AsBrowserView() override;
103   CefRefPtr<CefButton> AsButton() override;
104   CefRefPtr<CefPanel> AsPanel() override;
105   CefRefPtr<CefScrollView> AsScrollView() override;
106   CefRefPtr<CefTextfield> AsTextfield() override;
107   CefString GetTypeString() override;
108   CefString ToString(bool include_children) override;
109   bool IsValid() override;
110   bool IsAttached() override;
111   bool IsSame(CefRefPtr<CefView> that) override;
112   CefRefPtr<CefViewDelegate> GetDelegate() override;
113   CefRefPtr<CefWindow> GetWindow() override;
114   int GetID() override;
115   void SetID(int id) override;
116   int GetGroupID() override;
117   void SetGroupID(int group_id) override;
118   CefRefPtr<CefView> GetParentView() override;
119   CefRefPtr<CefView> GetViewForID(int id) override;
120   void SetBounds(const CefRect& bounds) override;
121   CefRect GetBounds() override;
122   CefRect GetBoundsInScreen() override;
123   void SetSize(const CefSize& size) override;
124   CefSize GetSize() override;
125   void SetPosition(const CefPoint& position) override;
126   CefPoint GetPosition() override;
127   void SetInsets(const CefInsets& insets) override;
128   CefInsets GetInsets() override;
129   CefSize GetPreferredSize() override;
130   void SizeToPreferredSize() override;
131   CefSize GetMinimumSize() override;
132   CefSize GetMaximumSize() override;
133   int GetHeightForWidth(int width) override;
134   void InvalidateLayout() override;
135   void SetVisible(bool visible) override;
136   bool IsVisible() override;
137   bool IsDrawn() override;
138   void SetEnabled(bool enabled) override;
139   bool IsEnabled() override;
140   void SetFocusable(bool focusable) override;
141   bool IsFocusable() override;
142   bool IsAccessibilityFocusable() override;
143   void RequestFocus() override;
144   void SetBackgroundColor(cef_color_t color) override;
145   cef_color_t GetBackgroundColor() override;
146   bool ConvertPointToScreen(CefPoint& point) override;
147   bool ConvertPointFromScreen(CefPoint& point) override;
148   bool ConvertPointToWindow(CefPoint& point) override;
149   bool ConvertPointFromWindow(CefPoint& point) override;
150   bool ConvertPointToView(CefRefPtr<CefView> view, CefPoint& point) override;
151   bool ConvertPointFromView(CefRefPtr<CefView> view, CefPoint& point) override;
152 };
153 
154 #endif  // CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_CTOCPP_H_
155