Kirigami-addons

messagedialoghelper.h
1// SPDX-FileCopyrightText: 2024 Carl Schwan <carl@carlschwan.eu>
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include <QObject>
7#include <QtQml/qqmlregistration.h>
8#include <KSharedConfig>
9#include <QJsonObject>
10
11/// @internal Only used by MessageDialog
13{
15 QML_ELEMENT
16 QML_SINGLETON
17
18 Q_PROPERTY(KConfig *config READ config WRITE setConfig NOTIFY configChanged);
19
20public:
21 explicit MessageDialogHelper(QObject *parent = nullptr);
22
23 KConfig *config() const;
24 void setConfig(KConfig *config);
25
26 Q_INVOKABLE QJsonObject shouldBeShownTwoActions(const QString &dontShowAgainName);
27
28 Q_INVOKABLE bool shouldBeShownContinue(const QString &dontShowAgainName);
29
30 Q_INVOKABLE void saveDontShowAgainTwoActions(const QString &dontShowAgainName, bool result);
31
32 Q_INVOKABLE void saveDontShowAgainContinue(const QString &dontShowAgainName);
33
35 void configChanged();
36
37private:
38 KConfig *m_config = nullptr;
39};
Q_INVOKABLEQ_INVOKABLE
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:48:17 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.