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

/*
 * Copyright © 2020 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-client-43.0.h"
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.h>
#include <glib-object.h>
#include "geary-engine.h"

static GType plugin_contact_store_get_type_once (void);

void
plugin_contact_store_search (PluginContactStore* self,
                             const gchar* query,
                             guint min_importance,
                             guint limit,
                             GCancellable* cancellable,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	PluginContactStoreIface* _iface_;
	_iface_ = PLUGIN_CONTACT_STORE_GET_INTERFACE (self);
	if (_iface_->search) {
		_iface_->search (self, query, min_importance, limit, cancellable, _callback_, _user_data_);
	}
}

GeeCollection*
plugin_contact_store_search_finish (PluginContactStore* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	PluginContactStoreIface* _iface_;
	_iface_ = PLUGIN_CONTACT_STORE_GET_INTERFACE (self);
	if (_iface_->search_finish) {
		return _iface_->search_finish (self, _res_, error);
	}
	return NULL;
}

void
plugin_contact_store_load (PluginContactStore* self,
                           GearyRFC822MailboxAddress* mailbox,
                           GCancellable* cancellable,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	PluginContactStoreIface* _iface_;
	_iface_ = PLUGIN_CONTACT_STORE_GET_INTERFACE (self);
	if (_iface_->load) {
		_iface_->load (self, mailbox, cancellable, _callback_, _user_data_);
	}
}

ApplicationContact*
plugin_contact_store_load_finish (PluginContactStore* self,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	PluginContactStoreIface* _iface_;
	_iface_ = PLUGIN_CONTACT_STORE_GET_INTERFACE (self);
	if (_iface_->load_finish) {
		return _iface_->load_finish (self, _res_, error);
	}
	return NULL;
}

static void
plugin_contact_store_default_init (PluginContactStoreIface * iface,
                                   gpointer iface_data)
{
}

/**
 * Provides plugins with access to contact information.
 *
 * Plugins may obtain instances of this object from their context
 * objects, for example {@link
 * NotificationContext.get_contacts_for_folder}.
 */
static GType
plugin_contact_store_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PluginContactStoreIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) plugin_contact_store_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType plugin_contact_store_type_id;
	plugin_contact_store_type_id = g_type_register_static (G_TYPE_INTERFACE, "PluginContactStore", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (plugin_contact_store_type_id, GEARY_TYPE_BASE_OBJECT);
	return plugin_contact_store_type_id;
}

GType
plugin_contact_store_get_type (void)
{
	static volatile gsize plugin_contact_store_type_id__once = 0;
	if (g_once_init_enter (&plugin_contact_store_type_id__once)) {
		GType plugin_contact_store_type_id;
		plugin_contact_store_type_id = plugin_contact_store_get_type_once ();
		g_once_init_leave (&plugin_contact_store_type_id__once, plugin_contact_store_type_id);
	}
	return plugin_contact_store_type_id__once;
}

