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

source code of knotifyconfig/src/knotifyeventlist.h