-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
IBrowser.cs
155 lines (131 loc) · 5.18 KB
/
IBrowser.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// Copyright © 2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
using System.Collections.Generic;
namespace CefSharp
{
/// <summary>
/// CefSharp interface for CefBrowser.
/// </summary>
public interface IBrowser : IDisposable
{
/// <summary>
/// Returns True if this object is currently valid. This will return false after
/// <see cref="ILifeSpanHandler.OnBeforeClose(IWebBrowser, IBrowser)"/> is called.
/// </summary>
bool IsValid { get; }
/// <summary>
/// Returns the browser host object. This method can only be called in the browser process.
/// </summary>
/// <returns>the browser host object</returns>
IBrowserHost GetHost();
/// <summary>
/// Returns true if the browser can navigate backwards.
/// </summary>
bool CanGoBack { get; }
/// <summary>
/// Navigate backwards.
/// </summary>
void GoBack();
/// <summary>
/// Returns true if the browser can navigate forwards.
/// </summary>
bool CanGoForward { get; }
/// <summary>
/// Navigate forwards.
/// </summary>
void GoForward();
/// <summary>
/// Returns true if the browser is currently loading.
/// </summary>
bool IsLoading { get; }
/// <summary>
/// Request that the browser close. The JavaScript 'onbeforeunload' event will be fired.
/// </summary>
/// <param name="forceClose">
/// If forceClose is false the event handler, if any, will be allowed to prompt the user and the
/// user can optionally cancel the close. If forceClose is true the prompt will not be displayed
/// and the close will proceed. Results in a call to <see cref="ILifeSpanHandler.DoClose"/> if
/// the event handler allows the close or if forceClose is true
/// See <see cref="ILifeSpanHandler.DoClose"/> documentation for additional usage information.
/// </param>
void CloseBrowser(bool forceClose);
/// <summary>
/// Reload the current page.
/// </summary>
/// <param name="ignoreCache">
/// <c>true</c> a reload is performed ignoring browser cache; <c>false</c> a reload is
/// performed using files from the browser cache, if available.
/// </param>
void Reload(bool ignoreCache = false);
/// <summary>
/// Stop loading the page.
/// </summary>
void StopLoad();
/// <summary>
/// Returns the globally unique identifier for this browser.
/// </summary>
int Identifier { get; }
/// <summary>
/// Returns true if this object is pointing to the same handle as that object.
/// </summary>
/// <param name="that">compare browser instances</param>
/// <returns>returns true if the same instance</returns>
bool IsSame(IBrowser that);
/// <summary>
/// Returns true if the window is a popup window.
/// </summary>
bool IsPopup { get; }
/// <summary>
/// Returns true if a document has been loaded in the browser.
/// </summary>
bool HasDocument { get; }
/// <summary>
/// Returns the main (top-level) frame for the browser window.
/// </summary>
IFrame MainFrame { get; }
/// <summary>
/// Returns the focused frame for the browser window.
/// </summary>
IFrame FocusedFrame { get; }
/// <summary>
/// Returns the frame with the specified identifier, or NULL if not found.
/// </summary>
/// <param name="identifier">identifier</param>
/// <returns>frame or null</returns>
IFrame GetFrame(Int64 identifier);
/// <summary>
/// Returns the frame with the specified name, or NULL if not found.
/// </summary>
/// <param name="name">name of frame</param>
/// <returns>frame or null</returns>
IFrame GetFrame(string name);
/// <summary>
/// Returns the number of frames that currently exist.
/// </summary>
/// <returns>the number of frames</returns>
int GetFrameCount();
/// <summary>
/// Returns the identifiers of all existing frames.
/// </summary>
/// <returns>list of frame identifiers</returns>
List<Int64> GetFrameIdentifiers();
/// <summary>
/// Returns the names of all existing frames.
/// </summary>
/// <returns>frame names</returns>
List<string> GetFrameNames();
/// <summary>
/// Gets a value indicating whether the browser has been disposed of.
/// </summary>
bool IsDisposed { get; }
//
// Send a message to the specified |target_process|. Returns true if the
// message was sent successfully.
//
/*--cef()--*/
//virtual bool SendProcessMessage(CefProcessId target_process,
// CefRefPtr<CefProcessMessage> message) =0;
}
}