PDFViewerWidget.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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(int fd, 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. RefPtr<GUI::Action> m_zoom_in_action;
  31. RefPtr<GUI::Action> m_zoom_out_action;
  32. RefPtr<GUI::Action> m_reset_zoom_action;
  33. bool m_sidebar_open { false };
  34. ByteBuffer m_buffer;
  35. };