Geoclue.Client

g GObject.GInterface GObject.GInterface Geoclue.Client Geoclue.Client GObject.GInterface->Geoclue.Client

Implementations:

Geoclue.ClientProxy, Geoclue.ClientSkeleton

Methods

class

interface_info ()

class

override_properties (klass, property_id_begin)

call_start (cancellable, callback, *user_data)

call_start_finish (res)

call_start_sync (cancellable)

call_stop (cancellable, callback, *user_data)

call_stop_finish (res)

call_stop_sync (cancellable)

complete_start (invocation)

complete_stop (invocation)

emit_location_updated (arg_old, arg_new)

Virtual Methods

do_handle_start (invocation)

do_handle_stop (invocation)

do_location_updated (arg_old, arg_new)

Properties

Name

Type

Flags

Short Description

active

bool

r/w

Active

desktop-id

str

r/w

DesktopId

distance-threshold

int

r/w

DistanceThreshold

location

str

r/w

Location

requested-accuracy-level

int

r/w

RequestedAccuracyLevel

time-threshold

int

r/w

TimeThreshold

Signals

Name

Short Description

handle-start

Signal emitted when a remote caller is invoking the ‘Start() [gdbus-method-org-freedesktop-GeoClue2-Client.Start]’ D-Bus method.

handle-stop

Signal emitted when a remote caller is invoking the ‘Stop() [gdbus-method-org-freedesktop-GeoClue2-Client.Stop]’ D-Bus method.

location-updated

On the client-side, this signal is emitted whenever the D-Bus signal ‘“LocationUpdated” [gdbus-signal-org-freedesktop-GeoClue2-Client.LocationUpdated]’ is received.

Fields

None

Class Details

class Geoclue.Client
Bases:

GObject.GInterface

Structure:

Geoclue.ClientIface

Abstract interface type for the D-Bus interface ‘org.freedesktop.GeoClue2.Client [gdbus-interface-org-freedesktop-GeoClue2-Client.top_of_page]’.

classmethod interface_info()
Returns:

A Gio.DBusInterfaceInfo. Do not free.

Return type:

Gio.DBusInterfaceInfo

Gets a machine-readable description of the ‘org.freedesktop.GeoClue2.Client [gdbus-interface-org-freedesktop-GeoClue2-Client.top_of_page]’ D-Bus interface.

classmethod override_properties(klass, property_id_begin)
Parameters:
Returns:

The last property id.

Return type:

int

Overrides all GObject.Object properties in the Geoclue.Client interface for a concrete class. The properties are overridden in the order they are defined.

call_start(cancellable, callback, *user_data)
Parameters:

Asynchronously invokes the ‘Start() [gdbus-method-org-freedesktop-GeoClue2-Client.Start]’ D-Bus method on self. 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 GLib.MainContext.push_thread_default()). You can then call Geoclue.Client.call_start_finish() to get the result of the operation.

See Geoclue.Client.call_start_sync() for the synchronous, blocking version of this method.

call_start_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to Geoclue.Client.call_start().

Raises:

GLib.Error

Returns:

True if the call succeeded, False if error is set.

Return type:

bool

Finishes an operation started with Geoclue.Client.call_start().

call_start_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – A Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

True if the call succeeded, False if error is set.

Return type:

bool

Synchronously invokes the ‘Start() [gdbus-method-org-freedesktop-GeoClue2-Client.Start]’ D-Bus method on self. The calling thread is blocked until a reply is received.

See Geoclue.Client.call_start() for the asynchronous version of this method.

call_stop(cancellable, callback, *user_data)
Parameters:

Asynchronously invokes the ‘Stop() [gdbus-method-org-freedesktop-GeoClue2-Client.Stop]’ D-Bus method on self. 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 GLib.MainContext.push_thread_default()). You can then call Geoclue.Client.call_stop_finish() to get the result of the operation.

See Geoclue.Client.call_stop_sync() for the synchronous, blocking version of this method.

call_stop_finish(res)
Parameters:

res (Gio.AsyncResult) – The Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to Geoclue.Client.call_stop().

Raises:

GLib.Error

Returns:

True if the call succeeded, False if error is set.

Return type:

bool

Finishes an operation started with Geoclue.Client.call_stop().

call_stop_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – A Gio.Cancellable or None.

Raises:

GLib.Error

Returns:

True if the call succeeded, False if error is set.

Return type:

bool

Synchronously invokes the ‘Stop() [gdbus-method-org-freedesktop-GeoClue2-Client.Stop]’ D-Bus method on self. The calling thread is blocked until a reply is received.

See Geoclue.Client.call_stop() for the asynchronous version of this method.

complete_start(invocation)
Parameters:

invocation (Gio.DBusMethodInvocation) – A Gio.DBusMethodInvocation.

Helper function used in service implementations to finish handling invocations of the ‘Start() [gdbus-method-org-freedesktop-GeoClue2-Client.Start]’ 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.

complete_stop(invocation)
Parameters:

invocation (Gio.DBusMethodInvocation) – A Gio.DBusMethodInvocation.

Helper function used in service implementations to finish handling invocations of the ‘Stop() [gdbus-method-org-freedesktop-GeoClue2-Client.Stop]’ 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.

emit_location_updated(arg_old, arg_new)
Parameters:
  • arg_old (str) – Argument to pass with the signal.

  • arg_new (str) – Argument to pass with the signal.

Emits the ‘“LocationUpdated” [gdbus-signal-org-freedesktop-GeoClue2-Client.LocationUpdated]’ D-Bus signal.

do_handle_start(invocation) virtual
Parameters:

invocation (Gio.DBusMethodInvocation) –

Return type:

bool

do_handle_stop(invocation) virtual
Parameters:

invocation (Gio.DBusMethodInvocation) –

Return type:

bool

do_location_updated(arg_old, arg_new) virtual
Parameters:
  • arg_old (str) –

  • arg_new (str) –

Signal Details

Geoclue.Client.signals.handle_start(client, invocation)
Signal Name:

handle-start

Flags:

RUN_LAST

Parameters:
Returns:

Gio.DBUS_METHOD_INVOCATION_HANDLED or True if the invocation was handled, Gio.DBUS_METHOD_INVOCATION_UNHANDLED or False to let other signal handlers run.

Return type:

bool

Signal emitted when a remote caller is invoking the ‘Start() [gdbus-method-org-freedesktop-GeoClue2-Client.Start]’ 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 Geoclue.Client.complete_start() 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 Gio.DBusError.UNKNOWN_METHOD error is returned.

Geoclue.Client.signals.handle_stop(client, invocation)
Signal Name:

handle-stop

Flags:

RUN_LAST

Parameters:
Returns:

Gio.DBUS_METHOD_INVOCATION_HANDLED or True if the invocation was handled, Gio.DBUS_METHOD_INVOCATION_UNHANDLED or False to let other signal handlers run.

Return type:

bool

Signal emitted when a remote caller is invoking the ‘Stop() [gdbus-method-org-freedesktop-GeoClue2-Client.Stop]’ 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 Geoclue.Client.complete_stop() 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 Gio.DBusError.UNKNOWN_METHOD error is returned.

Geoclue.Client.signals.location_updated(client, arg_old, arg_new)
Signal Name:

location-updated

Flags:

RUN_LAST

Parameters:
  • client (Geoclue.Client) – The object which received the signal

  • arg_old (str) – Argument.

  • arg_new (str) – Argument.

On the client-side, this signal is emitted whenever the D-Bus signal ‘“LocationUpdated” [gdbus-signal-org-freedesktop-GeoClue2-Client.LocationUpdated]’ 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.

Property Details

Geoclue.Client.props.active
Name:

active

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Represents the D-Bus property ‘“Active” [gdbus-property-org-freedesktop-GeoClue2-Client.Active]’.

Since the D-Bus property for this GObject.Object 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.

Geoclue.Client.props.desktop_id
Name:

desktop-id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Represents the D-Bus property ‘“DesktopId” [gdbus-property-org-freedesktop-GeoClue2-Client.DesktopId]’.

Since the D-Bus property for this GObject.Object property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side.

Geoclue.Client.props.distance_threshold
Name:

distance-threshold

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Represents the D-Bus property ‘“DistanceThreshold” [gdbus-property-org-freedesktop-GeoClue2-Client.DistanceThreshold]’.

Since the D-Bus property for this GObject.Object property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side.

Geoclue.Client.props.location
Name:

location

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Represents the D-Bus property ‘“Location” [gdbus-property-org-freedesktop-GeoClue2-Client.Location]’.

Since the D-Bus property for this GObject.Object 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.

Geoclue.Client.props.requested_accuracy_level
Name:

requested-accuracy-level

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Represents the D-Bus property ‘“RequestedAccuracyLevel” [gdbus-property-org-freedesktop-GeoClue2-Client.RequestedAccuracyLevel]’.

Since the D-Bus property for this GObject.Object property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side.

Geoclue.Client.props.time_threshold
Name:

time-threshold

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Represents the D-Bus property ‘“TimeThreshold” [gdbus-property-org-freedesktop-GeoClue2-Client.TimeThreshold]’.

Since the D-Bus property for this GObject.Object property is both readable and writable, it is meaningful to both read from it and write to it on both the service- and client-side.