EDataBook.DataBookView¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
The backend being monitored |
||
r/w/co |
The |
||
r/w |
|||
r/w |
|||
r/w/co |
The object path at which to export the view interface |
||
r/w/co |
The query expression for this view |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when new objects are added into the view. |
|
Emitted when the objects in the view are modified. |
|
Emitted when the objects are removed from the view. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class EDataBook.DataBookView(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(backend, sexp, connection, object_path)¶
- Parameters:
backend (
EDataBook.BookBackend
) – anEDataBook.BookBackend
sexp (
EDataBook.BookBackendSExp
) – anEDataBook.BookBackendSExp
connection (
Gio.DBusConnection
) – aGio.DBusConnection
object_path (
str
) – an object path for the view
- Raises:
- Returns:
an
EDataBook.DataBookView
orNone
on error- Return type:
Creates a new
EDataBook.DataBookView
and exports its D-Bus interface on connection at object_path. If an error occurs while exporting, the function sets error and returnsNone
.
- claim_contact_uid(uid)¶
- Parameters:
uid (
str
) – a contact UID
Tells the self, that it contains a contact with UID uid. This is useful for “manual query” view, which do not do initial notifications. It helps to not send “objects-added” signal for contacts, which are already
Camel.part
of the self, because for them the “objects-modified” should be emitted instead.New in version 3.50.
- dup_contacts(range_start, range_length)¶
- Parameters:
- Returns:
array of the read contacts, or
None
, when not applicable or when the range_start it out of bounds.- Return type:
Reads range_length contacts from index range_start. When there are asked more than
EDataBook.DataBookView.get_n_total
() contacts only those up to the total number of contacts are read.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, or
None
when cannot determine- Return type:
Returns a list of
EBookContacts.BookIndices
holding indices of the contacts in the view. These are received from the first sort field set byEDataBook.DataBookView.set_sort_fields
(). The last item of the returned array is the one with chr member beingNone
.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_connection()¶
- Returns:
- Return type:
Returns the
Gio.DBusConnection
on which the AddressBookView D-Bus interface is exported.New in version 3.8.
- get_fields_of_interest()¶
- Returns:
Hash table of field names which the listener is interested in. Backends can return fully populated objects, but the listener advertised that it will use only these. Returns
None
for all available fields.Note: The data pointer in the hash table has no special meaning, it’s only GINT_TO_POINTER(1) for easier checking. Also, field names are compared case insensitively.
- Return type:
- get_flags()¶
- Returns:
the flags for self.
- Return type:
Gets the
EBookContacts.BookClientViewFlags
that control the behaviour of self.New in version 3.4.
- get_force_initial_notifications()¶
- Returns:
value set by
EDataBook.DataBookView.set_force_initial_notifications
()- Return type:
Returns whether the self should do initial notifications even when the flags do not contain
EBookContacts.BookClientViewFlags.NOTIFY_INITIAL
. The default isFalse
.New in version 3.50.
- get_id()¶
- Returns:
an identifier of the view
- Return type:
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:
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:
Returns the object path at which the AddressBookView D-Bus interface is exported.
New in version 3.8.
- get_sexp()¶
- Returns:
The
EDataBook.BookBackendSExp
used.- Return type:
Gets the s-expression used for matching contacts to self.
New in version 3.8.
- is_completed()¶
- Returns:
whether the self had been completed; that is, whether
EDataBook.DataBookView.notify_complete
() had been called since the self had been started.- Return type:
New in version 3.34.
- notify_complete(error)¶
- Parameters:
error (
GLib.Error
) – the error of the query, if any
Notifies listeners that all pending updates on self have been sent. The listener’s information should now be in sync with the backend’s.
- notify_content_changed()¶
Notifies the client side that the content of the self changed, which it should use to refresh the view data.
Note: This function can be used only with
EBookContacts.BookClientViewFlags.MANUAL_QUERY
.New in version 3.50.
- notify_progress(percent, message)¶
-
Provides listeners with a human-readable text describing the current backend operation. This can be used for progress reporting.
New in version 3.2.
- notify_remove(id)¶
- Parameters:
id (
str
) – a unique contact ID
Notify listeners that a contact specified by id was removed from self.
- notify_update(contact)¶
- Parameters:
contact (
EBookContacts.Contact
) – anEBookContacts.Contact
Notify listeners that contact has changed. This can trigger an add, change or removal event depending on whether the change causes the contact to start matching, no longer match, or stay matching the query specified by self.
- notify_update_prefiltered_vcard(id, vcard)¶
-
Notify listeners that vcard has changed. This can trigger an add, change or removal event depending on whether the change causes the contact to start matching, no longer match, or stay matching the query specified by self. This method should be preferred over
EDataBook.DataBookView.notify_update
() when the native representation of a contact is a vCard.The important difference between this method and
EDataBook.DataBookView.notify_update
() andEDataBook.DataBookView.notify_update_vcard
() is that it doesn’t match the contact against the book view query to see if it should be included, it assumes that this has been done and the contact is known to exist in the view.
- notify_update_vcard(id, vcard)¶
-
Notify listeners that vcard has changed. This can trigger an add, change or removal event depending on whether the change causes the contact to start matching, no longer match, or stay matching the query specified by self. This method should be preferred over
EDataBook.DataBookView.notify_update
() when the native representation of a contact is a vCard.
- ref_backend()¶
- Returns:
The associated
EDataBook.BookBackend
.- Return type:
Refs the backend that self is querying. Unref the returned backend, if not
None
, withGObject.Object.unref
(), when no longer needed.New in version 3.34.
- set_force_initial_notifications(value)¶
- Parameters:
value (
bool
) – value to set
Sets whether the self should do initial notifications even when the flags do not contain
EBookContacts.BookClientViewFlags.NOTIFY_INITIAL
.New in version 3.50.
- set_indices(indices)¶
- Parameters:
indices (
EBookContacts.BookIndices
) – an array ofEBookContacts.BookIndices
Sets indices used by the self. The array is terminated by an item with chr member being
None
. SeeEDataBook.DataBookView.dup_indices
() for more information.Note: This function can be used only with
EBookContacts.BookClientViewFlags.MANUAL_QUERY
.New in version 3.50.
- set_n_total(n_total)¶
- Parameters:
n_total (
int
) – a value to set
Sets 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.
- set_sort_fields(fields)¶
- Parameters:
fields (
EBookContacts.BookClientViewSortFields
) – an array ofEBookContacts.BookClientViewSortFields
fields to sort by
Sets fields to sort the view by. The default is to sort by the file-as field. The contacts are always sorted in ascending order. Not every field can be used for sorting, the default available fields are
EBookContacts.ContactField.FILE_AS
,EBookContacts.ContactField.GIVEN_NAME
andEBookContacts.ContactField.FAMILY_NAME
.The first sort field is used to populate indices, as returned by
EDataBook.DataBookView.dup_indices
().Note: This function can be used only with
EBookContacts.BookClientViewFlags.MANUAL_QUERY
.New in version 3.50.
Signal Details¶
- EDataBook.DataBookView.signals.objects_added(data_book_view, vcards)¶
- Signal Name:
objects-added
- Flags:
- Parameters:
data_book_view (
EDataBook.DataBookView
) – The object which received the signalvcards ([
str
]) – array of vCards as string
Emitted when new objects are added into the view.
Note: This signal is used only when the view has set
EBookContacts.BookClientViewFlags.MANUAL_QUERY
flag.New in version 3.50.
- EDataBook.DataBookView.signals.objects_modified(data_book_view, vcards)¶
- Signal Name:
objects-modified
- Flags:
- Parameters:
data_book_view (
EDataBook.DataBookView
) – The object which received the signalvcards ([
str
]) – array of vCards as string
Emitted when the objects in the view are modified.
Note: This signal is used only when the view has set
EBookContacts.BookClientViewFlags.MANUAL_QUERY
flag.New in version 3.50.
- EDataBook.DataBookView.signals.objects_removed(data_book_view, uids)¶
- Signal Name:
objects-removed
- Flags:
- Parameters:
data_book_view (
EDataBook.DataBookView
) – The object which received the signaluids ([
str
]) – array of UIDs as string
Emitted when the objects are removed from the view.
Note: This signal is used only when the view has set
EBookContacts.BookClientViewFlags.MANUAL_QUERY
flag.New in version 3.50.
Property Details¶
- EDataBook.DataBookView.props.backend¶
- Name:
backend
- Type:
- Default Value:
- Flags:
The backend being monitored
- EDataBook.DataBookView.props.connection¶
- Name:
connection
- Type:
- Default Value:
- Flags:
The
Gio.DBusConnection
on which to export the view interface
- EDataBook.DataBookView.props.indices¶
- EDataBook.DataBookView.props.n_total¶
- EDataBook.DataBookView.props.object_path¶
- Name:
object-path
- Type:
- Default Value:
- Flags:
The object path at which to export the view interface
- EDataBook.DataBookView.props.sexp¶
- Name:
sexp
- Type:
- Default Value:
- Flags:
The query expression for this view