summaryrefslogtreecommitdiff
path: root/Applications/Help/ManualModel.h
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2019-09-21 00:47:31 +0300
committerAndreas Kling <awesomekling@gmail.com>2019-09-28 18:29:42 +0200
commit02ee8cbbe2f16d7da15c9b6454e5217fc2e7438a (patch)
tree75bb65ed9c8cdb86af346ef23a037e50df31d57d /Applications/Help/ManualModel.h
parent6ec625d6f38d93751be44afc79ab713b1cec8f1b (diff)
downloadserenity-02ee8cbbe2f16d7da15c9b6454e5217fc2e7438a.zip
Applications: Add a new Help app
This is a neat simple app that can display the Serenity manual ^)
Diffstat (limited to 'Applications/Help/ManualModel.h')
-rw-r--r--Applications/Help/ManualModel.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/Applications/Help/ManualModel.h b/Applications/Help/ManualModel.h
new file mode 100644
index 0000000000..d0ecb255fb
--- /dev/null
+++ b/Applications/Help/ManualModel.h
@@ -0,0 +1,31 @@
+#pragma once
+
+#include <AK/NonnullRefPtr.h>
+#include <AK/String.h>
+#include <LibGUI/GModel.h>
+
+class ManualModel final : public GModel {
+public:
+ static NonnullRefPtr<ManualModel> create()
+ {
+ return adopt(*new ManualModel);
+ }
+
+ virtual ~ManualModel() override {};
+
+ String page_path(const GModelIndex&) const;
+ String page_and_section(const GModelIndex&) const;
+
+ virtual int row_count(const GModelIndex& = GModelIndex()) const override;
+ virtual int column_count(const GModelIndex& = GModelIndex()) const override;
+ virtual GVariant data(const GModelIndex&, Role = Role::Display) const override;
+ virtual void update() override;
+ virtual GModelIndex parent_index(const GModelIndex&) const override;
+ virtual GModelIndex index(int row, int column = 0, const GModelIndex& parent = GModelIndex()) const override;
+
+private:
+ ManualModel();
+
+ GIcon m_section_icon;
+ GIcon m_page_icon;
+};