1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 12:35:07 +00:00
serenity/Userland/Applications/FileManager/FileOperationProgressWidget.h
Linus Groh 6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00

39 lines
1.2 KiB
C++

/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "FileUtils.h"
#include <LibCore/ElapsedTimer.h>
#include <LibCore/Stream.h>
#include <LibGUI/Widget.h>
namespace FileManager {
class FileOperationProgressWidget : public GUI::Widget {
C_OBJECT(FileOperationProgressWidget);
public:
virtual ~FileOperationProgressWidget() override;
private:
// FIXME: The helper_pipe_fd parameter is only needed because we can't get the fd from a Core::Stream.
FileOperationProgressWidget(FileOperation, NonnullOwnPtr<Core::Stream::BufferedFile> helper_pipe, int helper_pipe_fd);
void did_finish();
void did_error(StringView message);
void did_progress(off_t bytes_done, off_t total_byte_count, size_t files_done, size_t total_file_count, off_t current_file_done, off_t current_file_size, StringView current_filename);
void close_pipe();
DeprecatedString estimate_time(off_t bytes_done, off_t total_byte_count);
Core::ElapsedTimer m_elapsed_timer;
FileOperation m_operation;
RefPtr<Core::Notifier> m_notifier;
OwnPtr<Core::Stream::BufferedFile> m_helper_pipe;
};
}