MauiKit Calendar

agentconfiguration.h
1// SPDX-FileCopyrightText: 2021 Carl Schwan <carlschwan@kde.org>
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include "kalendarapplication.h"
7#include <Akonadi/AgentFilterProxyModel>
8#include <Akonadi/AgentInstance>
9#include <QObject>
10#include <QTimer>
11
12class AgentConfiguration : public QObject
13{
15 Q_PROPERTY(Akonadi::AgentFilterProxyModel *availableAgents READ availableAgents NOTIFY availableAgentsChanged)
16 Q_PROPERTY(Akonadi::AgentFilterProxyModel *runningAgents READ runningAgents NOTIFY runningAgentsChanged)
17 Q_PROPERTY(KalendarApplication::Mode mode READ mode WRITE setMode NOTIFY modeChanged)
18public:
19 enum AgentStatuses {
24 };
25 Q_ENUM(AgentStatuses);
26
27 explicit AgentConfiguration(QObject *parent = nullptr);
28 ~AgentConfiguration() override;
29
30 Akonadi::AgentFilterProxyModel *availableAgents();
31 Akonadi::AgentFilterProxyModel *runningAgents();
32 KalendarApplication::Mode mode() const;
33 void setMode(KalendarApplication::Mode mode);
34
35 Q_INVOKABLE void createNew(int index);
36 Q_INVOKABLE void edit(int index);
37 Q_INVOKABLE void editIdentifier(const QString &resourceIdentifier);
38 Q_INVOKABLE void remove(int index);
39 Q_INVOKABLE void removeIdentifier(const QString &resourceIdentifier);
40 Q_INVOKABLE void restart(int index);
41 Q_INVOKABLE void restartIdentifier(const QString &resourceIdentifier);
42
43public Q_SLOTS:
44 void processInstanceProgressChanged(const Akonadi::AgentInstance &instance);
45
47 void agentProgressChanged(const QVariantMap agentData);
48 void modeChanged();
49 void runningAgentsChanged();
50 void availableAgentsChanged();
51
52private:
53 void setupEdit(Akonadi::AgentInstance instance);
54 void setupRemove(const Akonadi::AgentInstance &instance);
55 void setupRestart(Akonadi::AgentInstance instance);
56
57 Akonadi::AgentFilterProxyModel *m_runningAgents = nullptr;
58 Akonadi::AgentFilterProxyModel *m_availableAgents = nullptr;
59 KalendarApplication::Mode m_mode;
60};
Q_INVOKABLEQ_INVOKABLE
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Sep 27 2024 11:56:15 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.