Modules | Functions

Modules

 ListColumns
 
 ListRows
 
 ListCells
 

Functions

ListModelP mdlListModel_create (int numCols)
 Creates a ListModel with the specified number of columns. More...
 
StatusInt mdlListModel_destroy (ListModelP pModel, bool bDestroyRows)
 Destroys a ListModel and optionally destroys the ListRows contained within the ListModel. More...
 
StatusInt mdlListModel_empty (ListModelP pModel, bool bDestroyRows)
 Empties the ListModel of all ListRows and optionally destroys them. More...
 
ListModelP mdlListModel_copy (ListModelCP pModel)
 Copies the specified ListModel. More...
 
int mdlListModel_getColumnCount (ListModelCP pModel)
 Returns the number of columns defined for this ListModel. More...
 
ListColumnP mdlListModel_getColumnAtIndex (ListModelCP pModel, int colIndex)
 Returns a pointer to the ListColumn at the specified column index. More...
 
ListColumnP mdlListModel_getColumnById (ListModelCP pModel, int colId)
 Returns a pointer to the ListColumn with the specified column Id. More...
 
ListColumnP mdlListModel_getColumnByName (ListModelCP pModel, WCharCP pwName)
 Returns a pointer to the ListColumn with the specified name. More...
 
StatusInt mdlListModel_sort (ListModelP pModel, bool ascending, int startIndex, int numToSort, int columnIndex)
 Sorts the ListRows within the ListModel in ascending or descending order based on values in a specified column index. More...
 
StatusInt mdlListModel_search (ListModelP pModel, MSValueDescrCP pValueDescr, InfoField *pInfoFields, int startIndex, int numToSearch, int columnIndex, int *pIndex)
 Searches through the ListRows within the ListModel for a specified value in a certain column. More...
 
StatusInt mdlListModel_searchUsingFunction (ListModelP pModel, MSValueDescrCP pValueDescr, InfoField *pInfoFields, int startIndex, int numToSearch, int columnIndex, ListColumnSearchFuncP pSearchFunc, MdlDescP pSearchOwnerMD, int *pIndex)
 Searches through the ListRows within the ListModel for a specified value in a certain column using the specified search function for all columns, including secondary columns. More...
 
int mdlListModel_getRowCount (ListModelCP pModel)
 Returns the number of ListRows in the ListModel. More...
 
ListRowP mdlListModel_getRowAtIndex (ListModelCP pModel, int index)
 Returns a pointer to the ListRow at a specified row index. More...
 
ListCellP mdlListModel_getCellAtIndexes (ListModelCP pModel, int iRow, int iCol)
 Returns a pointer to the ListCell at a specified row index and column index. More...
 
ListRowP mdlListModel_getFirstRow (ListModelCP pModel)
 Returns a pointer to the first ListRow in the ListModel. More...
 
ListRowP mdlListModel_getNextRow (ListModelCP pModel, ListRowCP pRow)
 Returns a pointer to the next ListRow after the specified ListRow in the ListModel. More...
 
ListRowP mdlListModel_getPrevRow (ListModelCP pModel, ListRowCP pRow)
 Returns a pointer to the previous ListRow before the specified ListRow in the ListModel. More...
 
ListRowP mdlListModel_getLastRow (ListModelCP pModel)
 Returns a pointer to the last ListRow in the ListModel. More...
 
int mdlListModel_addRow (ListModelP pModel, ListRowP pRow)
 Adds a specified ListRow to the end of the ListModel. More...
 
int mdlListModel_insertRow (ListModelP pModel, ListRowP pRow, int index)
 Inserts a specified ListRow into the ListModel before a certain index. More...
 
StatusInt mdlListModel_removeRow (ListModelP pModel, ListRowP pRow, bool bDestroyRow)
 Removes a specified ListRow from the ListModel and optionally destroys the ListRow. More...
 
StatusInt mdlListModel_removeRowAtIndex (ListModelP pModel, int iRow, bool bDestroy)
 Removes a ListRow at a specified index from the ListModel and optionally destroys the ListRow. More...
 
StatusInt mdlListModel_removeRows (ListModelP pModel, int iRow, int nRows, bool bDestroyRow)
 Removes a certain number of ListRows from the ListModel and optionally destroys the ListRows. More...
 
ListRowP mdlListModel_insertData (ListModelP pModel, MSValueDescrCR valueDescr, int index)
 Inserts a ListRow into the ListModel before a certain index with a specified value. More...
 
ListRowP mdlListModel_insertString (ListModelP pModel, WCharCP pwString, int index)
 Inserts a ListRow into the ListModel before a certain index with a specified Unicode string as the value. More...
 
int mdlListModel_getRowIndex (ListModelCP pModel, ListRowCP pRow)
 Returns the index of the specified ListRow within the ListModel. More...
 
StatusInt mdlListModel_filter (ListModelP pModel, WCharCP pwFilterTableName, UInt32 filterId, int startIndex, int numToFilter, int columnIndex, bool bDestroyRows)
 Activates the specified filter on the contents of the given ListModel using the specified parameters. More...
 
ListRow * mdlListModel_getFilterRow (ListModelCP pModel)
 Returns a pointer to the row used as a filter in the specified list model. More...
 
StatusInt mdlListModel_setFilterRow (ListModelP pModel, ListRowP pFilterRow)
 Sets the row to be used as a filter in the specified list model. More...
 
UserDataP mdlListModel_getAppData (ListModelCP pModel)
 Returns a pointer to application data associated with the ListModel. More...
 
StatusInt mdlListModel_setAppData (ListModelP pModel, UserDataP pAppData)
 Sets the pointer to application data to be associated with the ListModel. More...
 
int mdlListModel_getId (ListModelCP pModel)
 Returns the Id of a specified ListModel. More...
 
StatusInt mdlListModel_setId (ListModelP pModel, int id)
 Sets the Id of a specified ListModel. More...
 

Detailed Description

Function Documentation

int mdlListModel_addRow ( ListModelP  pModel,
ListRowP  pRow 
)

Adds a specified ListRow to the end of the ListModel.

Parameters
[in]pModelpoints to the ListModel
[in]pRowpoints to a ListRow
Returns
Index of new row or MDLERR_ADDRNOTVALID if pModel is invalid, MDLERR_INSFMEMORY if there was not enough memory to insert the row
See also
mdlListModel_insertRow mdlListModel_removeRow mdlListModel_removeRows
ListModelP mdlListModel_copy ( ListModelCP  pModel)

Copies the specified ListModel.

Parameters
[in]pModelpoints to the ListModel to copy.
Returns
A pointer to the copy of the ListModel.
See also
mdlListModel_destroy
ListModelP mdlListModel_create ( int  numCols)

Creates a ListModel with the specified number of columns.

Parameters
[in]numColsindicates the number of columns.
Returns
A pointer to the new ListModel
See also
mdlListModel_destroy
StatusInt mdlListModel_destroy ( ListModelP  pModel,
bool  bDestroyRows 
)

Destroys a ListModel and optionally destroys the ListRows contained within the ListModel.

Parameters
[in]pModelpoints to the ListModel
[in]bDestroyRowsindicates whether to destroy the ListRows; will usually be set to true
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pModel is invalid
See also
mdlListModel_create
StatusInt mdlListModel_empty ( ListModelP  pModel,
bool  bDestroyRows 
)

Empties the ListModel of all ListRows and optionally destroys them.

The ListModel object itself, along with column information and InfoField counts, is retained.

Parameters
[in]pModelpoints to the ListModel
[in]bDestroyRowsindicates whether to destroy the ListRows; will usually be set to true
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pModel is invalid
See also
mdlListModel_destroy
StatusInt mdlListModel_filter ( ListModelP  pModel,
WCharCP  pwFilterTableName,
UInt32  filterId,
int  startIndex,
int  numToFilter,
int  columnIndex,
bool  bDestroyRows 
)

Activates the specified filter on the contents of the given ListModel using the specified parameters.

Parameters
[in]pModelspecifies the ListModel on which the filter is activated.
[in]pwFilterTableNameis the id of the FilterNameSpace.
[in]filterIdis the id of the filter to activate.
[in]startIndexindicates the row in the ListModel at which to start the filter.
[in]numToFilterspecifies how many rows are filtered.
[in]columnIndexindicates the number of rows to filter.
[in]bDestroyRowsspecifies whether the contents of filtered out rows should be cleared out of the ListModel.
Returns
SUCCESS if the operation is completed successfully, otherwise ERROR.
UserDataP mdlListModel_getAppData ( ListModelCP  pModel)

Returns a pointer to application data associated with the ListModel.

Parameters
[in]pModelthe ListModel to process.
Returns
A pointer to the application data associated with the ListModel.
See also
mdlListModel_setAppData
ListCellP mdlListModel_getCellAtIndexes ( ListModelCP  pModel,
int  iRow,
int  iCol 
)

Returns a pointer to the ListCell at a specified row index and column index.

Parameters
[in]pModelpoints to the ListModel
[in]iRowindicates the row index of the ListRow containing the desired ListCell
[in]iColindicates the column index within the ListRow of the desired ListCell
Returns
A pointer to the ListCell at the specified row index and column index.
See also
mdlListModel_getRowAtIndex mdlListRow_getCellAtIndex
ListColumnP mdlListModel_getColumnAtIndex ( ListModelCP  pModel,
int  colIndex 
)

Returns a pointer to the ListColumn at the specified column index.

Parameters
[in]pModelpoints to the ListModel
[in]colIndexindex of the column to get
Returns
A pointer to the ListColumn at the specified column index
See also
mdlListModel_getColumnById
ListColumnP mdlListModel_getColumnById ( ListModelCP  pModel,
int  colId 
)

Returns a pointer to the ListColumn with the specified column Id.

Parameters
[in]pModelpoints to the ListModel
[in]colIdId of the column to get
Returns
A pointer to the ListColumn with the specified column Id
See also
mdlListModel_getColumnAtIndex
ListColumnP mdlListModel_getColumnByName ( ListModelCP  pModel,
WCharCP  pwName 
)

Returns a pointer to the ListColumn with the specified name.

Parameters
[in]pModelpoints to the ListModel
[in]pwNamepoints to the name of the column to get
Returns
A pointer to the ListColumn with the specified column name
See also
mdlListModel_getColumnById
int mdlListModel_getColumnCount ( ListModelCP  pModel)

Returns the number of columns defined for this ListModel.

This count is set by the mdlListModel_create function.

Parameters
[in]pModelpoints to the ListModel
Returns
The number of columns defined for this ListModel
See also
mdlListModel_getColumnAtIndex mdlListModel_getColumnById
ListRow* mdlListModel_getFilterRow ( ListModelCP  pModel)

Returns a pointer to the row used as a filter in the specified list model.

Parameters
[in]pModelthe ListModel to process.
Returns
A pointer to the filter row
See also
mdlListModel_setFilterRow
ListRowP mdlListModel_getFirstRow ( ListModelCP  pModel)

Returns a pointer to the first ListRow in the ListModel.

Parameters
[in]pModelpoints to the ListModel
Returns
A pointer to the first ListRow in the ListModel
See also
mdlListModel_getNextRow mdlListModel_getPrevRow mdlListModel_getLastRow
int mdlListModel_getId ( ListModelCP  pModel)

Returns the Id of a specified ListModel.

Parameters
[in]pModelpoints to the ListModel.
Returns
The Id of a specified ListModel, or ERROR if pModel is invalid
See also
mdlListModel_setId
ListRowP mdlListModel_getLastRow ( ListModelCP  pModel)

Returns a pointer to the last ListRow in the ListModel.

Parameters
[in]pModelpoints to the ListModel
Returns
A pointer to the last ListRow in the ListModel.
See also
mdlListModel_getFirstRow mdlListModel_getNextRow mdlListModel_getPrevRow
ListRowP mdlListModel_getNextRow ( ListModelCP  pModel,
ListRowCP  pRow 
)

Returns a pointer to the next ListRow after the specified ListRow in the ListModel.

Parameters
[in]pModelpoints to the ListModel
[in]pRowpoints to a specified ListRow before the desired ListRow
Returns
A pointer to the next ListRow in the ListModel after pRow, or NULL if pRow is the last ListRow in the ListModel.
See also
mdlListModel_getFirstRow mdlListModel_getPrevRow mdlListModel_getLastRow
ListRowP mdlListModel_getPrevRow ( ListModelCP  pModel,
ListRowCP  pRow 
)

Returns a pointer to the previous ListRow before the specified ListRow in the ListModel.

Parameters
[in]pModelpoints to the ListModel
[in]pRowpoints to a specified ListRow after the desired ListRow
Returns
A pointer to the previous ListRow in the ListModel before pRow, or NULL if pRow is the first ListRow in the ListModel
See also
mdlListModel_getFirstRow mdlListModel_getNextRow mdlListModel_getLastRow
ListRowP mdlListModel_getRowAtIndex ( ListModelCP  pModel,
int  index 
)

Returns a pointer to the ListRow at a specified row index.

Parameters
[in]pModelpoints to the ListModel
[in]indexindicates the index of the ListRow to get
Returns
A pointer to the ListRow at the specified row index
See also
mdlListModel_getRowCount mdlListModel_getRowIndex
int mdlListModel_getRowCount ( ListModelCP  pModel)

Returns the number of ListRows in the ListModel.

Parameters
[in]pModelpoints to the ListModel.
Returns
The number of ListRows in the ListModel.
See also
mdlListModel_insertRow, mdlListModel_removeRow, mdlListModel_removeRows
int mdlListModel_getRowIndex ( ListModelCP  pModel,
ListRowCP  pRow 
)

Returns the index of the specified ListRow within the ListModel.

Parameters
[in]pModelpoints to the ListModel
[in]pRowpoints to the ListRow to get the index of
Returns
The index within the ListModel of the specified ListRow, or MDLERR_ADDRNOTVALID if pModel is invalid, or MDLERR_NOMATCH if the ListRow is not in the ListModel
See also
mdlListModel_getRowAtIndex
ListRowP mdlListModel_insertData ( ListModelP  pModel,
MSValueDescrCR  valueDescr,
int  index 
)

Inserts a ListRow into the ListModel before a certain index with a specified value.

Parameters
[in]pModelpoints to the ListModel
[in]valueDescrpoints to a value to assign to the ListCell in column 0
[in]indexIndex of the ListRow to insert before. A value of -1 indicates to append the ListRow to the end.
Returns
A pointer to the new inserted ListRow
See also
mdlListModel_insertRow mdlListModel_insertString
int mdlListModel_insertRow ( ListModelP  pModel,
ListRowP  pRow,
int  index 
)

Inserts a specified ListRow into the ListModel before a certain index.

Parameters
[in]pModelpoints to the ListModel
[in]pRowpoints to a ListRow
[in]indexIndex of the ListRow to insert before. A value of -1 indicates to append the ListRow to the end.
Returns
Index of new row or MDLERR_ADDRNOTVALID if pModel is invalid, MDLERR_INSFMEMORY if there was not enough memory to insert the row.
See also
mdlListModel_removeRow mdlListModel_removeRows
ListRowP mdlListModel_insertString ( ListModelP  pModel,
WCharCP  pwString,
int  index 
)

Inserts a ListRow into the ListModel before a certain index with a specified Unicode string as the value.

Parameters
[in]pModelpoints to the ListModel
[in]pwStringpoints to a Unicode string value to assign to the ListCell in column 0
[in]indexIndex of the ListRow to insert before. A value of -1 indicates to append the ListRow to the end.
Returns
A pointer to the new ListRow
See also
mdlListModel_insertRow mdlListModel_insertData
StatusInt mdlListModel_removeRow ( ListModelP  pModel,
ListRowP  pRow,
bool  bDestroyRow 
)

Removes a specified ListRow from the ListModel and optionally destroys the ListRow.

Parameters
[in]pModelpoints to the ListModel
[in]pRowpoints to the ListRow to remove
[in]bDestroyRowtrue if the ListRow should be destroyed
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pModel is invalid, MDLERR_NOMATCH if the ListRow is not in the ListModel.
See also
mdlListModel_insertRow mdlListModel_removeRows
StatusInt mdlListModel_removeRowAtIndex ( ListModelP  pModel,
int  iRow,
bool  bDestroy 
)

Removes a ListRow at a specified index from the ListModel and optionally destroys the ListRow.

Parameters
[in]pModelpoints to the ListModel
[in]iRowindicates the 0-based index of the ListRow to remove
[in]bDestroytrue if the ListRow should be destroyed
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pModel is invalid, MDLERR_NOMATCH if the ListRow is not in the ListModel, MDLERR_BADINDEX if iRow is invalid.
See also
mdlListModel_insertRow mdlListModel_removeRow mdlListModel_removeRows
StatusInt mdlListModel_removeRows ( ListModelP  pModel,
int  iRow,
int  nRows,
bool  bDestroyRow 
)

Removes a certain number of ListRows from the ListModel and optionally destroys the ListRows.

Parameters
[in]pModelpoints to the ListModel
[in]iRowindex of the first ListRow to remove
[in]nRowsnumber of rows to remove. A value of -1 means to remove all rows to the end from iRow
[in]bDestroyRowtrue if the ListRows should be destroyed after removal
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pModel is invalid, MDLERR_BADINDEX if iRow is invalid
See also
mdlListModel_insertRow mdlListModel_removeRow
StatusInt mdlListModel_search ( ListModelP  pModel,
MSValueDescrCP  pValueDescr,
InfoField *  pInfoFields,
int  startIndex,
int  numToSearch,
int  columnIndex,
int *  pIndex 
)

Searches through the ListRows within the ListModel for a specified value in a certain column.

Parameters
[in]pModelpoints to the ListModel
[in]pValueDescrspecifies the format type and value to search for.
[in]pInfoFieldsspecifies any info fields to search for
[in]startIndexIndex of the ListRow to start the search with. A value of 0 indicates to start at the beginning.
[in]numToSearchNumber of ListRows to search. A value of -1 indicates to search all ListRows to the end from startIndex.
[in]columnIndexIndex of the column to search in.
[in]pIndexpoints to an integer that receives the index of the found ListRow. If MDLERR_NOMATCH is returned, the row number returned is where a new row may be inserted.
Remarks
The default internal search function first compares a ListCell's internal value to the pValueDescr passed in. If that comparison fails and the formatType of pValueDescr is FMT_STRING or FMT_WCHAR, the default function then compares the ListCell's display text to pValueDescr. The pInfoFields is not used in the default search function. To compare against pInfoFields, an application must provide its own search function by calling mdlListColumn_setSearchFunction or mdlListModel_searchUsingFunction.
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pModel is invalid, MDLERR_BADINDEX if either startIndex or columnIndex is invalid, MDLERR_NOMATCH if a row with the specified value is not found.
See also
mdlListColumn_setSearchFunction
StatusInt mdlListModel_searchUsingFunction ( ListModelP  pModel,
MSValueDescrCP  pValueDescr,
InfoField *  pInfoFields,
int  startIndex,
int  numToSearch,
int  columnIndex,
ListColumnSearchFuncP  pSearchFunc,
MdlDescP  pSearchOwnerMD,
int *  pIndex 
)

Searches through the ListRows within the ListModel for a specified value in a certain column using the specified search function for all columns, including secondary columns.

Parameters
[in]pModelpoints to the ListModel
[in]pValueDescrspecifies the format type and value to search for.
[in]pInfoFieldsspecifies any info fields to search for
[in]startIndexIndex of the ListRow to start the search with. A value of 0 indicates to start at the beginning.
[in]numToSearchNumber of ListRows to search. A value of -1 indicates to search all ListRows to the end from startIndex.
[in]columnIndexIndex of the column to search in.
[in]pSearchFuncspecifies to search function to use for all columns, including secondary columns.
[in]pSearchOwnerMDspecifies to search function's owner Mdl Descriptor.
[in]pIndexpoints to an integer that receives the index of the found ListRow. If MDLERR_NOMATCH is returned, the row number returned is where a new row may be inserted.
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pModel is invalid, MDLERR_BADINDEX if either startIndex or columnIndex is invalid, MDLERR_NOMATCH if a row with the specified value is not found.
See also
mdlListColumn_setSearchFunction
StatusInt mdlListModel_setAppData ( ListModelP  pModel,
UserDataP  pAppData 
)

Sets the pointer to application data to be associated with the ListModel.

Parameters
[in]pModelthe ListModel to process.
[in]pAppDatapoints to the application data to be associated with the ListModel.
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pModel is invalid
Remarks
The application data must be destroyed by the application.
See also
mdlListModel_getAppData
StatusInt mdlListModel_setFilterRow ( ListModelP  pModel,
ListRowP  pFilterRow 
)

Sets the row to be used as a filter in the specified list model.

Parameters
[in]pModelthe ListModel to process.
[in]pFilterRowpoints to the row to use as a filter.
Returns
SUCCESS if the specified row was set as the filter.
Remarks
The filter row must be destroyed by the application.
See also
mdlListModel_getFilterRow
StatusInt mdlListModel_setId ( ListModelP  pModel,
int  id 
)

Sets the Id of a specified ListModel.

Parameters
[in]pModelpoints to the ListModel
[in]idNew Id of ListModel
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pModel is invalid
See also
mdlListModel_getId
StatusInt mdlListModel_sort ( ListModelP  pModel,
bool  ascending,
int  startIndex,
int  numToSort,
int  columnIndex 
)

Sorts the ListRows within the ListModel in ascending or descending order based on values in a specified column index.

Parameters
[in]pModelpoints to the ListModel
[in]ascendingtrue if sorting in ascending order. false if sorting in descending order.
[in]startIndexIndex of the ListRow to start the sort with. A value of 0 indicates to start at the beginning.
[in]numToSortNumber of ListRows to sort. A value of -1 indicates to sort all ListRows to the end from startIndex.
[in]columnIndexIndex of the column to sort on. Note that a secondary column may be defined for a certain column using the mdlListColumn_setSortFunction function.
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pModel is invalid, MDLERR_BADINDEX if either startIndex or columnIndex is invalid
See also
mdlListColumn_setSortFunction

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.