using System;
namespace CefSharp
{
///
/// A delegate type used to listen to LoadError messages.
///
/// The URL that failed to load.
/// The error code.
/// The error text.
public delegate void LoadErrorEventHandler(string failedUrl, CefErrorCode errorCode, string errorText);
public interface IWebBrowser
{
///
/// Event handler for receiving Javascript console messages being sent from web pages.
///
event ConsoleMessageEventHandler ConsoleMessage;
///
/// Event handler that will get called whenever page loading is complete.
///
event LoadCompletedEventHandler LoadCompleted;
///
/// Event handler that will get called whenever a load error occurs.
///
event LoadErrorEventHandler LoadError;
void Load(string url);
///
/// Loads custom HTML content into the web browser.
///
/// The HTML content.
/// The URL that will be treated as the address of the content.
void LoadHtml(string html, string url);
///
/// Registers a Javascript object in this specific browser instance.
///
/// The name of the object. (e.g. "foo", if you want the object to be accessible as window.foo).
/// The object to be made accessible to Javascript.
void RegisterJsObject(string name, object objectToBind);
///
/// Execute some JavaScript code in the context of this WebBrowser. As the method name implies, the script will be
/// executed asynchronously, and the method therefore returns before the script has actually been executed.
///
/// The JavaScript code that should be executed.
void ExecuteScriptAsync(string script);
///
/// Execute some JavaScript code in the context of this WebBrowser, and return the result of the evaluation.
///
/// The Javascript code that should be executed.
/// The timeout after which the JavaScript code execution should be aborted.
object EvaluateScript(string script, TimeSpan? timeout = null);
IRequestHandler RequestHandler { get; set; }
bool IsBrowserInitialized { get; }
bool IsLoading { get; }
bool CanGoBack { get; }
bool CanGoForward { get; }
string Address { get; set; }
string Title { get; set; }
string TooltipText { get; set; }
}
}