![]() |
![]() |
![]() |
libgalago Reference Manual | ![]() |
---|---|---|---|---|
GalagoPerson; #define GALAGO_DBUS_PERSON_INTERFACE #define GALAGO_PERSON_ATTR_UID #define GALAGO_PERSON_ATTR_FIRST_NAME #define GALAGO_PERSON_ATTR_MIDDLE_NAME #define GALAGO_PERSON_ATTR_LAST_NAME #define GALAGO_PERSON_ATTR_ADDRESS #define GALAGO_PERSON_ATTR_CITY #define GALAGO_PERSON_ATTR_STATE #define GALAGO_PERSON_ATTR_COUNTRY #define GALAGO_PERSON_ATTR_ZIPCODE void galago_person_set_me (GalagoPerson *person); gboolean galago_person_is_me (const GalagoPerson *person); const char* galago_person_get_id (const GalagoPerson *person); const char* galago_person_get_session_id (const GalagoPerson *person); const char* galago_person_get_display_name (const GalagoPerson *person); void galago_person_set_photo (GalagoPerson *person, GalagoImage *photo); GalagoImage* galago_person_get_photo (const GalagoPerson *person, gboolean query); gboolean galago_person_has_accounts (const GalagoPerson *person, gboolean query); GList* galago_person_get_accounts (const GalagoPerson *person, gboolean query); GalagoAccount* galago_person_get_priority_account (const GalagoPerson *person); GalagoAccount* galago_person_get_account (const GalagoPerson *person, const GalagoService *service, const char *username, gboolean query);
"id" gchararray : Read / Write / Construct Only "photo" GalagoImage : Read / Write "session-id" gchararray : Read / Write / Construct Only
"account-added" void user_function (GalagoPerson *person, gpointer account, gpointer user_data) : Run last / Action "account-removed" void user_function (GalagoPerson *person, gpointer account, gpointer user_data) : Run last / Action "photo-set" void user_function (GalagoPerson *person, gpointer photo, gpointer user_data) : Run last / Action
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()
.
typedef struct _GalagoPerson GalagoPerson;
This is an opaque structure representing a person. This should not be used directly. Use the accessor functions below.
#define GALAGO_DBUS_PERSON_INTERFACE
The D-BUS interface that GalagoPerson maps to.
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.
person : |
The person. |
gboolean galago_person_is_me (const GalagoPerson *person);
Returns whether or not a person is the "Me" person.
person : |
The person. |
Returns : | TRUE if the person is the "Me" person, or FALSE. |
const char* galago_person_get_id (const GalagoPerson *person);
Returns a person's application-specific unique ID.
person : |
The person. |
Returns : | The person's ID. |
const char* galago_person_get_session_id (const GalagoPerson *person);
Returns a person's session ID.
person : |
The person. |
Returns : | The person's session ID. |
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.
person : |
The person. |
Returns : | The person's display name, or NULL. |
void galago_person_set_photo (GalagoPerson *person, GalagoImage *photo);
Sets the person's photo.
The person should be a local person.
person : |
The person. |
photo : |
The photo to set. |
GalagoImage* galago_person_get_photo (const GalagoPerson *person, gboolean query);
Returns the person's photo.
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. |
gboolean galago_person_has_accounts (const GalagoPerson *person, gboolean query);
Returns whether the person has any accounts at all.
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. |
GList* galago_person_get_accounts (const GalagoPerson *person, gboolean query);
Returns a list of accounts in the person.
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. |
GalagoAccount* galago_person_get_priority_account (const GalagoPerson *person);
Returns the most available "priority" account.
person : |
The person. |
Returns : | The priority 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.
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. |
id
" property"id" gchararray : Read / Write / Construct Only
The person's unique ID.
Default value: NULL
void user_function (GalagoPerson *person, gpointer account, gpointer user_data) : Run last / Action
Emitted whenever an account has been added to this person.
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. |
void user_function (GalagoPerson *person, gpointer account, gpointer user_data) : Run last / Action
Emitted whenever an account has been removed from this person.
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. |
void user_function (GalagoPerson *person, gpointer photo, gpointer user_data) : Run last / Action
Emitted whenever a photo has been set on this person.
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. |