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::JSAPIProxy Class Reference

JavaScript API Wrapper – this can wrap any type of JSAPI object and be passed back to any browser that. More...

#include "JSAPIProxy.h"

Inheritance diagram for FB::JSAPIProxy:
Inheritance graph
Collaboration diagram for FB::JSAPIProxy:
Collaboration graph

Public Member Functions

bool isExpired () const
 Returns true if the weak_ptr this contains doesn't point to anything. More...
 
void changeObject (const FB::JSAPIPtr &inner)
 Changes the wrapped JSAPIPtr to the given one. More...
 
void changeObject (const FB::JSAPIWeakPtr &inner)
 Changes the wrapped JSAPIWeakPtr to the given one. More...
 
void invalidate ()
 Invalidates this object. More...
 
virtual void getMemberNames (std::vector< std::string > &nameVector) const
 Called by the browser to enumerate the members of this JSAPI object. More...
 
virtual size_t getMemberCount () const
 Gets the member count. More...
 
virtual bool HasMethod (const std::wstring &methodName) const
 
virtual bool HasMethod (const std::string &methodName) const
 Query if the JSAPI object has the 'methodName' method. More...
 
virtual bool HasProperty (const std::wstring &propertyName) const
 
virtual bool HasProperty (const std::string &propertyName) const
 Query if 'propertyName' is a valid property. More...
 
virtual bool HasProperty (int idx) const
 Query if the property at "idx" exists. More...
 
virtual variant GetProperty (const std::wstring &propertyName)
 
virtual variant GetProperty (const std::string &propertyName)
 Gets a property value. More...
 
virtual void SetProperty (const std::wstring &propertyName, const variant &value)
 
virtual void SetProperty (const std::string &propertyName, const variant &value)
 Sets the value of a property. More...
 
virtual void RemoveProperty (const std::wstring &propertyName)
 
virtual void RemoveProperty (const std::string &propertyName)
 Removes a property. More...
 
virtual variant GetProperty (int idx)
 Gets the value of an indexed property. More...
 
virtual void SetProperty (int idx, const variant &value)
 Sets the value of an indexed property. More...
 
virtual void RemoveProperty (int idx)
 Removes an indexed property. More...
 
virtual variant Invoke (const std::wstring &methodName, const std::vector< variant > &args)
 
virtual variant Invoke (const std::string &methodName, const std::vector< variant > &args)
 Called by the browser to invoke a method on the JSAPI object. More...
 
virtual variant Construct (const std::vector< variant > &args)
 Called by the browser to construct the JSAPI object. More...
 
- Public Member Functions inherited from FB::JSAPIImpl
 JSAPIImpl (void)
 Default constructor. More...
 
virtual ~JSAPIImpl (void)
 Finaliser. More...
 
virtual void shutdown ()
 Called to notify the object that the plugin is shutting down. More...
 
virtual void pushZone (const SecurityZone &securityLevel)
 Pushes a new security level and locks a mutex (for every Push there must be a Pop!) More...
 
virtual void popZone ()
 Pops off a security level and unlocks the mutex (for every Push there must be a Pop!) More...
 
virtual void setDefaultZone (const SecurityZone &securityLevel)
 Sets the default zone (the zone the class operates on before a push) More...
 
virtual SecurityZone getDefaultZone () const
 Gets the default zone (the zone the class operates on before a push) More...
 
virtual SecurityZone getZone () const
 Gets the currently active zone. More...
 
virtual void registerEvent (const std::string &name)
 Register event so that event listeners can be added/attached from javascript. More...
 
virtual void registerEvent (const std::wstring &name)
 
virtual void registerEventMethod (const std::string &name, JSObjectPtr &event)
 Called by the browser to register an event handler method. More...
 
virtual void registerEventMethod (const std::wstring &name, JSObjectPtr &event)
 
virtual void unregisterEventMethod (const std::string &name, JSObjectPtr &event)
 Called by the browser to unregister an event handler method. More...
 
virtual void unregisterEventMethod (const std::wstring &name, JSObjectPtr &event)
 
virtual void registerEventInterface (const JSObjectPtr &event)
 Called by the browser to register a JSObject interface that handles events. This is primarily used by IE. Objects provided to this method are called when events are fired by calling a method of the event name on the event interface. More...
 
virtual void unregisterEventInterface (const JSObjectPtr &event)
 Called by the browser to unregister a JSObject interface that handles events. More...
 
- Public Member Functions inherited from FB::JSAPI
 JSAPI (void)
 Default constructor. More...
 
virtual ~JSAPI (void)
 Finaliser. More...
 
virtual bool HasMethodObject (const std::wstring &methodObjName) const
 
virtual bool HasMethodObject (const std::string &methodObjName) const
 Query if 'methodObjName' is a valid methodObj. More...
 
virtual JSAPIPtr GetMethodObject (const std::wstring &methodObjName)
 
virtual JSAPIPtr GetMethodObject (const std::string &methodObjName)
 Gets a method object (JSAPI object that has a default method) More...
 

Static Public Member Functions

static JSAPIProxyPtr create (const FB::JSAPIPtr &inner)
 Creates a JSAPIProxy that holds a shared_ptr reference to the JSAPI object provided. More...
 
static JSAPIProxyPtr create (const SecurityZone &securityLevel, const FB::JSAPIPtr &inner)
 
static JSAPIProxyPtr create (const FB::JSAPIWeakPtr &inner)
 Creates a JSAPIProxy that holds a weak_ptr reference to the JSAPI object provided. More...
 
static JSAPIProxyPtr create (const SecurityZone &securityLevel, const FB::JSAPIWeakPtr &inner)
 

Additional Inherited Members

- Protected Member Functions inherited from FB::JSAPIImpl
virtual void FireEvent (const std::wstring &eventName, const std::vector< variant > &args)
 
virtual void FireEvent (const std::string &eventName, const std::vector< variant > &args)
 Fires an event into javascript asynchronously. More...
 
virtual void FireJSEvent (const std::string &eventName, const FB::VariantMap &members, const FB::VariantList &arguments)
 Fires an event into javascript asynchronously using a W3C-compliant event parameter. More...
 
virtual void FireJSEvent (const std::string &eventName, const FB::VariantMap &params)
 
virtual void FireJSEvent (const std::string &eventName, const FB::VariantList &arguments)
 

Detailed Description

JavaScript API Wrapper – this can wrap any type of JSAPI object and be passed back to any browser that.

There are cases when you may want to pass a JSAPI object into another browser / browserhost instance (even just such as another page). This class makes it possible to return a JSAPI object from a different instance of the plugin into a page, or presumably even a JSObject from one page into another (be really careful with that). Note that not all JSAPI objects are linked to a BrowserHost instance, and thus might not need this wrapper class to function correctly

Both constructors also have an optional SecurityZone parameter that, if provided, can allow this proxy object to operate in a different security zone than the object it wraps, allowing the same object to be shared between two instances of a plugin that run in different security zones

See Also
FB::JSAPI
FB::JSAPIAuto

Definition at line 45 of file JSAPIProxy.h.


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