KNotifyConfig 5.109.0
knotifyconfigwidget.h
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2005 Olivier Goffart <ogoffart at kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-only
6*/
7
8#ifndef KNOTIFYCONFIGWIDGET_H
9#define KNOTIFYCONFIGWIDGET_H
10
11#include <QString>
12#include <QWidget>
13#include <knotifyconfig_export.h>
14
15class KNotifyConfigElement;
16class KNotifyConfigWidgetPrivate;
28class KNOTIFYCONFIG_EXPORT KNotifyConfigWidget : public QWidget
29{
30 Q_OBJECT
31public:
32 explicit KNotifyConfigWidget(QWidget *parent);
33 ~KNotifyConfigWidget() override;
34
41 static KNotifyConfigWidget *configure(QWidget *parent = nullptr, const QString &appname = QString());
42
50 void setApplication(const QString &appname = QString(), const QString &context_name = QString(), const QString &context_value = QString());
51
58 void selectEvent(const QString &eventId);
59
60public Q_SLOTS:
64 void save();
65
66 /*
67 * Reset the UI to display the default values
68 * @see KCModule::defaults
69 * @since 5.15
70 */
71 void revertToDefaults();
72
73 /*
74 * Disable all sounds for the current application
75 * @since 5.23
76 */
77 void disableAllSounds();
78
79Q_SIGNALS:
85 void changed(bool state);
86
87private:
88 KNotifyConfigWidgetPrivate *const d;
89private Q_SLOTS:
90 KNOTIFYCONFIG_NO_EXPORT void slotEventSelected(KNotifyConfigElement *e);
91 KNOTIFYCONFIG_NO_EXPORT void slotActionChanged();
92};
93
94#endif
Configure the notification for a given application / context.
Definition knotifyconfigwidget.h:29
void selectEvent(const QString &eventId)
Select a given notification in the current list.
static KNotifyConfigWidget * configure(QWidget *parent=nullptr, const QString &appname=QString())
Show a dialog with the widget.
void setApplication(const QString &appname=QString(), const QString &context_name=QString(), const QString &context_value=QString())
Change the application and the context.
void save()
save to the config file
void changed(bool state)
Indicate that the state of the modules contents has changed.