blob: 62d21e74c337f32ccb0d5fe877333573476879b3 [file] [log] [blame]
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.recovery.ui;
using zx;
type Status = strict enum {
ACTIVE = 1;
PAUSED = 2;
ERROR = 3;
CANCELLED = 4;
COMPLETE = 5;
};
/// Protocol to receive progress updates to display a carnelian based progress bar UI.
@discoverable
closed protocol ProgressRenderer {
/// Called to send progress updates to the renderer.
///
/// The return value is used for flow control, and implementers should acknowledge receipt of
/// each message in order to continue receiving future messages.
@available(deprecated=9)
strict Render(struct {
status Status;
percent_complete float32;
}) -> ();
/// Called to send progress updates to the renderer.
///
/// This call optionally contains timing or speed information for the progress bar to move
/// slowly to percent_complete
///
/// The return value is used for flow control, and implementers should acknowledge receipt of
/// each message in order to continue receiving future messages.
@available(added=9)
strict Render2(table {
1: status Status;
/// Optional, only used with status ACTIVE
/// No value or an invalid value sets the progress bar to 0%
/// Values: [0.0 - 100.0]
2: percent_complete float32;
/// Time to take to move slowly to percent_complete
/// Optional, only used with status ACTIVE
/// No value indicates an instant jump to percent_complete
3: elapsed_time zx.Duration;
}) -> ();
};