IMAPITable.c File Reference

Operations on tables. More...

#include "libmapi/libmapi.h"
#include "libmapi/libmapi_private.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)
 

Detailed Description

Operations on tables.

Function Documentation

_PUBLIC_ enum MAPISTATUS Abort ( mapi_object_t obj_table,
uint8_t *  TableStatus 
)

Aborts an asynchronous table operation in progress

Parameters
obj_tablethe table object where we want to abort an asynchronous operation
TableStatuspointer on the table status returned by the operation
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table or TableStatus are null
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), 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).

Parameters
obj_tablethe table we are collapsing the category in.
categoryIdthe 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.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
ExpandRow

References emsmdb_transaction_wrapper(), 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

Parameters
obj_tablethe table we are creating a bookmark in
lpbkPositionpointer to the bookmark value. This bookmark can be passed in a call to the SeekRowBookmark method
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SeekRowBookmark, FreeBookmark

References mapi_obj_bookmark::bin, mapi_obj_table::bk_last, mapi_obj_table::bookmark, emsmdb_transaction_wrapper(), 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).

Parameters
obj_tablethe table we are collapsing the category in.
categoryIdthe row identification for the heading row for the category being expanded.
maxRowsthe 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.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table, rowData or rowCount are NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
CollapseRow

References emsmdb_get_SRowSet(), emsmdb_transaction_wrapper(), mapi_session::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.

_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

Parameters
obj_tablethe table we are searching in
respointer on search criterias
bkOriginbookmark identifying the row where FindRow should begin
ulFlagscontrols the direction of the search
SRowSetthe resulting row

bkOrigin can either take the value of a bookmark created with CreateBookmark or any of the default values:

  • BOOKMARK_BEGINNING
  • BOOKMARK_CURRENT
  • BOOKMARK_END

ulFlags can be set either to DIR_FORWARD (0x0) or DIR_BACKWARD (0x1).

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_INVALID_BOOKMARK: the bookmark specified is invalid or beyond the last row requested.
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
CreateBookmark

References emsmdb_get_SRowSet(), emsmdb_transaction_wrapper(), get_mapi_SRestriction_size(), mapi_session::mapi_ctx, mapi_object_bookmark_find(), 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().

_PUBLIC_ enum MAPISTATUS FreeBookmark ( mapi_object_t obj_table,
uint32_t  bkPosition 
)

Release the resources associated with a bookmark

Parameters
obj_tablethe table the bookmark is associated to
bkPositionthe bookmark to be freed
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_INVALID_BOOKMARK: The bookmark specified is invalid or beyond the last row requested
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
CreateBookmark

References mapi_obj_bookmark::bin, mapi_obj_table::bk_last, mapi_obj_table::bookmark, emsmdb_transaction_wrapper(), 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

Parameters
respointer on the mapi_SRestriction
Returns
mapi_SRestriction size

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.

Parameters
obj_tablethe table we are retrieving the state from
rowIdthe row number for the cursor
rowInstanceNumberthe 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.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table or CollapseState are null
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetCollapseState

References emsmdb_transaction_wrapper(), 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

Parameters
obj_tablethe table we are retrieving the status from
TableStatusthe table status result

TableStatus can either hold:

  • TBLSTAT_COMPLETE (0x0)
  • TBLSTAT_SORTING (0x9)
  • TBLSTAT_SORT_ERROR (0xA)
  • TBLSTAT_SETTING_COLS (0xB)
  • TBLSTAT_SETCOL_ERROR (0xD)
  • TBLSTAT_RESTRICTING (0xE)
  • TBLSTAT_RESTRICT_ERROR (0xF)
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_INVALID_BOOKMARK: the bookmark specified is invalid or beyond the last row requested.
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetColumns, Restrict, FindRow, GetHierarchyTable, GetContentsTable

References emsmdb_transaction_wrapper(), 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

Parameters
obj_tablethe table we are retrieving columns from
colspointer to an array of property tags
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetColumns, QueryRows

References emsmdb_transaction_wrapper(), 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

Parameters
obj_tablepointer to the table's object
Numeratorpointer to the numerator of the fraction identifying the table position
Denominatorpointer to the denominator of the fraction identifying the table position
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
QueryRows
Examples:
fetchappointment.c, and fetchmail.c.

References emsmdb_transaction_wrapper(), 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

Parameters
obj_tablethe table we are requesting properties from
row_countthe maximum number of rows to retrieve
flagsflags to use for the query
rowSetthe results

flags possible values:

  • TBL_ADVANCE: index automatically increased from last rowcount
  • TBL_NOADVANCE: should be used for a single QueryRows call
  • TBL_ENABLEPACKEDBUFFERS: (not yet implemented)
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetColumns, QueryPosition, QueryColumns, SeekRow
Examples:
fetchappointment.c, and fetchmail.c.

References emsmdb_get_SRowSet(), emsmdb_transaction_wrapper(), mapi_session::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 ModifyUserPermission(), and RemoveUserPermission().

_PUBLIC_ enum MAPISTATUS Reset ( mapi_object_t obj_table)

Removes all filters that are currently on a table

Parameters
obj_tablethe table object to reset
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
Restrict

References emsmdb_transaction_wrapper(), 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.

Parameters
obj_tablethe object we are filtering
resthe filters we want to apply
TableStatusthe table status result

TableStatus can either hold:

  • TBLSTAT_COMPLETE (0x0)
  • TBLSTAT_SORTING (0x9)
  • TBLSTAT_SORT_ERROR (0xA)
  • TBLSTAT_SETTING_COLS (0xB)
  • TBLSTAT_SETCOL_ERROR (0xD)
  • TBLSTAT_RESTRICTING (0xE)
  • TBLSTAT_RESTRICT_ERROR (0xF)

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.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
QueryRows, Reset

References emsmdb_transaction_wrapper(), get_mapi_SRestriction_size(), 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

Parameters
obj_tablethe table we are moving cursor on
originthe table position where we start to seek
offseta particular offset in the table
rowthe position of the seeked row is returned in rows

origin possible values:

  • BOOKMARK_BEGINNING: Beginning of the table
  • BOOKMARK_CURRENT: Current position in the table
  • BOKMARK_END: End of the table
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetColumns, QueryRows

References emsmdb_transaction_wrapper(), 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

Parameters
obj_tablethe table we are moving cursor on
ulNumeratornumerator of the fraction representing the table position.
ulDenominatordenominator of the fraction representing the table position
  • If ulDenominator is NULL, then SeekRowApprox returns MAPI_E_INVALID_PARAMETER.
  • If ulNumerator is NULL, then SeekRowApprox moves the cursor to the beginning of the table. In such situation, SeekRowApprox call is similar to SeekRow with BOOKMARK_BEGINNING
  • If ulNumerator and ulDenominator have the same value, then SeekRowApprox moves the cursor to the end of the table. In such situation, SeekRowApprox call is similar to SeekRow with BOOKMARK_END
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SeekRow, SeekRowBookmark

References emsmdb_transaction_wrapper(), 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

Parameters
obj_tablethe table we are moving cursor on
lpbkPositionthe bookmarked position
RowCounta relative number of rows to the bookmark
rowthe position of the seeked row is returned in rows
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_INVALID_BOOKMARK: The bookmark specified is invalid or beyond the last row requested
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
CreateBookmark, FreeBookmark

References emsmdb_transaction_wrapper(), 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.

Parameters
obj_tablethe table we are restoring the state for
CollapseStatethe Collapse State to restore
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table or CollapseState are null
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetCollapseState

References emsmdb_transaction_wrapper(), 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.

Parameters
obj_tablethe table the function is setting columns for
propertiesthe properties intended to be set
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_W_ERROR_RETURNED: Problem encountered while trying to set one or more properties
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
QueryRows, QueryColumns, SeekRow, GetLastError
Examples:
fetchappointment.c, and fetchmail.c.

References emsmdb_transaction_wrapper(), 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

Parameters
obj_tablethe table we are ordering rows on
lpSortCriteriapointer on sort criterias to apply
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table or lpSortCriteria is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by GetUserFreeBusyData().


Creative Commons License
Creative Commons Attribution icon Creative Commons Share Alike icon
This content is licensed under the Creative Commons
Attribution ShareAlike License v. 3.0:
http://creativecommons.org/licenses/by-sa/3.0/