ladybird/Userland/Applications/PDFViewer/PDFViewerWidget.h
Kyle Lanmon a099d0e140 PDFViewer: Hide the rendering diagnostics window by default
You can enable it in the Debug menu and we will remember your choice.
2024-03-04 10:43:41 +01:00

61 lines
1.9 KiB
C++

/*
* Copyright (c) 2021, Matthew Olsson <mattco@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "PDFViewer.h"
#include "SidebarWidget.h"
#include <AK/NonnullRefPtr.h>
#include <AK/RefPtr.h>
#include <LibGUI/Action.h>
#include <LibGUI/ActionGroup.h>
#include <LibGUI/CheckBox.h>
#include <LibGUI/NumericInput.h>
#include <LibGUI/Splitter.h>
#include <LibGUI/Widget.h>
class PDFViewer;
class PagedErrorsModel;
class PDFViewerWidget final : public GUI::Widget {
C_OBJECT(PDFViewerWidget)
public:
~PDFViewerWidget() override = default;
ErrorOr<void> initialize_menubar(GUI::Window&);
void open_file(StringView path, NonnullOwnPtr<Core::File> file);
private:
PDFViewerWidget();
virtual void drag_enter_event(GUI::DragEvent&) override;
virtual void drop_event(GUI::DropEvent&) override;
void initialize_toolbar(GUI::Toolbar&);
PDF::PDFErrorOr<void> try_open_file(StringView path, NonnullOwnPtr<Core::File> file);
RefPtr<PDFViewer> m_viewer;
RefPtr<SidebarWidget> m_sidebar;
NonnullRefPtr<PagedErrorsModel> m_paged_errors_model;
RefPtr<GUI::VerticalSplitter> m_vertical_splitter;
RefPtr<GUI::TreeView> m_errors_tree_view;
RefPtr<GUI::NumericInput> m_page_text_box;
RefPtr<GUI::Label> m_total_page_label;
RefPtr<GUI::Action> m_go_to_prev_page_action;
RefPtr<GUI::Action> m_go_to_next_page_action;
RefPtr<GUI::Action> m_toggle_sidebar_action;
RefPtr<GUI::Action> m_zoom_in_action;
RefPtr<GUI::Action> m_zoom_out_action;
RefPtr<GUI::Action> m_reset_zoom_action;
RefPtr<GUI::Action> m_rotate_counterclockwise_action;
RefPtr<GUI::Action> m_rotate_clockwise_action;
GUI::ActionGroup m_page_view_action_group;
RefPtr<GUI::Action> m_page_view_mode_single;
RefPtr<GUI::Action> m_page_view_mode_multiple;
bool m_sidebar_open { false };
ByteBuffer m_buffer;
};