/* appstream_interface.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from appstream_interface.vala, do not modify */

/*
 *  pamac-vala
 *
 *  Copyright (C) 2023 Guillaume Benoit <guillaume@manjaro.org>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a get of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "pamac.h"

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define PAMAC_TYPE_APPSTREAM_PLUGIN (pamac_appstream_plugin_get_type ())
#define PAMAC_APPSTREAM_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAMAC_TYPE_APPSTREAM_PLUGIN, PamacAppstreamPlugin))
#define PAMAC_IS_APPSTREAM_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAMAC_TYPE_APPSTREAM_PLUGIN))
#define PAMAC_APPSTREAM_PLUGIN_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PAMAC_TYPE_APPSTREAM_PLUGIN, PamacAppstreamPluginIface))

typedef struct _PamacAppstreamPlugin PamacAppstreamPlugin;
typedef struct _PamacAppstreamPluginIface PamacAppstreamPluginIface;

#define PAMAC_TYPE_APP (pamac_app_get_type ())
#define PAMAC_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAMAC_TYPE_APP, PamacApp))
#define PAMAC_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PAMAC_TYPE_APP, PamacAppClass))
#define PAMAC_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAMAC_TYPE_APP))
#define PAMAC_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PAMAC_TYPE_APP))
#define PAMAC_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAMAC_TYPE_APP, PamacAppClass))

typedef struct _PamacApp PamacApp;
typedef struct _PamacAppClass PamacAppClass;
typedef struct _PamacAppPrivate PamacAppPrivate;
enum  {
	PAMAC_APP_0_PROPERTY,
	PAMAC_APP_NAME_PROPERTY,
	PAMAC_APP_ID_PROPERTY,
	PAMAC_APP_PKGNAME_PROPERTY,
	PAMAC_APP_DESC_PROPERTY,
	PAMAC_APP_LONG_DESC_PROPERTY,
	PAMAC_APP_REPO_PROPERTY,
	PAMAC_APP_LAUNCHABLE_PROPERTY,
	PAMAC_APP_ICON_PROPERTY,
	PAMAC_APP_SCREENSHOTS_PROPERTY,
	PAMAC_APP_NUM_PROPERTIES
};
static GParamSpec* pamac_app_properties[PAMAC_APP_NUM_PROPERTIES];

struct _PamacAppstreamPluginIface {
	GTypeInterface parent_iface;
	void (*load) (PamacAppstreamPlugin* self, GPtrArray* repos_names);
	GPtrArray* (*get_apps) (PamacAppstreamPlugin* self);
	GPtrArray* (*search) (PamacAppstreamPlugin* self, gchar** search_tokens, gint search_tokens_length1);
	GPtrArray* (*get_pkgname_apps) (PamacAppstreamPlugin* self, const gchar* pkgname);
	GHashTable* (*get_category_apps) (PamacAppstreamPlugin* self, const gchar* category);
};

struct _PamacApp {
	GObject parent_instance;
	PamacAppPrivate * priv;
};

struct _PamacAppClass {
	GObjectClass parent_class;
	const gchar* (*get_name) (PamacApp* self);
	const gchar* (*get_id) (PamacApp* self);
	const gchar* (*get_pkgname) (PamacApp* self);
	const gchar* (*get_desc) (PamacApp* self);
	const gchar* (*get_long_desc) (PamacApp* self);
	const gchar* (*get_repo) (PamacApp* self);
	const gchar* (*get_launchable) (PamacApp* self);
	const gchar* (*get_icon) (PamacApp* self);
	GPtrArray* (*get_screenshots) (PamacApp* self);
};

static gpointer pamac_app_parent_class = NULL;

VALA_EXTERN GType pamac_app_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType pamac_appstream_plugin_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void pamac_appstream_plugin_load (PamacAppstreamPlugin* self,
                                  GPtrArray* repos_names);
VALA_EXTERN GPtrArray* pamac_appstream_plugin_get_apps (PamacAppstreamPlugin* self);
VALA_EXTERN GPtrArray* pamac_appstream_plugin_search (PamacAppstreamPlugin* self,
                                          gchar** search_tokens,
                                          gint search_tokens_length1);
VALA_EXTERN GPtrArray* pamac_appstream_plugin_get_pkgname_apps (PamacAppstreamPlugin* self,
                                                    const gchar* pkgname);
VALA_EXTERN GHashTable* pamac_appstream_plugin_get_category_apps (PamacAppstreamPlugin* self,
                                                      const gchar* category);
static GType pamac_appstream_plugin_get_type_once (void);
VALA_EXTERN PamacApp* pamac_app_construct (GType object_type);
VALA_EXTERN const gchar* pamac_app_get_name (PamacApp* self);
VALA_EXTERN const gchar* pamac_app_get_id (PamacApp* self);
VALA_EXTERN const gchar* pamac_app_get_pkgname (PamacApp* self);
VALA_EXTERN const gchar* pamac_app_get_desc (PamacApp* self);
VALA_EXTERN const gchar* pamac_app_get_long_desc (PamacApp* self);
VALA_EXTERN const gchar* pamac_app_get_repo (PamacApp* self);
VALA_EXTERN const gchar* pamac_app_get_launchable (PamacApp* self);
VALA_EXTERN const gchar* pamac_app_get_icon (PamacApp* self);
VALA_EXTERN GPtrArray* pamac_app_get_screenshots (PamacApp* self);
static GType pamac_app_get_type_once (void);
static void _vala_pamac_app_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec);

void
pamac_appstream_plugin_load (PamacAppstreamPlugin* self,
                             GPtrArray* repos_names)
{
	PamacAppstreamPluginIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = PAMAC_APPSTREAM_PLUGIN_GET_INTERFACE (self);
	if (_iface_->load) {
		_iface_->load (self, repos_names);
	}
}

GPtrArray*
pamac_appstream_plugin_get_apps (PamacAppstreamPlugin* self)
{
	PamacAppstreamPluginIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = PAMAC_APPSTREAM_PLUGIN_GET_INTERFACE (self);
	if (_iface_->get_apps) {
		return _iface_->get_apps (self);
	}
	return NULL;
}

GPtrArray*
pamac_appstream_plugin_search (PamacAppstreamPlugin* self,
                               gchar** search_tokens,
                               gint search_tokens_length1)
{
	PamacAppstreamPluginIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = PAMAC_APPSTREAM_PLUGIN_GET_INTERFACE (self);
	if (_iface_->search) {
		return _iface_->search (self, search_tokens, search_tokens_length1);
	}
	return NULL;
}

GPtrArray*
pamac_appstream_plugin_get_pkgname_apps (PamacAppstreamPlugin* self,
                                         const gchar* pkgname)
{
	PamacAppstreamPluginIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = PAMAC_APPSTREAM_PLUGIN_GET_INTERFACE (self);
	if (_iface_->get_pkgname_apps) {
		return _iface_->get_pkgname_apps (self, pkgname);
	}
	return NULL;
}

GHashTable*
pamac_appstream_plugin_get_category_apps (PamacAppstreamPlugin* self,
                                          const gchar* category)
{
	PamacAppstreamPluginIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = PAMAC_APPSTREAM_PLUGIN_GET_INTERFACE (self);
	if (_iface_->get_category_apps) {
		return _iface_->get_category_apps (self, category);
	}
	return NULL;
}

static void
pamac_appstream_plugin_default_init (PamacAppstreamPluginIface * iface,
                                     gpointer iface_data)
{
}

static GType
pamac_appstream_plugin_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PamacAppstreamPluginIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pamac_appstream_plugin_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType pamac_appstream_plugin_type_id;
	pamac_appstream_plugin_type_id = g_type_register_static (G_TYPE_INTERFACE, "PamacAppstreamPlugin", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (pamac_appstream_plugin_type_id, G_TYPE_OBJECT);
	return pamac_appstream_plugin_type_id;
}

GType
pamac_appstream_plugin_get_type (void)
{
	static volatile gsize pamac_appstream_plugin_type_id__once = 0;
	if (g_once_init_enter (&pamac_appstream_plugin_type_id__once)) {
		GType pamac_appstream_plugin_type_id;
		pamac_appstream_plugin_type_id = pamac_appstream_plugin_get_type_once ();
		g_once_init_leave (&pamac_appstream_plugin_type_id__once, pamac_appstream_plugin_type_id);
	}
	return pamac_appstream_plugin_type_id__once;
}

PamacApp*
pamac_app_construct (GType object_type)
{
	PamacApp * self = NULL;
	self = (PamacApp*) g_object_new (object_type, NULL);
	return self;
}

const gchar*
pamac_app_get_name (PamacApp* self)
{
	PamacAppClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = PAMAC_APP_GET_CLASS (self);
	if (_klass_->get_name) {
		return _klass_->get_name (self);
	}
	return NULL;
}

const gchar*
pamac_app_get_id (PamacApp* self)
{
	PamacAppClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = PAMAC_APP_GET_CLASS (self);
	if (_klass_->get_id) {
		return _klass_->get_id (self);
	}
	return NULL;
}

const gchar*
pamac_app_get_pkgname (PamacApp* self)
{
	PamacAppClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = PAMAC_APP_GET_CLASS (self);
	if (_klass_->get_pkgname) {
		return _klass_->get_pkgname (self);
	}
	return NULL;
}

const gchar*
pamac_app_get_desc (PamacApp* self)
{
	PamacAppClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = PAMAC_APP_GET_CLASS (self);
	if (_klass_->get_desc) {
		return _klass_->get_desc (self);
	}
	return NULL;
}

const gchar*
pamac_app_get_long_desc (PamacApp* self)
{
	PamacAppClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = PAMAC_APP_GET_CLASS (self);
	if (_klass_->get_long_desc) {
		return _klass_->get_long_desc (self);
	}
	return NULL;
}

const gchar*
pamac_app_get_repo (PamacApp* self)
{
	PamacAppClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = PAMAC_APP_GET_CLASS (self);
	if (_klass_->get_repo) {
		return _klass_->get_repo (self);
	}
	return NULL;
}

const gchar*
pamac_app_get_launchable (PamacApp* self)
{
	PamacAppClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = PAMAC_APP_GET_CLASS (self);
	if (_klass_->get_launchable) {
		return _klass_->get_launchable (self);
	}
	return NULL;
}

const gchar*
pamac_app_get_icon (PamacApp* self)
{
	PamacAppClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = PAMAC_APP_GET_CLASS (self);
	if (_klass_->get_icon) {
		return _klass_->get_icon (self);
	}
	return NULL;
}

GPtrArray*
pamac_app_get_screenshots (PamacApp* self)
{
	PamacAppClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = PAMAC_APP_GET_CLASS (self);
	if (_klass_->get_screenshots) {
		return _klass_->get_screenshots (self);
	}
	return NULL;
}

static void
pamac_app_class_init (PamacAppClass * klass,
                      gpointer klass_data)
{
	pamac_app_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->get_property = _vala_pamac_app_get_property;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_APP_NAME_PROPERTY, pamac_app_properties[PAMAC_APP_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_APP_ID_PROPERTY, pamac_app_properties[PAMAC_APP_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_APP_PKGNAME_PROPERTY, pamac_app_properties[PAMAC_APP_PKGNAME_PROPERTY] = g_param_spec_string ("pkgname", "pkgname", "pkgname", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_APP_DESC_PROPERTY, pamac_app_properties[PAMAC_APP_DESC_PROPERTY] = g_param_spec_string ("desc", "desc", "desc", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_APP_LONG_DESC_PROPERTY, pamac_app_properties[PAMAC_APP_LONG_DESC_PROPERTY] = g_param_spec_string ("long-desc", "long-desc", "long-desc", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_APP_REPO_PROPERTY, pamac_app_properties[PAMAC_APP_REPO_PROPERTY] = g_param_spec_string ("repo", "repo", "repo", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_APP_LAUNCHABLE_PROPERTY, pamac_app_properties[PAMAC_APP_LAUNCHABLE_PROPERTY] = g_param_spec_string ("launchable", "launchable", "launchable", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_APP_ICON_PROPERTY, pamac_app_properties[PAMAC_APP_ICON_PROPERTY] = g_param_spec_string ("icon", "icon", "icon", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_APP_SCREENSHOTS_PROPERTY, pamac_app_properties[PAMAC_APP_SCREENSHOTS_PROPERTY] = g_param_spec_boxed ("screenshots", "screenshots", "screenshots", G_TYPE_PTR_ARRAY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
pamac_app_instance_init (PamacApp * self,
                         gpointer klass)
{
}

static GType
pamac_app_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PamacAppClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pamac_app_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PamacApp), 0, (GInstanceInitFunc) pamac_app_instance_init, NULL };
	GType pamac_app_type_id;
	pamac_app_type_id = g_type_register_static (G_TYPE_OBJECT, "PamacApp", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return pamac_app_type_id;
}

GType
pamac_app_get_type (void)
{
	static volatile gsize pamac_app_type_id__once = 0;
	if (g_once_init_enter (&pamac_app_type_id__once)) {
		GType pamac_app_type_id;
		pamac_app_type_id = pamac_app_get_type_once ();
		g_once_init_leave (&pamac_app_type_id__once, pamac_app_type_id);
	}
	return pamac_app_type_id__once;
}

static void
_vala_pamac_app_get_property (GObject * object,
                              guint property_id,
                              GValue * value,
                              GParamSpec * pspec)
{
	PamacApp * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PAMAC_TYPE_APP, PamacApp);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

