mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-05 11:13:18 +00:00
42 lines
1 KiB
C
42 lines
1 KiB
C
|
/*
|
||
|
* 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"
|
||
|
#include "mirai-core/TasksView.h"
|
||
|
#include "slint.h"
|
||
|
|
||
|
class UiState
|
||
|
{
|
||
|
|
||
|
public:
|
||
|
UiState(mirai::Mirai *mirai);
|
||
|
|
||
|
void run();
|
||
|
|
||
|
void reloadResources();
|
||
|
void reloadTags();
|
||
|
void reloadTasks();
|
||
|
|
||
|
private:
|
||
|
void setupCallbacks();
|
||
|
void setupEventWindowCallbacks();
|
||
|
void setupUtilsCallbacks();
|
||
|
|
||
|
std::shared_ptr<slint::VectorModel<slint::SharedString>> resources_;
|
||
|
std::shared_ptr<slint::VectorModel<slint::SharedString>> tags_;
|
||
|
std::shared_ptr<slint::VectorModel<Day>> days_;
|
||
|
|
||
|
slint::ComponentHandle<AppWindow> mainWindow_ = AppWindow::create();
|
||
|
slint::ComponentHandle<TaskEdit> taskEditWindow_ = TaskEdit::create();
|
||
|
slint::ComponentHandle<EventWindow> eventWindow_ = EventWindow::create();
|
||
|
|
||
|
mirai::Mirai *miraiInstance_;
|
||
|
mirai::TasksView view_;
|
||
|
};
|