mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:07:46 +00:00
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.
This commit is contained in:
parent
db3e1b128c
commit
1b5b1e4153
17 changed files with 696 additions and 176 deletions
48
Userland/Applications/Calendar/CalendarWidget.h
Normal file
48
Userland/Applications/Calendar/CalendarWidget.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2023, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "EventCalendar.h"
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <LibFileSystemAccessClient/Client.h>
|
||||
#include <LibGUI/Calendar.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
|
||||
namespace Calendar {
|
||||
|
||||
class CalendarWidget final : public GUI::Widget {
|
||||
C_OBJECT(CalendarWidget);
|
||||
|
||||
public:
|
||||
static ErrorOr<NonnullRefPtr<CalendarWidget>> create(GUI::Window*);
|
||||
virtual ~CalendarWidget() override = default;
|
||||
|
||||
void update_window_title();
|
||||
void load_file(FileSystemAccessClient::File file);
|
||||
|
||||
private:
|
||||
void create_on_tile_doubleclick();
|
||||
|
||||
String const& current_filename() const { return m_event_calendar->event_manager().current_filename(); }
|
||||
|
||||
void create_on_events_change();
|
||||
NonnullRefPtr<GUI::Action> create_save_as_action();
|
||||
NonnullRefPtr<GUI::Action> create_save_action(GUI::Action& save_as_action);
|
||||
ErrorOr<NonnullRefPtr<GUI::Action>> create_new_calendar_action();
|
||||
NonnullRefPtr<GUI::Action> create_open_calendar_action();
|
||||
ErrorOr<NonnullRefPtr<GUI::Action>> create_prev_date_action();
|
||||
ErrorOr<NonnullRefPtr<GUI::Action>> create_next_date_action();
|
||||
ErrorOr<NonnullRefPtr<GUI::Action>> create_add_event_action();
|
||||
ErrorOr<NonnullRefPtr<GUI::Action>> create_jump_to_action();
|
||||
ErrorOr<NonnullRefPtr<GUI::Action>> create_view_month_action();
|
||||
ErrorOr<NonnullRefPtr<GUI::Action>> create_view_year_action();
|
||||
ErrorOr<NonnullRefPtr<GUI::Action>> create_open_settings_action();
|
||||
|
||||
RefPtr<EventCalendar> m_event_calendar;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue