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-05-10 21:50:15 +03:00
|
|
|
void initialize_menubar(GUI::Menubar&);
|
2021-05-24 08:34:44 +03:00
|
|
|
void create_toolbar();
|
|
|
|
void open_file(const String& path);
|
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;
|
2021-05-24 07:34:06 +03:00
|
|
|
bool m_sidebar_open { false };
|
2021-05-10 21:50:15 +03:00
|
|
|
ByteBuffer m_buffer;
|
|
|
|
};
|