mirai/src/AppWindowBackend.h

39 lines
924 B
C
Raw Normal View History

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
#include "appwindow.h"
#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();
void reloadSources();
2024-08-16 21:35:12 +02:00
void reloadTasks();
private:
void setupCallbacks();
void setupUtilsCallbacks();
std::shared_ptr<slint::VectorModel<ui::Source>> sources_;
2024-08-16 21:35:12 +02:00
std::shared_ptr<slint::VectorModel<slint::SharedString>> tags_;
std::shared_ptr<slint::VectorModel<ui::Day>> days_;
std::shared_ptr<slint::VectorModel<ui::TaskData>> unscheduledTasks_;
2024-08-16 21:35:12 +02:00
slint::ComponentHandle<ui::AppWindow> mainWindow_ = ui::AppWindow::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
};