ladybird/Userland/Applications/HexEditor/GoToOffsetDialog.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

36 lines
954 B
C++

/*
* Copyright (c) 2021-2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Result.h>
#include <AK/Vector.h>
#include <LibGUI/Dialog.h>
class GoToOffsetDialog : public GUI::Dialog {
C_OBJECT(GoToOffsetDialog);
public:
static ExecResult show(GUI::Window* parent_window, int& history_offset, int& out_offset, int selection_offset, int end);
private:
GoToOffsetDialog();
virtual ~GoToOffsetDialog() override = default;
void update_statusbar();
int process_input();
int calculate_new_offset(int offset);
int m_selection_offset { 0 };
int m_buffer_size { 0 };
Vector<DeprecatedString> m_offset_type;
Vector<DeprecatedString> m_offset_from;
RefPtr<GUI::TextEditor> m_text_editor;
RefPtr<GUI::Button> m_go_button;
RefPtr<GUI::ComboBox> m_offset_type_box;
RefPtr<GUI::ComboBox> m_offset_from_box;
RefPtr<GUI::Statusbar> m_statusbar;
};