Developer

API Reference

IListContainerModelFactory_CreateCallbackBased()

Brew Release
Brew MP 1.0.2
Description
This method creates an IListContainerModel interface from a set of function callbacks provided by the caller.
A IListContainerModel that functions solely off callbacks is useful when app start up performance is important because only the data and widgets for the visual list items need to be instantiated. Remember that many of these callbacks could simply call through to a ListModel (or TypedListModel).
It is the user's responsibility to call IListContainerModel_Notify when the ListContainerModel data changes, see the IListContainerModel for further information on different types of model notifications.
Parameters
  • pif
    []:
    Pointer to the IListContainerModelFactory interface object.
  • pvCtx
    []:
    the user context.
  • pfnGetItemType
    []:
    function that returns the type of the item at a certain index.
  • pfnGetWidget
    []:
    function that returns a widget that represents item for a certain type and state.
  • pfnGetItemData
    []:
    function that returns a ITypedValueModel that represents the data at a certain index.
  • pfnGetNumItems
    []:
    function that returns the number of items in the list.
  • pfnCleanUp
    []:
    function that will be used to cleanup the context.
  • ppiListContainerModel
    []:
    On success, the newly created IListContainerModel backed by the provided functions.
Prototype
   int  IListContainerModelFactory_CreateCallbackBased(IListContainerModelFactory *pif, 
      void *pvCtx, 
      PFN_GET_ITEM_TYPE pfnGetItemType, 
      PFN_GET_ITEM_WIDGET pfnGetWidget, 
      PFN_GET_ITEM_DATA pfnGetItemData, 
      PFN_GET_NUM_ITEMS pfnGetNumItems,
      PFN_CONTEXT_CLEANUP pfnCleanUp,
      IListContainerModel **ppiListContainerModel);
   
Return
   AEE_SUCCESS             : On success.
   Error code              : Otherwise.
Side Effect
None
Comment
None
  • Follow