Constructor
EDataBookBookSqlitenew_full
since: 3.12
Declaration [src]
EBookSqlite*
e_book_sqlite_new_full (
const gchar* path,
ESource* source,
ESourceBackendSummarySetup* setup,
EbSqlVCardCallback vcard_callback,
EbSqlChangeCallback change_callback,
gpointer user_data,
GDestroyNotify user_data_destroy,
GCancellable* cancellable,
GError** error
)
Description [src]
Opens or creates a new addressbook at path.
Like e_book_sqlite_new(), but allows configuration of which contact fields
will be stored for quick reference in the summary. The configuration indicated by
setup will only be taken into account when initially creating the underlying table,
further configurations will be ignored.
The fields E_CONTACT_UID and E_CONTACT_REV are not optional,
they will be stored in the summary regardless of this function’s parameters. Only EContactFields with the type #G_TYPE_STRING, #G_TYPE_BOOLEAN or
E_TYPE_CONTACT_ATTR_LIST are currently supported.
If vcard_callback is specified, then vcards will not be stored by functions
such as e_book_sqlitedb_add_contact(). Instead vcard_callback will be invoked
at any time the created EBookSqlite requires a vcard, either as a fallback
for querying search expressions which cannot be satisfied with the summary
fields, or when reporting results from searches.
If any error occurs and NULL is returned, then the passed user_data will
be automatically freed using the user_data_destroy function, if specified.
It is recommended to store all contact vcards in the EBookSqlite addressbook
if at all possible, however in some cases the vcards must be stored in some
other storage.
Available since: 3.12
Parameters
path-
Type:
const gchar*Location to load or create the new database.
The data is owned by the caller of the function. The value is a NUL terminated UTF-8 string. source-
Type:
ESourceAn optional
ESource, associated with theEBookSqlite, orNULL.The argument can be NULL.The data is owned by the caller of the function. setup-
Type:
ESourceBackendSummarySetupAn
ESourceBackendSummarySetupdescribing how the summary should be setup, orNULLto use the default.The argument can be NULL.The data is owned by the caller of the function. vcard_callback-
Type:
EbSqlVCardCallbackA function to resolve vcards.
The argument can be NULL. change_callback-
Type:
EbSqlChangeCallbackA function to catch notifications of vcard changes.
The argument can be NULL. user_data-
Type:
gpointerCallback user data.
The argument can be NULL.The data is owned by the caller of the function. user_data_destroy-
Type:
GDestroyNotifyA function to free
user_dataautomatically when the createdEBookSqliteis destroyed.The argument can be NULL. cancellable-
Type:
GCancellableA
GCancellable.The argument can be NULL.The data is owned by the caller of the function. error-
Type:
GError **The return location for a recoverable error.
The argument can be NULL.If the return location is not NULL, then you must initialize it to aNULLGError*.The argument will be left initialized to NULLby the constructor if there are no errors.In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.
Return value
Type: EBookSqlite
The newly created EBookSqlite, or NULL if
opening or creating the addressbook failed.
| The caller of the function takes ownership of the data, and is responsible for freeing it. |