Skip to end of metadata
Go to start of metadata

void FB::JSAPISimple::registerProperty ( const std::string &  name,
GetPropPtr  getFunc,
SetPropPtr  setFunc 
) [virtual]

Register a property to be exposed to javascript.

All properties exposed to javascript through JSAPISimple must use getter functions that match the FB::GetPropPtr type and setter functions that match the FB::SetPropPtr type.

     // read-only
     registerProperty( "valid", (GetPropPtr)&MySimpleAPI::getValid, NULL );
     // -or- write-only
     registerProperty( "valid", NULL, (SetPropPtr)&MySimpleAPI::setValid );
     // -or- read-write
     registerProperty( "valid", (GetPropPtr)&MySimpleAPI::getValid, (SetPropPtr)&MySimpleAPI::setValid);
 @code
      
 This matches the following definition:
 @code
      variant getValid();
      void setValid(variant value);
Parameters:
name The name.
getFunc The get function (or NULL for write-only)
setFunc The set function (or NULL for read-only)

Definition at line 85 of file JSAPISimple.cpp.

00086 {
00087     m_propertyMap[name].getFunc = getFunc;
00088     m_propertyMap[name].setFunc = setFunc;
00089 }


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