/* plugin-trusted-extension.c generated by valac 0.56.3, the Vala compiler
 * generated from plugin-trusted-extension.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 <glib.h>

static GType plugin_trusted_extension_get_type_once (void);

ApplicationClient*
plugin_trusted_extension_get_client_application (PluginTrustedExtension* self)
{
	PluginTrustedExtensionIface* _iface_;
	g_return_val_if_fail (PLUGIN_IS_TRUSTED_EXTENSION (self), NULL);
	_iface_ = PLUGIN_TRUSTED_EXTENSION_GET_INTERFACE (self);
	if (_iface_->get_client_application) {
		return _iface_->get_client_application (self);
	}
	return NULL;
}

void
plugin_trusted_extension_set_client_application (PluginTrustedExtension* self,
                                                 ApplicationClient* value)
{
	PluginTrustedExtensionIface* _iface_;
	g_return_if_fail (PLUGIN_IS_TRUSTED_EXTENSION (self));
	_iface_ = PLUGIN_TRUSTED_EXTENSION_GET_INTERFACE (self);
	if (_iface_->set_client_application) {
		_iface_->set_client_application (self, value);
	}
}

ApplicationPluginManager*
plugin_trusted_extension_get_client_plugins (PluginTrustedExtension* self)
{
	PluginTrustedExtensionIface* _iface_;
	g_return_val_if_fail (PLUGIN_IS_TRUSTED_EXTENSION (self), NULL);
	_iface_ = PLUGIN_TRUSTED_EXTENSION_GET_INTERFACE (self);
	if (_iface_->get_client_plugins) {
		return _iface_->get_client_plugins (self);
	}
	return NULL;
}

void
plugin_trusted_extension_set_client_plugins (PluginTrustedExtension* self,
                                             ApplicationPluginManager* value)
{
	PluginTrustedExtensionIface* _iface_;
	g_return_if_fail (PLUGIN_IS_TRUSTED_EXTENSION (self));
	_iface_ = PLUGIN_TRUSTED_EXTENSION_GET_INTERFACE (self);
	if (_iface_->set_client_plugins) {
		_iface_->set_client_plugins (self, value);
	}
}

static void
plugin_trusted_extension_default_init (PluginTrustedExtensionIface * iface,
                                       gpointer iface_data)
{
	/**
	     * Client application object.
	     *
	     * This will be set during (or just after) plugin construction,
	     * before {@link PluginBase.activate} is called.
	     */
	g_object_interface_install_property (iface, g_param_spec_object ("client-application", "client-application", "client-application", APPLICATION_TYPE_CLIENT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	/**
	     * Client plugin manager object.
	     *
	     * This will be set during (or just after) plugin construction,
	     * before {@link PluginBase.activate} is called.
	     */
	g_object_interface_install_property (iface, g_param_spec_object ("client-plugins", "client-plugins", "client-plugins", APPLICATION_TYPE_PLUGIN_MANAGER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
}

/**
 * A plugin extension point for trusted plugins.
 *
 * In-tree plugins may implement this interface if they require access
 * to the client application's internal machinery.
 *
 * Since the client application and engine objects have no API
 * stability guarantee, Geary will refuse to load out-of-tree plugins
 * that implement this extension point.
 */
static GType
plugin_trusted_extension_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PluginTrustedExtensionIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) plugin_trusted_extension_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType plugin_trusted_extension_type_id;
	plugin_trusted_extension_type_id = g_type_register_static (G_TYPE_INTERFACE, "PluginTrustedExtension", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (plugin_trusted_extension_type_id, PLUGIN_TYPE_PLUGIN_BASE);
	return plugin_trusted_extension_type_id;
}

GType
plugin_trusted_extension_get_type (void)
{
	static volatile gsize plugin_trusted_extension_type_id__once = 0;
	if (g_once_init_enter (&plugin_trusted_extension_type_id__once)) {
		GType plugin_trusted_extension_type_id;
		plugin_trusted_extension_type_id = plugin_trusted_extension_get_type_once ();
		g_once_init_leave (&plugin_trusted_extension_type_id__once, plugin_trusted_extension_type_id);
	}
	return plugin_trusted_extension_type_id__once;
}

