| 157 | | @typedef JSObjectAddPropertiesToListCallback |
| 158 | | @abstract The callback invoked when adding an object's properties to a property list. |
| 159 | | @param object The JSObject whose properties need to be added to propertyList. |
| 160 | | @param propertyList A JavaScript property list that will be used to enumerate object's properties. |
| 161 | | @discussion If you named your function GetPropertyList, you would declare it like this: |
| 162 | | |
| 163 | | void AddPropertiesToList(JSObjectRef object, JSPropertyListRef propertyList); |
| 164 | | |
| 165 | | Use JSPropertyListAdd to add properties to propertyList. |
| 166 | | |
| 167 | | Property lists are used by JSPropertyEnumerators and JavaScript for...in loops. |
| | 157 | @typedef JSObjectGetPropertyNamesCallback |
| | 158 | @abstract The callback invoked to get the names of an object's properties. |
| | 159 | @param context The current execution context. |
| | 160 | @param object The JSObject whose property names need to be appended to propertyNames. |
| | 161 | @param accumulator A JavaScript property name accumulator, to which the object should add the names of its properties. |
| | 162 | @discussion If you named your function GetPropertyNames, you would declare it like this: |
| | 163 | |
| | 164 | void GetPropertyNames(JSContextRef context, JSObjectRef object, JSPropertyNameAccumulatorRef accumulator); |
| | 165 | |
| | 166 | Use JSPropertyNameAccumulatorAddName to add property names to accumulator. |
| | 167 | |
| | 168 | Property lists are used by JSPropertyEnumerators and JavaScript for...in loops. |
| | 169 | |
| | 170 | It's only necessary to add names of properties that you handle |
| | 171 | specially in your own get / set callbacks. Static property names, |
| | 172 | names of standard JS properties, and properties from the prototype |
| | 173 | will be added automatically. |
| 552 | | @abstract Creates an enumerator for an object's properties. |
| 553 | | @param object The object whose properties you want to enumerate. |
| 554 | | @result A JSPropertyEnumerator with a list of object's properties. Ownership follows the Create Rule. |
| 555 | | */ |
| 556 | | JSPropertyEnumeratorRef JSObjectCreatePropertyEnumerator(JSObjectRef object); |
| 557 | | /*! |
| 558 | | @function |
| 559 | | @abstract Retains a property enumerator. |
| 560 | | @param enumerator The JSPropertyEnumerator to retain. |
| 561 | | @result A JSPropertyEnumerator that is the same as enumerator. |
| 562 | | */ |
| 563 | | JSPropertyEnumeratorRef JSPropertyEnumeratorRetain(JSPropertyEnumeratorRef enumerator); |
| 564 | | /*! |
| 565 | | @function |
| 566 | | @abstract Releases a property enumerator. |
| 567 | | @param enumerator The JSPropertyEnumerator to release. |
| 568 | | */ |
| 569 | | void JSPropertyEnumeratorRelease(JSPropertyEnumeratorRef enumerator); |
| 570 | | /*! |
| 571 | | @function |
| 572 | | @abstract Gets a property enumerator's next property. |
| 573 | | @param enumerator The JSPropertyEnumerator whose next property you want to get. |
| 574 | | @result A JSString containing the property's name, or NULL if all properties have been enumerated. |
| 575 | | */ |
| 576 | | JSStringRef JSPropertyEnumeratorGetNextName(JSPropertyEnumeratorRef enumerator); |
| 577 | | |
| 578 | | /*! |
| 579 | | @function |
| 580 | | @abstract Adds a property to a property list. |
| 581 | | @discussion Use this method inside a JSObjectAddPropertiesToListCallback to add a property to an object's property list. |
| 582 | | @param propertyList The JSPropertyList to which you want to add a property. |
| 583 | | @param thisObject The JSObject to which the property belongs. |
| 584 | | @param propertyName A JSString specifying the property's name. |
| 585 | | */ |
| 586 | | void JSPropertyListAdd(JSPropertyListRef propertyList, JSObjectRef thisObject, JSStringRef propertyName); |
| | 557 | @abstract Get the names of all enumerable properties of an object. |
| | 558 | @param context The execution context to use. |
| | 559 | @param object The object from which to get property names. |
| | 560 | @result A JSPropertyNameArray containing the names of all the object's enumerable properties. |
| | 561 | */ |
| | 562 | JSPropertyNameArrayRef JSObjectCopyPropertyNames(JSContextRef context, JSObjectRef object); |
| | 563 | |
| | 564 | /*! |
| | 565 | @function |
| | 566 | @abstract Retains a JavaScript property name array. |
| | 567 | @param array The JSPropertyNameArray to retain. |
| | 568 | @result A JSPropertyNameArray that is the same as array. |
| | 569 | */ |
| | 570 | JSPropertyNameArrayRef JSPropertyNameArrayRetain(JSPropertyNameArrayRef array); |
| | 571 | |
| | 572 | /*! |
| | 573 | @function |
| | 574 | @abstract Releases a JavaScript property name array. |
| | 575 | @param array The JSPropetyNameArray to release. |
| | 576 | */ |
| | 577 | void JSPropertyNameArrayRelease(JSPropertyNameArrayRef array); |
| | 578 | |
| | 579 | /*! |
| | 580 | @function |
| | 581 | @abstract Get the number of items in a JavaScript property name array. |
| | 582 | @param array The array from which to retrieve the count. |
| | 583 | @result The count of items in the array. |
| | 584 | */ |
| | 585 | size_t JSPropertyNameArrayGetCount(JSPropertyNameArrayRef array); |
| | 586 | |
| | 587 | /*! |
| | 588 | @function |
| | 589 | @abstract Get a single item from a JavaScript property name array. |
| | 590 | @param array The array from which to retrieve a property name. |
| | 591 | @param index The index of the property name to retrieve. |
| | 592 | @result A JSStringRef containing the name of the property. |
| | 593 | */ |
| | 594 | JSStringRef JSPropertyNameArrayGetNameAtIndex(JSPropertyNameArrayRef array, size_t index); |
| | 595 | |
| | 596 | /*! |
| | 597 | @function |
| | 598 | @abstract Add a property name - useful while getting the property names for an object. |
| | 599 | @param accumulator The accumulator object to which to add the property. |
| | 600 | @param propertyName The new property to add. |
| | 601 | */ |
| | 602 | void JSPropertyNameAccumulatorAddName(JSPropertyNameAccumulatorRef accumulator, JSStringRef propertyName); |