Galago - desktop presence framework

galago-status.h File Reference

Galago Status API. More...

#include <libgalago/galago-presence.h>
#include <libgalago/galago-object.h>
#include <libgalago/galago-types.h>

Go to the source code of this file.


Common Status Definitions

#define GALAGO_STATUS_ID_AVAILABLE   "available"
#define GALAGO_STATUS_ID_AWAY   "away"
#define GALAGO_STATUS_ID_BRB   "brb"
#define GALAGO_STATUS_ID_BUSY   "busy"
#define GALAGO_STATUS_ID_DND   "dnd"
#define GALAGO_STATUS_ID_EXTENDED_AWAY   "xa"
#define GALAGO_STATUS_ID_HIDDEN   "hidden"
#define GALAGO_STATUS_ID_OFFLINE   "offline"

Status API

#define GALAGO_CLASS_STATUS   (galago_status_get_class())
#define GALAGO_IS_STATUS(obj)   (GALAGO_IS_OBJECT(obj) && galago_object_check_cast((obj), GALAGO_CLASS_STATUS))

Status API

GalagoObjectClassgalago_status_get_class (void)
 Returns the class for a GalagoStatus.
GalagoStatusgalago_status_new (GalagoStatusType type, const char *id, const char *name, galago_bool exclusive)
 Creates a new status.
GalagoStatusgalago_status_duplicate (const GalagoStatus *status)
 Duplicates a status.
void galago_status_set_presence (GalagoStatus *status, GalagoPresence *presence)
 Sets the parent presence of a status.
GalagoPresencegalago_status_get_presence (const GalagoStatus *status)
 Returns the parent presence of a status.
GalagoStatusType galago_status_get_type (const GalagoStatus *status)
 Returns the primitive type of a status.
const char * galago_status_get_id (const GalagoStatus *status)
 Returns the status's ID.
const char * galago_status_get_name (const GalagoStatus *status)
 Returns the status's name.
galago_bool galago_status_is_exclusive (const GalagoStatus *status)
 Returns whether or not a status is exclusive.
galago_bool galago_status_is_available (const GalagoStatus *status)
 Returns whether or not a status is considered available.
void galago_status_set_attr_bool (GalagoStatus *status, const char *attr_id, galago_bool value)
 Sets a boolean status attribute.
void galago_status_set_attr_string (GalagoStatus *status, const char *attr_id, const char *value)
 Sets a string status attribute.
void galago_status_set_attr_int (GalagoStatus *status, const char *attr_id, dbus_int32_t value)
 Sets an integer status attribute.
void galago_status_set_attr_double (GalagoStatus *status, const char *attr_id, double value)
 Sets a double status attribute.
void galago_status_remove_attr (GalagoStatus *status, const char *attr_id)
 Removes a status attribute.
galago_bool galago_status_get_attr_bool (const GalagoStatus *status, const char *attr_id)
 Returns a boolean status attribute.
const char * galago_status_get_attr_string (const GalagoStatus *status, const char *attr_id)
 Returns a string status attribute.
dbus_int32_t galago_status_get_attr_int (const GalagoStatus *status, const char *attr_id)
 Returns an integer status attribute.
double galago_status_get_attr_double (const GalagoStatus *status, const char *attr_id)
 Returns a double status attribute.
galago_bool galago_status_attr_exists (const GalagoStatus *status, const char *attr_id)
 Returns whether or not a status attribute exists.
const GalagoListgalago_status_get_attributes (const GalagoStatus *status)
 Returns the list of status attributes in this status.

GalagoStatusAttr API

GalagoStatusAttrType galago_status_attr_get_type (const GalagoStatusAttr *attr)
 Returns the type of a status attribute.
const char * galago_status_attr_get_id (const GalagoStatusAttr *attr)
 Returns the ID of a status attribute.
galago_bool galago_status_attr_get_bool (const GalagoStatusAttr *attr)
 Returns the value of a boolean status attribute.
const char * galago_status_attr_get_string (const GalagoStatusAttr *attr)
 Returns the value of a string status attribute.
dbus_int32_t galago_status_attr_get_int (const GalagoStatusAttr *attr)
 Returns the value of an integer status attribute.
double galago_status_attr_get_double (const GalagoStatusAttr *attr)
 Returns the value of a double status attribute.

Typedefs

typedef _GalagoStatus GalagoStatus
typedef _GalagoStatusClass GalagoStatusClass
typedef _GalagoStatusPrivate GalagoStatusPrivate
typedef _GalagoStatusAttr GalagoStatusAttr

Enumerations

enum  GalagoStatusType {
  GALAGO_STATUS_UNSET = 0, GALAGO_STATUS_OFFLINE, GALAGO_STATUS_AVAILABLE, GALAGO_STATUS_AWAY,
  GALAGO_STATUS_EXTENDED_AWAY, GALAGO_STATUS_HIDDEN
}
enum  GalagoStatusAttrType {
  GALAGO_STATUS_ATTR_UNSET = -1, GALAGO_STATUS_ATTR_BOOL = 0, GALAGO_STATUS_ATTR_STRING, GALAGO_STATUS_ATTR_INT,
  GALAGO_STATUS_ATTR_DOUBLE
}

Detailed Description

Galago Status 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-status.h.


Function Documentation

galago_bool galago_status_attr_exists const GalagoStatus status,
const char *  attr_id
 

Returns whether or not a status attribute exists.

Parameters:
status The status.
attr_id The attribute ID.
Returns:
TRUE if the status attribute exists, or FALSE otherwise.

galago_bool galago_status_attr_get_bool const GalagoStatusAttr *  attr  ) 
 

Returns the value of a boolean status attribute.

Parameters:
attr The status attribute.
Returns:
The boolean value.

double galago_status_attr_get_double const GalagoStatusAttr *  attr  ) 
 

Returns the value of a double status attribute.

Parameters:
attr The status attribute.
Returns:
The double value.

const char* galago_status_attr_get_id const GalagoStatusAttr *  attr  ) 
 

Returns the ID of a status attribute.

Parameters:
attr The status attribute.
Returns:
The status attribute's ID.

dbus_int32_t galago_status_attr_get_int const GalagoStatusAttr *  attr  ) 
 

Returns the value of an integer status attribute.

Parameters:
attr The status attribute.
Returns:
The integer value.

const char* galago_status_attr_get_string const GalagoStatusAttr *  attr  ) 
 

Returns the value of a string status attribute.

Parameters:
attr The status attribute.
Returns:
The string value.

GalagoStatusAttrType galago_status_attr_get_type const GalagoStatusAttr *  attr  ) 
 

Returns the type of a status attribute.

Parameters:
attr The status attribute.
Returns:
The status attribute's type.

GalagoStatus* galago_status_duplicate const GalagoStatus status  ) 
 

Duplicates a status.

Parameters:
status The status to duplicate.
Returns:
The duplicate status.

galago_bool galago_status_get_attr_bool const GalagoStatus status,
const char *  attr_id
 

Returns a boolean status attribute.

Parameters:
status The status.
attr_id The attribute ID.
Returns:
The boolean value.

double galago_status_get_attr_double const GalagoStatus status,
const char *  attr_id
 

Returns a double status attribute.

Parameters:
status The status.
attr_id The attribute ID.
Returns:
The double value.

dbus_int32_t galago_status_get_attr_int const GalagoStatus status,
const char *  attr_id
 

Returns an integer status attribute.

Parameters:
status The status.
attr_id The attribute ID.
Returns:
The integer value.

const char* galago_status_get_attr_string const GalagoStatus status,
const char *  attr_id
 

Returns a string status attribute.

Parameters:
status The status.
attr_id The attribute ID.
Returns:
The string value.

const GalagoList* galago_status_get_attributes const GalagoStatus status  ) 
 

Returns the list of status attributes in this status.

Parameters:
status The status.
Returns:
The status attributes in the status.

GalagoObjectClass* galago_status_get_class void   ) 
 

Returns the class for a GalagoStatus.

Returns:
The GalagoStatus class.

const char* galago_status_get_id const GalagoStatus status  ) 
 

Returns the status's ID.

Parameters:
status The status.
Returns:
The status's ID.

const char* galago_status_get_name const GalagoStatus status  ) 
 

Returns the status's name.

Parameters:
status The status.
Returns:
The status's name.

GalagoPresence* galago_status_get_presence const GalagoStatus status  ) 
 

Returns the parent presence of a status.

Parameters:
status The status.
Returns:
The presence.

GalagoStatusType galago_status_get_type const GalagoStatus status  ) 
 

Returns the primitive type of a status.

Parameters:
status The status.
Returns:
The status's primitive type.

galago_bool galago_status_is_available const GalagoStatus status  ) 
 

Returns whether or not a status is considered available.

Parameters:
status The status.
Returns:
TRUE if the status is available, or FALSE.

galago_bool galago_status_is_exclusive const GalagoStatus status  ) 
 

Returns whether or not a status is exclusive.

Parameters:
status The status.
Returns:
TRUE if the status is exclusive, or FALSE.

GalagoStatus* galago_status_new GalagoStatusType  type,
const char *  id,
const char *  name,
galago_bool  exclusive
 

Creates a new status.

If exclusive is TRUE, the status will be exclusive. Only one exclusive status can be set at a time. If another exclusive status is set, the previously set exclusive status will be removed.

If exclusive is FALSE, the status will not be removed unless manually removed.

Parameters:
type The type of status.
id The status ID.
name The name of the status.
exclusive TRUE if the status is exclusive.
Returns:
The status.

void galago_status_remove_attr GalagoStatus status,
const char *  attr_id
 

Removes a status attribute.

Parameters:
status The status.
attr_id The attribute ID.

void galago_status_set_attr_bool GalagoStatus status,
const char *  attr_id,
galago_bool  value
 

Sets a boolean status attribute.

Parameters:
status The status.
attr_id The attribute ID.
value The boolean value.

void galago_status_set_attr_double GalagoStatus status,
const char *  attr_id,
double  value
 

Sets a double status attribute.

Parameters:
status The status.
attr_id The attribute ID.
value The double value.

void galago_status_set_attr_int GalagoStatus status,
const char *  attr_id,
dbus_int32_t  value
 

Sets an integer status attribute.

Parameters:
status The status.
attr_id The attribute ID.
value The integer value.

void galago_status_set_attr_string GalagoStatus status,
const char *  attr_id,
const char *  value
 

Sets a string status attribute.

Parameters:
status The status.
attr_id The attribute ID.
value The string value.

void galago_status_set_presence GalagoStatus status,
GalagoPresence presence
 

Sets the parent presence of a status.

This should only be used internally.

Parameters:
status The status.
presence The presence.