FolksLocation

FolksLocation — A location. Typically latitude and longitude will be based on WGS84. However, folks often has no way of verifying that and just has to assume it's true.

Functions

Properties

FolksLocation * location Read / Write

Types and Values

Object Hierarchy

    GInterface
    ╰── FolksLocationDetails
    GObject
    ╰── FolksLocation

Prerequisites

FolksLocationDetails requires GObject.

Known Implementations

FolksLocationDetails is implemented by FolksIndividual.

Description

Functions

FOLKS_TYPE_LOCATION

#define FOLKS_TYPE_LOCATION (folks_location_get_type ())

The type for FolksLocation.


folks_location_equal ()

gboolean
folks_location_equal (FolksLocation *self,
                      FolksLocation *other);

Compare this location to another by geographical position.

Parameters

self

the FolksLocation instance

 

other

 .

the instance to compare against

.

[in]

Returns

true iff the coordinates are exactly the same

Since 0.9.2


folks_location_equal_coordinates ()

gboolean
folks_location_equal_coordinates (FolksLocation *self,
                                  gdouble latitude,
                                  gdouble longitude);

Compare the geographical position of this location against another position.

Parameters

self

the FolksLocation instance

 

latitude

 .

latitude of the other position

.

[in]

longitude

 .

longitude of the other position

.

[in]

Returns

true iff the coordinates are exactly the same

Since 0.9.2


folks_location_new ()

FolksLocation *
folks_location_new (gdouble latitude,
                    gdouble longitude);

Constructs a new instance with the given coordinates.

Parameters

latitude

 .

latitude of the new instance

.

[in]

longitude

 .

longitude of the new instance

.

[in]

Since 0.9.2


folks_location_details_change_location ()

void
folks_location_details_change_location
                               (FolksLocationDetails *self,
                                FolksLocation *location,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);

Set or remove the contact's currently advertised location.

It's preferred to call this rather than setting "location" directly, as this method gives error notification and will only return once the location has been written to the relevant backing store (or the operation's failed).

FolksPropertyError will be returned in error

if setting the location failed

See also: folks_location_details_change_location_finish()

Parameters

self

the FolksLocationDetails instance

 

location

 .

the contact's location, null to remove the information

.

[in][allow-none]

_callback_

callback to call when the request is satisfied.

[scope async]

_user_data_

the data to pass to _callback_ function.

[closure]

Since 0.9.2


folks_location_details_change_location_finish ()

void
folks_location_details_change_location_finish
                               (FolksLocationDetails *self,
                                GAsyncResult *_res_,
                                GError **error);

Set or remove the contact's currently advertised location.

It's preferred to call this rather than setting "location" directly, as this method gives error notification and will only return once the location has been written to the relevant backing store (or the operation's failed).

FolksPropertyError will be returned in error

if setting the location failed

See also: folks_location_details_change_location()

Parameters

self

the FolksLocationDetails instance

 

_res_

a GAsyncResult

 

error

location to store the error occuring, or NULL to ignore.

[error-domains FolksPropertyError]

Since 0.9.2


folks_location_details_get_location ()

FolksLocation *
folks_location_details_get_location (FolksLocationDetails *self);

Get and return the current value of the "location" property.

The current location of the contact. Null if the contact’s current location isn’t known, or they’re keeping it private.

Parameters

self

the FolksLocationDetails instance to query

 

Returns

the value of the "location" property

Since 0.9.2


folks_location_details_set_location ()

void
folks_location_details_set_location (FolksLocationDetails *self,
                                     FolksLocation *value);

Set the value of the "location" property to value .

The current location of the contact. Null if the contact’s current location isn’t known, or they’re keeping it private.

Parameters

self

the FolksLocationDetails instance to modify

 

value

the new value of the "location" property

 

Since 0.9.2

Types and Values

struct FolksLocation

struct FolksLocation;

A location. Typically latitude and longitude will be based on WGS84. However, folks often has no way of verifying that and just has to assume it's true.

Members

Since 0.9.2


struct FolksLocationClass

struct FolksLocationClass {
	GObjectClass parent_class;
};

The class structure for FOLKS_TYPE_LOCATION. All the fields in this structure are private and should never be accessed directly.

Members

GObjectClass parent_class;

the parent class structure

 

FolksLocationDetails

typedef struct _FolksLocationDetails FolksLocationDetails;

Location of a contact. folks tries to keep track of the current location and thus favors live data (say, as advertised by a chat service) over static data (from an address book). Static addresses, such as a contact's home or work address, should be presented using the FolksPostalAddressDetails interface. FolksLocationDetails is purely for exposing the contact's current or recent location.

Backends are expected to report only relevant changes in a persona's location. For storage backends like EDS, all changes must have been triggered by a person (e.g. editing the contact) and thus all are relevant.

A backend pulling in live data, for example from a GPS, is expected to filter the data to minimize noise.

folks itself will then apply all changes coming from backends without further filtering.

Since 0.9.2


struct FolksLocationDetailsIface

struct FolksLocationDetailsIface {
	GTypeInterface parent_iface;
	void (*change_location) (FolksLocationDetails* self, FolksLocation* location, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*change_location_finish) (FolksLocationDetails* self, GAsyncResult* _res_, GError** error);
	FolksLocation* (*get_location) (FolksLocationDetails* self);
	void (*set_location) (FolksLocationDetails* self, FolksLocation* value);
};

Interface for creating FolksLocationDetails implementations.

Members

GTypeInterface parent_iface;

the parent interface structure

 

change_location ()

virtual method called by folks_location_details_change_location()

 

change_location_finish ()

asynchronous finish function for change_location, called by folks_location_details_change_location()

 

get_location ()

getter method for the abstract property "location"

 

set_location ()

setter method for the abstract property "location"

 

Property Details

The “location” property

  “location”                 FolksLocation *

The current location of the contact. Null if the contact’s current location isn’t known, or they’re keeping it private.

Flags: Read / Write

Since 0.9.2