![]() |
![]() |
![]() |
libgalago Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
struct GalagoAccount; #define GALAGO_DBUS_ACCOUNT_INTERFACE void galago_account_set_connected (GalagoAccount *account
,gboolean connected
); GalagoService * galago_account_get_service (const GalagoAccount *account
); GalagoPerson * galago_account_get_person (const GalagoAccount *account
); const char * galago_account_get_username (const GalagoAccount *account
); gboolean galago_account_is_connected (const GalagoAccount *account
); void galago_account_set_display_name (GalagoAccount *account
,const char *display_name
); const char * galago_account_get_display_name (const GalagoAccount *account
); gboolean galago_account_is_display_name_set (const GalagoAccount *account
); void galago_account_add_contact (GalagoAccount *account
,GalagoAccount *contact
); void galago_account_remove_contact (GalagoAccount *account
,GalagoAccount *contact
); GalagoAccount * galago_account_get_contact (const GalagoAccount *account
,const char *username
,gboolean query
); GList * galago_account_get_contacts (const GalagoAccount *account
,gboolean query
); GalagoPresence * galago_account_create_presence (GalagoAccount *account
); GalagoPresence * galago_account_get_presence (const GalagoAccount *account
,gboolean query
); void galago_account_set_avatar (GalagoAccount *account
,GalagoImage *avatar
); GalagoImage * galago_account_get_avatar (const GalagoAccount *account
,gboolean query
);
"avatar" GalagoImage* : Read / Write "connected" gboolean : Read / Write "display-name" gchar* : Read / Write "person" GalagoPerson* : Read / Write / Construct Only "presence" GalagoPresence* : Read "service" GalagoService* : Read / Write / Construct Only "username" gchar* : Read / Write / Construct Only
"avatar-set" :Action
"connection-state-changed" :Action
"contact-added" :Action
"contact-removed" :Action
"display-name-changed" :Action
"presence-created" :Action
"presence-deleted" :Action
The GalagoAccount object represents an account on a messaging or VoIP service, The account may belong to the local user, or someone on the user's contact list.
Each GalagoAccount is owned and managed by a GalagoService, and has
an associated GalagoPerson. To create a GalagoAccount, use
galago_service_create_account()
.
struct GalagoAccount;
This is an opaque structure representing an account. This should not be used directly. Use the accessor functions below.
#define GALAGO_DBUS_ACCOUNT_INTERFACE "org.freedesktop.Galago.Account"
The D-BUS interface that GalagoAccount maps to.
void galago_account_set_connected (GalagoAccount *account
,gboolean connected
);
Sets whether or not the account is connected.
|
The account. |
|
The connected state. |
GalagoService * galago_account_get_service (const GalagoAccount *account
);
Returns an account's service.
|
The account. |
Returns : |
The account's service. |
GalagoPerson * galago_account_get_person (const GalagoAccount *account
);
Returns the person that owns an account.
|
The account. |
Returns : |
The person that owns the account. |
const char * galago_account_get_username (const GalagoAccount *account
);
Returns an account's username.
|
The account. |
Returns : |
The account's username. |
gboolean galago_account_is_connected (const GalagoAccount *account
);
Returns whether or not an account is connected.
|
The account. |
Returns : |
The account's connected state. |
void galago_account_set_display_name (GalagoAccount *account
,const char *display_name
);
Sets the account's displayed name.
This is the alias that the account may be shown as on another client. It's purely optional.
|
The account. |
|
The display name. |
const char * galago_account_get_display_name (const GalagoAccount *account
);
Returns the account's displayed name. If the displayed name is not explicitly set, this will return the screen name.
|
The account. |
Returns : |
The displayed name. |
gboolean galago_account_is_display_name_set (const GalagoAccount *account
);
Returns whether or not a custom displayed name is set.
|
The account. |
Returns : |
TRUE if a custom displayed name is set, or FALSE. |
void galago_account_add_contact (GalagoAccount *account
,GalagoAccount *contact
);
Adds a contact to an account.
|
The account. |
|
The contact's account to add. |
void galago_account_remove_contact (GalagoAccount *account
,GalagoAccount *contact
);
Removes a contact from an account.
|
The account. |
|
The contact's account to remove. |
GalagoAccount * galago_account_get_contact (const GalagoAccount *account
,const char *username
,gboolean query
);
Returns the contact with the specified username in an account.
|
The account. |
|
The username. |
|
TRUE if a remote query should be done if there is no local contact found, or FALSE. |
Returns : |
The contact's account, if found, or NULL. |
GList * galago_account_get_contacts (const GalagoAccount *account
,gboolean query
);
Returns a list of accounts of users seen from this account.
This may emit a contact-added signal for every object that returns. If
your code connects to this signal and calls galago_account_get_contacts()
as a result, you will want to add a lock so that you don't end up with
unwanted side-effects.
|
The account. |
|
TRUE if a remote query should be done if there is no local contact found, or FALSE. |
Returns : |
A list of accounts of other users, or NULL. |
GalagoPresence * galago_account_create_presence (GalagoAccount *account
);
Creates an account's presence.
The account should be a local account. If the account already has a presence, this will return the existing one.
|
The account. |
Returns : |
The presence. |
GalagoPresence * galago_account_get_presence (const GalagoAccount *account
,gboolean query
);
Returns the account's presence.
|
The account. |
|
TRUE if a remote query should be done if there is no local presence found, or FALSE. |
Returns : |
The presence, if found, or NULL. |
void galago_account_set_avatar (GalagoAccount *account
,GalagoImage *avatar
);
Sets the account's avatar. The account should be a local account.
|
The account. |
|
The avatar to set. |
GalagoImage * galago_account_get_avatar (const GalagoAccount *account
,gboolean query
);
Returns the account's avatar.
|
The account. |
|
TRUE if a remote query should be done if there is no local avatar found, or FALSE. |
Returns : |
The avatar, if found, or NULL. |
"connected"
property "connected" gboolean : Read / Write
The account's connected state.
Default value: FALSE
"display-name"
property "display-name" gchar* : Read / Write
The account's username intended for display.
Default value: NULL
"person"
property"person" GalagoPerson* : Read / Write / Construct Only
The person the account belongs to.
"service"
property"service" GalagoService* : Read / Write / Construct Only
The service the account is on.
"avatar-set"
signalvoid user_function (GalagoAccount *account,
gpointer avatar,
gpointer user_data) : Action
Emitted whenever an avatar is set for this account.
|
The object which received the signal. |
|
The avatar set. |
|
user data set when the signal handler was connected. |
"connection-state-changed"
signalvoid user_function (GalagoAccount *account,
gpointer user_data) : Action
Emitted when the state of the connection changes, when the account goes online or offline.
|
The object which received the signal. |
|
user data set when the signal handler was connected. |
"contact-added"
signalvoid user_function (GalagoAccount *account,
gpointer contact,
gpointer user_data) : Action
Emitted whenever a contact has been added to this account.
|
The object which received the signal. |
|
The contact added to this account. |
|
user data set when the signal handler was connected. |
"contact-removed"
signalvoid user_function (GalagoAccount *account,
gpointer contact,
gpointer user_data) : Action
Emitted whenever a contact has been removed from this account.
|
The object which received the signal. |
|
The contact removed from this account. |
|
user data set when the signal handler was connected. |
"display-name-changed"
signalvoid user_function (GalagoAccount *account,
gpointer user_data) : Action
Emitted whenever the display name of the account changes.
|
The object which received the signal. |
|
user data set when the signal handler was connected. |
"presence-created"
signalvoid user_function (GalagoAccount *account,
gpointer presence,
gpointer user_data) : Action
Emitted whenever a new GalagoPresence object is created for this account.
|
The object which received the signal. |
|
The new presence object. |
|
user data set when the signal handler was connected. |
"presence-deleted"
signalvoid user_function (GalagoAccount *account,
gpointer user_data) : Action
Emitted whenever a GalagoPresence object associated with this account is destroyed.
|
The object which received the signal. |
|
user data set when the signal handler was connected. |