- public void add_view (DataBookView view)
Adds view to this for
querying.
- public void configure_direct (string config)
This method is called on this in
direct read access mode.
- public async bool contains_email (string email_address, Cancellable? cancellable) throws Error
Asynchronously checks whether contains an email_address.
- public bool contains_email_sync (string email_address, Cancellable? cancellable = null) throws Error
Checks whether contains an email_address.
- public async bool create_contacts (string vcards, uint32 opflags, Cancellable? cancellable) throws Error
Asynchronously creates one or more new contacts from vcards
.
- public bool create_contacts_sync (string vcards, uint32 opflags, Queue out_contacts, Cancellable? cancellable = null) throws Error
Creates one or more new contacts from vcards, and
deposits an Contact instance for each newly-created contact in
out_contacts.
- public unowned DataBookCursor create_cursor (ContactField sort_fields, BookCursorSortType sort_types, uint n_fields) throws Error
Creates a new
DataBookCursor for the given backend if the backend has cursor support.
- public bool delete_cursor (DataBookCursor cursor) throws Error
Requests this to release and destroy
cursor, this will trigger an e_client_error_invalid_arg error if cursor
is not owned by this.
- public string dup_cache_dir ()
- public string dup_locale ()
Fetches a copy of the currently configured locale for the addressbook
- public GenericArray<unowned Contact>? dup_view_contacts (size_t view_id, uint range_start, uint range_length)
Returns range_length contacts from 0-based index
range_start in the view identified by the view_id.
- public BookIndices? dup_view_indices (size_t view_id)
Returns a list of
BookIndices holding indices of the contacts in the view
identified by view_id.
- public BookClientViewSortFields dup_view_sort_fields (size_t view_id)
Returns currently used sort fields for manual query views.
- public bool foreach_view (BookBackendForeachViewFunc func)
Calls func for each existing view (as returned by
list_views).
- public void foreach_view_notify_progress (bool only_completed_views, int percent, string? message)
Notifies each view of the this about
progress.
- public string get_backend_property (string prop_name)
Obtains the value of the backend property named prop_name
.
- public unowned string get_cache_dir ()
Returns the cache directory path used by
this.
- public async Contact get_contact (string uid, Cancellable? cancellable) throws Error
Asynchronously obtains an
Contact for uid.
- public async bool get_contact_list (string query, Cancellable? cancellable) throws Error
Asynchronously obtains a set of
Contact instances which satisfy the criteria specified in
query.
- public bool get_contact_list_sync (string query, Queue out_contacts, Cancellable? cancellable = null) throws Error
Obtains a set of
Contact instances which satisfy the criteria specified in
query, and deposits them in out_contacts.
- public async bool get_contact_list_uids (string query, Cancellable? cancellable) throws Error
Asynchronously obtains a set of ID strings for contacts which satisfy
the criteria specified in query.
- public bool get_contact_list_uids_sync (string query, Queue out_uids, Cancellable? cancellable = null) throws Error
Obtains a set of ID strings for contacts which satisfy the criteria
specified in query, and deposits them in out_uids.
- public Contact get_contact_sync (string uid, Cancellable? cancellable = null) throws Error
- public DataBookDirect? get_direct_book ()
Tries to create an
DataBookDirect for this if backend supports direct read access.
- public unowned SourceRegistry get_registry ()
Returns the data source registry to which
source belongs.
- public uint get_view_n_total (size_t view_id)
Returns how many contacts the view identified by view_id
contains.
- public bool get_writable ()
Returns whether this will accept
changes to its data content.
- public virtual void impl_configure_direct (string config)
For addressbook backends which support Direct Read Access, configure a
backend instantiated on the client side for Direct Read Access, using data reported from the server via the get_direct_book
method.
- public virtual void impl_contains_email (DataBook book, uint32 opid, Cancellable? cancellable, string email_address)
Checkes whether the backend contains an email address
- public virtual void impl_create_contacts (DataBook book, uint32 opid, Cancellable? cancellable, string vcards, uint32 opflags)
Add and store the passed vcards
- public virtual bool impl_delete_cursor (DataBookCursor cursor) throws Error
- public virtual string impl_dup_locale ()
Return the currently set locale setting (must be a string duplicate,
for thread safety).
- public virtual BookIndices impl_dup_view_indices (size_t view_id)
retrieve indexes into an alphabet for contacts in the "manual query"
view; default implementation returns value set by set_view_indices.
- public virtual string impl_get_backend_property (string prop_name)
Fetch a property value by name from the backend
- public virtual void impl_get_contact (DataBook book, uint32 opid, Cancellable? cancellable, string id)
Fetch a contact by UID
- public virtual void impl_get_contact_list (DataBook book, uint32 opid, Cancellable? cancellable, string query)
Fetch a list of contacts based on a search expression
- public virtual void impl_get_contact_list_uids (DataBook book, uint32 opid, Cancellable? cancellable, string query)
Fetch a list of contact UIDs based on a search expression
- public virtual uint impl_get_view_n_total (size_t view_id)
retrieve how many contacts a "manual query" view has; default
implementation returns value set by set_view_n_total.
- public virtual void impl_modify_contacts (DataBook book, uint32 opid, Cancellable? cancellable, string vcards, uint32 opflags)
Modify the existing contacts using the passed vcards
- public virtual void impl_notify_update (Contact contact)
Notify changes which might have occured for a given contact
- public virtual void impl_open (DataBook book, uint32 opid, Cancellable? cancellable = null)
Open the backend
- public virtual void impl_refresh (DataBook book, uint32 opid, Cancellable? cancellable = null)
Refresh the backend
- public virtual void impl_remove_contacts (DataBook book, uint32 opid, Cancellable? cancellable, string uids, uint32 opflags)
Remove the contacts specified by the passed UIDs
- public virtual bool impl_set_locale (string locale, Cancellable? cancellable = null) throws Error
Store & remember the passed locale setting
- public virtual void impl_set_view_sort_fields (size_t view_id, BookClientViewSortFields fields)
sets sort fields for "manual query" views; default implementation
saves the values into internal structures, which can be read back with
dup_view_sort_fields.
- public virtual void impl_start_view (DataBookView view)
Start up the specified view
- public virtual void impl_stop_view (DataBookView view)
Stop the specified view
- public bool is_opened ()
Checks if this's storage has been
opened (and authenticated, if necessary) and the backend itself is ready for accessing.
- public bool is_readonly ()
Checks if we can write to this.
- public List<DataBookView> list_views ()
- public async bool modify_contacts (string vcards, uint32 opflags, Cancellable? cancellable) throws Error
Asynchronously modifies one or more contacts according to vcards
.
- public bool modify_contacts_sync (string vcards, uint32 opflags, Cancellable? cancellable = null) throws Error
Modifies one or more contacts according to vcards.
- public void notify_complete ()
Notifies all of this's book views
that the current set of notifications is complete; use this after a series of
notify_update and
notify_remove calls.
- public void notify_error (string message)
Notifies each backend listener about an error.
- public void notify_property_changed (string prop_name, string? prop_value)
Notifies clients about property value change.
- public void notify_remove (string id)
Notifies all of this's book views
that the contact with UID id has been removed.
- public void notify_update (Contact contact)
Notifies all of this's book views
about the new or modified contacts contact.
- public async bool open (Cancellable? cancellable) throws Error
Asynchronously "opens" the this.
- public bool open_sync (Cancellable? cancellable = null) throws Error
"Opens" the this.
- public Task prepare_for_completion (uint32 opid)
Obtains the Task
for opid.
- public DataBook? ref_data_book ()
- public ProxyResolver? ref_proxy_resolver ()
- public DataBookView? ref_view (size_t view_id)
- public Object ref_view_user_data (size_t view_id)
- public async bool refresh (Cancellable? cancellable) throws Error
Asynchronously initiates a refresh for this
, if the this supports refreshing.
- public bool refresh_sync (Cancellable? cancellable = null) throws Error
Initiates a refresh for this, if the
this supports refreshing.
- public async bool remove_contacts (string[] uids, uint32 opflags, Cancellable? cancellable) throws Error
Asynchronously removes one or more contacts according to uids
.
- public bool remove_contacts_sync (string uids, uint32 opflags, Cancellable? cancellable = null) throws Error
Removes one or more contacts according to uids.
- public void remove_view (DataBookView view)
Removes view from this.
- public void schedule_custom_operation (Cancellable? use_cancellable, owned BookBackendCustomOpFunc func)
Schedules user function func to be run in a dedicated
thread as a blocking operation.
- public void set_cache_dir (string cache_dir)
Sets the cache directory path for use by
this.
- public void set_data_book (DataBook data_book)
- public bool set_locale (string locale, Cancellable? cancellable = null) throws Error
Notify the addressbook backend that the current locale has changed,
this is important for backends which support ordered result lists which are locale sensitive.
- public void set_view_indices (size_t view_id, BookIndices? indices)
Stores current indices for the view identified by the
view_id and, if such exists, notifies about it also the corresponding
DataBookView.
- public void set_view_n_total (size_t view_id, uint n_total)
Stores how many contacts the view identified by view_id
contains.
- public void set_view_sort_fields (size_t view_id, BookClientViewSortFields? fields)
Sets the sort fields for the view identified by the view_id
.
- public void set_writable (bool writable)
Sets whether this will accept
changes to its data content.
- public void start_view (DataBookView view)
Starts running the query specified by view, emitting
signals for matching contacts.
- public void stop_view (DataBookView view)
Stops running the query specified by view, emitting no
more signals.
- public void sync ()
- public void take_view_user_data (size_t view_id, owned Object? user_data)
Sets the user data for the view_id.