![]() |
![]() |
![]() |
UDisks Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Prerequisites | Known Implementations | Properties | Signals |
UDisksJob; struct UDisksJobIface; GDBusInterfaceInfo * udisks_job_interface_info (void
); guint udisks_job_override_properties (GObjectClass *klass
,guint property_id_begin
); void udisks_job_call_cancel (UDisksJob *proxy
,GVariant *arg_options
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); gboolean udisks_job_call_cancel_finish (UDisksJob *proxy
,GAsyncResult *res
,GError **error
); gboolean udisks_job_call_cancel_sync (UDisksJob *proxy
,GVariant *arg_options
,GCancellable *cancellable
,GError **error
); void udisks_job_complete_cancel (UDisksJob *object
,GDBusMethodInvocation *invocation
); void udisks_job_emit_completed (UDisksJob *object
,gboolean arg_success
,const gchar *arg_message
); guint64 udisks_job_get_expected_end_time (UDisksJob *object
); gdouble udisks_job_get_progress (UDisksJob *object
); guint64 udisks_job_get_bytes (UDisksJob *object
); guint64 udisks_job_get_rate (UDisksJob *object
); guint64 udisks_job_get_start_time (UDisksJob *object
); const gchar *const * udisks_job_get_objects (UDisksJob *object
); gboolean udisks_job_get_cancelable (UDisksJob *object
); const gchar * udisks_job_get_operation (UDisksJob *object
); gboolean udisks_job_get_progress_valid (UDisksJob *object
); guint udisks_job_get_started_by_uid (UDisksJob *object
); gchar ** udisks_job_dup_objects (UDisksJob *object
); gchar * udisks_job_dup_operation (UDisksJob *object
); void udisks_job_set_expected_end_time (UDisksJob *object
,guint64 value
); void udisks_job_set_progress (UDisksJob *object
,gdouble value
); void udisks_job_set_bytes (UDisksJob *object
,guint64 value
); void udisks_job_set_rate (UDisksJob *object
,guint64 value
); void udisks_job_set_start_time (UDisksJob *object
,guint64 value
); void udisks_job_set_objects (UDisksJob *object
,const gchar *const *value
); void udisks_job_set_cancelable (UDisksJob *object
,gboolean value
); void udisks_job_set_operation (UDisksJob *object
,const gchar *value
); void udisks_job_set_progress_valid (UDisksJob *object
,gboolean value
); void udisks_job_set_started_by_uid (UDisksJob *object
,guint value
); struct UDisksJobProxy; struct UDisksJobProxyClass; void udisks_job_proxy_new (GDBusConnection *connection
,GDBusProxyFlags flags
,const gchar *name
,const gchar *object_path
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); UDisksJob * udisks_job_proxy_new_finish (GAsyncResult *res
,GError **error
); UDisksJob * udisks_job_proxy_new_sync (GDBusConnection *connection
,GDBusProxyFlags flags
,const gchar *name
,const gchar *object_path
,GCancellable *cancellable
,GError **error
); void udisks_job_proxy_new_for_bus (GBusType bus_type
,GDBusProxyFlags flags
,const gchar *name
,const gchar *object_path
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); UDisksJob * udisks_job_proxy_new_for_bus_finish (GAsyncResult *res
,GError **error
); UDisksJob * udisks_job_proxy_new_for_bus_sync (GBusType bus_type
,GDBusProxyFlags flags
,const gchar *name
,const gchar *object_path
,GCancellable *cancellable
,GError **error
); struct UDisksJobSkeleton; struct UDisksJobSkeletonClass; UDisksJob * udisks_job_skeleton_new (void
);
GInterface +----UDisksJob
GObject +----GDBusProxy +----UDisksJobProxy
GObject +----GDBusInterfaceSkeleton +----UDisksJobSkeleton +----UDisksBaseJob
UDisksJobProxy implements GDBusInterface, GInitable, GAsyncInitable and UDisksJob.
UDisksJobSkeleton implements GDBusInterface and UDisksJob.
UDisksJob is implemented by UDisksBaseJob, UDisksJobProxy, UDisksJobSkeleton, UDisksSimpleJob, UDisksSpawnedJob and UDisksThreadedJob.
"bytes" guint64 : Read / Write "cancelable" gboolean : Read / Write "expected-end-time" guint64 : Read / Write "objects" GStrv : Read / Write "operation" gchar* : Read / Write "progress" gdouble : Read / Write "progress-valid" gboolean : Read / Write "rate" guint64 : Read / Write "start-time" guint64 : Read / Write "started-by-uid" guint : Read / Write
This section contains code for working with the org.freedesktop.UDisks2.Job D-Bus interface in C.
typedef struct _UDisksJob UDisksJob;
Abstract interface type for the D-Bus interface org.freedesktop.UDisks2.Job.
struct UDisksJobIface { GTypeInterface parent_iface; gboolean (*handle_cancel) ( UDisksJob *object, GDBusMethodInvocation *invocation, GVariant *arg_options); gboolean (*get_cancelable) (UDisksJob *object); guint64 (*get_expected_end_time) (UDisksJob *object); const gchar *const * (*get_objects) (UDisksJob *object); const gchar * (*get_operation) (UDisksJob *object); gdouble (*get_progress) (UDisksJob *object); gboolean (*get_progress_valid) (UDisksJob *object); guint64 (*get_start_time) (UDisksJob *object); guint (*get_started_by_uid) (UDisksJob *object); void (*completed) ( UDisksJob *object, gboolean arg_success, const gchar *arg_message); guint64 (*get_bytes) (UDisksJob *object); guint64 (*get_rate) (UDisksJob *object); };
Virtual table for the D-Bus interface org.freedesktop.UDisks2.Job.
The parent interface. | |
Handler for the "handle-cancel" signal. | |
Getter for the "cancelable" property. | |
Getter for the "expected-end-time" property. | |
Getter for the "objects" property. | |
Getter for the "operation" property. | |
Getter for the "progress" property. | |
Getter for the "progress-valid" property. | |
Getter for the "start-time" property. | |
Getter for the "started-by-uid" property. | |
Handler for the "completed" signal. | |
Getter for the "bytes" property. | |
Getter for the "rate" property. |
GDBusInterfaceInfo * udisks_job_interface_info (void
);
Gets a machine-readable description of the org.freedesktop.UDisks2.Job D-Bus interface.
Returns : |
A GDBusInterfaceInfo. Do not free. [transfer none] |
guint udisks_job_override_properties (GObjectClass *klass
,guint property_id_begin
);
Overrides all GObject properties in the UDisksJob interface for a concrete class. The properties are overridden in the order they are defined.
|
The class structure for a GObject-derived class. |
|
The property id to assign to the first overridden property. |
Returns : |
The last property id. |
void udisks_job_call_cancel (UDisksJob *proxy
,GVariant *arg_options
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously invokes the Cancel()
D-Bus method on proxy
.
When the operation is finished, callback
will be invoked in the thread-default main loop of the thread you are calling this method from.
You can then call udisks_job_call_cancel_finish()
to get the result of the operation.
See udisks_job_call_cancel_sync()
for the synchronous, blocking version of this method.
|
A UDisksJobProxy. |
|
Argument to pass with the method invocation. |
|
A GCancellable or NULL . [allow-none]
|
|
A GAsyncReadyCallback to call when the request is satisfied or NULL . |
|
User data to pass to callback . |
gboolean udisks_job_call_cancel_finish (UDisksJob *proxy
,GAsyncResult *res
,GError **error
);
Finishes an operation started with udisks_job_call_cancel()
.
|
A UDisksJobProxy. |
|
The GAsyncResult obtained from the GAsyncReadyCallback passed to udisks_job_call_cancel() . |
|
Return location for error or NULL . |
Returns : |
TRUE if the call succeded, FALSE if error is set. [skip]
|
gboolean udisks_job_call_cancel_sync (UDisksJob *proxy
,GVariant *arg_options
,GCancellable *cancellable
,GError **error
);
Synchronously invokes the Cancel()
D-Bus method on proxy
. The calling thread is blocked until a reply is received.
See udisks_job_call_cancel()
for the asynchronous version of this method.
|
A UDisksJobProxy. |
|
Argument to pass with the method invocation. |
|
A GCancellable or NULL . [allow-none]
|
|
Return location for error or NULL . |
Returns : |
TRUE if the call succeded, FALSE if error is set. [skip]
|
void udisks_job_complete_cancel (UDisksJob *object
,GDBusMethodInvocation *invocation
);
Helper function used in service implementations to finish handling invocations of the Cancel()
D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error()
or similar.
This method will free invocation
, you cannot use it afterwards.
|
A UDisksJob. |
|
A GDBusMethodInvocation. [transfer full] |
void udisks_job_emit_completed (UDisksJob *object
,gboolean arg_success
,const gchar *arg_message
);
Emits the "Completed" D-Bus signal.
|
A UDisksJob. |
|
Argument to pass with the signal. |
|
Argument to pass with the signal. |
guint64 udisks_job_get_expected_end_time (UDisksJob *object
);
Gets the value of the "ExpectedEndTime" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
|
A UDisksJob. |
Returns : |
The property value. |
gdouble udisks_job_get_progress (UDisksJob *object
);
Gets the value of the "Progress" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
|
A UDisksJob. |
Returns : |
The property value. |
guint64 udisks_job_get_bytes (UDisksJob *object
);
Gets the value of the "Bytes" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
|
A UDisksJob. |
Returns : |
The property value. |
Since 2.1
guint64 udisks_job_get_rate (UDisksJob *object
);
Gets the value of the "Rate" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
|
A UDisksJob. |
Returns : |
The property value. |
Since 2.1
guint64 udisks_job_get_start_time (UDisksJob *object
);
Gets the value of the "StartTime" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
|
A UDisksJob. |
Returns : |
The property value. |
const gchar *const * udisks_job_get_objects (UDisksJob *object
);
Gets the value of the "Objects" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
object
was constructed. Use udisks_job_dup_objects()
if on another thread.
|
A UDisksJob. |
Returns : |
The property value or NULL if the property is not set. Do not free the returned value, it belongs to object . [transfer none]
|
gboolean udisks_job_get_cancelable (UDisksJob *object
);
Gets the value of the "Cancelable" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
|
A UDisksJob. |
Returns : |
The property value. |
const gchar * udisks_job_get_operation (UDisksJob *object
);
Gets the value of the "Operation" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
object
was constructed. Use udisks_job_dup_operation()
if on another thread.
|
A UDisksJob. |
Returns : |
The property value or NULL if the property is not set. Do not free the returned value, it belongs to object . [transfer none]
|
gboolean udisks_job_get_progress_valid (UDisksJob *object
);
Gets the value of the "ProgressValid" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
|
A UDisksJob. |
Returns : |
The property value. |
guint udisks_job_get_started_by_uid (UDisksJob *object
);
Gets the value of the "StartedByUID" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
|
A UDisksJob. |
Returns : |
The property value. |
gchar ** udisks_job_dup_objects (UDisksJob *object
);
Gets a copy of the "Objects" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
|
A UDisksJob. |
Returns : |
The property value or NULL if the property is not set. The returned value should be freed with g_strfreev() . [transfer full]
|
gchar * udisks_job_dup_operation (UDisksJob *object
);
Gets a copy of the "Operation" D-Bus property.
Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
|
A UDisksJob. |
Returns : |
The property value or NULL if the property is not set. The returned value should be freed with g_free() . [transfer full]
|
void udisks_job_set_expected_end_time (UDisksJob *object
,guint64 value
);
Sets the "ExpectedEndTime" D-Bus property to value
.
Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
|
A UDisksJob. |
|
The value to set. |
void udisks_job_set_progress (UDisksJob *object
,gdouble value
);
Sets the "Progress" D-Bus property to value
.
Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
|
A UDisksJob. |
|
The value to set. |
void udisks_job_set_bytes (UDisksJob *object
,guint64 value
);
Sets the "Bytes" D-Bus property to value
.
Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
|
A UDisksJob. |
|
The value to set. |
Since 2.1
void udisks_job_set_rate (UDisksJob *object
,guint64 value
);
Sets the "Rate" D-Bus property to value
.
Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
|
A UDisksJob. |
|
The value to set. |
Since 2.1
void udisks_job_set_start_time (UDisksJob *object
,guint64 value
);
Sets the "StartTime" D-Bus property to value
.
Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
|
A UDisksJob. |
|
The value to set. |
void udisks_job_set_objects (UDisksJob *object
,const gchar *const *value
);
Sets the "Objects" D-Bus property to value
.
Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
|
A UDisksJob. |
|
The value to set. |
void udisks_job_set_cancelable (UDisksJob *object
,gboolean value
);
Sets the "Cancelable" D-Bus property to value
.
Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
|
A UDisksJob. |
|
The value to set. |
void udisks_job_set_operation (UDisksJob *object
,const gchar *value
);
Sets the "Operation" D-Bus property to value
.
Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
|
A UDisksJob. |
|
The value to set. |
void udisks_job_set_progress_valid (UDisksJob *object
,gboolean value
);
Sets the "ProgressValid" D-Bus property to value
.
Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
|
A UDisksJob. |
|
The value to set. |
void udisks_job_set_started_by_uid (UDisksJob *object
,guint value
);
Sets the "StartedByUID" D-Bus property to value
.
Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
|
A UDisksJob. |
|
The value to set. |
struct UDisksJobProxy;
The UDisksJobProxy structure contains only private data and should only be accessed using the provided API.
struct UDisksJobProxyClass { GDBusProxyClass parent_class; };
Class structure for UDisksJobProxy.
void udisks_job_proxy_new (GDBusConnection *connection
,GDBusProxyFlags flags
,const gchar *name
,const gchar *object_path
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously creates a proxy for the D-Bus interface org.freedesktop.UDisks2.Job. See g_dbus_proxy_new()
for more details.
When the operation is finished, callback
will be invoked in the thread-default main loop of the thread you are calling this method from.
You can then call udisks_job_proxy_new_finish()
to get the result of the operation.
See udisks_job_proxy_new_sync()
for the synchronous, blocking version of this constructor.
|
A GDBusConnection. |
|
Flags from the GDBusProxyFlags enumeration. |
|
A bus name (well-known or unique) or NULL if connection is not a message bus connection. [allow-none]
|
|
An object path. |
|
A GCancellable or NULL . [allow-none]
|
|
A GAsyncReadyCallback to call when the request is satisfied. |
|
User data to pass to callback . |
UDisksJob * udisks_job_proxy_new_finish (GAsyncResult *res
,GError **error
);
Finishes an operation started with udisks_job_proxy_new()
.
|
The GAsyncResult obtained from the GAsyncReadyCallback passed to udisks_job_proxy_new() . |
|
Return location for error or NULL
|
Returns : |
The constructed proxy object or NULL if error is set. [transfer full][type UDisksJobProxy]
|
UDisksJob * udisks_job_proxy_new_sync (GDBusConnection *connection
,GDBusProxyFlags flags
,const gchar *name
,const gchar *object_path
,GCancellable *cancellable
,GError **error
);
Synchronously creates a proxy for the D-Bus interface org.freedesktop.UDisks2.Job. See g_dbus_proxy_new_sync()
for more details.
The calling thread is blocked until a reply is received.
See udisks_job_proxy_new()
for the asynchronous version of this constructor.
|
A GDBusConnection. |
|
Flags from the GDBusProxyFlags enumeration. |
|
A bus name (well-known or unique) or NULL if connection is not a message bus connection. [allow-none]
|
|
An object path. |
|
A GCancellable or NULL . [allow-none]
|
|
Return location for error or NULL
|
Returns : |
The constructed proxy object or NULL if error is set. [transfer full][type UDisksJobProxy]
|
void udisks_job_proxy_new_for_bus (GBusType bus_type
,GDBusProxyFlags flags
,const gchar *name
,const gchar *object_path
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Like udisks_job_proxy_new()
but takes a GBusType instead of a GDBusConnection.
When the operation is finished, callback
will be invoked in the thread-default main loop of the thread you are calling this method from.
You can then call udisks_job_proxy_new_for_bus_finish()
to get the result of the operation.
See udisks_job_proxy_new_for_bus_sync()
for the synchronous, blocking version of this constructor.
|
A GBusType. |
|
Flags from the GDBusProxyFlags enumeration. |
|
A bus name (well-known or unique). |
|
An object path. |
|
A GCancellable or NULL . [allow-none]
|
|
A GAsyncReadyCallback to call when the request is satisfied. |
|
User data to pass to callback . |
UDisksJob * udisks_job_proxy_new_for_bus_finish (GAsyncResult *res
,GError **error
);
Finishes an operation started with udisks_job_proxy_new_for_bus()
.
|
The GAsyncResult obtained from the GAsyncReadyCallback passed to udisks_job_proxy_new_for_bus() . |
|
Return location for error or NULL
|
Returns : |
The constructed proxy object or NULL if error is set. [transfer full][type UDisksJobProxy]
|
UDisksJob * udisks_job_proxy_new_for_bus_sync (GBusType bus_type
,GDBusProxyFlags flags
,const gchar *name
,const gchar *object_path
,GCancellable *cancellable
,GError **error
);
Like udisks_job_proxy_new_sync()
but takes a GBusType instead of a GDBusConnection.
The calling thread is blocked until a reply is received.
See udisks_job_proxy_new_for_bus()
for the asynchronous version of this constructor.
|
A GBusType. |
|
Flags from the GDBusProxyFlags enumeration. |
|
A bus name (well-known or unique). |
|
An object path. |
|
A GCancellable or NULL . [allow-none]
|
|
Return location for error or NULL
|
Returns : |
The constructed proxy object or NULL if error is set. [transfer full][type UDisksJobProxy]
|
struct UDisksJobSkeleton;
The UDisksJobSkeleton structure contains only private data and should only be accessed using the provided API.
struct UDisksJobSkeletonClass { GDBusInterfaceSkeletonClass parent_class; };
Class structure for UDisksJobSkeleton.
UDisksJob * udisks_job_skeleton_new (void
);
Creates a skeleton object for the D-Bus interface org.freedesktop.UDisks2.Job.
Returns : |
The skeleton object. [transfer full][type UDisksJobSkeleton] |
"bytes"
property "bytes" guint64 : Read / Write
Represents the D-Bus property "Bytes".
Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
Default value: 0
Since 2.1
"cancelable"
property "cancelable" gboolean : Read / Write
Represents the D-Bus property "Cancelable".
Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
Default value: FALSE
"expected-end-time"
property "expected-end-time" guint64 : Read / Write
Represents the D-Bus property "ExpectedEndTime".
Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
Default value: 0
"objects"
property "objects" GStrv : Read / Write
Represents the D-Bus property "Objects".
Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
"operation"
property "operation" gchar* : Read / Write
Represents the D-Bus property "Operation".
Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
Default value: NULL
"progress"
property "progress" gdouble : Read / Write
Represents the D-Bus property "Progress".
Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
Default value: 0
"progress-valid"
property "progress-valid" gboolean : Read / Write
Represents the D-Bus property "ProgressValid".
Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
Default value: FALSE
"rate"
property "rate" guint64 : Read / Write
Represents the D-Bus property "Rate".
Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
Default value: 0
Since 2.1
"start-time"
property "start-time" guint64 : Read / Write
Represents the D-Bus property "StartTime".
Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
Default value: 0
"started-by-uid"
property "started-by-uid" guint : Read / Write
Represents the D-Bus property "StartedByUID".
Since the D-Bus property for this GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
Default value: 0
"completed"
signalvoid user_function (UDisksJob *object,
gboolean arg_success,
gchar *arg_message,
gpointer user_data) : Run Last
On the client-side, this signal is emitted whenever the D-Bus signal "Completed" is received.
On the service-side, this signal can be used with e.g. g_signal_emit_by_name()
to make the object emit the D-Bus signal.
|
A UDisksJob. |
|
Argument. |
|
Argument. |
|
user data set when the signal handler was connected. |
"handle-cancel"
signalgboolean user_function (UDisksJob *object,
GDBusMethodInvocation *invocation,
GVariant *arg_options,
gpointer user_data) : Run Last
Signal emitted when a remote caller is invoking the Cancel()
D-Bus method.
If a signal handler returns TRUE
, it means the signal handler will handle the invocation (e.g. take a reference to invocation
and eventually call udisks_job_complete_cancel()
or e.g. g_dbus_method_invocation_return_error()
on it) and no order signal handlers will run. If no signal handler handles the invocation, the G_DBUS_ERROR_UNKNOWN_METHOD
error is returned.
|
A UDisksJob. |
|
A GDBusMethodInvocation. |
|
Argument passed by remote caller. |
|
user data set when the signal handler was connected. |
Returns : |
TRUE if the invocation was handled, FALSE to let other signal handlers run. |