1 // Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved.
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
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
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.
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.
30 // ---------------------------------------------------------------------------
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
37 #ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
38 #define CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
41 #include "include/capi/cef_base_capi.h"
42 #include "include/capi/cef_dom_capi.h"
43 #include "include/capi/cef_request_capi.h"
44 #include "include/capi/cef_stream_capi.h"
45 #include "include/capi/cef_string_visitor_capi.h"
51 struct _cef_browser_t;
52 struct _cef_v8context_t;
55 // Structure used to represent a frame in the browser window. When used in the
56 // browser process the functions of this structure may be called on any thread
57 // unless otherwise indicated in the comments. When used in the render process
58 // the functions of this structure may only be called on the main thread.
60 typedef struct _cef_frame_t {
67 // True if this object is currently attached to a valid frame.
69 int (CEF_CALLBACK *is_valid)(struct _cef_frame_t* self);
72 // Execute undo in this frame.
74 void (CEF_CALLBACK *undo)(struct _cef_frame_t* self);
77 // Execute redo in this frame.
79 void (CEF_CALLBACK *redo)(struct _cef_frame_t* self);
82 // Execute cut in this frame.
84 void (CEF_CALLBACK *cut)(struct _cef_frame_t* self);
87 // Execute copy in this frame.
89 void (CEF_CALLBACK *copy)(struct _cef_frame_t* self);
92 // Execute paste in this frame.
94 void (CEF_CALLBACK *paste)(struct _cef_frame_t* self);
97 // Execute delete in this frame.
99 void (CEF_CALLBACK *del)(struct _cef_frame_t* self);
102 // Execute select all in this frame.
104 void (CEF_CALLBACK *select_all)(struct _cef_frame_t* self);
107 // Save this frame's HTML source to a temporary file and open it in the
108 // default text viewing application. This function can only be called from the
111 void (CEF_CALLBACK *view_source)(struct _cef_frame_t* self);
114 // Retrieve this frame's HTML source as a string sent to the specified
117 void (CEF_CALLBACK *get_source)(struct _cef_frame_t* self,
118 struct _cef_string_visitor_t* visitor);
121 // Retrieve this frame's display text as a string sent to the specified
124 void (CEF_CALLBACK *get_text)(struct _cef_frame_t* self,
125 struct _cef_string_visitor_t* visitor);
128 // Load the request represented by the |request| object.
130 void (CEF_CALLBACK *load_request)(struct _cef_frame_t* self,
131 struct _cef_request_t* request);
134 // Load the specified |url|.
136 void (CEF_CALLBACK *load_url)(struct _cef_frame_t* self,
137 const cef_string_t* url);
140 // Load the contents of |string_val| with the specified dummy |url|. |url|
141 // should have a standard scheme (for example, http scheme) or behaviors like
142 // link clicks and web security restrictions may not behave as expected.
144 void (CEF_CALLBACK *load_string)(struct _cef_frame_t* self,
145 const cef_string_t* string_val, const cef_string_t* url);
148 // Execute a string of JavaScript code in this frame. The |script_url|
149 // parameter is the URL where the script in question can be found, if any. The
150 // renderer may request this URL to show the developer the source of the
151 // error. The |start_line| parameter is the base line number to use for error
154 void (CEF_CALLBACK *execute_java_script)(struct _cef_frame_t* self,
155 const cef_string_t* code, const cef_string_t* script_url,
159 // Returns true (1) if this is the main (top-level) frame.
161 int (CEF_CALLBACK *is_main)(struct _cef_frame_t* self);
164 // Returns true (1) if this is the focused frame.
166 int (CEF_CALLBACK *is_focused)(struct _cef_frame_t* self);
169 // Returns the name for this frame. If the frame has an assigned name (for
170 // example, set via the iframe "name" attribute) then that value will be
171 // returned. Otherwise a unique name will be constructed based on the frame
172 // parent hierarchy. The main (top-level) frame will always have an NULL name
175 // The resulting string must be freed by calling cef_string_userfree_free().
176 cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_frame_t* self);
179 // Returns the globally unique identifier for this frame.
181 int64 (CEF_CALLBACK *get_identifier)(struct _cef_frame_t* self);
184 // Returns the parent of this frame or NULL if this is the main (top-level)
187 struct _cef_frame_t* (CEF_CALLBACK *get_parent)(struct _cef_frame_t* self);
190 // Returns the URL currently loaded in this frame.
192 // The resulting string must be freed by calling cef_string_userfree_free().
193 cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_frame_t* self);
196 // Returns the browser that this frame belongs to.
198 struct _cef_browser_t* (CEF_CALLBACK *get_browser)(struct _cef_frame_t* self);
201 // Get the V8 context associated with the frame. This function can only be
202 // called from the render process.
204 struct _cef_v8context_t* (CEF_CALLBACK *get_v8context)(
205 struct _cef_frame_t* self);
208 // Visit the DOM document. This function can only be called from the render
211 void (CEF_CALLBACK *visit_dom)(struct _cef_frame_t* self,
212 struct _cef_domvisitor_t* visitor);
220 #endif // CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_