Move Models and Actions slint definitions in the shared directory

This commit is contained in:
Vyn 2025-06-24 12:04:54 +02:00
parent f2f472a595
commit 72b004b7b0
Signed by: vyn
GPG key ID: E1B2BE34E7A971E7
15 changed files with 58 additions and 66 deletions

52
src/shared/Models.slint Normal file
View file

@ -0,0 +1,52 @@
import { Date, Time } from "std-widgets.slint";
import { CalendarDay } from "../components/Calendar.slint";
export struct Source {
id: int,
name: string,
selected: bool,
path: string
}
export struct TaskData {
sourceId: int,
eventId: int,
id: int,
title: string,
date: Date,
checked: bool,
}
export struct Event {
sourceId: int,
id: int,
title: string,
startsAt: Time,
endsAt: Time,
tasks: [TaskData],
}
export struct Day {
sourceId: int,
id: int,
date: Date,
events: [Event],
tasks: [TaskData],
isLate: bool,
isToday: bool,
relativeDaysDiff: int
}
export global AppModels {
in-out property<[Source]> sources-selected;
in-out property<int> default-source-index;
in-out property<[string]> sources;
in-out property<bool> no-source-selected;
in-out property<[Day]> days;
in-out property<[CalendarDay]> calendar;
in-out property<[TaskData]> unscheduled-tasks;
callback get-source-id-from-name(string) -> int;
pure callback get-source-name-from-id(int) -> string;
pure callback get-source-path-from-id(int) -> string;
}