GalagoPerson

GalagoPerson — A representation of a person.

Functions

Properties

gchar * id Read / Write / Construct Only
GalagoImage * photo Read / Write
gchar * session-id Read / Write / Construct Only

Signals

void account-added Action
void account-removed Action
void photo-set Action

Types and Values

Object Hierarchy

    GObject
    ╰── GalagoObject
        ╰── GalagoPerson

Description

GalagoPerson objects represent an individual user, usually one that owns one or more GalagoAccounts. This is really a fancy container object.

Not all GalagoPersons map to a real person. A GalagoPerson may have a unique ID provided by a feed, in which case it probably does represent a real person in an addressbook. However, it may be ID-less, in which case it's pretty much just a container.

GalagoPersons are created through galago_create_person().

Functions

galago_person_set_me ()

void
galago_person_set_me (GalagoPerson *person);

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

This is an internal function. Please use galago_get_me() instead of ever using this.

Parameters

person

The person.

 

galago_person_is_me ()

gboolean
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_person_get_id ()

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.


galago_person_get_session_id ()

const char *
galago_person_get_session_id (const GalagoPerson *person);

Returns a person's session ID.

Parameters

person

The person.

 

Returns

The person's session ID.


galago_person_get_display_name ()

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 g_strdup it.

Parameters

person

The person.

 

Returns

The person's display name, or NULL.


galago_person_set_photo ()

void
galago_person_set_photo (GalagoPerson *person,
                         GalagoImage *photo);

Sets the person's photo.

The person should be a local person.

Parameters

person

The person.

 

photo

The photo to set.

 

galago_person_get_photo ()

GalagoImage *
galago_person_get_photo (const GalagoPerson *person,
                         gboolean 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.


galago_person_has_accounts ()

gboolean
galago_person_has_accounts (const GalagoPerson *person,
                            gboolean 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_person_get_accounts ()

GList *
galago_person_get_accounts (const GalagoPerson *person,
                            gboolean 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.


galago_person_get_priority_account ()

GalagoAccount *
galago_person_get_priority_account (const GalagoPerson *person);

Returns the most available "priority" account.

Parameters

person

The person.

 

Returns

The priority account.


galago_person_get_account ()

GalagoAccount *
galago_person_get_account (const GalagoPerson *person,
                           const GalagoService *service,
                           const char *username,
                           gboolean 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.

Types and Values

struct GalagoPerson

struct GalagoPerson;

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


GALAGO_DBUS_PERSON_INTERFACE

#define GALAGO_DBUS_PERSON_INTERFACE "org.freedesktop.Galago.Person"

The D-BUS interface that GalagoPerson maps to.


GALAGO_PERSON_ATTR_UID

#define GALAGO_PERSON_ATTR_UID          "uid"

A unique ID attribute.


GALAGO_PERSON_ATTR_FIRST_NAME

#define GALAGO_PERSON_ATTR_FIRST_NAME   "first-name"

A first name attribute.


GALAGO_PERSON_ATTR_MIDDLE_NAME

#define GALAGO_PERSON_ATTR_MIDDLE_NAME  "middle-name"

A middle name attribute.


GALAGO_PERSON_ATTR_LAST_NAME

#define GALAGO_PERSON_ATTR_LAST_NAME    "last-name"

A last name attribute.


GALAGO_PERSON_ATTR_ADDRESS

#define GALAGO_PERSON_ATTR_ADDRESS      "address"

A street address attribute.


GALAGO_PERSON_ATTR_CITY

#define GALAGO_PERSON_ATTR_CITY         "city"

A city attribute.


GALAGO_PERSON_ATTR_STATE

#define GALAGO_PERSON_ATTR_STATE        "state"

A state attribute.


GALAGO_PERSON_ATTR_COUNTRY

#define GALAGO_PERSON_ATTR_COUNTRY      "country"

A country attribute.


GALAGO_PERSON_ATTR_ZIPCODE

#define GALAGO_PERSON_ATTR_ZIPCODE      "zipcode"

A zipcode attribute.

Property Details

The “id” property

  “id”                       gchar *

The person's unique ID.

Flags: Read / Write / Construct Only

Default value: NULL


The “photo” property

  “photo”                    GalagoImage *

The person's unique ID.

Flags: Read / Write


The “session-id” property

  “session-id”               gchar *

The person's session ID.

Flags: Read / Write / Construct Only

Default value: NULL

Signal Details

The “account-added” signal

void
user_function (GalagoPerson *person,
               gpointer      account,
               gpointer      user_data)

Emitted whenever an account has been added to this person.

Parameters

person

The object which received the signal.

 

account

The account added to this person.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “account-removed” signal

void
user_function (GalagoPerson *person,
               gpointer      account,
               gpointer      user_data)

Emitted whenever an account has been removed from this person.

Parameters

person

The object which received the signal.

 

account

The account added to this person.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “photo-set” signal

void
user_function (GalagoPerson *person,
               gpointer      photo,
               gpointer      user_data)

Emitted whenever a photo has been set on this person.

Parameters

person

The object which received the signal.

 

photo

The photo set on this person.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action

See Also

GalagoAccount