1 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved. 2 // 3 // Redistribution and use in source and binary forms, with or without 4 // modification, are permitted provided that the following conditions are 5 // met: 6 // 7 // * Redistributions of source code must retain the above copyright 8 // notice, this list of conditions and the following disclaimer. 9 // * Redistributions in binary form must reproduce the above 10 // copyright notice, this list of conditions and the following disclaimer 11 // in the documentation and/or other materials provided with the 12 // distribution. 13 // * Neither the name of Google Inc. nor the name Chromium Embedded 14 // Framework nor the names of its contributors may be used to endorse 15 // or promote products derived from this software without specific prior 16 // written permission. 17 // 18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 // 30 // --------------------------------------------------------------------------- 31 // 32 // This file was generated by the CEF translator tool and should not edited 33 // by hand. See the translator.README.txt file in the tools directory for 34 // more information. 35 // 36 // $hash=cd5d7c4e83237ceb39c5639489ca6004d2d69f0c$ 37 // 38 39 #ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_ 40 #define CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_ 41 #pragma once 42 43 #include "include/capi/views/cef_panel_delegate_capi.h" 44 45 #ifdef __cplusplus 46 extern "C" { 47 #endif 48 49 struct _cef_window_t; 50 51 /// 52 // Implement this structure to handle window events. The functions of this 53 // structure will be called on the browser process UI thread unless otherwise 54 // indicated. 55 /// 56 typedef struct _cef_window_delegate_t { 57 /// 58 // Base structure. 59 /// 60 cef_panel_delegate_t base; 61 62 /// 63 // Called when |window| is created. 64 /// 65 void(CEF_CALLBACK* on_window_created)(struct _cef_window_delegate_t* self, 66 struct _cef_window_t* window); 67 68 /// 69 // Called when |window| is destroyed. Release all references to |window| and 70 // do not attempt to execute any functions on |window| after this callback 71 // returns. 72 /// 73 void(CEF_CALLBACK* on_window_destroyed)(struct _cef_window_delegate_t* self, 74 struct _cef_window_t* window); 75 76 /// 77 // Return the parent for |window| or NULL if the |window| does not have a 78 // parent. Windows with parents will not get a taskbar button. Set |is_menu| 79 // to true (1) if |window| will be displayed as a menu, in which case it will 80 // not be clipped to the parent window bounds. Set |can_activate_menu| to 81 // false (0) if |is_menu| is true (1) and |window| should not be activated 82 // (given keyboard focus) when displayed. 83 /// 84 struct _cef_window_t*(CEF_CALLBACK* get_parent_window)( 85 struct _cef_window_delegate_t* self, 86 struct _cef_window_t* window, 87 int* is_menu, 88 int* can_activate_menu); 89 90 /// 91 // Return the initial bounds for |window| in density independent pixel (DIP) 92 // coordinates. If this function returns an NULL CefRect then 93 // get_preferred_size() will be called to retrieve the size, and the window 94 // will be placed on the screen with origin (0,0). This function can be used 95 // in combination with cef_view_t::get_bounds_in_screen() to restore the 96 // previous window bounds. 97 /// 98 cef_rect_t(CEF_CALLBACK* get_initial_bounds)( 99 struct _cef_window_delegate_t* self, 100 struct _cef_window_t* window); 101 102 /// 103 // Return the initial show state for |window|. 104 /// 105 cef_show_state_t(CEF_CALLBACK* get_initial_show_state)( 106 struct _cef_window_delegate_t* self, 107 struct _cef_window_t* window); 108 109 /// 110 // Return true (1) if |window| should be created without a frame or title bar. 111 // The window will be resizable if can_resize() returns true (1). Use 112 // cef_window_t::set_draggable_regions() to specify draggable regions. 113 /// 114 int(CEF_CALLBACK* is_frameless)(struct _cef_window_delegate_t* self, 115 struct _cef_window_t* window); 116 117 /// 118 // Return true (1) if |window| can be resized. 119 /// 120 int(CEF_CALLBACK* can_resize)(struct _cef_window_delegate_t* self, 121 struct _cef_window_t* window); 122 123 /// 124 // Return true (1) if |window| can be maximized. 125 /// 126 int(CEF_CALLBACK* can_maximize)(struct _cef_window_delegate_t* self, 127 struct _cef_window_t* window); 128 129 /// 130 // Return true (1) if |window| can be minimized. 131 /// 132 int(CEF_CALLBACK* can_minimize)(struct _cef_window_delegate_t* self, 133 struct _cef_window_t* window); 134 135 /// 136 // Return true (1) if |window| can be closed. This will be called for user- 137 // initiated window close actions and when cef_window_t::close() is called. 138 /// 139 int(CEF_CALLBACK* can_close)(struct _cef_window_delegate_t* self, 140 struct _cef_window_t* window); 141 142 /// 143 // Called when a keyboard accelerator registered with 144 // cef_window_t::SetAccelerator is triggered. Return true (1) if the 145 // accelerator was handled or false (0) otherwise. 146 /// 147 int(CEF_CALLBACK* on_accelerator)(struct _cef_window_delegate_t* self, 148 struct _cef_window_t* window, 149 int command_id); 150 151 /// 152 // Called after all other controls in the window have had a chance to handle 153 // the event. |event| contains information about the keyboard event. Return 154 // true (1) if the keyboard event was handled or false (0) otherwise. 155 /// 156 int(CEF_CALLBACK* on_key_event)(struct _cef_window_delegate_t* self, 157 struct _cef_window_t* window, 158 const struct _cef_key_event_t* event); 159 } cef_window_delegate_t; 160 161 #ifdef __cplusplus 162 } 163 #endif 164 165 #endif // CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_ 166