![]() |
![]() |
![]() |
libinfinity-0.6 Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Prerequisites | Known Implementations | Properties | Signals |
#include <libinfinity/common/inf-request.h> InfRequest; struct InfRequestIface; void (*InfRequestFunc) (InfRequest *request
,const InfRequestResult *result
,const GError *error
,gpointer user_data
); void inf_request_fail (InfRequest *request
,const GError *error
); void inf_request_finish (InfRequest *request
,InfRequestResult *result
); gboolean inf_request_is_local (InfRequest *request
);
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.
typedef struct _InfRequest InfRequest;
InfRequest is an opaque data type. You should only access it via the public API functions.
struct InfRequestIface { 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. |
void (*InfRequestFunc) (InfRequest *request
,const InfRequestResult *result
,const GError *error
,gpointer user_data
);
Signature of a signal handler for the "finished" signal.
|
The InfRequest that emits the signal. |
|
A InfRequestResult which contains the result of the request. |
|
Error information in case the request failed, or NULL
otherwise. |
|
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.
|
A InfRequest. |
|
A GError describing the reason for why the request failed. |
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
.
|
A InfRequest. |
|
A InfRequestResult containing the result of the request. |
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.
|
A InfRequest. |
Returns : |
TRUE if the request is local and FALSE if it is remote. |
"progress"
property"progress" gdouble : Read
Percentage of completion of the request.
Allowed values: [0,1]
Default value: 0
"type"
property"type" gchar* : Read / Write / Construct Only
A string identifier for the type of the request.
Default value: NULL
"finished"
signalvoid user_function (InfRequest *request,
InfRequestResult *result,
gpointer error,
gpointer user_data) : Run Last
This signal is emitted when the request finishes. If error
is
non-NULL
the request failed, otherwise it finished successfully.
|
The InfRequest which finished. |
|
A InfRequestResult which contains the result of the request. |
|
Error information in case the request failed, or NULL
otherwise. |
|
user data set when the signal handler was connected. |