2024-08-16 21:35:12 +02:00
|
|
|
/*
|
|
|
|
* Mirai. Copyright (C) 2024 Vyn
|
|
|
|
* This file is licensed under version 3 of the GNU General Public License (GPL-3.0-only)
|
|
|
|
* The license can be found in the LICENSE file or at https://www.gnu.org/licenses/gpl-3.0.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2024-10-29 15:02:46 +01:00
|
|
|
#include "AppWindow.h"
|
2024-08-16 21:35:12 +02:00
|
|
|
#include "mirai-core/Mirai.h"
|
2024-10-11 16:26:13 +02:00
|
|
|
#include "mirai-core/View.h"
|
2024-08-16 21:35:12 +02:00
|
|
|
#include "slint.h"
|
|
|
|
|
2024-10-27 22:11:11 +01:00
|
|
|
class AppWindowBackend
|
2024-08-16 21:35:12 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2024-10-27 22:11:11 +01:00
|
|
|
AppWindowBackend(mirai::Mirai *mirai);
|
2024-08-16 21:35:12 +02:00
|
|
|
|
|
|
|
void run();
|
|
|
|
|
2024-09-02 11:52:06 +02:00
|
|
|
void reloadSources();
|
2024-08-16 21:35:12 +02:00
|
|
|
void reloadTasks();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void setupCallbacks();
|
|
|
|
void setupUtilsCallbacks();
|
|
|
|
|
2024-10-15 16:51:05 +02:00
|
|
|
std::shared_ptr<slint::VectorModel<ui::Source>> sources_;
|
2024-08-16 21:35:12 +02:00
|
|
|
std::shared_ptr<slint::VectorModel<slint::SharedString>> tags_;
|
2024-10-15 16:51:05 +02:00
|
|
|
std::shared_ptr<slint::VectorModel<ui::Day>> days_;
|
2024-10-29 15:02:46 +01:00
|
|
|
std::shared_ptr<slint::VectorModel<ui::CalendarDay>> calendar_;
|
2024-10-15 16:51:05 +02:00
|
|
|
std::shared_ptr<slint::VectorModel<ui::TaskData>> unscheduledTasks_;
|
2024-08-16 21:35:12 +02:00
|
|
|
|
2024-10-15 16:51:05 +02:00
|
|
|
slint::ComponentHandle<ui::AppWindow> mainWindow_ = ui::AppWindow::create();
|
2024-10-29 15:02:46 +01:00
|
|
|
slint::ComponentHandle<ui::SettingsWindow> settingsWindow_ = ui::SettingsWindow::create();
|
2024-11-01 13:43:45 +01:00
|
|
|
slint::ComponentHandle<ui::AddSourceWindow> addSourceWindow_ = ui::AddSourceWindow::create();
|
|
|
|
slint::ComponentHandle<ui::EditSourceWindow> editSourceWindow_ = ui::EditSourceWindow::create();
|
2024-08-16 21:35:12 +02:00
|
|
|
|
|
|
|
mirai::Mirai *miraiInstance_;
|
2024-10-11 16:26:13 +02:00
|
|
|
mirai::View view_;
|
2024-08-16 21:35:12 +02:00
|
|
|
};
|