mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
This PR fixes #22622. Added a nice Events dialog showing a list of all events in a single day.
41 lines
1.2 KiB
C++
41 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2019-2020, Ryan Grieb <[email protected]>
|
|
* Copyright (c) 2022-2023, the SerenityOS developers.
|
|
* Copyright (c) 2023, David Ganz <[email protected]>
|
|
* Copyright (c) 2026, RiffPointer <[email protected]>.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "EventManager.h"
|
|
#include <AK/Optional.h>
|
|
#include <LibGUI/Calendar.h>
|
|
#include <LibGUI/Dialog.h>
|
|
#include <LibGUI/Window.h>
|
|
|
|
namespace Calendar {
|
|
|
|
class AddEventDialog final : public GUI::Dialog {
|
|
C_OBJECT(AddEventDialog)
|
|
public:
|
|
virtual ~AddEventDialog() override = default;
|
|
|
|
static void show(Core::DateTime date_time, EventManager& event_manager, Window* parent_window = nullptr, Event const* event_to_edit = nullptr)
|
|
{
|
|
auto dialog = AddEventDialog::construct(date_time, event_manager, parent_window, event_to_edit);
|
|
dialog->exec();
|
|
}
|
|
|
|
ErrorOr<bool> add_event_to_calendar(Core::DateTime start_date_time, Core::DateTime end_date_time);
|
|
|
|
private:
|
|
AddEventDialog(Core::DateTime date_time, EventManager& event_manager, Window* parent_window = nullptr, Event const* event_to_edit = nullptr);
|
|
|
|
EventManager& m_event_manager;
|
|
Optional<Event> m_event_to_edit;
|
|
};
|
|
|
|
}
|