OssoABookAggregator

OssoABookAggregator — Aggregated view of multiple EBook instances.

Synopsis

                    OssoABookAggregator;
void                osso_abook_aggregator_add_filter    (OssoABookAggregator *aggregator,
                                                         OssoABookContactFilter *filter);
OssoABookRosterManager* osso_abook_aggregator_get_roster_manager
                                                        (OssoABookAggregator *aggregator);
GList*              osso_abook_aggregator_lookup        (OssoABookAggregator *aggregator,
                                                         const char *uid);
OssoABookRoster*    osso_abook_aggregator_new           (EBook *book,
                                                         GError **error);
OssoABookRoster*    osso_abook_aggregator_new_with_query
                                                        (EBook *book,
                                                         EBookQuery *query,
                                                         GList *requested_fields,
                                                         int max_results,
                                                         GError **error);
OssoABookRoster*    osso_abook_aggregator_new_with_view (EBookView *view);
void                osso_abook_aggregator_remove_filter (OssoABookAggregator *aggregator,
                                                         OssoABookContactFilter *filter);
void                osso_abook_aggregator_set_roster_manager
                                                        (OssoABookAggregator *aggregator,
                                                         OssoABookRosterManager *manager);

Description

The OssoABookAggregator merges information from multiple EBook instances into one single view. One of the books is considered the master address book, the other books ("rosters") provide dynamic presence information.

Details

OssoABookAggregator

typedef struct {
        OssoABookRoster parent;
} OssoABookAggregator;

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


osso_abook_aggregator_add_filter ()

void                osso_abook_aggregator_add_filter    (OssoABookAggregator *aggregator,
                                                         OssoABookContactFilter *filter);

Adds another contact filter to the aggregator. Master contacts will not show up unless they are accepted by all filters. The aggregator will synthesize "contacts-remove" signals when the new filter rejects currently visible contacts.

aggregator : a OssoABookAggregator
filter : the OssoABookContactFilter to add

osso_abook_aggregator_get_roster_manager ()

OssoABookRosterManager* osso_abook_aggregator_get_roster_manager
                                                        (OssoABookAggregator *aggregator);

Retrieves the current value of the "roster-manager" property.

aggregator : a OssoABookAggregator
Returns : The current value of the property.

osso_abook_aggregator_lookup ()

GList*              osso_abook_aggregator_lookup        (OssoABookAggregator *aggregator,
                                                         const char *uid);

Lists all master contacts currently known by the aggregator and matching the requested uid. When uid directly matches a master contact, only this contact is returned. When uid matches an attached roster contact all of its master contacts are returned.

aggregator : a OssoABookAggregator
uid : the contact's UID
Returns : A newly allocated list of OssoABookContact instances which has to be freed with g_list_free().

osso_abook_aggregator_new ()

OssoABookRoster*    osso_abook_aggregator_new           (EBook *book,
                                                         GError **error);

Creates a new OssoABookAggregator on top of book.

book : the master addressbook
error : a return location for errors
Returns : A newly allocated OssoABookAggregator, or NULL on error.

osso_abook_aggregator_new_with_query ()

OssoABookRoster*    osso_abook_aggregator_new_with_query
                                                        (EBook *book,
                                                         EBookQuery *query,
                                                         GList *requested_fields,
                                                         int max_results,
                                                         GError **error);

Creates a new OssoABookAggregator on top of book, but only contacts matching the query are considered.

book : the master addressbook
query : the query for choosing contacts
requested_fields : a GList containing the names of fields to return, or NULL for all
max_results : the maximum number of contacts to show (or 0 for all)
error : a return location for errors
Returns : A newly allocated OssoABookAggregator, or NULL on error.

osso_abook_aggregator_new_with_view ()

OssoABookRoster*    osso_abook_aggregator_new_with_view (EBookView *view);

Creates a new OssoABookAggregator on top of view. Usually it is more reasonable to call osso_abook_aggregator_new_with_query() or osso_abook_aggregator_new(), since those functions take care of the burden to open the EBook and the EBookView asynchroniously.

view : the EBookView providing contacts
Returns : A newly allocated OssoABookAggregator.

osso_abook_aggregator_remove_filter ()

void                osso_abook_aggregator_remove_filter (OssoABookAggregator *aggregator,
                                                         OssoABookContactFilter *filter);

Removes a contact filter from the aggregator. Master contacts will not show up unless they are accepted by all filters. The aggregator will synthesize "contacts-added" signals when the filter was the last one rejecting certain contacts.

aggregator : a OssoABookAggregator
filter : the OssoABookContactFilter to remove

osso_abook_aggregator_set_roster_manager ()

void                osso_abook_aggregator_set_roster_manager
                                                        (OssoABookAggregator *aggregator,
                                                         OssoABookRosterManager *manager);

Changes the value of the "roster-manager" property.

aggregator : a OssoABookAggregator
manager : the new OssoABookRosterManager, or NULL

See Also

EBookView