]> git.sesse.net Git - casparcg/blob - dependencies64/cef/include/cef_frame.h
* Merged html producer and updated to latest CEF version (does not have satisfactory...
[casparcg] / dependencies64 / cef / include / cef_frame.h
1 // Copyright (c) 2012 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 // The contents of this file must follow a specific format in order to
33 // support the CEF translator tool. See the translator.README.txt file in the
34 // tools directory for more information.
35 //
36
37 #ifndef CEF_INCLUDE_CEF_FRAME_H_
38 #define CEF_INCLUDE_CEF_FRAME_H_
39 #pragma once
40
41 #include "include/cef_base.h"
42 #include "include/cef_dom.h"
43 #include "include/cef_request.h"
44 #include "include/cef_stream.h"
45 #include "include/cef_string_visitor.h"
46
47 class CefBrowser;
48 class CefV8Context;
49
50 ///
51 // Class used to represent a frame in the browser window. When used in the
52 // browser process the methods of this class may be called on any thread unless
53 // otherwise indicated in the comments. When used in the render process the
54 // methods of this class may only be called on the main thread.
55 ///
56 /*--cef(source=library)--*/
57 class CefFrame : public virtual CefBase {
58  public:
59   ///
60   // True if this object is currently attached to a valid frame.
61   ///
62   /*--cef()--*/
63   virtual bool IsValid() =0;
64
65   ///
66   // Execute undo in this frame.
67   ///
68   /*--cef()--*/
69   virtual void Undo() =0;
70
71   ///
72   // Execute redo in this frame.
73   ///
74   /*--cef()--*/
75   virtual void Redo() =0;
76
77   ///
78   // Execute cut in this frame.
79   ///
80   /*--cef()--*/
81   virtual void Cut() =0;
82
83   ///
84   // Execute copy in this frame.
85   ///
86   /*--cef()--*/
87   virtual void Copy() =0;
88
89   ///
90   // Execute paste in this frame.
91   ///
92   /*--cef()--*/
93   virtual void Paste() =0;
94
95   ///
96   // Execute delete in this frame.
97   ///
98   /*--cef(capi_name=del)--*/
99   virtual void Delete() =0;
100
101   ///
102   // Execute select all in this frame.
103   ///
104   /*--cef()--*/
105   virtual void SelectAll() =0;
106
107   ///
108   // Save this frame's HTML source to a temporary file and open it in the
109   // default text viewing application. This method can only be called from the
110   // browser process.
111   ///
112   /*--cef()--*/
113   virtual void ViewSource() =0;
114
115   ///
116   // Retrieve this frame's HTML source as a string sent to the specified
117   // visitor.
118   ///
119   /*--cef()--*/
120   virtual void GetSource(CefRefPtr<CefStringVisitor> visitor) =0;
121
122   ///
123   // Retrieve this frame's display text as a string sent to the specified
124   // visitor.
125   ///
126   /*--cef()--*/
127   virtual void GetText(CefRefPtr<CefStringVisitor> visitor) =0;
128
129   ///
130   // Load the request represented by the |request| object.
131   ///
132   /*--cef()--*/
133   virtual void LoadRequest(CefRefPtr<CefRequest> request) =0;
134
135   ///
136   // Load the specified |url|.
137   ///
138   /*--cef()--*/
139   virtual void LoadURL(const CefString& url) =0;
140
141   ///
142   // Load the contents of |string_val| with the specified dummy |url|. |url|
143   // should have a standard scheme (for example, http scheme) or behaviors like
144   // link clicks and web security restrictions may not behave as expected.
145   ///
146   /*--cef()--*/
147   virtual void LoadString(const CefString& string_val,
148                           const CefString& url) =0;
149
150   ///
151   // Execute a string of JavaScript code in this frame. The |script_url|
152   // parameter is the URL where the script in question can be found, if any.
153   // The renderer may request this URL to show the developer the source of the
154   // error.  The |start_line| parameter is the base line number to use for error
155   // reporting.
156   ///
157   /*--cef(optional_param=script_url)--*/
158   virtual void ExecuteJavaScript(const CefString& code,
159                                  const CefString& script_url,
160                                  int start_line) =0;
161
162   ///
163   // Returns true if this is the main (top-level) frame.
164   ///
165   /*--cef()--*/
166   virtual bool IsMain() =0;
167
168   ///
169   // Returns true if this is the focused frame.
170   ///
171   /*--cef()--*/
172   virtual bool IsFocused() =0;
173
174   ///
175   // Returns the name for this frame. If the frame has an assigned name (for
176   // example, set via the iframe "name" attribute) then that value will be
177   // returned. Otherwise a unique name will be constructed based on the frame
178   // parent hierarchy. The main (top-level) frame will always have an empty name
179   // value.
180   ///
181   /*--cef()--*/
182   virtual CefString GetName() =0;
183
184   ///
185   // Returns the globally unique identifier for this frame.
186   ///
187   /*--cef()--*/
188   virtual int64 GetIdentifier() =0;
189
190   ///
191   // Returns the parent of this frame or NULL if this is the main (top-level)
192   // frame.
193   ///
194   /*--cef()--*/
195   virtual CefRefPtr<CefFrame> GetParent() =0;
196
197   ///
198   // Returns the URL currently loaded in this frame.
199   ///
200   /*--cef()--*/
201   virtual CefString GetURL() =0;
202
203   ///
204   // Returns the browser that this frame belongs to.
205   ///
206   /*--cef()--*/
207   virtual CefRefPtr<CefBrowser> GetBrowser() =0;
208
209   ///
210   // Get the V8 context associated with the frame. This method can only be
211   // called from the render process.
212   ///
213   /*--cef()--*/
214   virtual CefRefPtr<CefV8Context> GetV8Context() =0;
215   
216   ///
217   // Visit the DOM document. This method can only be called from the render
218   // process.
219   ///
220   /*--cef()--*/
221   virtual void VisitDOM(CefRefPtr<CefDOMVisitor> visitor) =0;
222 };
223
224 #endif  // CEF_INCLUDE_CEF_FRAME_H_