OssoABookAccountManager

OssoABookAccountManager — Management of Mission Control accounts.

Synopsis

                    OssoABookAccountManager;
OssoABookAccountManager* osso_abook_account_manager_get_default
                                                        (void);
OssoABookAccountManager* osso_abook_account_manager_new (void);
TpDBusDaemon*       osso_abook_account_manager_get_dbus_daemon
                                                        (OssoABookAccountManager *manager);
TpConnectionPresenceType osso_abook_account_manager_get_presence
                                                        (OssoABookAccountManager *manager);
void                osso_abook_account_manager_set_active_accounts_only
                                                        (OssoABookAccountManager *manager,
                                                         gboolean setting);
gboolean            osso_abook_account_manager_is_active_accounts_only
                                                        (OssoABookAccountManager *manager);
void                osso_abook_account_manager_set_allowed_accounts
                                                        (OssoABookAccountManager *manager,
                                                         GList *accounts);
GList*              osso_abook_account_manager_get_allowed_accounts
                                                        (OssoABookAccountManager *manager);
void                osso_abook_account_manager_set_allowed_capabilities
                                                        (OssoABookAccountManager *manager,
                                                         OssoABookCapsFlags caps);
OssoABookCapsFlags  osso_abook_account_manager_get_allowed_capabilities
                                                        (OssoABookAccountManager *manager);
void                osso_abook_account_manager_set_required_capabilities
                                                        (OssoABookAccountManager *manager,
                                                         OssoABookCapsFlags caps);
OssoABookCapsFlags  osso_abook_account_manager_get_required_capabilities
                                                        (OssoABookAccountManager *manager);
void                osso_abook_account_manager_set_account_protocol
                                                        (OssoABookAccountManager *manager,
                                                         const char *protocol);
const char*         osso_abook_account_manager_get_account_protocol
                                                        (OssoABookAccountManager *manager);
McAccount*          osso_abook_account_manager_lookup_by_name
                                                        (OssoABookAccountManager *manager,
                                                         const char *name);
McAccount*          osso_abook_account_manager_lookup_by_vcard_field
                                                        (OssoABookAccountManager *manager,
                                                         const char *vcard_field,
                                                         const char *vcard_value);
GList*              osso_abook_account_manager_list_accounts
                                                        (OssoABookAccountManager *manager,
                                                         McAccountFilterFunc filter,
                                                         gpointer user_data);
GList*              osso_abook_account_manager_list_enabled_accounts
                                                        (OssoABookAccountManager *manager);
GList*              osso_abook_account_manager_list_by_profile
                                                        (OssoABookAccountManager *manager,
                                                         const char *profile_id);
GList*              osso_abook_account_manager_list_by_vcard_field
                                                        (OssoABookAccountManager *manager,
                                                         const char *vcard_field);
GList*              osso_abook_account_manager_list_by_secondary_vcard_field
                                                        (OssoABookAccountManager *manager,
                                                         const char *vcard_field);
const GList*        osso_abook_account_manager_get_primary_vcard_fields
                                                        (OssoABookAccountManager *manager);
gboolean            osso_abook_account_manager_has_primary_vcard_field
                                                        (OssoABookAccountManager *manager,
                                                         const char *vcard_field);
const GList*        osso_abook_account_manager_get_secondary_vcard_fields
                                                        (OssoABookAccountManager *manager);
gboolean            osso_abook_account_manager_has_secondary_vcard_field
                                                        (OssoABookAccountManager *manager,
                                                         const char *vcard_field);
const char*         osso_abook_account_manager_get_vcard_field
                                                        (OssoABookAccountManager *manager,
                                                         const char *account_name);
GList*              osso_abook_account_manager_list_profiles
                                                        (OssoABookAccountManager *manager,
                                                         const gchar *attr_name,
                                                         gboolean no_roster_only);
void                osso_abook_account_manager_call_when_ready
                                                        (OssoABookAccountManager *manager,
                                                         OssoABookAccountManagerReadyCallbackcallback ,
                                                         gpointer user_data,
                                                         GDestroyNotify destroy);
void                osso_abook_account_manager_wait_until_ready
                                                        (OssoABookAccountManager *manager,
                                                         GMainContext *context,
                                                         GError **error);
void                osso_abook_account_manager_set_roster_query
                                                        (OssoABookAccountManager *manager,
                                                         EBookQuery *query);

Object Hierarchy

  GObject
   +----OssoABookAccountManager

Implemented Interfaces

OssoABookAccountManager implements OssoABookWaitable and OssoABookRosterManager.

Properties

  "account-protocol"         gchar*                : Read / Write / Construct
  "active-accounts-only"     gboolean              : Read / Write / Construct
  "allowed-accounts"         gpointer              : Read / Write / Construct
  "allowed-capabilities"     OssoABookCapsFlags    : Read / Write / Construct
  "presence"                 guint                 : Read
  "required-capabilities"    OssoABookCapsFlags    : Read / Write / Construct

Signals

  "account-changed"                                : Run First / Has Details
  "account-created"                                : Run First
  "account-removed"                                : Run Last

Description

The OssoABookAccountManager watches creation, removal and state changes of Mission Control accounts, and provides convenient access to the current set of Mission Control accounts.

It tries to fill the gaps libmcclient leaves.

See also: McAccount

Details

OssoABookAccountManager

typedef struct _OssoABookAccountManager OssoABookAccountManager;

All the fields of this structure are private to the object's implementation and should never be accessed directly.


osso_abook_account_manager_get_default ()

OssoABookAccountManager* osso_abook_account_manager_get_default
                                                        (void);

Retrieve the default OssoABookAccountManager.

Returns : The default OssoABookAccountManager. This object is owned by the library and must not be unreferenced.

osso_abook_account_manager_new ()

OssoABookAccountManager* osso_abook_account_manager_new (void);

Creates a new OssoABookAccountManager instance.

Returns : A newly allocated OssoABookAccountManager.

osso_abook_account_manager_get_dbus_daemon ()

TpDBusDaemon*       osso_abook_account_manager_get_dbus_daemon
                                                        (OssoABookAccountManager *manager);

Retrieves the TpDBusDaemon object used when this OssoABookAccountManager communicates with Telepathy or Mission Control.

manager : a OssoABookAccountManager, or NULL for the default instance
Returns : The TpDBusDaemon of this object.

osso_abook_account_manager_get_presence ()

TpConnectionPresenceType osso_abook_account_manager_get_presence
                                                        (OssoABookAccountManager *manager);

Queries the current value of the "presence" property.

manager : a OssoABookAccountManager, or NULL for the default instance
Returns : Current property value.

osso_abook_account_manager_set_active_accounts_only ()

void                osso_abook_account_manager_set_active_accounts_only
                                                        (OssoABookAccountManager *manager,
                                                         gboolean setting);

Changes the current value of the "active-accounts-only" property.

manager : a OssoABookAccountManager, or NULL for the default instance
setting : the new property value

osso_abook_account_manager_is_active_accounts_only ()

gboolean            osso_abook_account_manager_is_active_accounts_only
                                                        (OssoABookAccountManager *manager);

Queries the current value of the "active-accounts-only" property.

manager : a OssoABookAccountManager, or NULL for the default instance
Returns : Current property value.

osso_abook_account_manager_set_allowed_accounts ()

void                osso_abook_account_manager_set_allowed_accounts
                                                        (OssoABookAccountManager *manager,
                                                         GList *accounts);

Sets the value of the "allowed-accounts" property, which is the list of allowed accounts that the manager is being filtered by.

The manager copies accounts (but not the elements), so you must free the list after calling this function.

model : An OssoABookAccountManager
accounts : A GList of McAccounts to filter the model by.

osso_abook_account_manager_get_allowed_accounts ()

GList*              osso_abook_account_manager_get_allowed_accounts
                                                        (OssoABookAccountManager *manager);

Retrieves the current value of the "allowed-accounts" property, which is the list of allowed accounts that the manager is being filtered by.

This list is owned by the manager and it and its elements must not be freed.

model : An OssoABookAccountManager
Returns : A GList of the McAccounts that the model is being filtered by. The list is owned by manager

osso_abook_account_manager_set_allowed_capabilities ()

void                osso_abook_account_manager_set_allowed_capabilities
                                                        (OssoABookAccountManager *manager,
                                                         OssoABookCapsFlags caps);

Changes the current value of the "allowed-capabilities" property.

manager : a OssoABookAccountManager, or NULL for the default instance
caps : the new property value

osso_abook_account_manager_get_allowed_capabilities ()

OssoABookCapsFlags  osso_abook_account_manager_get_allowed_capabilities
                                                        (OssoABookAccountManager *manager);

Queries the current value of the "allowed-capabilities" property.

manager : a OssoABookAccountManager, or NULL for the default instance
Returns : Current property value.

osso_abook_account_manager_set_required_capabilities ()

void                osso_abook_account_manager_set_required_capabilities
                                                        (OssoABookAccountManager *manager,
                                                         OssoABookCapsFlags caps);

Changes the current value of the "required-capabilities" property.

manager : a OssoABookAccountManager, or NULL for the default instance
caps : the new property value

osso_abook_account_manager_get_required_capabilities ()

OssoABookCapsFlags  osso_abook_account_manager_get_required_capabilities
                                                        (OssoABookAccountManager *manager);

Queries the current value of the "required-capabilities" property.

manager : a OssoABookAccountManager, or NULL for the default instance
Returns : Current property value.

osso_abook_account_manager_set_account_protocol ()

void                osso_abook_account_manager_set_account_protocol
                                                        (OssoABookAccountManager *manager,
                                                         const char *protocol);

Changes the current value of the "account-protocol" property.

manager : a OssoABookAccountManager, or NULL for the default instance
protocol : the new property value, in the same format as the vCard field name (eg, "X-JABBER" for raw XMPP).

osso_abook_account_manager_get_account_protocol ()

const char*         osso_abook_account_manager_get_account_protocol
                                                        (OssoABookAccountManager *manager);

Queries the current value of the "account-protocol" property.

manager : a OssoABookAccountManager, or NULL for the default instance
Returns : Current property value (NULL for all protocols).

osso_abook_account_manager_lookup_by_name ()

McAccount*          osso_abook_account_manager_lookup_by_name
                                                        (OssoABookAccountManager *manager,
                                                         const char *name);

Finds the McAccount with the given unique name.

manager : a OssoABookAccountManager, or NULL for the default instance
name : the unique McAccount name
Returns : The requested McAccount, or NULL when no such account is known. The account is owned by manager

osso_abook_account_manager_lookup_by_vcard_field ()

McAccount*          osso_abook_account_manager_lookup_by_vcard_field
                                                        (OssoABookAccountManager *manager,
                                                         const char *vcard_field,
                                                         const char *vcard_value);

Finds the McAccount which can be used to contact the communication handle described by vcard_field and vcard_value.

manager : a OssoABookAccountManager, or NULL for the default instance
vcard_field : the name of the vCard attribute
vcard_value : the value of the vCard attribute
Returns : The requested McAccount, or NULL when no such account is known. The account is owned by manager

osso_abook_account_manager_list_accounts ()

GList*              osso_abook_account_manager_list_accounts
                                                        (OssoABookAccountManager *manager,
                                                         McAccountFilterFunc filter,
                                                         gpointer user_data);

Lists all McAccount known by this OssoABookAccountManager. The list of returned contacts can be limited by passing a filter function.

manager : a OssoABookAccountManager, or NULL for the default instance
filter : a function for filtering the known accounts, or NULL
user_data : user data which shall be passed to filter, or NULL
Returns : A list of matching McAccounts. The list is owned by the caller and must be released with g_list_free(). The elements of the list are owned by manager.

osso_abook_account_manager_list_enabled_accounts ()

GList*              osso_abook_account_manager_list_enabled_accounts
                                                        (OssoABookAccountManager *manager);

Lists all currently enabled McAccount this OssoABookAccountManager knows.

manager : a OssoABookAccountManager, or NULL for the default instance
Returns : The list currently enabled McAccounts. The list is owned by the caller and must be released with g_list_free(). The elements of the list are owned by manager.

osso_abook_account_manager_list_by_profile ()

GList*              osso_abook_account_manager_list_by_profile
                                                        (OssoABookAccountManager *manager,
                                                         const char *profile_id);

Lists all currently known account backed by the Mission Control profile identified by profile_id.

manager : a OssoABookAccountManager, or NULL for the default instance
profile_id : the ID of the required McProfile
Returns : A list of matching McAccounts. The list is owned by the caller and must be released with g_list_free(). The elements of the list are owned by manager.

osso_abook_account_manager_list_by_vcard_field ()

GList*              osso_abook_account_manager_list_by_vcard_field
                                                        (OssoABookAccountManager *manager,
                                                         const char *vcard_field);

Lists all currently known account supporting the requested vcard_field as preferred communication method.

manager : a OssoABookAccountManager, or NULL for the default instance
vcard_field : the name of the vCard attribute
Returns : A list of matching McAccounts. The list is owned by the caller and must be released with g_list_free(). The elements of the list are owned by manager.

osso_abook_account_manager_list_by_secondary_vcard_field ()

GList*              osso_abook_account_manager_list_by_secondary_vcard_field
                                                        (OssoABookAccountManager *manager,
                                                         const char *vcard_field);

Lists all currently known account supporting the requested vcard_field as additional communication method.

manager : a OssoABookAccountManager, or NULL for the default instance
vcard_field : the name of the vCard attribute
Returns : A list of matching McAccounts. The list is owned by the caller and must be released with g_list_free(). The elements of the list are owned by manager.

osso_abook_account_manager_get_primary_vcard_fields ()

const GList*        osso_abook_account_manager_get_primary_vcard_fields
                                                        (OssoABookAccountManager *manager);

Lists the vCard fields for all preferred communication method supported by the currently known Mission Control accounts.

manager : a OssoABookAccountManager, or NULL for the default instance
Returns : The list of vCard attribute names (as strings). The list is owned by the object and must not be freed.

osso_abook_account_manager_has_primary_vcard_field ()

gboolean            osso_abook_account_manager_has_primary_vcard_field
                                                        (OssoABookAccountManager *manager,
                                                         const char *vcard_field);

Checks if there is a Mission Control account which prefers the communication method described by vcard_field.

manager : a OssoABookAccountManager, or NULL for the default instance
vcard_field : the vCard attribute name for some communication method
Returns : TRUE if there is such an McAccount, and FALSE otherwise.

osso_abook_account_manager_get_secondary_vcard_fields ()

const GList*        osso_abook_account_manager_get_secondary_vcard_fields
                                                        (OssoABookAccountManager *manager);

Lists the vCard fields for all additional communication methods currently known Mission Control accounts.

manager : a OssoABookAccountManager, or NULL for the default instance
Returns : The list of vCard attribute names. The list is owned by the object and must not be freed.

osso_abook_account_manager_has_secondary_vcard_field ()

gboolean            osso_abook_account_manager_has_secondary_vcard_field
                                                        (OssoABookAccountManager *manager,
                                                         const char *vcard_field);

Checks if there is a Mission Control account which also supports the communication method described by vcard_field.

manager : a OssoABookAccountManager, or NULL for the default instance
vcard_field : the vCard attribute name for some communication method
Returns : TRUE if there is such an McAccount, and FALSE otherwise.

osso_abook_account_manager_get_vcard_field ()

const char*         osso_abook_account_manager_get_vcard_field
                                                        (OssoABookAccountManager *manager,
                                                         const char *account_name);

Gets the name of the vcard field associated with account_name

manager : a OssoABookAccountManager, or NULL for the default instance
account_name : the name of an account
Returns : a vcard field name as a string

osso_abook_account_manager_list_profiles ()

GList*              osso_abook_account_manager_list_profiles
                                                        (OssoABookAccountManager *manager,
                                                         const gchar *attr_name,
                                                         gboolean no_roster_only);

List all account profiles whose vCard field matches attr_name. If no_roster_only is TRUE, the list will be limited to only those account profiles that don't support rosters.

manager : a OssoABookAccountManager, or NULL for the default instance
attr_name : the name of a vCard Attribute
no_roster_only : whether to match only profiles without roster support
Returns : a list of matching McProfiles. The list and its elements are owned by the caller. The elements should be unreferenced with g_object_unref() and the list must be released with g_list_free().

osso_abook_account_manager_call_when_ready ()

void                osso_abook_account_manager_call_when_ready
                                                        (OssoABookAccountManager *manager,
                                                         OssoABookAccountManagerReadyCallbackcallback ,
                                                         gpointer user_data,
                                                         GDestroyNotify destroy);

Registers callback as a function to be called when manager becomes ready. See osso_abook_waitable_call_when_ready() for more details.

manager : a OssoABookAccountManager, or NULL for the default instance
callback : a function to call when manager becomes ready
user_data : additional data to pass to callback
destroy : an optional function that will free user_data when no longer needed

osso_abook_account_manager_wait_until_ready ()

void                osso_abook_account_manager_wait_until_ready
                                                        (OssoABookAccountManager *manager,
                                                         GMainContext *context,
                                                         GError **error);

Spins a main loop until manager is ready. See osso_abook_waitable_run() for more details.

manager : a OssoABookAccountManager, or NULL for the default instance
context : a GMainContext to run in
error : a return location for error reporting

osso_abook_account_manager_set_roster_query ()

void                osso_abook_account_manager_set_roster_query
                                                        (OssoABookAccountManager *manager,
                                                         EBookQuery *query);

This function can be used to restrict the contacts reported by the rosters the manager creates for its accounts when acting as OssoABookRosterManager.

For instance if you are just interested in contacts with birthday field, the following setup could be used:

manager = osso_abook_account_manager_new ();
query = e_book_query_vcard_field_exists (EVC_BDAY);
osso_abook_account_manager_set_roster_query (manager, query);

aggregator = osso_abook_aggregator_new_with_query (NULL, query, NULL, 0, NULL);
osso_abook_aggregator_set_roster_manager (OSSO_ABOOK_AGGREGATOR (aggregator), manager);

e_book_query_unref (query);
manager : a OssoABookAccountManager, or NULL for the default instance
query : the EBookQuery, or NULL for default query

Property Details

The "account-protocol" property

  "account-protocol"         gchar*                : Read / Write / Construct

Accepted account protocol (NULL for all protocols).

Default value: NULL


The "active-accounts-only" property

  "active-accounts-only"     gboolean              : Read / Write / Construct

Don't report accounts which are disabled.

Default value: TRUE


The "allowed-accounts" property

  "allowed-accounts"         gpointer              : Read / Write / Construct

Accounts which may appear in the model (if all additional filters allow them).


The "allowed-capabilities" property

  "allowed-capabilities"     OssoABookCapsFlags    : Read / Write / Construct

Set of of accepted account capabilities.

Default value: OSSO_ABOOK_CAPS_EMAIL|OSSO_ABOOK_CAPS_CHAT|OSSO_ABOOK_CAPS_CHAT_ADDITIONAL|OSSO_ABOOK_CAPS_VOICE|OSSO_ABOOK_CAPS_VOICE_ADDITIONAL|OSSO_ABOOK_CAPS_VIDEO|OSSO_ABOOK_CAPS_PHONE|OSSO_ABOOK_CAPS_ADDRESSBOOK|OSSO_ABOOK_CAPS_SMS


The "presence" property

  "presence"                 guint                 : Read

Current presence status of this session.

Default value: 0


The "required-capabilities" property

  "required-capabilities"    OssoABookCapsFlags    : Read / Write / Construct

Set of of required account capabilities.

Signal Details

The "account-changed" signal

void                user_function                      (OssoABookAccountManager *manager,
                                                        McAccount               *account,
                                                        guint                    property,
                                                        GValue                  *value,
                                                        gpointer                 user_data)      : Run First / Has Details

This signal is emitted when some account property changes.

manager : a OssoABookAccountManager
account : the McAccount which changed
property : the GQuark for the changed property's name
value : the new value of the property
user_data : user data set when the signal handler was connected.

The "account-created" signal

void                user_function                      (OssoABookAccountManager *manager,
                                                        McAccount               *account,
                                                        gpointer                 user_data)      : Run First

This signal is emitted when a account is added to Mission Control.

manager : a OssoABookAccountManager
account : the new McAccount
user_data : user data set when the signal handler was connected.

The "account-removed" signal

void                user_function                      (OssoABookAccountManager *manager,
                                                        McAccount               *account,
                                                        gpointer                 user_data)      : Run Last

This signal is emitted when a account is removed from Mission Control.

manager : a OssoABookAccountManager
account : the removed McAccount
user_data : user data set when the signal handler was connected.