Operations on tables. More...
#include <libmapi/libmapi.h>
Functions | |
_PUBLIC_ enum MAPISTATUS | Abort (mapi_object_t *obj_table, uint8_t *TableStatus) |
_PUBLIC_ enum MAPISTATUS | CollapseRow (mapi_object_t *obj_table, uint64_t categoryId, uint32_t *rowCount) |
_PUBLIC_ enum MAPISTATUS | CreateBookmark (mapi_object_t *obj_table, uint32_t *lpbkPosition) |
_PUBLIC_ enum MAPISTATUS | ExpandRow (mapi_object_t *obj_table, uint64_t categoryId, uint16_t maxRows, struct SRowSet *rowData, uint32_t *expandedRowCount) |
_PUBLIC_ enum MAPISTATUS | FindRow (mapi_object_t *obj_table, struct mapi_SRestriction *res, enum BOOKMARK bkOrigin, enum FindRow_ulFlags ulFlags, struct SRowSet *SRowSet) |
_PUBLIC_ enum MAPISTATUS | FreeBookmark (mapi_object_t *obj_table, uint32_t bkPosition) |
uint32_t | get_mapi_SRestriction_size (struct mapi_SRestriction *res) |
_PUBLIC_ enum MAPISTATUS | GetCollapseState (mapi_object_t *obj_table, uint64_t rowId, uint32_t rowInstanceNumber, struct SBinary_short *CollapseState) |
_PUBLIC_ enum MAPISTATUS | GetStatus (mapi_object_t *obj_table, uint8_t *TableStatus) |
_PUBLIC_ enum MAPISTATUS | QueryColumns (mapi_object_t *obj_table, struct SPropTagArray *cols) |
_PUBLIC_ enum MAPISTATUS | QueryPosition (mapi_object_t *obj_table, uint32_t *Numerator, uint32_t *Denominator) |
_PUBLIC_ enum MAPISTATUS | QueryRows (mapi_object_t *obj_table, uint16_t row_count, enum QueryRowsFlags flags, struct SRowSet *rowSet) |
_PUBLIC_ enum MAPISTATUS | Reset (mapi_object_t *obj_table) |
_PUBLIC_ enum MAPISTATUS | Restrict (mapi_object_t *obj_table, struct mapi_SRestriction *res, uint8_t *TableStatus) |
_PUBLIC_ enum MAPISTATUS | SeekRow (mapi_object_t *obj_table, enum BOOKMARK origin, int32_t offset, uint32_t *row) |
_PUBLIC_ enum MAPISTATUS | SeekRowApprox (mapi_object_t *obj_table, uint32_t ulNumerator, uint32_t ulDenominator) |
_PUBLIC_ enum MAPISTATUS | SeekRowBookmark (mapi_object_t *obj_table, uint32_t lpbkPosition, uint32_t RowCount, uint32_t *row) |
_PUBLIC_ enum MAPISTATUS | SetCollapseState (mapi_object_t *obj_table, struct SBinary_short *CollapseState) |
_PUBLIC_ enum MAPISTATUS | SetColumns (mapi_object_t *obj_table, struct SPropTagArray *properties) |
_PUBLIC_ enum MAPISTATUS | SortTable (mapi_object_t *obj_table, struct SSortOrderSet *lpSortCriteria) |
Operations on tables.
_PUBLIC_ enum MAPISTATUS Abort | ( | mapi_object_t * | obj_table, | |
uint8_t * | TableStatus | |||
) |
Aborts an asynchronous table operation in progress
obj_table | the table object where we want to abort an asynchronous operation | |
TableStatus | pointer on the table status returned by the operation |
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
_PUBLIC_ enum MAPISTATUS CollapseRow | ( | mapi_object_t * | obj_table, | |
uint64_t | categoryId, | |||
uint32_t * | rowCount | |||
) |
Collapse an expanded row in a table
After a contents table has been sorted and categorized using SortTable, rows can be expanded and collapsed (using ExpandRow and CollapseRow repectively).
obj_table | the table we are collapsing the category in. | |
categoryId | the row identification for the heading row for the category being collapsed. | |
rowCount | (result) the number of rows that were removed from the table when the row was collapsed. |
You obtain the categoryId argument from the PR_INST_ID property of the heading row for the category that is being collapsed.
If you pass rowCount as null, the number of rows will not be returned.
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
_PUBLIC_ enum MAPISTATUS CreateBookmark | ( | mapi_object_t * | obj_table, | |
uint32_t * | lpbkPosition | |||
) |
Marks the table current position
obj_table | the table we are creating a bookmark in | |
lpbkPosition | pointer to the bookmark value. This bookmark can be passed in a call to the SeekRowBookmark method |
References mapi_obj_bookmark::bin, mapi_obj_table::bk_last, mapi_obj_table::bookmark, mapi_provider::ctx, DLIST_ADD, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_obj_bookmark::index, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.
_PUBLIC_ enum MAPISTATUS ExpandRow | ( | mapi_object_t * | obj_table, | |
uint64_t | categoryId, | |||
uint16_t | maxRows, | |||
struct SRowSet * | rowData, | |||
uint32_t * | expandedRowCount | |||
) |
Expand a collapsed row in a table
After a contents table has been sorted and categorized using SortTable, rows can be expanded and collapsed (using ExpandRow and CollapseRow repectively).
obj_table | the table we are collapsing the category in. | |
categoryId | the row identification for the heading row for the category being expanded. | |
maxRows | the maximum number of rows to retrieve (can be zero) | |
rowData | (result) the data rows under this category heading | |
expandedRowCount | (result) the number of rows that were added to the table when the row was expanded |
You obtain the categoryId argument from the PR_INST_ID property of the heading row for the category that is being collapsed.
The maxRows argument specifies the upper limit on how many rows to return (as rowData) when the category is expanded. The expandedRowCount argument returns the number of rows that were added to the table. As an example, consider a collapsed category with 8 entries. If you set maxRows to 3, then rowData will contain the data for the first three rows, and expandedRowCount will be set to 8. If you now use QueryRows(), you can read the 5 additional rows. If you'd specified maxRows as 8 (or more), rowData would have contained all 8 rows and expandedRowCount still would have been 8.
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_get_SRowSet(), emsmdb_transaction(), global_mapi_ctx, mapi_ctx::lp_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.
_PUBLIC_ enum MAPISTATUS FindRow | ( | mapi_object_t * | obj_table, | |
struct mapi_SRestriction * | res, | |||
enum BOOKMARK | bkOrigin, | |||
enum FindRow_ulFlags | ulFlags, | |||
struct SRowSet * | SRowSet | |||
) |
Find the next row in a table that matches specific search criteria
obj_table | the table we are searching in | |
res | pointer on search criterias | |
bkOrigin | bookmark identifying the row where FindRow should begin | |
ulFlags | controls the direction of the search | |
SRowSet | the resulting row |
bkOrigin can either take the value of a bookmark created with CreateBookmark or any of the default values:
ulFlags can be set either to DIR_FORWARD (0x0) or DIR_BACKWARD (0x1).
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_get_SRowSet(), emsmdb_transaction(), get_mapi_SRestriction_size(), global_mapi_ctx, mapi_ctx::lp_ctx, mapi_object_bookmark_find(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.
Referenced by GetUserFreeBusyData().
_PUBLIC_ enum MAPISTATUS FreeBookmark | ( | mapi_object_t * | obj_table, | |
uint32_t | bkPosition | |||
) |
Release the resources associated with a bookmark
obj_table | the table the bookmark is associated to | |
bkPosition | the bookmark to be freed |
References mapi_obj_bookmark::bin, mapi_obj_table::bk_last, mapi_obj_table::bookmark, mapi_provider::ctx, DLIST_REMOVE, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_obj_bookmark::index, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), MAPIFreeBuffer(), mapi_obj_bookmark::next, OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.
uint32_t get_mapi_SRestriction_size | ( | struct mapi_SRestriction * | res | ) |
Get the size associated to a mapi SRestriction
res | pointer on the mapi_SRestriction |
References get_mapi_property_size(), RES_AND, RES_BITMASK, RES_COMPAREPROPS, RES_CONTENT, RES_EXIST, RES_OR, RES_PROPERTY, and RES_SIZE.
Referenced by FindRow(), Restrict(), and SetSearchCriteria().
_PUBLIC_ enum MAPISTATUS GetCollapseState | ( | mapi_object_t * | obj_table, | |
uint64_t | rowId, | |||
uint32_t | rowInstanceNumber, | |||
struct SBinary_short * | CollapseState | |||
) |
Get the Collapse State of a Table
After a contents table has been sorted and categorized using SortTable, rows can be expanded and collapsed (using ExpandRow() and CollapseRow() repectively). You can save the state of the table using this function, and restore it using SetCollapseState.
obj_table | the table we are retrieving the state from | |
rowId | the row number for the cursor | |
rowInstanceNumber | the instance number for the cursor | |
CollapseState | (result) the returned table Collapse State |
You obtain the row number and row instance number arguments from the PR_INST_ID and PR_INST_NUM properties of the row you want to use as the cursor.
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
_PUBLIC_ enum MAPISTATUS GetStatus | ( | mapi_object_t * | obj_table, | |
uint8_t * | TableStatus | |||
) |
Get the status of a table
obj_table | the table we are retrieving the status from | |
TableStatus | the table status result |
TableStatus can either hold:
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
_PUBLIC_ enum MAPISTATUS QueryColumns | ( | mapi_object_t * | obj_table, | |
struct SPropTagArray * | cols | |||
) |
Retrieves the set of columns defined in the current table view
obj_table | the table we are retrieving columns from | |
cols | pointer to an array of property tags |
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.
_PUBLIC_ enum MAPISTATUS QueryPosition | ( | mapi_object_t * | obj_table, | |
uint32_t * | Numerator, | |||
uint32_t * | Denominator | |||
) |
Returns the approximate cursor position
obj_table | pointer to the table's object | |
Numerator | pointer to the numerator of the fraction identifying the table position | |
Denominator | pointer to the denominator of the fraction identifying the table position |
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
Referenced by ModifyUserPermission(), and RemoveUserPermission().
_PUBLIC_ enum MAPISTATUS QueryRows | ( | mapi_object_t * | obj_table, | |
uint16_t | row_count, | |||
enum QueryRowsFlags | flags, | |||
struct SRowSet * | rowSet | |||
) |
Returns a RowSet with the properties returned by the server
obj_table | the table we are requesting properties from | |
row_count | the maximum number of rows to retrieve | |
flags | flags to use for the query | |
rowSet | the results |
flags possible values:
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_get_SRowSet(), emsmdb_transaction(), global_mapi_ctx, mapi_ctx::lp_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.
Referenced by ModifyUserPermission(), and RemoveUserPermission().
_PUBLIC_ enum MAPISTATUS Reset | ( | mapi_object_t * | obj_table | ) |
Removes all filters that are currently on a table
obj_table | the table object to reset |
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
_PUBLIC_ enum MAPISTATUS Restrict | ( | mapi_object_t * | obj_table, | |
struct mapi_SRestriction * | res, | |||
uint8_t * | TableStatus | |||
) |
Applies a filter to a table, reducing the row set to only those rows matching the specified criteria.
obj_table | the object we are filtering | |
res | the filters we want to apply | |
TableStatus | the table status result |
TableStatus can either hold:
Unlike MAPI, you don't pass a null restriction argument to remove the current restrictions. Use Reset() instead.
TableStatus should be set to NULL if you don't want to retrieve the status of the table.
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), get_mapi_SRestriction_size(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
_PUBLIC_ enum MAPISTATUS SeekRow | ( | mapi_object_t * | obj_table, | |
enum BOOKMARK | origin, | |||
int32_t | offset, | |||
uint32_t * | row | |||
) |
Move the table cursor at a specific location
obj_table | the table we are moving cursor on | |
origin | the table position where we start to seek | |
offset | a particular offset in the table | |
row | the position of the seeked row is returned in rows |
origin possible values:
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
_PUBLIC_ enum MAPISTATUS SeekRowApprox | ( | mapi_object_t * | obj_table, | |
uint32_t | ulNumerator, | |||
uint32_t | ulDenominator | |||
) |
Moves the cursor to an approximate fractional position in the table
obj_table | the table we are moving cursor on | |
ulNumerator | numerator of the fraction representing the table position. | |
ulDenominator | denominator of the fraction representing the table position |
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
_PUBLIC_ enum MAPISTATUS SeekRowBookmark | ( | mapi_object_t * | obj_table, | |
uint32_t | lpbkPosition, | |||
uint32_t | RowCount, | |||
uint32_t * | row | |||
) |
Move the table cursor at a specific location given a bookmark
obj_table | the table we are moving cursor on | |
lpbkPosition | the bookmarked position | |
RowCount | a relative number of rows to the bookmark | |
row | the position of the seeked row is returned in rows |
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_bookmark_find(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
_PUBLIC_ enum MAPISTATUS SetCollapseState | ( | mapi_object_t * | obj_table, | |
struct SBinary_short * | CollapseState | |||
) |
Set the Collapse State of a Table
After a contents table has been sorted and categorized using SortTable, rows can be expanded and collapsed (using ExpandRow() and CollapseRow() repectively). You can save the state of the table using GetCollapseState, and restore it using this function.
obj_table | the table we are restoring the state for | |
CollapseState | the Collapse State to restore |
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.
_PUBLIC_ enum MAPISTATUS SetColumns | ( | mapi_object_t * | obj_table, | |
struct SPropTagArray * | properties | |||
) |
Defines the particular properties and order of properties to appear as columns in the table.
obj_table | the table the function is setting columns for | |
properties | the properties intended to be set |
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, mapi_object::private_data, and mapi_obj_table::proptags.
Referenced by GetUserFreeBusyData(), ModifyUserPermission(), and RemoveUserPermission().
_PUBLIC_ enum MAPISTATUS SortTable | ( | mapi_object_t * | obj_table, | |
struct SSortOrderSet * | lpSortCriteria | |||
) |
Order the rows of the table based on a criteria
obj_table | the table we are ordering rows on | |
lpSortCriteria | pointer on sort criterias to apply |
References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
Referenced by GetUserFreeBusyData().
![]() ![]() ![]() |
This content is licensed under the Creative Commons Attribution ShareAlike License v. 3.0: http://creativecommons.org/licenses/by-sa/3.0/ |