Skip to end of metadata
Go to start of metadata

FB::JSObject Class Reference

Wraps a Javascript Object. More...

#include <JSObject.h>

Inheritance diagram for FB::JSObject:
Inheritance graph
Collaboration diagram for FB::JSObject:
Collaboration graph

List of all members.

Public Member Functions

 JSObject (const BrowserHostPtr &h)
 Constructor.
virtual ~JSObject ()
 Finaliser.
virtual void InvokeAsync (const std::string &methodName, const std::vector< variant > &args)
 Just like Invoke, but works asynchronously. Useful for javascript callbacks and events. Can be safely called from any thread.
virtual void SetPropertyAsync (const std::string &propertyName, const variant &value)
 Just like SetProperty, but works asynchronously. Useful if you are running on another thread and don't need to wait to be sure it worked.
virtual JSAPIPtr getJSAPI () const =0
 Get associated FB::JSAPI.
BrowserHostPtr getHost ()
 Get the associated FB::BrowserHost; may throw std::bad_cast.

Static Public Member Functions

template<class Cont >
static void GetArrayValues (const FB::JSObjectPtr &src, Cont &dst)
 Gets Array values out of src and adds them to the STL container dst.
template<class Dict >
static void GetObjectValues (const FB::JSObjectPtr &src, Dict &dst)
 Gets object values out of the javscript object src and adds them to the STL Dict container dst.

Detailed Description

Wraps a Javascript Object.

Whenever you access a javascript object on a page, it will be through this object. Because JSObject extends JSAPI, the API will be the same as a JSAPI object other than a few additional methods provided on this object for convenience.

Implementations of JSObject are expected to be threadsafe as of 1.3.0. What that usually means is that if you call a method from another thread that it can't be safely run on it will use BrowserHost::CallOnMainThread to make the call on the main thread and wait for it to complete. There may be performance issues with this that should be taken into consideration.

See also:
JSAPI
NPObjectAPI
IDispatchAPI

Definition at line 46 of file JSObject.h.


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

Generated on 26 May 2013 for FireBreath by  doxygen 1.6.1
Labels
  • None