PDFViewerWidget.h 950 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2021, Matthew Olsson <mattco@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include "NumericInput.h"
  8. #include "PDFViewer.h"
  9. #include "SidebarWidget.h"
  10. #include <LibGUI/Action.h>
  11. #include <LibGUI/TextBox.h>
  12. #include <LibGUI/Widget.h>
  13. class PDFViewer;
  14. class PDFViewerWidget final : public GUI::Widget {
  15. C_OBJECT(PDFViewerWidget)
  16. public:
  17. ~PDFViewerWidget() override = default;
  18. void initialize_menubar(GUI::Menubar&);
  19. void create_toolbar();
  20. void open_file(const String& path);
  21. private:
  22. PDFViewerWidget();
  23. RefPtr<PDFViewer> m_viewer;
  24. RefPtr<SidebarWidget> m_sidebar;
  25. RefPtr<NumericInput> m_page_text_box;
  26. RefPtr<GUI::Label> m_total_page_label;
  27. RefPtr<GUI::Action> m_go_to_prev_page_action;
  28. RefPtr<GUI::Action> m_go_to_next_page_action;
  29. RefPtr<GUI::Action> m_toggle_sidebar_action;
  30. bool m_sidebar_open { false };
  31. ByteBuffer m_buffer;
  32. };