2021-05-10 21:50:15 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, Matthew Olsson <mattco@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2021-05-24 08:34:44 +03:00
|
|
|
#include "NumericInput.h"
|
2021-05-10 21:50:15 +03:00
|
|
|
#include "PDFViewer.h"
|
2021-05-24 07:34:06 +03:00
|
|
|
#include "SidebarWidget.h"
|
|
|
|
#include <LibGUI/Action.h>
|
2021-05-24 08:34:44 +03:00
|
|
|
#include <LibGUI/TextBox.h>
|
2021-05-10 21:50:15 +03:00
|
|
|
#include <LibGUI/Widget.h>
|
|
|
|
|
|
|
|
class PDFViewer;
|
|
|
|
|
|
|
|
class PDFViewerWidget final : public GUI::Widget {
|
|
|
|
C_OBJECT(PDFViewerWidget)
|
2021-05-24 07:34:06 +03:00
|
|
|
|
2021-05-10 21:50:15 +03:00
|
|
|
public:
|
2021-05-24 07:34:06 +03:00
|
|
|
~PDFViewerWidget() override = default;
|
|
|
|
|
2021-07-21 22:21:03 +03:00
|
|
|
void initialize_menubar(GUI::Window&);
|
2021-05-24 08:34:44 +03:00
|
|
|
void create_toolbar();
|
2022-01-17 04:47:11 +03:00
|
|
|
void open_file(Core::File&);
|
2021-05-10 21:50:15 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
PDFViewerWidget();
|
|
|
|
|
|
|
|
RefPtr<PDFViewer> m_viewer;
|
2021-05-24 07:34:06 +03:00
|
|
|
RefPtr<SidebarWidget> m_sidebar;
|
2021-05-24 08:34:44 +03:00
|
|
|
RefPtr<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;
|
2022-01-02 23:58:51 +03:00
|
|
|
RefPtr<GUI::Action> m_zoom_in_action;
|
|
|
|
RefPtr<GUI::Action> m_zoom_out_action;
|
|
|
|
RefPtr<GUI::Action> m_reset_zoom_action;
|
2022-01-03 02:24:11 +03:00
|
|
|
RefPtr<GUI::Action> m_rotate_counterclockwise_action;
|
|
|
|
RefPtr<GUI::Action> m_rotate_clockwise_action;
|
2022-01-02 23:58:51 +03:00
|
|
|
|
2021-05-24 07:34:06 +03:00
|
|
|
bool m_sidebar_open { false };
|
2021-05-10 21:50:15 +03:00
|
|
|
ByteBuffer m_buffer;
|
|
|
|
};
|