1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 10:15:07 +00:00
serenity/Userland/Libraries/LibManual/Node.h
kleines Filmröllchen 4625f7aab5 LibManual: Refactor SectionNode in preparation for subsections
- Calculate the full name on demand
- Make section and name protected
- Reorder some members logically
- Change the name getter to be fallible, as some implementors need to
  allocate
2022-12-11 16:05:23 +00:00

30 lines
672 B
C++

/*
* Copyright (c) 2019-2020, Sergey Bugaev <bugaevc@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/NonnullRefPtrVector.h>
#include <AK/RefCounted.h>
#include <AK/String.h>
#include <AK/StringView.h>
namespace Manual {
class PageNode;
class Node : public RefCounted<Node> {
public:
virtual ~Node() = default;
virtual NonnullRefPtrVector<Node>& children() const = 0;
virtual Node const* parent() const = 0;
virtual ErrorOr<String> name() const = 0;
virtual bool is_page() const { return false; }
virtual bool is_open() const { return false; }
};
}