![]() |
![]() |
![]() |
libgalago Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
struct GalagoPresence; #define GALAGO_DBUS_PRESENCE_INTERFACE void galago_presence_set_idle (GalagoPresence *presence
,gboolean idle
,time_t idle_start_time
); void galago_presence_set_statuses (GalagoPresence *presence
,GList *statuses
); void galago_presence_add_status (GalagoPresence *presence
,GalagoStatus *status
); void galago_presence_remove_status (GalagoPresence *presence
,const char *status_id
); void galago_presence_clear_statuses (GalagoPresence *presence
); GalagoAccount * galago_presence_get_account (const GalagoPresence *presence
); gboolean galago_presence_is_idle (const GalagoPresence *presence
); time_t galago_presence_get_idle_time (const GalagoPresence *presence
); time_t galago_presence_get_idle_start_time (const GalagoPresence *presence
); gboolean galago_presence_is_discarded (const GalagoPresence *presence
); gboolean galago_presence_is_available (const GalagoPresence *presence
); GList * galago_presence_get_statuses (const GalagoPresence *presence
); GalagoStatus * galago_presence_get_active_status (const GalagoPresence *presence
); gboolean galago_presence_is_status_exclusive (const GalagoPresence *presence
,const char *status_id
); GalagoStatus * galago_presence_get_status (const GalagoPresence *presence
,const char *status_id
); gboolean galago_presence_has_status (const GalagoPresence *presence
,const char *status_id
); gboolean galago_presence_has_status_type (const GalagoPresence *presence
,GalagoStatusType type
); int galago_presence_compare (const GalagoPresence *presence1
,const GalagoPresence *presence2
);
"changed" :Action
"idle-changed" :Action
"status-added" :Action
"status-removed" :Action
"status-updated" :Action
GalagoPresence contains information on a GalagoAccount's presence, including idle time and a list of statuses.
struct GalagoPresence;
This is an opaque structure representing a presence. This should not be used directly. Use the accessor functions below.
#define GALAGO_DBUS_PRESENCE_INTERFACE "org.freedesktop.Galago.Presence"
The D-BUS interface that GalagoPresence maps to.
void galago_presence_set_idle (GalagoPresence *presence
,gboolean idle
,time_t idle_start_time
);
Sets the idle start time on a presence.
|
The presence. |
|
TRUE if the user is idle, otherwise FALSE . |
|
The idle start time in seconds. |
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.
|
The presence. |
|
The list of statuses. |
void galago_presence_add_status (GalagoPresence *presence
,GalagoStatus *status
);
Adds a single status to a presence.
|
The presence. |
|
The 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.
|
The presence. |
|
The ID of the status to remove. |
void galago_presence_clear_statuses (GalagoPresence *presence
);
Clears all statuses in a presence.
|
The presence. |
GalagoAccount * galago_presence_get_account (const GalagoPresence *presence
);
Returns the account from a presence.
|
The presence. |
Returns : |
The presence's account. |
gboolean galago_presence_is_idle (const GalagoPresence *presence
);
Returns the idle state from a presence.
|
The presence. |
Returns : |
The presence's idle state. |
time_t galago_presence_get_idle_time (const GalagoPresence *presence
);
Returns the presence's idle time in seconds.
|
The presence. |
Returns : |
The presence's idle time in seconds. |
time_t galago_presence_get_idle_start_time (const GalagoPresence *presence
);
Returns the time the presence was marked idle.
|
The presence. |
Returns : |
The presence's start idle time. |
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.
|
The presence. |
Returns : |
TRUE if the presence is discarded, or FALSE . |
gboolean galago_presence_is_available (const GalagoPresence *presence
);
Returns whether or not a presence is considered available.
|
The presence. |
Returns : |
TRUE if the presence is available, or FALSE . |
GList * galago_presence_get_statuses (const GalagoPresence *presence
);
Returns the list of statuses from a presence.
|
The presence. |
Returns : |
The list of statuses. |
GalagoStatus * galago_presence_get_active_status (const GalagoPresence *presence
);
Returns the active exclusive status from a presence.
|
The presence. |
Returns : |
The active exclusive status, if set, or NULL. |
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.
|
The presence. |
|
The ID of the status. |
Returns : |
TRUE if the status is exclusive, or FALSE . |
GalagoStatus * galago_presence_get_status (const GalagoPresence *presence
,const char *status_id
);
Returns the status from a presence with the specified ID.
|
The presence. |
|
The status ID. |
Returns : |
The status, if found, or NULL. |
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.
|
The presence. |
|
The status ID. |
Returns : |
TRUE if the presence has the status, or FALSE . |
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.
|
The presence. |
|
The status type. |
Returns : |
TRUE if the presence has the status, or FALSE . |
int galago_presence_compare (const GalagoPresence *presence1
,const GalagoPresence *presence2
);
Compares two presences for availability.
|
The first presence. |
|
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 . |
"account"
property"account" GalagoAccount* : Read / Write / Construct Only
The account that owns this presence.
"changed"
signalvoid user_function (GalagoPresence *presence,
gpointer user_data) : Action
Emitted when a property (idle state or a status added or removed) on the presence is updated.
|
The object which received the signal. |
|
user data set when the signal handler was connected. |
"idle-changed"
signalvoid user_function (GalagoPresence *presence,
gboolean idle,
gulong idle_start_time,
gpointer user_data) : Action
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.
|
The object which received the signal. |
|
The idle state. |
|
The time the user went idle, if idle is TRUE , or 0. |
|
user data set when the signal handler was connected. |
"status-added"
signalvoid user_function (GalagoPresence *presence,
gpointer status,
gpointer user_data) : Action
Emitted whenever a status is added.
|
The object which received the signal. |
|
The status that was added. |
|
user data set when the signal handler was connected. |
"status-removed"
signalvoid user_function (GalagoPresence *presence,
gpointer status,
gpointer user_data) : Action
Emitted whenever a status is removed.
|
The object which received the signal. |
|
The status that was removed. |
|
user data set when the signal handler was connected. |
"status-updated"
signalvoid user_function (GalagoPresence *presence,
gpointer status,
gchar *name,
gpointer user_data) : Action
Emitted when an attribute on a status was set or updated.
|
The object which received the signal. |
|
The status that was updated. |
|
The name of the attribute updated. |
|
user data set when the signal handler was connected. |