mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +00:00
Applications: Add a new Help app
This is a neat simple app that can display the Serenity manual ^)
This commit is contained in:
parent
6ec625d6f3
commit
02ee8cbbe2
12 changed files with 349 additions and 1 deletions
34
Applications/Help/ManualSectionNode.h
Normal file
34
Applications/Help/ManualSectionNode.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
#pragma once
|
||||
|
||||
#include "ManualNode.h"
|
||||
|
||||
class ManualSectionNode : public ManualNode {
|
||||
public:
|
||||
virtual ~ManualSectionNode() override {}
|
||||
|
||||
ManualSectionNode(String section, String name)
|
||||
: m_section(section)
|
||||
, m_full_name(String::format("%s. %s", section.characters(), name.characters()))
|
||||
{
|
||||
}
|
||||
|
||||
virtual NonnullOwnPtrVector<ManualNode>& children() const override
|
||||
{
|
||||
reify_if_needed();
|
||||
return m_children;
|
||||
}
|
||||
|
||||
virtual const ManualNode* parent() const override { return nullptr; }
|
||||
virtual String name() const override { return m_full_name; }
|
||||
|
||||
const String& section_name() const { return m_section; }
|
||||
String path() const;
|
||||
|
||||
private:
|
||||
void reify_if_needed() const;
|
||||
|
||||
String m_section;
|
||||
String m_full_name;
|
||||
mutable NonnullOwnPtrVector<ManualNode> m_children;
|
||||
mutable bool m_reified { false };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue