mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-12 14:12:52 +00:00
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 :^)
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "CodeDocument.h"
|
|
#include <AK/ByteBuffer.h>
|
|
#include <AK/DeprecatedString.h>
|
|
#include <AK/NonnullRefPtr.h>
|
|
#include <AK/RefCounted.h>
|
|
|
|
namespace HackStudio {
|
|
|
|
class ProjectFile : public RefCounted<ProjectFile> {
|
|
public:
|
|
static NonnullRefPtr<ProjectFile> construct_with_name(DeprecatedString const& name)
|
|
{
|
|
return adopt_ref(*new ProjectFile(name));
|
|
}
|
|
|
|
DeprecatedString const& name() const { return m_name; }
|
|
bool could_render_text() const { return m_could_render_text; }
|
|
|
|
GUI::TextDocument& document() const;
|
|
CodeDocument& code_document() const;
|
|
|
|
int vertical_scroll_value() const;
|
|
void vertical_scroll_value(int);
|
|
int horizontal_scroll_value() const;
|
|
void horizontal_scroll_value(int);
|
|
|
|
private:
|
|
explicit ProjectFile(DeprecatedString const& name);
|
|
void create_document_if_needed() const;
|
|
|
|
DeprecatedString m_name;
|
|
mutable RefPtr<CodeDocument> m_document;
|
|
mutable bool m_could_render_text { false };
|
|
int m_vertical_scroll_value { 0 };
|
|
int m_horizontal_scroll_value { 0 };
|
|
};
|
|
|
|
}
|