import { Date, Time } from "std-widgets.slint";
import { CalendarDay } from "../../components/Calendar.slint";

export struct NewTaskData {
	sourceId: int,
	eventId: int,
	title: string,
	scheduled: bool,
	date: Date
}

export struct SaveTaskData {
	sourceId: int,
	id: int,
	title: string,
	scheduled: bool,
	date: Date,
}

export struct NewEventParams {
	title: string,
	date: Date,
	startsAt: Time,
	endsAt: Time
}

export struct SaveEventParams {
	sourceId: int,
	id: int,
	title: string,
	date: Date,
	startsAt: Time,
	endsAt: Time
}

struct OpenNewTaskFormParams {
	eventSourceId: int,
	eventId: int,
}

export struct CreateEventParams {
	title: string,
	date: Date,
	startsAt: Time,
	endsAt: Time
}

export global AppWindowActions  {
	callback task-clicked(int, int);
	callback source-clicked(int);
	callback open-settings-window();
	callback open-add-source-window();
	callback open-edit-source-window(int);
	
	callback open-new-task-form(OpenNewTaskFormParams);
	callback open-edit-task-form(int, int);
	callback open-new-event-form();
	callback open-edit-event-form(int, int);
	callback toggle-show-completed-tasks();
	callback delete-task-clicked(int, int);

	callback open-add-event-window();

	callback create-task(NewTaskData);
	callback save-task(SaveTaskData);
	callback create-event(CreateEventParams);
	callback delete-event(sourceId: int, eventId: int);
}
