fwupd/libfwupdplugin/fu-device-private.h
Richard Hughes 40cd18fa97 Allow using a per-device global percentage completion
It's actually quite hard to build a front-end for fwupd at the moment
as you're never sure when the progress bar is going to zip back to 0%
and start all over again. Some plugins go 0..100% for write, others
go 0..100% for erase, then again for write, then *again* for verify.

By creating a helper object we can easily split up the progress of the
specific task, e.g. write_firmware().

We can encode at the plugin level "the erase takes 50% of the time, the
write takes 40% and the read takes 10%". This means we can have a
progressbar which goes up just once at a consistent speed.
2021-09-13 14:28:15 +01:00

55 lines
1.5 KiB
C

/*
* Copyright (C) 2017 Richard Hughes <richard@hughsie.com>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#pragma once
#include <fu-device.h>
#include <xmlb.h>
#define fu_device_set_plugin(d, v) fwupd_device_set_plugin(FWUPD_DEVICE(d), v)
const gchar *
fu_device_internal_flag_to_string(FuDeviceInternalFlags flag);
FuDeviceInternalFlags
fu_device_internal_flag_from_string(const gchar *flag);
GPtrArray *
fu_device_get_parent_guids(FuDevice *self);
gboolean
fu_device_has_parent_guid(FuDevice *self, const gchar *guid);
GPtrArray *
fu_device_get_parent_physical_ids(FuDevice *self);
gboolean
fu_device_has_parent_physical_id(FuDevice *self, const gchar *physical_id);
void
fu_device_set_parent(FuDevice *self, FuDevice *parent);
gint
fu_device_get_order(FuDevice *self);
void
fu_device_set_order(FuDevice *self, gint order);
void
fu_device_set_alternate(FuDevice *self, FuDevice *alternate);
gboolean
fu_device_ensure_id(FuDevice *self, GError **error) G_GNUC_WARN_UNUSED_RESULT;
void
fu_device_incorporate_from_component(FuDevice *device, XbNode *component);
void
fu_device_convert_instance_ids(FuDevice *self);
gchar *
fu_device_get_guids_as_str(FuDevice *self);
GPtrArray *
fu_device_get_possible_plugins(FuDevice *self);
void
fu_device_add_possible_plugin(FuDevice *self, const gchar *plugin);
guint
fu_device_get_request_cnt(FuDevice *self, FwupdRequestKind request_kind);
guint64
fu_device_get_private_flags(FuDevice *self);
void
fu_device_set_private_flags(FuDevice *self, guint64 flag);
void
fu_device_set_progress(FuDevice *self, FuProgress *progress);