From 6f0f7d1b40a8fa8d46a2d6f4317600001cdbbb18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:57:27 +0200 Subject: Adding upstream version 43.5. Signed-off-by: Daniel Baumann --- lib/gs-plugin-event.h | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 lib/gs-plugin-event.h (limited to 'lib/gs-plugin-event.h') diff --git a/lib/gs-plugin-event.h b/lib/gs-plugin-event.h new file mode 100644 index 0000000..949eb85 --- /dev/null +++ b/lib/gs-plugin-event.h @@ -0,0 +1,61 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * vi:set noexpandtab tabstop=8 shiftwidth=8: + * + * Copyright (C) 2016 Richard Hughes + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#pragma once + +#include + +#include "gs-app.h" +#include "gs-plugin-types.h" + +G_BEGIN_DECLS + +#define GS_TYPE_PLUGIN_EVENT (gs_plugin_event_get_type ()) + +G_DECLARE_FINAL_TYPE (GsPluginEvent, gs_plugin_event, GS, PLUGIN_EVENT, GObject) + +typedef struct _GsPluginJob GsPluginJob; + +/** + * GsPluginEventFlag: + * @GS_PLUGIN_EVENT_FLAG_NONE: No special flags set + * @GS_PLUGIN_EVENT_FLAG_INVALID: Event is no longer valid, e.g. was dismissed + * @GS_PLUGIN_EVENT_FLAG_VISIBLE: Event is is visible on the screen + * @GS_PLUGIN_EVENT_FLAG_WARNING: Event should be shown with more urgency + * @GS_PLUGIN_EVENT_FLAG_INTERACTIVE: The plugin job was created with interactive=True + * + * Any flags an event can have. + **/ +typedef enum { + GS_PLUGIN_EVENT_FLAG_NONE = 0, /* Since: 3.22 */ + GS_PLUGIN_EVENT_FLAG_INVALID = 1 << 0, /* Since: 3.22 */ + GS_PLUGIN_EVENT_FLAG_VISIBLE = 1 << 1, /* Since: 3.22 */ + GS_PLUGIN_EVENT_FLAG_WARNING = 1 << 2, /* Since: 3.22 */ + GS_PLUGIN_EVENT_FLAG_INTERACTIVE = 1 << 3, /* Since: 3.30 */ + GS_PLUGIN_EVENT_FLAG_LAST /*< skip >*/ +} GsPluginEventFlag; + +GsPluginEvent *gs_plugin_event_new (const gchar *first_property_name, + ...) G_GNUC_NULL_TERMINATED; + +const gchar *gs_plugin_event_get_unique_id (GsPluginEvent *event); + +GsApp *gs_plugin_event_get_app (GsPluginEvent *event); +GsApp *gs_plugin_event_get_origin (GsPluginEvent *event); +GsPluginAction gs_plugin_event_get_action (GsPluginEvent *event); +GsPluginJob *gs_plugin_event_get_job (GsPluginEvent *event); +const GError *gs_plugin_event_get_error (GsPluginEvent *event); + +void gs_plugin_event_add_flag (GsPluginEvent *event, + GsPluginEventFlag flag); +void gs_plugin_event_remove_flag (GsPluginEvent *event, + GsPluginEventFlag flag); +gboolean gs_plugin_event_has_flag (GsPluginEvent *event, + GsPluginEventFlag flag); + +G_END_DECLS -- cgit v1.2.3