Callbacks¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- Infinity.AdoptedStateVectorForeachFunc(id, value, *user_data)¶
- Parameters:
id (
int
) – The ID of the entry.value (
int
) – The value of the entry.user_data (
object
orNone
) – The user data passed toInfinity.AdoptedStateVector.foreach
().
This function is called for every component in the state vector during the invocation of
Infinity.AdoptedStateVector.foreach
().
- Infinity.AsyncOperationDoneFunc(run_data, *user_data)¶
- Parameters:
run_data (
object
orNone
) – The result of the asynchronous operation.user_data (
object
orNone
) – Data passed inInfinity.AsyncOperation.new
().
This function is called in the main thread once the asynchronous operation has finished.
- Infinity.AsyncOperationRunFunc(run_data, run_notify, *user_data)¶
- Parameters:
run_data (
object
orNone
) – Location where to write the result of the asynchronous operation.run_notify (
GLib.DestroyNotify
) – Function to be used to free run_data, orNone
.user_data (
object
orNone
) – Data passed inInfinity.AsyncOperation.new
().
This function performs the asynchronous task and is executed in a separate thread. The pointer written into run_data is passed back to the main thread after the function has finished executing.
- Infinity.DiscoveryResolvCompleteFunc(info, connection, error, *user_data)¶
- Parameters:
info (
Infinity.DiscoveryInfo
) – The resolvedInfinity.DiscoveryInfo
.connection (
Infinity.XmlConnection
) – The resultingInfinity.XmlConnection
.error (
GLib.Error
) – Reason in case of failure.user_data (
object
orNone
) – The user_data passed toInfinity.Discovery.resolve
().
This callback is called when a call to
Infinity.Discovery.resolve
() finished.
- Infinity.FileListFunc(name, path, type, *user_data)¶
- Parameters:
name (
str
) – The name of the current file.path (
str
) – The full path to the current file.type (
Infinity.FileType
) – The type of the current file.user_data (
object
orNone
) – User data specified at the time of the call.
- Returns:
True
if the iteration should be continued orFalse
otherwise.- Return type:
This is the prototype of the callback function passed to
Infinity.file_util_list_directory
(). If the function returnsFalse
then directory traversal is stopped immediately. In addition error can be set and it is propagated to the caller ofInfinity.file_util_list_directory
().
- Infinity.IoDispatchFunc(*user_data)¶
- Parameters:
user_data (
object
orNone
) – User-defined data specified inInfinity.Io.add_dispatch
().
Callback function that is called when a dispatch is executed by the thread that runs
Infinity.Io
.
- Infinity.IoTimeoutFunc(*user_data)¶
- Parameters:
user_data (
object
orNone
) – User-defined data specified inInfinity.Io.add_timeout
().
Callback function that is called when a timeout has elapsed.
- Infinity.IoWatchFunc(socket, event, *user_data)¶
- Parameters:
socket ([
int
]) – The socket on which an event occurred.event (
Infinity.IoEvent
) – A bitmask of the events that occurred.user_data (
object
orNone
) – User-defined data specified inInfinity.Io.add_watch
().
Callback function that is called when an event occurs on a watched socket.
- Infinity.RequestFunc(request, result, error, *user_data)¶
- Parameters:
request (
Infinity.Request
) – TheInfinity.Request
that emits the signal.result (
Infinity.RequestResult
) – AInfinity.RequestResult
which contains the result of the request.error (
GLib.Error
) – Error information in case the request failed, orNone
otherwise.user_data (
object
orNone
) – Additional data set when the signal handler was connected.
Signature of a signal handler for the
Infinity.Request
::finished
signal.
- Infinity.SaslContextCallbackFunc(session, property, session_data, *user_data)¶
- Parameters:
session (
Infinity.SaslContextSession
) – AInfinity.SaslContextSession
.property (
int
) – The property requested.session_data (
object
orNone
) – The session data for session specified inInfinity.SaslContext.server_start_session
() orInfinity.SaslContext.client_start_session
().user_data (
object
orNone
) – The user data specified inInfinity.SaslContext.set_callback
().
This callback is called whenever a property is required to proceed with authentication. For example, when a password is required, the callback is called with property set to %GSASL_PASSCODE.
The function is then expected to set that property using
Infinity.SaslContextSession.set_property
() and, once it is done, callInfinity.SaslContextSession.continue_
(). This can happen fully asynchronously, that is it does not need to take place directly within the callback but the callback can, for example, open a dialog for the user to enter a password and then once the user closes the dialog call the two functions mentioned above.
- Infinity.SaslContextSessionFeedFunc(session, data, needs_more, error, *user_data)¶
- Parameters:
session (
Infinity.SaslContextSession
) – AInfinity.SaslContextSession
.data (
str
) – The response to the fed data, base64 encoded and null-terminated.needs_more (
bool
) – IfTrue
thenInfinity.SaslContextSession.feed
() needs to be called again with more data, otherwise the authentication has finished.error (
GLib.Error
) – This is nonzero if an error occurred while processing the input data.user_data (
object
orNone
) – The user data specified inInfinity.SaslContextSession.feed
().
This function is called in response to
Infinity.SaslContextSession.feed
(). When all required properties (if any) have been provided by the callback function then this function is called with the response to send to the remote site.If an error occurred then error will be set and data will be
None
.
- Infinity.UserTableForeachUserFunc(user, *user_data)¶
- Parameters:
user (
Infinity.User
) – TheInfinity.User
for the current iteration.user_data (
object
orNone
) – The user_data passed toInfinity.UserTable.foreach_user
() orInfinity.UserTable.foreach_local_user
().
This callback is called for every user iterated by
Infinity.UserTable.foreach_user
() orInfinity.UserTable.foreach_local_user
().