GalagoPresence

GalagoPresence — An account's presence.

Functions

Properties

GalagoAccount * account Read / Write / Construct Only

Signals

void changed Action
void idle-changed Action
void status-added Action
void status-removed Action
void status-updated Action

Types and Values

Object Hierarchy

    GObject
    ╰── GalagoObject
        ╰── GalagoPresence

Description

GalagoPresence contains information on a GalagoAccount's presence, including idle time and a list of statuses.

Functions

galago_presence_set_idle ()

void
galago_presence_set_idle (GalagoPresence *presence,
                          gboolean idle,
                          time_t idle_start_time);

Sets the idle start time on a presence.

Parameters

presence

The presence.

 

idle

TRUE if the user is idle, otherwise FALSE.

 

idle_start_time

The idle start time in seconds.

 

galago_presence_set_statuses ()

void
galago_presence_set_statuses (GalagoPresence *presence,
                              GList *statuses);

Sets a list of statuses in a presence.

The presence claims ownership of the list and will free it when destroyed.

Parameters

presence

The presence.

 

statuses

The list of statuses.

 

galago_presence_add_status ()

void
galago_presence_add_status (GalagoPresence *presence,
                            GalagoStatus *status);

Adds a single status to a presence.

Parameters

presence

The presence.

 

status

The status.

 

galago_presence_remove_status ()

void
galago_presence_remove_status (GalagoPresence *presence,
                               const char *status_id);

Removes a single status from a presence.

The status being removed must not be an exclusive status.

Parameters

presence

The presence.

 

status_id

The ID of the status to remove.

 

galago_presence_clear_statuses ()

void
galago_presence_clear_statuses (GalagoPresence *presence);

Clears all statuses in a presence.

Parameters

presence

The presence.

 

galago_presence_get_account ()

GalagoAccount *
galago_presence_get_account (const GalagoPresence *presence);

Returns the account from a presence.

Parameters

presence

The presence.

 

Returns

The presence's account.


galago_presence_is_idle ()

gboolean
galago_presence_is_idle (const GalagoPresence *presence);

Returns the idle state from a presence.

Parameters

presence

The presence.

 

Returns

The presence's idle state.


galago_presence_get_idle_time ()

time_t
galago_presence_get_idle_time (const GalagoPresence *presence);

Returns the presence's idle time in seconds.

Parameters

presence

The presence.

 

Returns

The presence's idle time in seconds.


galago_presence_get_idle_start_time ()

time_t
galago_presence_get_idle_start_time (const GalagoPresence *presence);

Returns the time the presence was marked idle.

Parameters

presence

The presence.

 

Returns

The presence's start idle time.


galago_presence_is_discarded ()

gboolean
galago_presence_is_discarded (const GalagoPresence *presence);

Returns whether or not this is a discarded presence.

A discarded presence signifies that all existing presence info for that user is to be discarded.

Parameters

presence

The presence.

 

Returns

TRUE if the presence is discarded, or FALSE.


galago_presence_is_available ()

gboolean
galago_presence_is_available (const GalagoPresence *presence);

Returns whether or not a presence is considered available.

Parameters

presence

The presence.

 

Returns

TRUE if the presence is available, or FALSE.


galago_presence_get_statuses ()

GList *
galago_presence_get_statuses (const GalagoPresence *presence);

Returns the list of statuses from a presence.

Parameters

presence

The presence.

 

Returns

The list of statuses.


galago_presence_get_active_status ()

GalagoStatus *
galago_presence_get_active_status (const GalagoPresence *presence);

Returns the active exclusive status from a presence.

Parameters

presence

The presence.

 

Returns

The active exclusive status, if set, or NULL.


galago_presence_is_status_exclusive ()

gboolean
galago_presence_is_status_exclusive (const GalagoPresence *presence,
                                     const char *status_id);

Returns whether or not the status with the specified ID in a presence is exclusive.

Parameters

presence

The presence.

 

status_id

The ID of the status.

 

Returns

TRUE if the status is exclusive, or FALSE.


galago_presence_get_status ()

GalagoStatus *
galago_presence_get_status (const GalagoPresence *presence,
                            const char *status_id);

Returns the status from a presence with the specified ID.

Parameters

presence

The presence.

 

status_id

The status ID.

 

Returns

The status, if found, or NULL.


galago_presence_has_status ()

gboolean
galago_presence_has_status (const GalagoPresence *presence,
                            const char *status_id);

Returns whether or not a presence has a status with the specified ID.

Parameters

presence

The presence.

 

status_id

The status ID.

 

Returns

TRUE if the presence has the status, or FALSE.


galago_presence_has_status_type ()

gboolean
galago_presence_has_status_type (const GalagoPresence *presence,
                                 GalagoStatusType type);

Returns whether or not a presence has a status with the specified primitive type.

Parameters

presence

The presence.

 

type

The status type.

 

Returns

TRUE if the presence has the status, or FALSE.


galago_presence_compare ()

int
galago_presence_compare (const GalagoPresence *presence1,
                         const GalagoPresence *presence2);

Compares two presences for availability.

Parameters

presence1

The first presence.

 

presence2

The second presence.

 

Returns

-1 if presence1 is less available than presence2 , 0 if presence1 is as available as presence2 , and 1 if presence1 is more available than presence2 .

Types and Values

struct GalagoPresence

struct GalagoPresence;

This is an opaque structure representing a presence. This should not be used directly. Use the accessor functions below.


GALAGO_DBUS_PRESENCE_INTERFACE

#define GALAGO_DBUS_PRESENCE_INTERFACE "org.freedesktop.Galago.Presence"

The D-BUS interface that GalagoPresence maps to.

Property Details

The “account” property

  “account”                  GalagoAccount *

The account that owns this presence.

Flags: Read / Write / Construct Only

Signal Details

The “changed” signal

void
user_function (GalagoPresence *presence,
               gpointer        user_data)

Emitted when a property (idle state or a status added or removed) on the presence is updated.

Parameters

presence

The object which received the signal.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “idle-changed” signal

void
user_function (GalagoPresence *presence,
               gboolean        idle,
               gulong          idle_start_time,
               gpointer        user_data)

Emitted whenever the idle state changes. If idle is TRUE, idle_start_time will be a UNIX timestamp indicating when the user went idle. Otherwise, it will be 0.

Parameters

presence

The object which received the signal.

 

idle

The idle state.

 

idle_start_time

The time the user went idle, if idle is TRUE, or 0.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “status-added” signal

void
user_function (GalagoPresence *presence,
               gpointer        status,
               gpointer        user_data)

Emitted whenever a status is added.

Parameters

presence

The object which received the signal.

 

status

The status that was added.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “status-removed” signal

void
user_function (GalagoPresence *presence,
               gpointer        status,
               gpointer        user_data)

Emitted whenever a status is removed.

Parameters

presence

The object which received the signal.

 

status

The status that was removed.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “status-updated” signal

void
user_function (GalagoPresence *presence,
               gpointer        status,
               gchar          *name,
               gpointer        user_data)

Emitted when an attribute on a status was set or updated.

Parameters

presence

The object which received the signal.

 

status

The status that was updated.

 

name

The name of the attribute updated.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action