/* * Copyright (c) 2021, Matthew Olsson * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include "NumericInput.h" #include "PDFViewer.h" #include "SidebarWidget.h" #include #include #include #include #include #include class PDFViewer; class PagedErrorsModel; class PDFViewerWidget final : public GUI::Widget { C_OBJECT(PDFViewerWidget) public: ~PDFViewerWidget() override = default; void initialize_menubar(GUI::Window&); void open_file(StringView path, NonnullOwnPtr file); private: PDFViewerWidget(); void initialize_toolbar(GUI::Toolbar&); PDF::PDFErrorOr try_open_file(StringView path, NonnullOwnPtr file); RefPtr m_viewer; RefPtr m_sidebar; NonnullRefPtr m_paged_errors_model; RefPtr m_errors_tree_view; RefPtr m_page_text_box; RefPtr m_total_page_label; RefPtr m_go_to_prev_page_action; RefPtr m_go_to_next_page_action; RefPtr m_toggle_sidebar_action; RefPtr m_zoom_in_action; RefPtr m_zoom_out_action; RefPtr m_reset_zoom_action; RefPtr m_rotate_counterclockwise_action; RefPtr m_rotate_clockwise_action; GUI::ActionGroup m_page_view_action_group; RefPtr m_page_view_mode_single; RefPtr m_page_view_mode_multiple; RefPtr m_show_clipping_paths; RefPtr m_show_images; bool m_sidebar_open { false }; ByteBuffer m_buffer; };