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 KNOTIFYEVENTLIST_H
9#define KNOTIFYEVENTLIST_H
10
11#include "knotifyconfigelement.h"
12
13#include <QTreeWidget>
14
15class KNotifyConfigElement;
16class KNotifyEventListItem;
17class KConfig;
18
19class KNotifyEventList : public QTreeWidget
20{
21 Q_OBJECT
22public:
23 explicit KNotifyEventList(QWidget *parent);
24 ~KNotifyEventList() override;
25 void fill(const QString &appname, bool loadDefaults = false);
26 void save();
27 void updateCurrentItem();
28 void updateAllItems();
29 QSize sizeHint() const override;
30
31 void selectEvent(const QString &eventId);
32 bool disableAllSounds();
33
34private:
35 KConfig *config;
36 QList<KNotifyEventListItem *> m_elements;
37
38 class KNotifyEventListDelegate;
39
40private Q_SLOTS:
41 void slotSelectionChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
42
43Q_SIGNALS:
44 void eventSelected(KNotifyConfigElement *);
45};
46
47class KNotifyEventListItem : public QTreeWidgetItem
48{
49public:
50 KNotifyEventListItem(QTreeWidget *parent, const QString &eventName, const QString &name, const QString &description, KConfig *confir);
51 ~KNotifyEventListItem() override;
52 void save();
53
54 KNotifyConfigElement *configElement()
55 {
56 return &m_config;
57 }
58
59 void update();
60
61private:
62 KNotifyConfigElement m_config;
63};
64
65#endif
66

source code of knotifyconfig/src/knotifyeventlist.h