EBook.BookClientView

g EBook.BookClientView EBook.BookClientView GObject.GInterface GObject.GInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object GObject.Object->EBook.BookClientView Gio.Initable->EBook.BookClientView

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

dup_contacts (range_start, range_length, cancellable, cb, *user_data)

dup_contacts_finish (result)

dup_indices ()

get_client ()

get_connection ()

get_id ()

get_n_total ()

get_object_path ()

is_running ()

ref_client ()

set_fields_of_interest (fields_of_interest)

set_flags (flags)

set_sort_fields_sync (fields, cancellable)

start ()

stop ()

Virtual Methods

Inherited:

GObject.Object (7), Gio.Initable (1)

do_complete (error)

do_progress (percent, message)

Properties

Name

Type

Flags

Short Description

client

EBook.BookClient

r/w/co

The EBook.BookClient for the view

connection

Gio.DBusConnection

r/w/co

The Gio.DBusConnection used to create the D-Bus proxy

indices

EBookContacts.BookIndices

r

n-total

int

r

object-path

str

r/w/co

The object path used to create the D-Bus proxy

Signals

Inherited:

GObject.Object (1)

Name

Short Description

complete

content-changed

The signal is emitted whenever content of any contact in the client_view changes, or a contact is added or removed.

objects-added

objects-modified

objects-removed

progress

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class EBook.BookClientView(**kwargs)
Bases:

GObject.Object, Gio.Initable

Abstract:

No

Structure:

EBook.BookClientViewClass

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

New in version 3.2.

dup_contacts(range_start, range_length, cancellable, cb, *user_data)
Parameters:

Asynchronously reads range_length contacts from index range_start. When there are asked more than EBook.BookClientView.get_n_total() contacts only those up to the total number of contacts are read. Asking for out of range contacts results in an error.

Finish the call by EBook.BookClientView.dup_contacts_finish() from the cb.

Note: This function can be used only with EBookContacts.BookClientViewFlags.MANUAL_QUERY.

New in version 3.50.

dup_contacts_finish(result)
Parameters:

result (Gio.AsyncResult) – an asynchronous call result

Raises:

GLib.Error

Returns:

whether succeeded; if not, the error is set

out_range_start:

output location where to store original range start, or None

out_contacts:

output location where to store array of the read contacts

Return type:

(bool, out_range_start: int, out_contacts: [EBookContacts.Contact])

Finishes previous call of EBook.BookClientView.dup_contacts(); see it for further information.

Free the returned GLib.PtrArray with g_ptr_array_unref(), when no longer needed.

Note: This function can be used only with EBookContacts.BookClientViewFlags.MANUAL_QUERY.

New in version 3.50.

dup_indices()
Returns:

list of indices for the view

Return type:

EBookContacts.BookIndices

Returns a list of EBookContacts.BookIndices holding indices of the contacts in the view. These are received from the first sort field set by EBook.BookClientView.set_sort_fields_sync(). The last item of the returned array is the one with chr member being None.

Free the returned array with e_book_indices_free(), when no longer needed.

Note: This function can be used only with EBookContacts.BookClientViewFlags.MANUAL_QUERY.

New in version 3.50.

get_client()
Returns:

an EBook.BookClient

Return type:

EBook.BookClient

Returns the EBook.BookClientView :client associated with self.

Deprecated since version 3.10: Use EBook.BookClientView.ref_client() instead.

get_connection()
Returns:

the Gio.DBusConnection

Return type:

Gio.DBusConnection

Returns the Gio.DBusConnection used to create the D-Bus proxy.

New in version 3.8.

get_id()
Returns:

an identifier of the view

Return type:

int

Returns an identifier of the self. It does not change for the whole life time of the self.

Note: This function can be used only with EBookContacts.BookClientViewFlags.MANUAL_QUERY.

New in version 3.50.

get_n_total()
Returns:

how many contacts are available in the view

Return type:

int

Returns how many contacts are available in the view.

Note: This function can be used only with EBookContacts.BookClientViewFlags.MANUAL_QUERY.

New in version 3.50.

get_object_path()
Returns:

the object path

Return type:

str

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

New in version 3.8.

is_running()
Return type:

bool

ref_client()
Returns:

an EBook.BookClient

Return type:

EBook.BookClient

Returns the EBook.BookClientView :client associated with self.

The returned EBook.BookClient is referenced for thread-safety. Unreference the EBook.BookClient with GObject.Object.unref() when finished with it.

New in version 3.10.

set_fields_of_interest(fields_of_interest)
Parameters:

fields_of_interest ([str]) – List of field names in which the client is interested

Raises:

GLib.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 None 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.

set_flags(flags)
Parameters:

flags (EBookContacts.BookClientViewFlags) – the EBookContacts.BookClientViewFlags for self

Raises:

GLib.Error

Sets the flags which control the behaviour of self.

New in version 3.4.

set_sort_fields_sync(fields, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

whether succeeded

Return type:

bool

Sets fields to sort the view by. The default is to sort by the file-as field in ascending order. Not every field can be used for sorting, usually available fields are EBookContacts.ContactField.FILE_AS, EBookContacts.ContactField.GIVEN_NAME and EBookContacts.ContactField.FAMILY_NAME.

The array is terminated by an item with an EBookContacts.ContactField.FIELD_LAST field.

The first sort field is used to populate indices, as returned by EBook.BookClientView.dup_indices().

Note: This function can be used only with EBookContacts.BookClientViewFlags.MANUAL_QUERY.

New in version 3.50.

start()
Raises:

GLib.Error

Tells self to start processing events.

stop()
Raises:

GLib.Error

Tells self to stop processing events.

do_complete(error) virtual
Parameters:

error (GLib.Error) –

Notification that loading a view has completed, after calling EBook.BookClientView.start()

do_progress(percent, message) virtual
Parameters:
  • percent (int) –

  • message (str) –

Signal emitted intermittently while loading a view after calling EBook.BookClientView.start()

Signal Details

EBook.BookClientView.signals.complete(book_client_view, object)
Signal Name:

complete

Flags:

RUN_LAST

Parameters:
EBook.BookClientView.signals.content_changed(book_client_view)
Signal Name:

content-changed

Flags:

RUN_LAST

Parameters:

book_client_view (EBook.BookClientView) – The object which received the signal

The signal is emitted whenever content of any contact in the client_view changes, or a contact is added or removed. It may or may not change EBookClientView:n-total property too.

Note: This signal can be used only with EBookContacts.BookClientViewFlags.MANUAL_QUERY.

New in version 3.50.

EBook.BookClientView.signals.objects_added(book_client_view, objects)
Signal Name:

objects-added

Flags:

RUN_LAST

Parameters:
EBook.BookClientView.signals.objects_modified(book_client_view, objects)
Signal Name:

objects-modified

Flags:

RUN_LAST

Parameters:
EBook.BookClientView.signals.objects_removed(book_client_view, uids)
Signal Name:

objects-removed

Flags:

RUN_LAST

Parameters:
EBook.BookClientView.signals.progress(book_client_view, object, p0)
Signal Name:

progress

Flags:

RUN_LAST

Parameters:

Property Details

EBook.BookClientView.props.client
Name:

client

Type:

EBook.BookClient

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The EBook.BookClient for the view

EBook.BookClientView.props.connection
Name:

connection

Type:

Gio.DBusConnection

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Gio.DBusConnection used to create the D-Bus proxy

EBook.BookClientView.props.indices
Name:

indices

Type:

EBookContacts.BookIndices

Default Value:

None

Flags:

READABLE

A list of EBookContacts.BookIndices holding indices of the contacts in the view. These are received from the first sort field set by EBook.BookClientView.set_sort_fields_sync(). The last item of the returned array is the one with chr member being None.

Note: This property can be used only with EBookContacts.BookClientViewFlags.MANUAL_QUERY.

New in version 3.50.

EBook.BookClientView.props.n_total
Name:

n-total

Type:

int

Default Value:

0

Flags:

READABLE

How many contacts are available in the view.

Note: This property can be used only with EBookContacts.BookClientViewFlags.MANUAL_QUERY.

New in version 3.50.

EBook.BookClientView.props.object_path
Name:

object-path

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The object path used to create the D-Bus proxy