File indexing completed on 2024-04-14 14:26:47

0001 /*
0002     This file is part of the KDE project
0003     SPDX-FileCopyrightText: 2005-2006 Olivier Goffart <ogoffart at kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only
0006 */
0007 
0008 #ifndef KNOTIFYCONFIGELEMENT_H
0009 #define KNOTIFYCONFIGELEMENT_H
0010 
0011 #include <QMap>
0012 #include <QString>
0013 
0014 class KConfig;
0015 class KConfigGroup;
0016 
0017 /**
0018  * Represent the config for an event
0019         @author Olivier Goffart <ogoffart@kde.org>
0020  */
0021 class KNotifyConfigElement
0022 {
0023 public:
0024     KNotifyConfigElement(const QString &eventid, KConfig *config);
0025     ~KNotifyConfigElement();
0026 
0027     KNotifyConfigElement(const KNotifyConfigElement &) = delete;
0028     KNotifyConfigElement &operator=(const KNotifyConfigElement &) = delete;
0029 
0030     QString readEntry(const QString &entry, bool path = false);
0031     void writeEntry(const QString &entry, const QString &data);
0032 
0033     QString eventId() const;
0034 
0035     void save();
0036 
0037     /**
0038      * Return whether Qt5TextToSpeech is installed or not.
0039      */
0040     static bool have_tts();
0041 
0042 private:
0043     QMap<QString, QString> m_cache;
0044     KConfigGroup *m_config;
0045     QString m_eventId;
0046 };
0047 
0048 #endif