| 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 | */ |
| 20 | class KNotifyConfigElement |
| 21 | { |
| 22 | public: |
| 23 | KNotifyConfigElement(const QString &eventid, KConfig *config); |
| 24 | ~KNotifyConfigElement(); |
| 25 | |
| 26 | KNotifyConfigElement(const KNotifyConfigElement &) = delete; |
| 27 | KNotifyConfigElement &operator=(const KNotifyConfigElement &) = delete; |
| 28 | |
| 29 | QString readEntry(const QString &entry, bool path = false); |
| 30 | void writeEntry(const QString &entry, const QString &data); |
| 31 | |
| 32 | QString eventId() const; |
| 33 | |
| 34 | void save(); |
| 35 | |
| 36 | private: |
| 37 | QMap<QString, QString> m_cache; |
| 38 | KConfigGroup *m_config; |
| 39 | QString m_eventId; |
| 40 | }; |
| 41 | |
| 42 | #endif |
| 43 | |