CallsContactsProvider: Calls Reference Manual

## CallsContactsProvider CallsContactsProvider — Provides contact information |

## Functions

void | (*IdleCallback) ()
CallsContactsProvider * | calls_contacts_provider_new ()
GeeCollection * | calls_contacts_provider_get_individuals ()
CallsBestMatch * | calls_contacts_provider_lookup_id ()
void | calls_contacts_provider_consume_iter_on_idle ()
gboolean | calls_contacts_provider_get_can_add_contacts ()
void | calls_contacts_provider_add_new_contact ()

## Properties

gboolean | can-add-contacts | Read

## Signals

void | added | Run Last
void | removed | Run Last

## Types and Values

#define | CALLS_TYPE_CONTACTS_PROVIDER
| CallsContactsProvider

## Object Hierarchy

        GObject
        ╰── CallsContactsProvider

## Description

This object tracks contacts reported by libfolks, allow to perform contact lookups and provides functions for adding new contacts.

## Functions

### IdleCallback ()

    void
    (*IdleCallback) (gpointer user_data,
                     FolksIndividual *individual);

### calls_contacts_provider_new ()

    CallsContactsProvider *
    calls_contacts_provider_new (void);

### calls_contacts_provider_get_individuals ()

    GeeCollection *
    calls_contacts_provider_get_individuals
                                   (CallsContactsProvider *self);

### calls_contacts_provider_lookup_id ()

    CallsBestMatch *
    calls_contacts_provider_lookup_id (CallsContactsProvider *self,
                                       const char *id);

### calls_contacts_provider_consume_iter_on_idle ()

    void
    calls_contacts_provider_consume_iter_on_idle
                                   (GeeIterator *iter,
                                    IdleCallback callback,
                                    gpointer user_data);

Queue's processing of all FolksIndividual items of `iter` with `callback` one individual per event loop iteration. Can be used to split up operating on potentially large set of individuals to prevent the event loop from being blocked for too long making the UI unresponsive.

#### Parameters

iter | A GeeIterator |
callback | A callback to be called on all items of `iter` |
user_data | A pointer to be passed to the `callback` |

### calls_contacts_provider_get_can_add_contacts ()

    gboolean
    calls_contacts_provider_get_can_add_contacts
                                   (CallsContactsProvider *self);

#### Parameters

self | The CallsContactsProvider |

#### Returns

`TRUE` if contacts can be added, `FALSE` otherwise

### calls_contacts_provider_add_new_contact ()

    void
    calls_contacts_provider_add_new_contact
                                   (CallsContactsProvider *self,
                                    const char *phone_number);

Opens GNOME contacts and prepopulates the phone number for a new contact to be added.

#### Parameters

self | The CallsContactsProvider |
phone_number | The phone number of the new contact |

## Types and Values

### CALLS_TYPE_CONTACTS_PROVIDER

    #define CALLS_TYPE_CONTACTS_PROVIDER (calls_contacts_provider_get_type ())

### CallsContactsProvider

    typedef struct _CallsContactsProvider CallsContactsProvider;

## Property Details

### The `“can-add-contacts”` property

      “can-add-contacts”         gboolean

Whether we can add contacts.

Owner: CallsContactsProvider

Flags: Read

Default value: FALSE

## Signal Details

### The `“added”` signal

    void
    user_function (CallsContactsProvider *self,
                   FolksIndividual       *individual,
                   gpointer               user_data)

This signal is emitted when the backend reports a new contact having been added.

#### Parameters

self | The CallsContactsProvider instance |
individual | A FolksIndividual |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“removed”` signal

    void
    user_function (CallsContactsProvider *self,
                   FolksIndividual       *individual,
                   gpointer               user_data)

This signal is emitted when the backend reports a contact having been removed.

#### Parameters

self | The CallsContactsProvider instance |
individual | A FolksIndividual |
user_data | user data set when the signal handler was connected. |

Flags: Run Last