1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 22:28:12 +00:00
serenity/Userland/Applications/Presenter/PresenterWidget.h
kleines Filmröllchen de44d6c0a6 Applications: Add Presenter
This version can already:
- load all of the defined file format except for the image type and the
  frame-specific stuff
- navigate frames and slides (though frames are mostly stubbed out)
- display text with various common settings
- displays text with various fitting and scaling methods
- scale and position objects correctly no matter the window size
2022-11-25 14:28:33 -07:00

38 lines
962 B
C++

/*
* Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "LibGUI/Action.h"
#include "Presentation.h"
#include <LibGUI/Event.h>
#include <LibGUI/UIDimensions.h>
#include <LibGUI/Widget.h>
// Title, Author
constexpr StringView const title_template = "{} ({}) — Presenter"sv;
class PresenterWidget : public GUI::Widget {
C_OBJECT(PresenterWidget);
public:
PresenterWidget();
ErrorOr<void> initialize_menubar();
virtual ~PresenterWidget() override = default;
// Errors that happen here are directly displayed to the user.
void set_file(StringView file_name);
protected:
virtual void paint_event(GUI::PaintEvent&) override;
virtual void keydown_event(GUI::KeyEvent&) override;
private:
OwnPtr<Presentation> m_current_presentation;
RefPtr<GUI::Action> m_next_slide_action;
RefPtr<GUI::Action> m_previous_slide_action;
};