FB::JSAPI Class Reference
JavaScript API class -- provides a javascript interface that can be exposed to the browser. More...
#include <JSAPI.h>
Inheritance diagram for FB::JSAPI:

Public Member Functions | |
| JSAPI (void) | |
| Default constructor. | |
| virtual | ~JSAPI (void) |
| Finaliser. | |
| virtual void | invalidate ()=0 |
| Invalidates this object. | |
| virtual void | shutdown () |
| Called to notify the object that the plugin is shutting down. | |
| virtual void | pushZone (const SecurityZone &securityLevel) |
| Pushes a new security level and locks a mutex (for every Push there *must* be a Pop!). | |
| virtual void | popZone () |
| Pops off a security level and unlocks the mutex (for every Push there *must* be a Pop!). | |
| virtual void | setDefaultZone (const SecurityZone &securityLevel) |
| Sets the default zone (the zone the class operates on before a push). | |
| virtual SecurityZone | getDefaultZone () const |
| Gets the default zone (the zone the class operates on before a push). | |
| virtual SecurityZone | getZone () const |
| Gets the currently active zone. | |
| virtual void | registerEventMethod (const std::string &name, JSObjectPtr &event) |
| Called by the browser to register an event handler method. | |
| 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. | |
| 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. | |
| virtual void | unregisterEventInterface (const JSObjectPtr &event) |
| Called by the browser to unregister a JSObject interface that handles events. | |
| virtual void | getMemberNames (std::vector< std::string > &nameVector) const =0 |
| Called by the browser to enumerate the members of this JSAPI object. | |
| virtual size_t | getMemberCount () const =0 |
| Gets the member count. | |
| virtual bool | HasMethod (const std::wstring &methodName) const |
| virtual bool | HasMethod (const std::string &methodName) const =0 |
| Query if the JSAPI object has the 'methodName' method. | |
| virtual bool | HasMethodObject (const std::wstring &methodObjName) const |
| virtual bool | HasMethodObject (const std::string &methodObjName) const |
| Query if 'methodObjName' is a valid methodObj. | |
| virtual bool | HasProperty (const std::wstring &propertyName) const |
| virtual bool | HasProperty (const std::string &propertyName) const =0 |
| Query if 'propertyName' is a valid property. | |
| virtual bool | HasProperty (int idx) const =0 |
| Query if the property at "idx" exists. | |
| 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). | |
| virtual variant | GetProperty (const std::wstring &propertyName) |
| virtual variant | GetProperty (const std::string &propertyName)=0 |
| Gets a property value. | |
| virtual void | SetProperty (const std::wstring &propertyName, const variant &value) |
| virtual void | SetProperty (const std::string &propertyName, const variant &value)=0 |
| Sets the value of a property. | |
| virtual variant | GetProperty (int idx)=0 |
| Gets the value of an indexed property. | |
| virtual void | SetProperty (int idx, const variant &value)=0 |
| Sets the value of an indexed property. | |
| virtual void | RemoveProperty (const std::wstring &propertyName) |
| virtual void | RemoveProperty (const std::string &propertyName)=0 |
| Removes a property. | |
| virtual void | RemoveProperty (int idx)=0 |
| Removes an indexed property. | |
| virtual variant | Invoke (const std::wstring &methodName, const std::vector< variant > &args) |
| virtual variant | Invoke (const std::string &methodName, const std::vector< variant > &args)=0 |
| Called by the browser to invoke a method on the JSAPI object. | |
| virtual variant | Construct (const std::vector< variant > &args)=0 |
| Called by the browser to construct the JSAPI object. | |
Detailed Description
JavaScript API class -- provides a javascript interface that can be exposed to the browser.
JSAPI is the core class for all interaction with javascript. All PluginCore-derived Plugin objects must provide a JSAPI object to provide the javascript interface for their <object> tag, and methods or properties of that object can return other JSAPI objects.
Important things to know about JSAPI objects:
- Unless you have unusual needs, you will most likely want to extend FB::JSAPIAuto instead of extending JSAPI directly.
- Any time you work with a JSAPI object you should use it with a boost::shared_ptr. FB::JSAPIPtr is a typedef for a boost::shared_ptr<JSAPI> which may be useful.
- From inside the object you can use the shared_from_this() method to get a shared_ptr for "this"
- Objects passed in from javascript, including functions, will be passed in as FB::JSObject objects which extend JSAPI.
- See also:
- FB::JSAPIAuto
Definition at line 56 of file JSAPI.h.
The documentation for this class was generated from the following file:
Generated on 17 Jun 2013 for FireBreath by
1.6.1
Labels
Page: class FB JSAPI Members
Page: class FB JSAPI popZone
Page: class FB JSAPI Invoke (2)
Page: class FB JSAPI HasMethodObject
Page: class FB JSAPI invalidate
Page: class FB JSAPI unregisterEventMethod (2)
Page: class FB JSAPI registerEventInterface
Page: class FB JSAPI GetProperty (3)
Page: class FB JSAPI registerEventMethod
Page: class FB JSAPI SetProperty
Page: class FB JSAPI HasProperty
Page: class FB JSAPI getDefaultZone
Page: class FB JSAPI setDefaultZone
Page: class FB JSAPI GetMethodObject
Page: class FB JSAPI HasMethodObject (2)
Page: class FB JSAPI shutdown
Page: class FB JSAPI JSAPI
Page: class FB JSAPI unregisterEventMethod
Page: class FB JSAPI getMemberCount
Page: class FB JSAPI ~JSAPI
Page: class FB JSAPI Invoke
Page: class FB JSAPI pushZone
Page: class FB JSAPI HasMethod (2)
Page: class FB JSAPI getZone
Page: class FB JSAPI GetProperty (2)
Page: class FB JSAPI SetProperty (3)
Page: class FB JSAPI unregisterEventInterface
Page: class FB JSAPI Construct
Page: class FB JSAPI registerEventMethod (2)
Page: class FB JSAPI HasProperty (2)
Page: class FB JSAPI GetMethodObject (2)
Page: class FB JSAPI RemoveProperty (2)
Page: class FB JSAPI RemoveProperty (3)
Page: class FB JSAPI HasMethod
Page: class FB JSAPI getMemberNames
Page: class FB JSAPI HasProperty (3)
Page: class FB JSAPI RemoveProperty
Page: class FB JSAPI GetProperty
Page: class FB JSAPI SetProperty (2)
