• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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=8527ceea6b8778d6fabc1b4ef82e4faa06ba777a$
37 //
38 
39 #ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
40 #define CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
41 #pragma once
42 
43 #include "include/capi/cef_base_capi.h"
44 #include "include/capi/cef_dom_capi.h"
45 #include "include/capi/cef_process_message_capi.h"
46 #include "include/capi/cef_request_capi.h"
47 #include "include/capi/cef_stream_capi.h"
48 #include "include/capi/cef_string_visitor_capi.h"
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 struct _cef_browser_t;
55 struct _cef_urlrequest_client_t;
56 struct _cef_urlrequest_t;
57 struct _cef_v8context_t;
58 
59 ///
60 // Structure used to represent a frame in the browser window. When used in the
61 // browser process the functions of this structure may be called on any thread
62 // unless otherwise indicated in the comments. When used in the render process
63 // the functions of this structure may only be called on the main thread.
64 ///
65 typedef struct _cef_frame_t {
66   ///
67   // Base structure.
68   ///
69   cef_base_ref_counted_t base;
70 
71   ///
72   // True if this object is currently attached to a valid frame.
73   ///
74   int(CEF_CALLBACK* is_valid)(struct _cef_frame_t* self);
75 
76   ///
77   // Execute undo in this frame.
78   ///
79   void(CEF_CALLBACK* undo)(struct _cef_frame_t* self);
80 
81   ///
82   // Execute redo in this frame.
83   ///
84   void(CEF_CALLBACK* redo)(struct _cef_frame_t* self);
85 
86   ///
87   // Execute cut in this frame.
88   ///
89   void(CEF_CALLBACK* cut)(struct _cef_frame_t* self);
90 
91   ///
92   // Execute copy in this frame.
93   ///
94   void(CEF_CALLBACK* copy)(struct _cef_frame_t* self);
95 
96   ///
97   // Execute paste in this frame.
98   ///
99   void(CEF_CALLBACK* paste)(struct _cef_frame_t* self);
100 
101   ///
102   // Execute delete in this frame.
103   ///
104   void(CEF_CALLBACK* del)(struct _cef_frame_t* self);
105 
106   ///
107   // Execute select all in this frame.
108   ///
109   void(CEF_CALLBACK* select_all)(struct _cef_frame_t* self);
110 
111   ///
112   // Save this frame's HTML source to a temporary file and open it in the
113   // default text viewing application. This function can only be called from the
114   // browser process.
115   ///
116   void(CEF_CALLBACK* view_source)(struct _cef_frame_t* self);
117 
118   ///
119   // Retrieve this frame's HTML source as a string sent to the specified
120   // visitor.
121   ///
122   void(CEF_CALLBACK* get_source)(struct _cef_frame_t* self,
123                                  struct _cef_string_visitor_t* visitor);
124 
125   ///
126   // Retrieve this frame's display text as a string sent to the specified
127   // visitor.
128   ///
129   void(CEF_CALLBACK* get_text)(struct _cef_frame_t* self,
130                                struct _cef_string_visitor_t* visitor);
131 
132   ///
133   // Load the request represented by the |request| object.
134   //
135   // WARNING: This function will fail with "bad IPC message" reason
136   // INVALID_INITIATOR_ORIGIN (213) unless you first navigate to the request
137   // origin using some other mechanism (LoadURL, link click, etc).
138   ///
139   void(CEF_CALLBACK* load_request)(struct _cef_frame_t* self,
140                                    struct _cef_request_t* request);
141 
142   ///
143   // Load the specified |url|.
144   ///
145   void(CEF_CALLBACK* load_url)(struct _cef_frame_t* self,
146                                const cef_string_t* url);
147 
148   ///
149   // Execute a string of JavaScript code in this frame. The |script_url|
150   // parameter is the URL where the script in question can be found, if any. The
151   // renderer may request this URL to show the developer the source of the
152   // error.  The |start_line| parameter is the base line number to use for error
153   // reporting.
154   ///
155   void(CEF_CALLBACK* execute_java_script)(struct _cef_frame_t* self,
156                                           const cef_string_t* code,
157                                           const cef_string_t* script_url,
158                                           int start_line);
159 
160   ///
161   // Returns true (1) if this is the main (top-level) frame.
162   ///
163   int(CEF_CALLBACK* is_main)(struct _cef_frame_t* self);
164 
165   ///
166   // Returns true (1) if this is the focused frame.
167   ///
168   int(CEF_CALLBACK* is_focused)(struct _cef_frame_t* self);
169 
170   ///
171   // Returns the name for this frame. If the frame has an assigned name (for
172   // example, set via the iframe "name" attribute) then that value will be
173   // returned. Otherwise a unique name will be constructed based on the frame
174   // parent hierarchy. The main (top-level) frame will always have an NULL name
175   // value.
176   ///
177   // The resulting string must be freed by calling cef_string_userfree_free().
178   cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_frame_t* self);
179 
180   ///
181   // Returns the globally unique identifier for this frame or < 0 if the
182   // underlying frame does not yet exist.
183   ///
184   int64(CEF_CALLBACK* get_identifier)(struct _cef_frame_t* self);
185 
186   ///
187   // Returns the parent of this frame or NULL if this is the main (top-level)
188   // frame.
189   ///
190   struct _cef_frame_t*(CEF_CALLBACK* get_parent)(struct _cef_frame_t* self);
191 
192   ///
193   // Returns the URL currently loaded in this frame.
194   ///
195   // The resulting string must be freed by calling cef_string_userfree_free().
196   cef_string_userfree_t(CEF_CALLBACK* get_url)(struct _cef_frame_t* self);
197 
198   ///
199   // Returns the browser that this frame belongs to.
200   ///
201   struct _cef_browser_t*(CEF_CALLBACK* get_browser)(struct _cef_frame_t* self);
202 
203   ///
204   // Get the V8 context associated with the frame. This function can only be
205   // called from the render process.
206   ///
207   struct _cef_v8context_t*(CEF_CALLBACK* get_v8context)(
208       struct _cef_frame_t* self);
209 
210   ///
211   // Visit the DOM document. This function can only be called from the render
212   // process.
213   ///
214   void(CEF_CALLBACK* visit_dom)(struct _cef_frame_t* self,
215                                 struct _cef_domvisitor_t* visitor);
216 
217   ///
218   // Create a new URL request that will be treated as originating from this
219   // frame and the associated browser. This request may be intercepted by the
220   // client via cef_resource_request_handler_t or cef_scheme_handler_factory_t.
221   // Use cef_urlrequest_t::Create instead if you do not want the request to have
222   // this association, in which case it may be handled differently (see
223   // documentation on that function). Requests may originate from both the
224   // browser process and the render process.
225   //
226   // For requests originating from the browser process:
227   //   - POST data may only contain a single element of type PDE_TYPE_FILE or
228   //     PDE_TYPE_BYTES.
229   // For requests originating from the render process:
230   //   - POST data may only contain a single element of type PDE_TYPE_BYTES.
231   //   - If the response contains Content-Disposition or Mime-Type header values
232   //     that would not normally be rendered then the response may receive
233   //     special handling inside the browser (for example, via the file download
234   //     code path instead of the URL request code path).
235   //
236   // The |request| object will be marked as read-only after calling this
237   // function.
238   ///
239   struct _cef_urlrequest_t*(CEF_CALLBACK* create_urlrequest)(
240       struct _cef_frame_t* self,
241       struct _cef_request_t* request,
242       struct _cef_urlrequest_client_t* client);
243 
244   ///
245   // Send a message to the specified |target_process|. Ownership of the message
246   // contents will be transferred and the |message| reference will be
247   // invalidated. Message delivery is not guaranteed in all cases (for example,
248   // if the browser is closing, navigating, or if the target process crashes).
249   // Send an ACK message back from the target process if confirmation is
250   // required.
251   ///
252   void(CEF_CALLBACK* send_process_message)(
253       struct _cef_frame_t* self,
254       cef_process_id_t target_process,
255       struct _cef_process_message_t* message);
256 } cef_frame_t;
257 
258 #ifdef __cplusplus
259 }
260 #endif
261 
262 #endif  // CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
263