ladybird/Userland/Applications/Calendar/EventCalendar.h
Monroe Clinton 1b5b1e4153 Calendar: Implement saving, loading, and displaying of calendars
The user can now save, load, and view calendars. A calendar is made up
of an array of events which are saved in a JSON file. In the future we
should implement the iCalendar standard instead of using a custom
format.
2023-08-07 13:14:58 -06:00

35 lines
856 B
C++

/*
* Copyright (c) 2023, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "EventManager.h"
#include <LibFileSystemAccessClient/Client.h>
#include <LibGUI/Calendar.h>
namespace Calendar {
class EventCalendar final : public GUI::Calendar {
C_OBJECT(EventCalendar);
public:
virtual ~EventCalendar() override = default;
EventManager& event_manager() const { return *m_event_manager; }
private:
EventCalendar(Core::DateTime date_time = Core::DateTime::now(), Mode mode = Month);
ErrorOr<void> save(FileSystemAccessClient::File& file);
ErrorOr<void> load_file(FileSystemAccessClient::File& file);
virtual void paint_tile(GUI::Painter&, GUI::Calendar::Tile&, Gfx::IntRect&, int x_offset, int y_offset, int day_offset) override;
OwnPtr<EventManager> m_event_manager;
};
}