ladybird/Userland/DevTools/HackStudio/ProjectFile.h
Brian Gianforcaro 1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00

46 lines
1.1 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/NonnullRefPtr.h>
#include <AK/RefCounted.h>
#include <AK/String.h>
namespace HackStudio {
class ProjectFile : public RefCounted<ProjectFile> {
public:
static NonnullRefPtr<ProjectFile> construct_with_name(const String& name)
{
return adopt(*new ProjectFile(name));
}
const String& 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(const String& name);
void create_document_if_needed() const;
String 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 };
};
}