FrameworkIntegration

frameworkintegrationplugin.h
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2012 David Faure <faure+bluesystems@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#ifndef FRAMEWORKINTEGRATIONPLUGIN_H
9#define FRAMEWORKINTEGRATIONPLUGIN_H
10
11#include <KMessageBoxDontAskAgainInterface>
12#include <KMessageBoxNotifyInterface>
13#include <QObject>
14
15class KConfig;
16
17class KMessageBoxDontAskAgainConfigStorage : public KMessageBoxDontAskAgainInterface
18{
19public:
20 KMessageBoxDontAskAgainConfigStorage()
21 : KMessageBox_againConfig(nullptr)
22 {
23 }
24 ~KMessageBoxDontAskAgainConfigStorage() override
25 {
26 }
27
28 bool shouldBeShownTwoActions(const QString &dontShowAgainName, KMessageBox::ButtonCode &result) override;
29 bool shouldBeShownContinue(const QString &dontShowAgainName) override;
30 void saveDontShowAgainTwoActions(const QString &dontShowAgainName, KMessageBox::ButtonCode result) override;
31 void saveDontShowAgainContinue(const QString &dontShowAgainName) override;
32 void enableAllMessages() override;
33 void enableMessage(const QString &dontShowAgainName) override;
34 void setConfig(KConfig *cfg) override
35 {
36 KMessageBox_againConfig = cfg;
37 }
38
39private:
40 KConfig *KMessageBox_againConfig;
41};
42
43class KMessageBoxNotify : public KMessageBoxNotifyInterface
44{
45public:
46 void sendNotification(QMessageBox::Icon notificationType, const QString &message, QWidget *parent) override;
47};
48
49class KFrameworkIntegrationPlugin : public QObject
50{
51 Q_PLUGIN_METADATA(IID "org.kde.FrameworkIntegrationPlugin")
53public:
54 KFrameworkIntegrationPlugin();
55
56public Q_SLOTS:
57 void reparseConfiguration();
58
59private:
60 KMessageBoxDontAskAgainConfigStorage m_dontAskAgainConfigStorage;
61 KMessageBoxNotify m_notify;
62};
63
64#endif // FRAMEWORKINTEGRATIONPLUGIN_H
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.