UDisksJob

UDisksJob — Generated C code for the org.freedesktop.UDisks2.Job D-Bus interface

Functions

Properties

guint64 bytes Read / Write
gboolean cancelable Read / Write
guint64 expected-end-time Read / Write
GStrv objects Read / Write
char * operation Read / Write
double progress Read / Write
gboolean progress-valid Read / Write
guint64 rate Read / Write
guint64 start-time Read / Write
guint started-by-uid Read / Write

Signals

void completed Run Last
gboolean handle-cancel Run Last

Types and Values

Object Hierarchy

    GInterface
    ╰── UDisksJob
    GObject
    ├── GDBusInterfaceSkeleton
       ╰── UDisksJobSkeleton
           ╰── UDisksBaseJob
    ╰── GDBusProxy
        ╰── UDisksJobProxy

Prerequisites

UDisksJob requires GObject.

Implemented Interfaces

UDisksJobProxy implements GDBusInterface, GInitable, GAsyncInitable and UDisksJob.

UDisksJobSkeleton implements GDBusInterface and UDisksJob.

Known Implementations

UDisksJob is implemented by UDisksBaseJob, UDisksJobProxy, UDisksJobSkeleton, UDisksSimpleJob, UDisksSpawnedJob and UDisksThreadedJob.

Description

This section contains code for working with the org.freedesktop.UDisks2.Job D-Bus interface in C.

Functions

udisks_job_interface_info ()

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]


udisks_job_override_properties ()

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.

Parameters

klass

The class structure for a GObject derived class.

 

property_id_begin

The property id to assign to the first overridden property.

 

Returns

The last property id.


udisks_job_call_cancel ()

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 (see g_main_context_push_thread_default()). 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.

Parameters

proxy

A UDisksJobProxy.

 

arg_options

Argument to pass with the method invocation.

 

cancellable

A GCancellable or NULL.

[nullable]

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL.

 

user_data

User data to pass to callback .

 

udisks_job_call_cancel_finish ()

gboolean
udisks_job_call_cancel_finish (UDisksJob *proxy,
                               GAsyncResult *res,
                               GError **error);

Finishes an operation started with udisks_job_call_cancel().

Parameters

proxy

A UDisksJobProxy.

 

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to udisks_job_call_cancel().

 

error

Return location for error or NULL.

 

Returns

TRUE if the call succeeded, FALSE if error is set.

[skip]


udisks_job_call_cancel_sync ()

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.

Parameters

proxy

A UDisksJobProxy.

 

arg_options

Argument to pass with the method invocation.

 

cancellable

A GCancellable or NULL.

[nullable]

error

Return location for error or NULL.

 

Returns

TRUE if the call succeeded, FALSE if error is set.

[skip]


udisks_job_complete_cancel ()

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.

Parameters

object

A UDisksJob.

 

invocation

A GDBusMethodInvocation.

[transfer full]

udisks_job_emit_completed ()

void
udisks_job_emit_completed (UDisksJob *object,
                           gboolean arg_success,
                           const gchar *arg_message);

Emits the "Completed" D-Bus signal.

Parameters

object

A UDisksJob.

 

arg_success

Argument to pass with the signal.

 

arg_message

Argument to pass with the signal.

 

udisks_job_get_expected_end_time ()

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]

Parameters

object

A UDisksJob.

 

Returns

The property value.


udisks_job_get_progress ()

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]

Parameters

object

A UDisksJob.

 

Returns

The property value.


udisks_job_get_bytes ()

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]

Parameters

object

A UDisksJob.

 

Returns

The property value.


udisks_job_get_rate ()

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]

Parameters

object

A UDisksJob.

 

Returns

The property value.


udisks_job_get_start_time ()

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]

Parameters

object

A UDisksJob.

 

Returns

The property value.


udisks_job_get_objects ()

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.

The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where object was constructed. Use udisks_job_dup_objects() if on another thread.

[skip]

Parameters

object

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][nullable]


udisks_job_get_cancelable ()

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]

Parameters

object

A UDisksJob.

 

Returns

The property value.


udisks_job_get_operation ()

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.

The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where object was constructed. Use udisks_job_dup_operation() if on another thread.

[skip]

Parameters

object

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][nullable]


udisks_job_get_progress_valid ()

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]

Parameters

object

A UDisksJob.

 

Returns

The property value.


udisks_job_get_started_by_uid ()

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]

Parameters

object

A UDisksJob.

 

Returns

The property value.


udisks_job_dup_objects ()

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]

Parameters

object

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][nullable]


udisks_job_dup_operation ()

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]

Parameters

object

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][nullable]


udisks_job_set_expected_end_time ()

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]

Parameters

object

A UDisksJob.

 

value

The value to set.

 

udisks_job_set_progress ()

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]

Parameters

object

A UDisksJob.

 

value

The value to set.

 

udisks_job_set_bytes ()

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]

Parameters

object

A UDisksJob.

 

value

The value to set.

 

udisks_job_set_rate ()

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]

Parameters

object

A UDisksJob.

 

value

The value to set.

 

udisks_job_set_start_time ()

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]

Parameters

object

A UDisksJob.

 

value

The value to set.

 

udisks_job_set_objects ()

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]

Parameters

object

A UDisksJob.

 

value

The value to set.

 

udisks_job_set_cancelable ()

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]

Parameters

object

A UDisksJob.

 

value

The value to set.

 

udisks_job_set_operation ()

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]

Parameters

object

A UDisksJob.

 

value

The value to set.

 

udisks_job_set_progress_valid ()

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]

Parameters

object

A UDisksJob.

 

value

The value to set.

 

udisks_job_set_started_by_uid ()

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]

Parameters

object

A UDisksJob.

 

value

The value to set.

 

udisks_job_proxy_new ()

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 (see g_main_context_push_thread_default()). 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.

Parameters

connection

A GDBusConnection.

 

flags

Flags from the GDBusProxyFlags enumeration.

 

name

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

[nullable]

object_path

An object path.

 

cancellable

A GCancellable or NULL.

[nullable]

callback

A GAsyncReadyCallback to call when the request is satisfied.

 

user_data

User data to pass to callback .

 

udisks_job_proxy_new_finish ()

UDisksJob *
udisks_job_proxy_new_finish (GAsyncResult *res,
                             GError **error);

Finishes an operation started with udisks_job_proxy_new().

Parameters

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to udisks_job_proxy_new().

 

error

Return location for error or NULL

 

Returns

The constructed proxy object or NULL if error is set.

[transfer full][type UDisksJobProxy]


udisks_job_proxy_new_sync ()

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.

Parameters

connection

A GDBusConnection.

 

flags

Flags from the GDBusProxyFlags enumeration.

 

name

A bus name (well-known or unique) or NULL if connection is not a message bus connection.

[nullable]

object_path

An object path.

 

cancellable

A GCancellable or NULL.

[nullable]

error

Return location for error or NULL

 

Returns

The constructed proxy object or NULL if error is set.

[transfer full][type UDisksJobProxy]


udisks_job_proxy_new_for_bus ()

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 (see g_main_context_push_thread_default()). 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.

Parameters

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 NULL.

[nullable]

callback

A GAsyncReadyCallback to call when the request is satisfied.

 

user_data

User data to pass to callback .

 

udisks_job_proxy_new_for_bus_finish ()

UDisksJob *
udisks_job_proxy_new_for_bus_finish (GAsyncResult *res,
                                     GError **error);

Finishes an operation started with udisks_job_proxy_new_for_bus().

Parameters

res

The GAsyncResult obtained from the GAsyncReadyCallback passed to udisks_job_proxy_new_for_bus().

 

error

Return location for error or NULL

 

Returns

The constructed proxy object or NULL if error is set.

[transfer full][type UDisksJobProxy]


udisks_job_proxy_new_for_bus_sync ()

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.

Parameters

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 NULL.

[nullable]

error

Return location for error or NULL

 

Returns

The constructed proxy object or NULL if error is set.

[transfer full][type UDisksJobProxy]


udisks_job_skeleton_new ()

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]

Types and Values

UDisksJob

typedef struct _UDisksJob UDisksJob;

Abstract interface type for the D-Bus interface org.freedesktop.UDisks2.Job.


struct UDisksJobIface

struct UDisksJobIface {
  GTypeInterface parent_iface;

  gboolean (*handle_cancel) (
    UDisksJob *object,
    GDBusMethodInvocation *invocation,
    GVariant *arg_options);

  guint64  (*get_bytes) (UDisksJob *object);

  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_rate) (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);
};

Virtual table for the D-Bus interface org.freedesktop.UDisks2.Job.

Members

GTypeInterface parent_iface;

The parent interface.

 

handle_cancel ()

Handler for the “handle-cancel” signal.

 

get_bytes ()

Getter for the “bytes” property.

 

get_cancelable ()

Getter for the “cancelable” property.

 

get_expected_end_time ()

Getter for the “expected-end-time” property.

 

get_objects ()

Getter for the “objects” property.

 

get_operation ()

Getter for the “operation” property.

 

get_progress ()

Getter for the “progress” property.

 

get_progress_valid ()

Getter for the “progress-valid” property.

 

get_rate ()

Getter for the “rate” property.

 

get_start_time ()

Getter for the “start-time” property.

 

get_started_by_uid ()

Getter for the “started-by-uid” property.

 

completed ()

Handler for the “completed” signal.

 

struct UDisksJobProxy

struct UDisksJobProxy;

The UDisksJobProxy structure contains only private data and should only be accessed using the provided API.


struct UDisksJobProxyClass

struct UDisksJobProxyClass {
  GDBusProxyClass parent_class;
};

Class structure for UDisksJobProxy.

Members


struct UDisksJobSkeleton

struct UDisksJobSkeleton;

The UDisksJobSkeleton structure contains only private data and should only be accessed using the provided API.


struct UDisksJobSkeletonClass

struct UDisksJobSkeletonClass {
  GDBusInterfaceSkeletonClass parent_class;
};

Class structure for UDisksJobSkeleton.

Members

Property Details

The “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.

Owner: UDisksJob

Flags: Read / Write

Default value: 0


The “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.

Owner: UDisksJob

Flags: Read / Write

Default value: FALSE


The “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.

Owner: UDisksJob

Flags: Read / Write

Default value: 0


The “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.

Owner: UDisksJob

Flags: Read / Write


The “operation” property

  “operation”                char *

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.

Owner: UDisksJob

Flags: Read / Write

Default value: NULL


The “progress” property

  “progress”                 double

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.

Owner: UDisksJob

Flags: Read / Write

Default value: 0


The “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.

Owner: UDisksJob

Flags: Read / Write

Default value: FALSE


The “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.

Owner: UDisksJob

Flags: Read / Write

Default value: 0


The “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.

Owner: UDisksJob

Flags: Read / Write

Default value: 0


The “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.

Owner: UDisksJob

Flags: Read / Write

Default value: 0

Signal Details

The “completed” signal

void
user_function (UDisksJob *object,
               gboolean   arg_success,
               char      *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.

Parameters

object

A UDisksJob.

 

arg_success

Argument.

 

arg_message

Argument.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “handle-cancel” signal

gboolean
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 other signal handlers will run. If no signal handler handles the invocation, the G_DBUS_ERROR_UNKNOWN_METHOD error is returned.

Parameters

object

A UDisksJob.

 

invocation

A GDBusMethodInvocation.

 

arg_options

Argument passed by remote caller.

 

user_data

user data set when the signal handler was connected.

 

Returns

G_DBUS_METHOD_INVOCATION_HANDLED or TRUE if the invocation was handled, G_DBUS_METHOD_INVOCATION_UNHANDLED or FALSE to let other signal handlers run.

Flags: Run Last