mirai/src/UiState.h

39 lines
886 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"
class UiState
{
public:
UiState(mirai::Mirai *mirai);
void run();
void reloadSources();
2024-08-16 21:35:12 +02:00
void reloadTasks();
private:
void setupCallbacks();
void setupUtilsCallbacks();
std::shared_ptr<slint::VectorModel<Source>> sources_;
2024-08-16 21:35:12 +02:00
std::shared_ptr<slint::VectorModel<slint::SharedString>> tags_;
std::shared_ptr<slint::VectorModel<Day>> days_;
2024-10-08 16:36:01 +02:00
std::shared_ptr<slint::VectorModel<TaskData>> unscheduledTasks_;
2024-08-16 21:35:12 +02:00
slint::ComponentHandle<AppWindow> mainWindow_ = AppWindow::create();
mirai::Mirai *miraiInstance_;
2024-10-11 16:26:13 +02:00
mirai::View view_;
2024-08-16 21:35:12 +02:00
};