| Top |
| void | (*InfRequestFunc) () |
| void | inf_request_fail () |
| void | inf_request_finish () |
| gboolean | inf_request_is_local () |
InfRequest is implemented by InfcProgressRequest, InfcRequest, InfdProgressRequest and InfdRequest.
InfRequest represents a potentially asynchronous operation. This is a basic interface which allows to query the type of the operation and to be notified when the request finishes.
void (*InfRequestFunc) (InfRequest *request,const InfRequestResult *result,const GError *error,gpointer user_data);
Signature of a signal handler for the “finished” signal.
request |
The InfRequest that emits the signal. |
|
result |
A InfRequestResult which contains the result of the request. |
|
error |
Error information in case the request failed, or |
|
user_data |
Additional data set when the signal handler was connected. |
void inf_request_fail (InfRequest *request,const GError *error);
Declares the request as failed by emitting the “finished” signal with the given error.
void inf_request_finish (InfRequest *request,InfRequestResult *result);
Declares the request as succeeded by emitting the “finished”
signal with the given result. The function takes ownership of result
.
request |
A InfRequest. |
|
result |
A InfRequestResult containing the result of the request. |
[transfer full] |
gboolean
inf_request_is_local (InfRequest *request);
Returns whether request
is local or remote. A local request was triggered
by a local API call, whereas a remote request was caused by a remote
participant from the network.
typedef struct _InfRequest InfRequest;
InfRequest is an opaque data type. You should only access it via the public API functions.
struct InfRequestInterface {
void (*finished)(InfRequest* request,
const InfRequestResult* result,
const GError* error);
gboolean (*is_local)(InfRequest* request);
};
Virtual functions of the InfRequest interface.
Default signal handler of the “finished” signal. |
||
Virtual function to check whether the request is local or remote. |
“progress” property“progress” gdouble
Percentage of completion of the request.
Flags: Read
Allowed values: [0,1]
Default value: 0
“type” property“type” gchar *
A string identifier for the type of the request.
Flags: Read / Write / Construct Only
Default value: NULL
“finished” signalvoid user_function (InfRequest *request, InfRequestResult *result, GError *error, gpointer user_data)
This signal is emitted when the request finishes. If error
is
non-NULL the request failed, otherwise it finished successfully.
request |
The InfRequest which finished. |
|
result |
A InfRequestResult which contains the result of the request. |
|
error |
Error information in case the request failed, or |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last