Page tree
Skip to end of metadata
Go to start of metadata

void FB::JSAPIAuto::registerProperty ( const std::string &  name,
const PropertyFunctors propFuncs 
)
virtual

Register property to be exposed to javascript.

To provide a property called "IsFinished" that javascript can access, you need two methods:

bool get_IsFinished();
void set_IsFinished(bool newVal);

Then in the constructor of your class that extends JSAPIAuto (we'll call it MyPluginAPI), you register it like so:

registerProperty("IsFinished", make_property(this, &MyPluginAPI::get_IsFinished, &MyPluginAPI::set_IsFinished));

To register a property that is read- or write-only, simply provide "NULL" for the getter or setter function when registering the property.

Parameters
nameThe name.
propFuncsThe property funcs.

Definition at line 104 of file JSAPIAuto.cpp.

105 {
106  boost::recursive_mutex::scoped_lock lock(m_zoneMutex);
107  m_propertyFunctorsMap[name] = propFuncs;
108  m_zoneMap[name] = getZone();
109 }
virtual SecurityZone getZone() const
Gets the currently active zone.
Definition: JSAPIImpl.h:238
  • No labels