mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 15:32:51 +00:00
This is a first step in deduplicating code within and across Help and man. Because LibManual also doesn't contain any DeprecatedString, some adjustments to Help's string handling is included, just to interoperate with LibManual better. Further work in this area mostly requires String APIs in LibGUI.
54 lines
1.3 KiB
C++
54 lines
1.3 KiB
C++
/*
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "History.h"
|
|
#include "ManualModel.h"
|
|
#include <LibGUI/FilteringProxyModel.h>
|
|
#include <LibWebView/OutOfProcessWebView.h>
|
|
|
|
namespace Help {
|
|
|
|
class MainWidget final : public GUI::Widget {
|
|
C_OBJECT(MainWidget);
|
|
|
|
public:
|
|
virtual ~MainWidget() override = default;
|
|
|
|
ErrorOr<void> initialize_fallibles(GUI::Window&);
|
|
ErrorOr<void> set_start_page(StringView page, u32 section);
|
|
|
|
private:
|
|
MainWidget();
|
|
|
|
void open_url(URL const&);
|
|
void open_page(Optional<String> const& path);
|
|
void open_external(URL const&);
|
|
|
|
History m_history;
|
|
RefPtr<GUI::Menu> m_context_menu;
|
|
RefPtr<ManualModel> m_manual_model;
|
|
RefPtr<GUI::FilteringProxyModel> m_filter_model;
|
|
|
|
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;
|
|
RefPtr<WebView::OutOfProcessWebView> m_web_view;
|
|
|
|
RefPtr<GUI::Toolbar> m_toolbar;
|
|
RefPtr<GUI::Statusbar> m_statusbar;
|
|
};
|
|
|
|
}
|