FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
void NPObjectAPI::SetProperty ( int  idx,
const variant value 

Sets the value of an indexed property.

This can be used for providing array-style access on your object. For example, the following will result in a call to SetProperty with idx = 12:

document.getElementById("plugin")[12] = "property value";
idxZero-based index of the property to set the value of.
valueThe new property value.

Implements FB::JSAPI.

Definition at line 247 of file NPObjectAPI.cpp.

References SetProperty().

248 {
249  if (m_browser.expired())
250  return;
252  NpapiBrowserHostPtr browser(getHost());
253  std::string strIdx(boost::lexical_cast<std::string>(idx));
254  if (is_JSAPI) {
255  FB::JSAPIPtr tmp = inner.lock();
256  if (tmp)
257  SetProperty(idx, value);
258  }
259  SetProperty(strIdx, value);
260 }
void SetProperty(const std::string &propertyName, const variant &value)
Sets the value of a property.
boost::shared_ptr< FB::JSAPI > JSAPIPtr
Defines an alias for a JSAPI shared_ptr (you should never use a JSAPI* directly)
Definition: APITypes.h:94

Here is the call graph for this function: