## EBookClientView

EBookClientView — Recieving change notifications on addressbooks

## Functions

struct _EBookClient * | e_book_client_view_ref_client ()
GDBusConnection * | e_book_client_view_get_connection ()
const gchar * | e_book_client_view_get_object_path ()
gboolean | e_book_client_view_is_running ()
void | e_book_client_view_set_fields_of_interest ()
void | e_book_client_view_start ()
void | e_book_client_view_stop ()
void | e_book_client_view_set_flags ()
struct _EBookClient * | e_book_client_view_get_client ()

## Properties

EBookClient * | client | Read / Write / Construct Only
GDBusConnection * | connection | Read / Write / Construct Only
EBookBackend * | direct-backend | Write / Construct Only
char * | object-path | Read / Write / Construct Only

## Signals

void | complete | Run Last
void | objects-added | Run Last
void | objects-modified | Run Last
void | objects-removed | Run Last
void | progress | Run Last

## Types and Values

struct | EBookClientView
struct | EBookClientViewClass

## Object Hierarchy

        GObject
        ╰── EBookClientView

## Implemented Interfaces

EBookClientView implements GInitable.

## Includes

    #include <libebook/libebook.h>

## Description

This class provides functionality for watching for changes on a given addressbook opened with an EBookClient. Use `e_book_client_get_view()` to create an EBookClientView.

## Functions

### e_book_client_view_ref_client ()

    struct _EBookClient *
    e_book_client_view_ref_client (EBookClientView *client_view);

Returns the “client” associated with `client_view` .

The returned EBookClient is referenced for thread-safety. Unreference the EBookClient with `g_object_unref()` when finished with it.

#### Parameters

client_view | an EBookClientView |

#### Returns

an EBookClient.

[transfer full][type EBookClient]

Since: 3.10

### e_book_client_view_get_connection ()

    GDBusConnection *
    e_book_client_view_get_connection (EBookClientView *client_view);

Returns the GDBusConnection used to create the D-Bus proxy.

#### Parameters

client_view | an EBookClientView |

#### Returns

the GDBusConnection.

[transfer none]

Since: 3.8

### e_book_client_view_get_object_path ()

    const gchar *
    e_book_client_view_get_object_path (EBookClientView *client_view);

Returns the object path used to create the D-Bus proxy.

#### Parameters

client_view | an EBookClientView |

#### Returns

the object path

Since: 3.8

### e_book_client_view_is_running ()

    gboolean
    e_book_client_view_is_running (EBookClientView *client_view);

### e_book_client_view_set_fields_of_interest ()

    void
    e_book_client_view_set_fields_of_interest
                                   (EBookClientView *client_view,
                                    const GSList *fields_of_interest,
                                    GError **error);

Client can instruct server to which fields it is interested in only, thus the server can return less data over the wire. The server can still return complete objects, this is just a hint to it that the listed fields will be used only. The UID field is returned always. Initial views has no fields of interest and using `NULL` for `fields_of_interest` will unset any previous changes.

Some backends can use summary information of its cache to create artifical objects, which will omit stored object parsing. If this cannot be done then it will simply return object as is stored in the cache.

#### Parameters

client_view | an EBookClientView |
fields_of_interest | List of field names in which the client is interested. | [element-type utf8]
error | return location for a GError, or `NULL` |

### e_book_client_view_start ()

    void
    e_book_client_view_start (EBookClientView *client_view,
                              GError **error);

Tells `client_view` to start processing events.

#### Parameters

client_view | an EBookClientView |
error | return location for a GError, or `NULL` |

### e_book_client_view_stop ()

    void
    e_book_client_view_stop (EBookClientView *client_view,
                             GError **error);

Tells `client_view` to stop processing events.

#### Parameters

client_view | an EBookClientView |
error | return location for a GError, or `NULL` |

### e_book_client_view_set_flags ()

    void
    e_book_client_view_set_flags (EBookClientView *client_view,
                                  EBookClientViewFlags flags,
                                  GError **error);

Sets the `flags` which control the behaviour of `client_view` .

#### Parameters

client_view | an EBookClientView |
flags | the EBookClientViewFlags for `client_view` |
error | return location for a GError, or `NULL` |

Since: 3.4

### e_book_client_view_get_client ()

    struct _EBookClient *
    e_book_client_view_get_client (EBookClientView *client_view);

`e_book_client_view_get_client` has been deprecated since version 3.10 and should not be used in newly-written code.

Use `e_book_client_view_ref_client()` instead.

Returns the “client” associated with `client_view` .

#### Parameters

client_view | an EBookClientView |

#### Returns

an EBookClient.

[transfer none][type EBookClient]

## Types and Values

### struct EBookClientView

    struct EBookClientView;

Contains only private data the should be read and manipulated using the functions below.

Since: 3.2

### struct EBookClientViewClass

    struct EBookClientViewClass {
    	/* Signals */
    	void		(*objects_added) (EBookClientView *client_view,
    						 const GSList *objects);
    	void		(*objects_modified) (EBookClientView *client_view,
    						 const GSList *objects);
    	void		(*objects_removed) (EBookClientView *client_view,
    						 const GSList *uids);
    	void		(*progress)		(EBookClientView *client_view,
    						 guint percent,
    						 const gchar *message);
    	void		(*complete)		(EBookClientView *client_view,
    						 const GError *error);
    };

Class structure for the EBookClient class.

#### Members

`objects_added` () | Signal emitted when contacts are added in the view |
`objects_modified` () | Signal emitted when contacts in the view are modified |
`objects_removed` () | Signal emitted when contacts are removed from the view |
`progress` () | Signal emitted intermittently while loading a view after calling `e_book_client_view_start()` |
`complete` () | Notification that loading a view has completed, after calling `e_book_client_view_start()` |

Since: 3.2

## Property Details

### The `“client”` property

      “client”                   EBookClient *

The EBookClient for the view.

Owner: EBookClientView

Flags: Read / Write / Construct Only

### The `“connection”` property

      “connection”               GDBusConnection *

The GDBusConnection used to create the D-Bus proxy.

Owner: EBookClientView

Flags: Read / Write / Construct Only

### The `“direct-backend”` property

      “direct-backend”           EBookBackend *

The EBookBackend to fetch contact data from, if direct read access is enabled.

Owner: EBookClientView

Flags: Write / Construct Only

### The `“object-path”` property

      “object-path”              char *

The object path used to create the D-Bus proxy.

Owner: EBookClientView

Flags: Read / Write / Construct Only

Default value: NULL

## Signal Details

### The `“complete”` signal

    void
    user_function (EBookClientView *ebookclientview,
                   GError          *arg1,
                   gpointer         user_data)

Flags: Run Last

### The `“objects-added”` signal

    void
    user_function (EBookClientView *client_view,
                   gpointer         objects,
                   gpointer         user_data)

#### Parameters

client_view | the EBookClientView which emitted the signal |
objects | a GSList of added EContact objects into the `client_view` . | [type GSList][transfer none][element-type EContact]
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“objects-modified”` signal

    void
    user_function (EBookClientView *client_view,
                   gpointer         objects,
                   gpointer         user_data)

#### Parameters

client_view | the EBookClientView which emitted the signal |
objects | a GSList of modified EContact objects within the `client_view` . | [type GSList][transfer none][element-type EContact]
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“objects-removed”` signal

    void
    user_function (EBookClientView *client_view,
                   gpointer         uids,
                   gpointer         user_data)

#### Parameters

client_view | the EBookClientView which emitted the signal |
uids | a GSList of removed objects, described by their UID. | [type GSList][transfer none][element-type utf8]
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“progress”` signal

    void
    user_function (EBookClientView *ebookclientview,
                   guint            arg1,
                   char            *arg2,
                   gpointer         user_data)

Flags: Run Last