1 | /* |
2 | This file is part of the KDE project |
3 | SPDX-FileCopyrightText: 2005-2006 Olivier Goffart <ogoffart at kde.org> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.0-only |
6 | */ |
7 | |
8 | #ifndef KNOTIFYCONFIGELEMENT_H |
9 | #define KNOTIFYCONFIGELEMENT_H |
10 | |
11 | #include <QMap> |
12 | #include <QString> |
13 | |
14 | class KConfig; |
15 | class KConfigGroup; |
16 | |
17 | /** |
18 | * Represent the config for an event |
19 | @author Olivier Goffart <ogoffart@kde.org> |
20 | */ |
21 | class KNotifyConfigElement |
22 | { |
23 | public: |
24 | KNotifyConfigElement(const QString &eventid, KConfig *config); |
25 | ~KNotifyConfigElement(); |
26 | |
27 | KNotifyConfigElement(const KNotifyConfigElement &) = delete; |
28 | KNotifyConfigElement &operator=(const KNotifyConfigElement &) = delete; |
29 | |
30 | QString readEntry(const QString &entry, bool path = false); |
31 | void writeEntry(const QString &entry, const QString &data); |
32 | |
33 | QString eventId() const; |
34 | |
35 | void save(); |
36 | |
37 | private: |
38 | QMap<QString, QString> m_cache; |
39 | KConfigGroup *m_config; |
40 | QString m_eventId; |
41 | }; |
42 | |
43 | #endif |
44 | |