Galago - desktop presence framework

galago-presence.h File Reference

Galago Presence API. More...

#include <sys/time.h>
#include <time.h>
#include <libgalago/galago-account.h>
#include <libgalago/galago-list.h>
#include <libgalago/galago-object.h>
#include <libgalago/galago-person.h>
#include <libgalago/galago-status.h>
#include <libgalago/galago-signals.h>
#include <libgalago/galago-types.h>

Go to the source code of this file.


Presence API

GalagoObjectClassgalago_presence_get_class (void)
 Returns the class for a GalagoPresence.
GalagoPresencegalago_presence_new (GalagoAccount *account)
 Creates a new presence.
void galago_presence_set_idle (GalagoPresence *presence, galago_bool idle, time_t idle_time)
 Sets the idle state on a presence.
void galago_presence_set_statuses (GalagoPresence *presence, GalagoList *statuses)
 Sets a list of statuses in a presence.
void galago_presence_add_status (GalagoPresence *presence, GalagoStatus *status)
 Adds a single status to a presence.
void galago_presence_remove_status (GalagoPresence *presence, const char *status_id)
 Removes a single status from a presence.
void galago_presence_clear_statuses (GalagoPresence *presence)
 Clears all statuses in a presence.
GalagoAccountgalago_presence_get_account (const GalagoPresence *presence)
 Returns the account from a presence.
galago_bool galago_presence_is_idle (const GalagoPresence *presence)
 Returns the idle state from a presence.
time_t galago_presence_get_idle_time (const GalagoPresence *presence)
 Returns the presence's idle time in seconds.
galago_bool galago_presence_is_discarded (const GalagoPresence *presence)
 Returns whether or not this is a discarded presence.
galago_bool galago_presence_is_available (const GalagoPresence *presence)
 Returns whether or not a presence is considered available.
const GalagoListgalago_presence_get_statuses (const GalagoPresence *presence)
 Returns the list of statuses from a presence.
GalagoStatusgalago_presence_get_active_status (const GalagoPresence *presence)
 Returns the active exclusive status from a presence.
galago_bool 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.
GalagoStatusgalago_presence_get_status (const GalagoPresence *presence, const char *status_id)
 Returns the status from a presence with the specified ID.
galago_bool galago_presence_has_status (const GalagoPresence *presence, const char *status_id)
 Returns whether or not a presence has a status with the specified ID.
galago_bool galago_presence_has_status_type (const GalagoPresence *presence, GalagoStatusType type)
 Returns whether or not a presence has a status with the specified primitive type.
int galago_presence_compare (const GalagoPresence *presence1, const GalagoPresence *presence2)
 Compares two presences for availability.

Defines

#define GALAGO_CLASS_PRESENCE   (galago_presence_get_class())
#define GALAGO_DBUS_PRESENCE_INTERFACE   "org.freedesktop.Galago.Presence"
#define GALAGO_IS_PRESENCE(obj)   (GALAGO_IS_OBJECT(obj) && galago_object_check_cast((obj), GALAGO_CLASS_PRESENCE))

Typedefs

typedef _GalagoPresence GalagoPresence
typedef _GalagoPresenceClass GalagoPresenceClass
typedef _GalagoPresencePrivate GalagoPresencePrivate

Detailed Description

Galago Presence API.

Copyright:
(C) 2004-2005 Christian Hammond
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Definition in file galago-presence.h.


Function Documentation

void galago_presence_add_status GalagoPresence presence,
GalagoStatus status
 

Adds a single status to a presence.

Parameters:
presence The presence.
status The status.

void galago_presence_clear_statuses GalagoPresence presence  ) 
 

Clears all statuses in a presence.

Parameters:
presence The presence.

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.

GalagoAccount* galago_presence_get_account const GalagoPresence presence  ) 
 

Returns the account from a presence.

Parameters:
presence The presence.
Returns:
The presence's account.

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.

GalagoObjectClass* galago_presence_get_class void   ) 
 

Returns the class for a GalagoPresence.

Returns:
The GalagoPresence class.

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.

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.

const GalagoList* 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_bool 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_bool 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_bool 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_bool 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_bool 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_bool 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.

GalagoPresence* galago_presence_new GalagoAccount account  ) 
 

Creates a new presence.

Parameters:
account The account this presence represents.
Returns:
The presence.

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.

void galago_presence_set_idle GalagoPresence presence,
galago_bool  idle,
time_t  idle_time
 

Sets the idle state on a presence.

Parameters:
presence The presence.
idle TRUE if the user is idle, or FALSE.
idle_time The optional idle time in seconds.

void galago_presence_set_statuses GalagoPresence presence,
GalagoList 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.