PDFViewerWidget.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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::Window&);
  19. void create_toolbar();
  20. void open_file(Core::File&);
  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. RefPtr<GUI::Action> m_zoom_in_action;
  31. RefPtr<GUI::Action> m_zoom_out_action;
  32. RefPtr<GUI::Action> m_reset_zoom_action;
  33. RefPtr<GUI::Action> m_rotate_counterclockwise_action;
  34. RefPtr<GUI::Action> m_rotate_clockwise_action;
  35. bool m_sidebar_open { false };
  36. ByteBuffer m_buffer;
  37. };