DataBookCursorGetPositionFunc


Description:

[ CCode ( has_target = false ) ]
[ Version ( since = "3.12" ) ]
public delegate bool DataBookCursorGetPositionFunc (DataBookCursor cursor, out int total, out int position, Cancellable? cancellable = null) throws Error

Method type for EDataBookCursorClass.get_position

Cursor implementations must implement this to count the total results matching cursor's query expression and to calculate the amount of contacts leading up to the current cursor state (cursor inclusive).

A cursor position is defined as an integer which is inclusive of the current contact to which it points (if the cursor points to an exact contact). A position of 0 indicates that the cursor is situated in a position that is before and after the entire result set. The cursor position should be 0 at creation time, and should start again from the symbolic 0 position whenever e_book_cursor_origin_begin is specified in the step method (or whenever moving the cursor beyond the end of the result set).

If the cursor is positioned beyond the end of the list, then the position should be the total amount of contacts available in the list ( as returned through the total argument) plus one.

This method is called by recalculate and in some other cases where cursor's current position and total must be recalculated from scratch.

Parameters:

cursor

an DataBookCursor

total

The total number of contacts matching cursor's query expression

position

The current position of cursor in its result list

cancellable

A Cancellable

Returns:

true on Success, otherwise false is returned if any error occurred and throws is set to reflect the error which occurred.


Namespace: E