Richard Hughes | b333e00 | 2021-04-01 10:40:02 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2021 Richard Hughes <richard@hughsie.com> |
| 3 | * |
| 4 | * SPDX-License-Identifier: LGPL-2.1+ |
| 5 | */ |
| 6 | |
| 7 | #pragma once |
| 8 | |
| 9 | #include <gio/gio.h> |
| 10 | |
Richard Hughes | 4d76d18 | 2021-04-06 13:35:15 +0100 | [diff] [blame] | 11 | #include "fu-common.h" |
| 12 | |
Richard Hughes | b333e00 | 2021-04-01 10:40:02 +0100 | [diff] [blame] | 13 | #define FU_TYPE_CONTEXT (fu_context_get_type ()) |
| 14 | G_DECLARE_DERIVABLE_TYPE (FuContext, fu_context, FU, CONTEXT, GObject) |
| 15 | |
| 16 | struct _FuContextClass { |
| 17 | GObjectClass parent_class; |
| 18 | /* signals */ |
| 19 | void (* security_changed) (FuContext *self); |
| 20 | /*< private >*/ |
| 21 | gpointer padding[30]; |
| 22 | }; |
| 23 | |
| 24 | typedef void (*FuContextLookupIter) (FuContext *self, |
| 25 | const gchar *key, |
| 26 | const gchar *value, |
| 27 | gpointer user_data); |
| 28 | |
| 29 | const gchar *fu_context_get_smbios_string (FuContext *self, |
| 30 | guint8 structure_type, |
| 31 | guint8 offset); |
| 32 | guint fu_context_get_smbios_integer (FuContext *self, |
| 33 | guint8 type, |
| 34 | guint8 offset); |
| 35 | GBytes *fu_context_get_smbios_data (FuContext *self, |
| 36 | guint8 structure_type); |
| 37 | gboolean fu_context_has_hwid_guid (FuContext *self, |
| 38 | const gchar *guid); |
| 39 | GPtrArray *fu_context_get_hwid_guids (FuContext *self); |
| 40 | const gchar *fu_context_get_hwid_value (FuContext *self, |
| 41 | const gchar *key); |
| 42 | gchar *fu_context_get_hwid_replace_value (FuContext *self, |
| 43 | const gchar *keys, |
| 44 | GError **error) |
| 45 | G_GNUC_WARN_UNUSED_RESULT; |
| 46 | void fu_context_add_runtime_version (FuContext *self, |
| 47 | const gchar *component_id, |
| 48 | const gchar *version); |
| 49 | void fu_context_add_compile_version (FuContext *self, |
| 50 | const gchar *component_id, |
| 51 | const gchar *version); |
| 52 | void fu_context_add_udev_subsystem (FuContext *self, |
| 53 | const gchar *subsystem); |
| 54 | const gchar *fu_context_lookup_quirk_by_id (FuContext *self, |
| 55 | const gchar *guid, |
| 56 | const gchar *key); |
| 57 | gboolean fu_context_lookup_quirk_by_id_iter (FuContext *self, |
| 58 | const gchar *guid, |
| 59 | FuContextLookupIter iter_cb, |
| 60 | gpointer user_data); |
| 61 | void fu_context_add_quirk_key (FuContext *self, |
| 62 | const gchar *key); |
| 63 | void fu_context_security_changed (FuContext *self); |
Richard Hughes | 4d76d18 | 2021-04-06 13:35:15 +0100 | [diff] [blame] | 64 | |
| 65 | FuBatteryState fu_context_get_battery_state (FuContext *self); |
| 66 | void fu_context_set_battery_state (FuContext *self, |
| 67 | FuBatteryState battery_state); |
| 68 | guint fu_context_get_battery_level (FuContext *self); |
| 69 | void fu_context_set_battery_level (FuContext *self, |
| 70 | guint battery_level); |
| 71 | guint fu_context_get_battery_threshold (FuContext *self); |
| 72 | void fu_context_set_battery_threshold (FuContext *self, |
| 73 | guint battery_threshold); |