Top |
guint64 | bytes | Read / Write |
gboolean | cancelable | Read / Write |
guint64 | expected-end-time | Read / Write |
GStrv | objects | Read / Write |
gchar * | operation | Read / Write |
gdouble | progress | Read / Write |
gboolean | progress-valid | Read / Write |
guint64 | rate | Read / Write |
guint64 | start-time | Read / Write |
guint | started-by-uid | Read / Write |
UDisksJob | |
struct | UDisksJobIface |
struct | UDisksJobProxy |
struct | UDisksJobProxyClass |
struct | UDisksJobSkeleton |
struct | UDisksJobSkeletonClass |
GInterface ╰── UDisksJob GObject ├── GDBusInterfaceSkeleton │ ╰── UDisksJobSkeleton │ ╰── UDisksBaseJob ╰── GDBusProxy ╰── UDisksJobProxy
UDisksJobProxy implements GDBusInterface, GInitable, GAsyncInitable and UDisksJob.
UDisksJobSkeleton implements GDBusInterface and UDisksJob.
UDisksJob is implemented by UDisksBaseJob, UDisksJobProxy, UDisksJobSkeleton, UDisksSimpleJob, UDisksSpawnedJob and UDisksThreadedJob.
This section contains code for working with the org.freedesktop.UDisks2.Job D-Bus interface in C.
GDBusInterfaceInfo *
udisks_job_interface_info (void
);
Gets a machine-readable description of the org.freedesktop.UDisks2.Job D-Bus interface.
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.
klass |
The class structure for a GObject derived class. |
|
property_id_begin |
The property id to assign to the first overridden property. |
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.
proxy |
||
arg_options |
Argument to pass with the method invocation. |
|
cancellable |
A GCancellable or |
[nullable] |
callback |
A GAsyncReadyCallback to call when the request is satisfied or |
|
user_data |
User data to pass to |
gboolean udisks_job_call_cancel_finish (UDisksJob *proxy
,GAsyncResult *res
,GError **error
);
Finishes an operation started with udisks_job_call_cancel()
.
proxy |
||
res |
The GAsyncResult obtained from the GAsyncReadyCallback passed to |
|
error |
Return location for error or |
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.
proxy |
||
arg_options |
Argument to pass with the method invocation. |
|
cancellable |
A GCancellable or |
[nullable] |
error |
Return location for error or |
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.
void udisks_job_emit_completed (UDisksJob *object
,gboolean arg_success
,const gchar *arg_message
);
Emits the "Completed" D-Bus signal.
object |
A UDisksJob. |
|
arg_success |
Argument to pass with the signal. |
|
arg_message |
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.
[skip]
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.
[skip]
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.
[skip]
Since: 2.0.0
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.
[skip]
Since: 2.0.0
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.
[skip]
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.[skip]
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.
[skip]
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.[skip]
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.
[skip]
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.
[skip]
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.
[skip]
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.
[skip]
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.
[skip]
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.
[skip]
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.
[skip]
Since: 2.0.0
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.
[skip]
Since: 2.0.0
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.
[skip]
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.
[skip]
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.
[skip]
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.
[skip]
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.
[skip]
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.
[skip]
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.
connection |
||
flags |
Flags from the GDBusProxyFlags enumeration. |
|
name |
A bus name (well-known or unique) or |
[nullable] |
object_path |
An object path. |
|
cancellable |
A GCancellable or |
[nullable] |
callback |
A GAsyncReadyCallback to call when the request is satisfied. |
|
user_data |
User data to pass to |
UDisksJob * udisks_job_proxy_new_finish (GAsyncResult *res
,GError **error
);
Finishes an operation started with udisks_job_proxy_new()
.
res |
The GAsyncResult obtained from the GAsyncReadyCallback passed to |
|
error |
Return location for error or |
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.
connection |
||
flags |
Flags from the GDBusProxyFlags enumeration. |
|
name |
A bus name (well-known or unique) or |
[nullable] |
object_path |
An object path. |
|
cancellable |
A GCancellable or |
[nullable] |
error |
Return location for error or |
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.
bus_type |
A GBusType. |
|
flags |
Flags from the GDBusProxyFlags enumeration. |
|
name |
A bus name (well-known or unique). |
|
object_path |
An object path. |
|
cancellable |
A GCancellable or |
[nullable] |
callback |
A GAsyncReadyCallback to call when the request is satisfied. |
|
user_data |
User data to pass to |
UDisksJob * udisks_job_proxy_new_for_bus_finish (GAsyncResult *res
,GError **error
);
Finishes an operation started with udisks_job_proxy_new_for_bus()
.
res |
The GAsyncResult obtained from the GAsyncReadyCallback passed to |
|
error |
Return location for error or |
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.
bus_type |
A GBusType. |
|
flags |
Flags from the GDBusProxyFlags enumeration. |
|
name |
A bus name (well-known or unique). |
|
object_path |
An object path. |
|
cancellable |
A GCancellable or |
[nullable] |
error |
Return location for error or |
UDisksJob *
udisks_job_skeleton_new (void
);
Creates a skeleton object for the D-Bus interface org.freedesktop.UDisks2.Job.
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.
GTypeInterface |
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. |
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.
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.
“bytes”
property“bytes” guint64
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.
Flags: Read / Write
Default value: 0
Since: 2.0.0
“cancelable”
property“cancelable” gboolean
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.
Flags: Read / Write
Default value: FALSE
“expected-end-time”
property“expected-end-time” guint64
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.
Flags: Read / Write
Default value: 0
“objects”
property“objects” GStrv
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.
Flags: Read / Write
“operation”
property“operation” gchar *
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.
Flags: Read / Write
Default value: NULL
“progress”
property“progress” gdouble
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.
Flags: Read / Write
Default value: 0
“progress-valid”
property“progress-valid” gboolean
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.
Flags: Read / Write
Default value: FALSE
“rate”
property“rate” guint64
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.
Flags: Read / Write
Default value: 0
Since: 2.0.0
“start-time”
property“start-time” guint64
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.
Flags: Read / Write
Default value: 0
“started-by-uid”
property“started-by-uid” guint
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.
Flags: Read / Write
Default value: 0
“completed”
signalvoid user_function (UDisksJob *object, gboolean arg_success, gchar *arg_message, gpointer user_data)
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.
object |
A UDisksJob. |
|
arg_success |
Argument. |
|
arg_message |
Argument. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“handle-cancel”
signalgboolean user_function (UDisksJob *object, GDBusMethodInvocation *invocation, GVariant *arg_options, gpointer user_data)
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.
object |
A UDisksJob. |
|
invocation |
||
arg_options |
Argument passed by remote caller. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last