FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
Public Member Functions | Static Public Member Functions | List of all members
FB::BrowserHost Class Referenceabstract

Browser host base class. More...

#include "BrowserHost.h"

Inheritance diagram for FB::BrowserHost:
Inheritance graph

Public Member Functions

 BrowserHost ()
 Default constructor. More...
 
virtual ~BrowserHost ()
 Finaliser. More...
 
bool ScheduleAsyncCall (void(*func)(void *), void *userData) const
 Schedule asynchronous call to be executed on the main thread. More...
 
template<class Functor >
Functor::result_type CallOnMainThread (Functor func) const
 Execute a call on the main thread, wait for the result, and return it. More...
 
template<class C , class Functor >
void ScheduleOnMainThread (const boost::shared_ptr< C > &obj, Functor func) const
 Schedule a call to be executed on the main thread. More...
 
virtual void * getContextID () const =0
 Gets a unique identifier for this BrowserHost. There are cases where you may need multiple BrowserHosts in a single FireBreath plugin, primarily if you are embedding some sort of web browser inside your plugin, and this is needed for that. More...
 
virtual BrowserStreamPtr createStream (const std::string &url, const PluginEventSinkPtr &callback, bool cache=true, bool seekable=false, size_t internalBufferSize=128 *1024) const
 Creates a BrowserStream (deprecated since 1.7.0) More...
 
virtual BrowserStreamPtr createPostStream (const std::string &url, const PluginEventSinkPtr &callback, const std::string &postdata, bool cache=true, bool seekable=false, size_t internalBufferSize=128 *1024) const
 Creates a BrowserStream. More...
 
virtual BrowserStreamPtr createUnsolicitedStream (const BrowserStreamRequest &req) const
 Used internally to create a BrowserStream to handle an unsolicited NPP_NewStream. More...
 
void assertMainThread () const
 When running in debug mode, asserts that the call is made on the main thread. More...
 
bool isMainThread () const
 Query if this object is on the main thread. More...
 
virtual DOM::DocumentPtr getDOMDocument ()=0
 Gets a DOM::Document wrapper for the document object that the plugin resides in. More...
 
virtual DOM::WindowPtr getDOMWindow ()=0
 Gets a DOM::Window wrapper for the DOM/JS window object that the plugin resides in. More...
 
virtual DOM::ElementPtr getDOMElement ()=0
 Gets a DOM::Element wrapper for the DOM/JS object tag that the plugin resides in. More...
 
virtual void Navigate (const std::string &url, const std::string &target)
 Instructs the browser to navigate to the specified url in the target window. More...
 
virtual void evaluateJavaScript (const std::string &script)=0
 Evaluates arbitrary javascript; note that it does not return the result due to cross- browser compatibility issues. More...
 
virtual void evaluateJavaScript (const std::wstring &script)
 
int delayedInvoke (const int delayms, const FB::JSObjectPtr &func, const FB::VariantList &args, const std::string &fname="")
 Executes the provided method object after a delay using window.setTimeout. More...
 
virtual void htmlLog (const std::string &str)
 Sends a log message to the containing web page using Console.log (firebug) More...
 
virtual void setEnableHtmlLog (const bool enabled=true)
 Enables or disables the htmlLog method. More...
 
virtual void shutdown ()
 Notifies the browserhost object that the associated plugin object is shutting down. More...
 
bool isShutDown () const
 returns true if the FB::BrowserHost::shutdown() method has been called on this object More...
 
void freeRetainedObjects () const
 releases all JSAPI objects that have been passed to the browser More...
 
void retainJSAPIPtr (const FB::JSAPIPtr &obj) const
 retains an instance of the JSAPI object until the plugin shuts down More...
 
void releaseJSAPIPtr (const FB::JSAPIPtr &obj) const
 releases the specified JSAPI object to allow it to be invalidated and freed. This is done automatically for all retained objects on shutdown More...
 
virtual void DoDeferredRelease () const =0
 Releases any browser-specific objects that were destroyed on a thread other than the main thread. Usually safe to just let FireBreath deal with this. More...
 
virtual bool DetectProxySettings (std::map< std::string, std::string > &settingsMap, const std::string &url="")
 Detects the proxy settings from the browser. More...
 

Static Public Member Functions

static void AsyncHtmlLog (void *data)
 Don't call this; it is a helper function used by htmlLog. More...
 
static int getInstanceCount ()
 Returns the count of how many BrowserHost object instances are active. More...
 

Detailed Description

Browser host base class.

In actual use, this class will be used as either a NpapiBrowserHost or a ActiveXBrowserHost. This class provides APIs for making calls to the browser of any kind. It is also used for making calls on the primary thread. There will always be exactly one BrowserHost object per plugin instance and it is unique to that instance

See Also
NpapiBrowserHost
ActiveXBrowserHost

Definition at line 69 of file BrowserHost.h.


The documentation for this class was generated from the following files: