Galago - desktop presence framework

galago-person.h File Reference

Galago Person API. More...

#include <libgalago/galago-account.h>
#include <libgalago/galago-list.h>
#include <libgalago/galago-object.h>
#include <libgalago/galago-photo.h>
#include <libgalago/galago-service.h>
#include <libgalago/galago-signals.h>
#include <libgalago/galago-value.h>

Go to the source code of this file.


Common Property Definitions

#define GALAGO_PERSON_PROP_FIRST_NAME   "first-name"
#define GALAGO_PERSON_PROP_MIDDLE_NAME   "middle-name"
#define GALAGO_PERSON_PROP_LAST_NAME   "last-name"
#define GALAGO_PERSON_PROP_ADDRESS   "address"
#define GALAGO_PERSON_PROP_CITY   "city"
#define GALAGO_PERSON_PROP_STATE   "state"
#define GALAGO_PERSON_PROP_COUNTRY   "country"
#define GALAGO_PERSON_PROP_ZIPCODE   "zipcode"

Person API

GalagoObjectClassgalago_person_get_class (void)
 Returns the class for a GalagoPerson.
GalagoPersongalago_person_new (const char *id, galago_bool native)
 Creates a person.
GalagoPersongalago_person_me_new (galago_bool native)
 Creates a new "Me" person.
void galago_person_set_me (GalagoPerson *person)
 Sets a person to be the "Me" person.
galago_bool galago_person_is_me (const GalagoPerson *person)
 Returns whether or not a person is the "Me" person.
const char * galago_person_get_id (const GalagoPerson *person)
 Returns a person's application-specific unique ID.
galago_bool galago_person_is_native (const GalagoPerson *person)
 Returns whether or not a person is native to the local application.
const char * galago_person_get_display_name (const GalagoPerson *person)
 Returns the display name of a person, if any.
void galago_person_set_photo (GalagoPerson *person, GalagoPhoto *photo)
 Sets the person's photo.
GalagoPhotogalago_person_get_photo (const GalagoPerson *person, galago_bool query)
 Returns the person's photo.
galago_bool galago_person_has_accounts (const GalagoPerson *person, galago_bool query)
 Returns whether the person has any accounts at all.
const GalagoListgalago_person_get_accounts (const GalagoPerson *person, galago_bool query)
 Returns a list of accounts in the person.
GalagoAccountgalago_person_get_priority_account (const GalagoPerson *person)
 Returns the most available "priority" account.
void galago_person_add_account (GalagoPerson *person, GalagoAccount *account)
 Adds an account to a person.
void galago_person_remove_account (GalagoPerson *person, GalagoAccount *account)
 Removes an account from a person.
GalagoAccountgalago_person_get_account (const GalagoPerson *person, const GalagoService *service, const char *username, galago_bool query)
 Returns the account with the specified username and service.
void galago_person_set_property_string (GalagoPerson *person, const char *name, const char *value)
 Sets a string property on a person.
void galago_person_set_property_bool (GalagoPerson *person, const char *name, galago_bool value)
 Sets a boolean property on a person.
void galago_person_set_property_uint32 (GalagoPerson *person, const char *name, dbus_uint32_t value)
 Sets a uint32 property on a person.
void galago_person_set_property (GalagoPerson *person, const char *name, GalagoValue *value)
 Sets a property on a person.
galago_bool galago_person_remove_property (GalagoPerson *person, const char *name)
 Removes a property on a person.
const char * galago_person_get_property_string (const GalagoPerson *person, const char *name)
 Returns the value of a string property on a person.
galago_bool galago_person_get_property_bool (const GalagoPerson *person, const char *name)
 Returns the value of a boolean property on a person.
dbus_uint32_t galago_person_get_property_uint32 (const GalagoPerson *person, const char *name)
 Returns the value of a uint32 property on a person.
const GalagoValue * galago_person_get_property (const GalagoPerson *person, const char *name)
 Returns the value of a property on a person.

Defines

#define GALAGO_CLASS_PERSON   (galago_person_get_class())
#define GALAGO_DBUS_PERSON_INTERFACE   "org.freedesktop.Galago.Person"
#define GALAGO_IS_PERSON(obj)   (GALAGO_IS_OBJECT(obj) && galago_object_check_cast((obj), GALAGO_CLASS_PERSON))

Typedefs

typedef _GalagoPerson GalagoPerson
typedef _GalagoPersonClass GalagoPersonClass
typedef _GalagoPersonPrivate GalagoPersonPrivate

Enumerations

enum  GalagoPropertyType { GALAGO_PROPERTY_TYPE_UNKNOWN = -1, GALAGO_PROPERTY_TYPE_STRING = 0, GALAGO_PROPERTY_TYPE_BOOL, GALAGO_PROPERTY_TYPE_UINT32 }

Detailed Description

Galago Person 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-person.h.


Enumeration Type Documentation

enum GalagoPropertyType
 

Enumeration values:
GALAGO_PROPERTY_TYPE_UNKNOWN  Unknown property type.
GALAGO_PROPERTY_TYPE_STRING  String type.
GALAGO_PROPERTY_TYPE_BOOL  Boolean type.
GALAGO_PROPERTY_TYPE_UINT32  Unsigned 32-bit integer type.

Definition at line 64 of file galago-person.h.


Function Documentation

void galago_person_add_account GalagoPerson person,
GalagoAccount account
 

Adds an account to a person.

This is used internally. You don't need to call this.

Parameters:
person The person.
account The account to add.

GalagoAccount* galago_person_get_account const GalagoPerson person,
const GalagoService service,
const char *  username,
galago_bool  query
 

Returns the account with the specified username and service.

Parameters:
person The person.
service The service.
username The username.
query TRUE if a remote query should be done if there is no local account found, or FALSE.
Returns:
The account, if found, or NULL.

const GalagoList* galago_person_get_accounts const GalagoPerson person,
galago_bool  query
 

Returns a list of accounts in the person.

Parameters:
person The person.
query TRUE if a remote query should be done if there is no local account found, or FALSE.
Returns:
The list of accounts.

GalagoObjectClass* galago_person_get_class void   ) 
 

Returns the class for a GalagoPerson.

Returns:
The GalagoPerson class.

const char* galago_person_get_display_name const GalagoPerson person  ) 
 

Returns the display name of a person, if any.

The returned display name is from a static buffer. If you wish to store the name, you must strdup it.

Parameters:
person The person.
Returns:
The person's display name, or NULL.

const char* galago_person_get_id const GalagoPerson person  ) 
 

Returns a person's application-specific unique ID.

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

GalagoPhoto* galago_person_get_photo const GalagoPerson person,
galago_bool  query
 

Returns the person's photo.

Parameters:
person The person.
query TRUE if a remote query should be done if there is no local photo found, or FALSE.
Returns:
The photo, if found, or NULL.

GalagoAccount* galago_person_get_priority_account const GalagoPerson person  ) 
 

Returns the most available "priority" account.

Parameters:
person The person.
Returns:
The priority account.

const GalagoValue* galago_person_get_property const GalagoPerson person,
const char *  name
 

Returns the value of a property on a person.

Parameters:
person The person.
name The name of the property.
Returns:
The property value, or NULL.

galago_bool galago_person_get_property_bool const GalagoPerson person,
const char *  name
 

Returns the value of a boolean property on a person.

Parameters:
person The person.
name The name of the property.
Returns:
The property value, or NULL.

const char* galago_person_get_property_string const GalagoPerson person,
const char *  name
 

Returns the value of a string property on a person.

Parameters:
person The person.
name The name of the property.
Returns:
The property value, or NULL.

dbus_uint32_t galago_person_get_property_uint32 const GalagoPerson person,
const char *  name
 

Returns the value of a uint32 property on a person.

Parameters:
person The person.
name The name of the property.
Returns:
The property value, or NULL.

galago_bool galago_person_has_accounts const GalagoPerson person,
galago_bool  query
 

Returns whether the person has any accounts at all.

Parameters:
person The person.
query TRUE if a query should be done to check the server-side state of the accounts, or FALSE.
Returns:
TRUE if the person has at least one account, or FALSE otherwise.

galago_bool galago_person_is_me const GalagoPerson person  ) 
 

Returns whether or not a person is the "Me" person.

Parameters:
person The person.
Returns:
TRUE if the person is the "Me" person, or FALSE.

galago_bool galago_person_is_native const GalagoPerson person  ) 
 

Returns whether or not a person is native to the local application.

Parameters:
person The person.
Returns:
TRUE if the person is native to the local application, or FALSE if it came from another feed.

GalagoPerson* galago_person_me_new galago_bool  native  ) 
 

Creates a new "Me" person.

Parameters:
native TRUE if this person is native, or FALSE otherwise.
Returns:
The "Me" person.

GalagoPerson* galago_person_new const char *  id,
galago_bool  native
 

Creates a person.

If I could do this in real life, I'd never have be without a date again.

Parameters:
id The application-specific unqiue ID of the person
native TRUE if this person is native, or FALSE otherwise.
Returns:
The person.

void galago_person_remove_account GalagoPerson person,
GalagoAccount account
 

Removes an account from a person.

This is used internally. You don't need to call this.

Parameters:
person The person.
account The account to remove.

galago_bool galago_person_remove_property GalagoPerson person,
const char *  name
 

Removes a property on a person.

Parameters:
person The person
name The name of the property to remove
Returns:
TRUE if the property was removed, or FALSE.

void galago_person_set_me GalagoPerson person  ) 
 

Sets a person to be the "Me" person.

This should only be used internally. Please use galago_person_me_new() from the beginning.

This is a one-way thing. You can't make a "Me" person a normal person.

Parameters:
person The person.

void galago_person_set_photo GalagoPerson person,
GalagoPhoto photo
 

Sets the person's photo.

This is used internally. You don't need to call this.

Parameters:
person The person.
photo The photo to set.

void galago_person_set_property GalagoPerson person,
const char *  name,
GalagoValue *  value
 

Sets a property on a person.

This is limited to string, boolean, and uint32 value types.

Parameters:
person The person.
name The name of the property to set.
value The value of the property.

void galago_person_set_property_bool GalagoPerson person,
const char *  name,
galago_bool  value
 

Sets a boolean property on a person.

Parameters:
person The person.
name The name of the property to set.
value The value of the property.

void galago_person_set_property_string GalagoPerson person,
const char *  name,
const char *  value
 

Sets a string property on a person.

Parameters:
person The person.
name The name of the property to set.
value The value of the property.

void galago_person_set_property_uint32 GalagoPerson person,
const char *  name,
dbus_uint32_t  value
 

Sets a uint32 property on a person.

Parameters:
person The person.
name The name of the property to set.
value The value of the property.