2022-02-28 19:05:35 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "History.h"
|
|
|
|
#include "ManualModel.h"
|
2022-02-28 19:25:43 +03:00
|
|
|
#include <LibGUI/FilteringProxyModel.h>
|
2022-04-30 11:46:33 +03:00
|
|
|
#include <LibWebView/OutOfProcessWebView.h>
|
2022-02-28 19:05:35 +03:00
|
|
|
|
|
|
|
namespace Help {
|
|
|
|
|
|
|
|
class MainWidget final : public GUI::Widget {
|
|
|
|
C_OBJECT(MainWidget);
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual ~MainWidget() override = default;
|
|
|
|
|
2023-02-08 19:20:43 +03:00
|
|
|
static ErrorOr<NonnullRefPtr<MainWidget>> try_create();
|
|
|
|
|
2024-01-22 18:52:25 +03:00
|
|
|
ErrorOr<void> initialize(GUI::Window&);
|
2022-07-12 21:23:28 +03:00
|
|
|
ErrorOr<void> set_start_page(Vector<StringView, 2> query_parameters);
|
2022-02-28 19:05:35 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
MainWidget();
|
|
|
|
|
|
|
|
void open_url(URL const&);
|
2022-07-13 01:20:27 +03:00
|
|
|
void open_page(Optional<String> const& path);
|
2022-02-28 19:05:35 +03:00
|
|
|
void open_external(URL const&);
|
|
|
|
|
|
|
|
History m_history;
|
|
|
|
RefPtr<GUI::Menu> m_context_menu;
|
|
|
|
RefPtr<ManualModel> m_manual_model;
|
2022-02-28 19:25:43 +03:00
|
|
|
RefPtr<GUI::FilteringProxyModel> m_filter_model;
|
2022-02-28 19:05:35 +03:00
|
|
|
|
|
|
|
RefPtr<GUI::Action> m_go_back_action;
|
|
|
|
RefPtr<GUI::Action> m_go_forward_action;
|
|
|
|
RefPtr<GUI::Action> m_go_home_action;
|
|
|
|
RefPtr<GUI::Action> m_copy_action;
|
|
|
|
RefPtr<GUI::Action> m_select_all_action;
|
|
|
|
|
|
|
|
RefPtr<GUI::TabWidget> m_tab_widget;
|
|
|
|
RefPtr<GUI::Widget> m_search_container;
|
|
|
|
RefPtr<GUI::TextBox> m_search_box;
|
|
|
|
RefPtr<GUI::ListView> m_search_view;
|
|
|
|
RefPtr<GUI::TreeView> m_browse_view;
|
2022-04-30 11:46:33 +03:00
|
|
|
RefPtr<WebView::OutOfProcessWebView> m_web_view;
|
2022-02-28 19:05:35 +03:00
|
|
|
|
|
|
|
RefPtr<GUI::Toolbar> m_toolbar;
|
|
|
|
RefPtr<GUI::Statusbar> m_statusbar;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|