File indexing completed on 2024-04-21 15:32:40

0001 /*
0002     SPDX-FileCopyrightText: 2014-2015 Harald Sitter <sitter@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef PULSEOBJECT_H
0008 #define PULSEOBJECT_H
0009 
0010 #include <QObject>
0011 
0012 #include "pulseaudioqt_export.h"
0013 
0014 namespace PulseAudioQt
0015 {
0016 class Context;
0017 
0018 template<typename Type, typename PAInfo>
0019 class MapBase;
0020 
0021 /**
0022  * Base class for most PulseAudio objects.
0023  */
0024 class PULSEAUDIOQT_EXPORT PulseObject : public QObject
0025 {
0026     Q_OBJECT
0027     Q_PROPERTY(QString name READ name NOTIFY nameChanged)
0028     Q_PROPERTY(QString iconName READ iconName CONSTANT)
0029     Q_PROPERTY(QVariantMap properties READ properties NOTIFY propertiesChanged)
0030 
0031 public:
0032     ~PulseObject();
0033 
0034     QString name() const;
0035 
0036     /**
0037      * A freedesktop.org icon name that fits this object.
0038      */
0039     QString iconName() const;
0040 
0041     /**
0042      * A map of properties associated with this object.
0043      * The set of available properties depends on the type of object.
0044      */
0045     QVariantMap properties() const;
0046 
0047 Q_SIGNALS:
0048     /**
0049      * Emitted when any of the \ref properties changed.
0050      */
0051     void propertiesChanged();
0052 
0053     void nameChanged();
0054 
0055 protected:
0056     /** @private */
0057     explicit PulseObject(QObject *parent);
0058 
0059     /** @private */
0060     class PulseObjectPrivate *const d;
0061 
0062 private:
0063     // Ensure that we get properly parented.
0064     PulseObject();
0065     friend class IndexedPulseObjectPrivate;
0066     friend class ClientPrivate;
0067     friend class CardPrivate;
0068     friend class ModulePrivate;
0069     friend class VolumeObjectPrivate;
0070     friend class ProfilePrivate;
0071     friend class StreamRestorePrivate;
0072 };
0073 
0074 } // PulseAudioQt
0075 
0076 #endif // PULSEOBJECT_H