/* geary-contact-store.c generated by valac 0.56.3, the Vala compiler
 * generated from geary-contact-store.vala, do not modify */

/*
 * Copyright 2016 Software Freedom Conservancy Inc.
 * Copyright 2019 Michael Gratton <mike@vee.net>
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later). See the COPYING file in this distribution.
 */

#include "geary-engine.h"
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <glib-object.h>

static GType geary_contact_store_get_type_once (void);

void
geary_contact_store_get_by_rfc822 (GearyContactStore* self,
                                   GearyRFC822MailboxAddress* address,
                                   GCancellable* cancellable,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	GearyContactStoreIface* _iface_;
	_iface_ = GEARY_CONTACT_STORE_GET_INTERFACE (self);
	if (_iface_->get_by_rfc822) {
		_iface_->get_by_rfc822 (self, address, cancellable, _callback_, _user_data_);
	}
}

GearyContact*
geary_contact_store_get_by_rfc822_finish (GearyContactStore* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	GearyContactStoreIface* _iface_;
	_iface_ = GEARY_CONTACT_STORE_GET_INTERFACE (self);
	if (_iface_->get_by_rfc822_finish) {
		return _iface_->get_by_rfc822_finish (self, _res_, error);
	}
	return NULL;
}

void
geary_contact_store_search (GearyContactStore* self,
                            const gchar* query,
                            guint min_importance,
                            guint limit,
                            GCancellable* cancellable,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_)
{
	GearyContactStoreIface* _iface_;
	_iface_ = GEARY_CONTACT_STORE_GET_INTERFACE (self);
	if (_iface_->search) {
		_iface_->search (self, query, min_importance, limit, cancellable, _callback_, _user_data_);
	}
}

GeeCollection*
geary_contact_store_search_finish (GearyContactStore* self,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	GearyContactStoreIface* _iface_;
	_iface_ = GEARY_CONTACT_STORE_GET_INTERFACE (self);
	if (_iface_->search_finish) {
		return _iface_->search_finish (self, _res_, error);
	}
	return NULL;
}

void
geary_contact_store_update_contacts (GearyContactStore* self,
                                     GeeCollection* updated,
                                     GCancellable* cancellable,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	GearyContactStoreIface* _iface_;
	_iface_ = GEARY_CONTACT_STORE_GET_INTERFACE (self);
	if (_iface_->update_contacts) {
		_iface_->update_contacts (self, updated, cancellable, _callback_, _user_data_);
	}
}

void
geary_contact_store_update_contacts_finish (GearyContactStore* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	GearyContactStoreIface* _iface_;
	_iface_ = GEARY_CONTACT_STORE_GET_INTERFACE (self);
	if (_iface_->update_contacts_finish) {
		_iface_->update_contacts_finish (self, _res_, error);
	}
}

static void
geary_contact_store_default_init (GearyContactStoreIface * iface,
                                  gpointer iface_data)
{
}

/**
 * Interface for objects that provide contact information storage.
 *
 * Implementations of this class will typically be backed by a
 * database. As such, to avoid IO overhead, batch calls together using
 * collections of contacts wherever possible.
 */
 G_GNUC_NO_INLINE static GType
geary_contact_store_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GearyContactStoreIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) geary_contact_store_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType geary_contact_store_type_id;
	geary_contact_store_type_id = g_type_register_static (G_TYPE_INTERFACE, "GearyContactStore", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (geary_contact_store_type_id, G_TYPE_OBJECT);
	return geary_contact_store_type_id;
}

GType
geary_contact_store_get_type (void)
{
	static gsize geary_contact_store_type_id__once = 0;
	if (g_once_init_enter (&geary_contact_store_type_id__once)) {
		GType geary_contact_store_type_id;
		geary_contact_store_type_id = geary_contact_store_get_type_once ();
		g_once_init_leave (&geary_contact_store_type_id__once, geary_contact_store_type_id);
	}
	return geary_contact_store_type_id__once;
}

