From 56294d30a82ec2da6f9ce399740c1ef65a9ddef4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 17:18:46 +0200 Subject: Adding upstream version 3.38.1. Signed-off-by: Daniel Baumann --- lib/gs-plugin.h | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 lib/gs-plugin.h (limited to 'lib/gs-plugin.h') diff --git a/lib/gs-plugin.h b/lib/gs-plugin.h new file mode 100644 index 0000000..e211931 --- /dev/null +++ b/lib/gs-plugin.h @@ -0,0 +1,132 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * vi:set noexpandtab tabstop=8 shiftwidth=8: + * + * Copyright (C) 2012-2016 Richard Hughes + * Copyright (C) 2020 Kalev Lember + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include "gs-app.h" +#include "gs-app-list.h" +#include "gs-category.h" +#include "gs-plugin-event.h" +#include "gs-plugin-types.h" + +G_BEGIN_DECLS + +#define GS_TYPE_PLUGIN (gs_plugin_get_type ()) + +G_DECLARE_DERIVABLE_TYPE (GsPlugin, gs_plugin, GS, PLUGIN, GObject) + +struct _GsPluginClass +{ + GObjectClass parent_class; + void (*updates_changed) (GsPlugin *plugin); + void (*status_changed) (GsPlugin *plugin, + GsApp *app, + guint status); + void (*reload) (GsPlugin *plugin); + void (*report_event) (GsPlugin *plugin, + GsPluginEvent *event); + void (*allow_updates) (GsPlugin *plugin, + gboolean allow_updates); + void (*basic_auth_start) (GsPlugin *plugin, + const gchar *remote, + const gchar *realm, + GCallback callback, + gpointer user_data); + gpointer padding[25]; +}; + +typedef struct GsPluginData GsPluginData; + +/* helpers */ +#define GS_PLUGIN_ERROR gs_plugin_error_quark () + +GQuark gs_plugin_error_quark (void); + +/* public getters and setters */ +GsPluginData *gs_plugin_alloc_data (GsPlugin *plugin, + gsize sz); +GsPluginData *gs_plugin_get_data (GsPlugin *plugin); +const gchar *gs_plugin_get_name (GsPlugin *plugin); +const gchar *gs_plugin_get_appstream_id (GsPlugin *plugin); +void gs_plugin_set_appstream_id (GsPlugin *plugin, + const gchar *appstream_id); +gboolean gs_plugin_get_enabled (GsPlugin *plugin); +void gs_plugin_set_enabled (GsPlugin *plugin, + gboolean enabled); +gboolean gs_plugin_has_flags (GsPlugin *plugin, + GsPluginFlags flags); +void gs_plugin_add_flags (GsPlugin *plugin, + GsPluginFlags flags); +void gs_plugin_remove_flags (GsPlugin *plugin, + GsPluginFlags flags); +guint gs_plugin_get_scale (GsPlugin *plugin); +const gchar *gs_plugin_get_locale (GsPlugin *plugin); +const gchar *gs_plugin_get_language (GsPlugin *plugin); +SoupSession *gs_plugin_get_soup_session (GsPlugin *plugin); +void gs_plugin_set_soup_session (GsPlugin *plugin, + SoupSession *soup_session); +void gs_plugin_add_rule (GsPlugin *plugin, + GsPluginRule rule, + const gchar *name); + +/* helpers */ +GBytes *gs_plugin_download_data (GsPlugin *plugin, + GsApp *app, + const gchar *uri, + GCancellable *cancellable, + GError **error); +gboolean gs_plugin_download_file (GsPlugin *plugin, + GsApp *app, + const gchar *uri, + const gchar *filename, + GCancellable *cancellable, + GError **error); +gchar *gs_plugin_download_rewrite_resource (GsPlugin *plugin, + GsApp *app, + const gchar *resource, + GCancellable *cancellable, + GError **error); + +gboolean gs_plugin_check_distro_id (GsPlugin *plugin, + const gchar *distro_id); +GsApp *gs_plugin_cache_lookup (GsPlugin *plugin, + const gchar *key); +void gs_plugin_cache_add (GsPlugin *plugin, + const gchar *key, + GsApp *app); +void gs_plugin_cache_remove (GsPlugin *plugin, + const gchar *key); +void gs_plugin_cache_invalidate (GsPlugin *plugin); +void gs_plugin_status_update (GsPlugin *plugin, + GsApp *app, + GsPluginStatus status); +gboolean gs_plugin_app_launch (GsPlugin *plugin, + GsApp *app, + GError **error); +void gs_plugin_updates_changed (GsPlugin *plugin); +void gs_plugin_reload (GsPlugin *plugin); +const gchar *gs_plugin_status_to_string (GsPluginStatus status); +void gs_plugin_report_event (GsPlugin *plugin, + GsPluginEvent *event); +void gs_plugin_set_allow_updates (GsPlugin *plugin, + gboolean allow_updates); +gboolean gs_plugin_get_network_available (GsPlugin *plugin); +void gs_plugin_basic_auth_start (GsPlugin *plugin, + const gchar *remote, + const gchar *realm, + GCallback callback, + gpointer user_data); + +G_END_DECLS -- cgit v1.2.3