/*  This file is part of the KDE project
    Copyright (C) 2007 Matthias Kretz <kretz@kde.org>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License version 2 as published by the Free Software Foundation.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.

*/

#ifndef PHONON_MIXERCONTROL_H
#define PHONON_MIXERCONTROL_H

#include "phonon_mixer_export.h"

#include <QtCore/QObject>
#include <QtCore/QtGlobal>

class QObject;
class QVariant;
class QStringList;

namespace Phonon
{
namespace Mixer
{

class MixerControlPrivate;
class MixerControlSet;
class PHONON_MIXER_EXPORT MixerControl
{
    friend class Mixer;
    friend class MixerSharedData;
    Q_DECLARE_PRIVATE(MixerControl)
    public:
        const QObject *notifier() const;
        operator const QObject *() const { return notifier(); }
        MixerControl(const MixerControl &);
        MixerControl &operator=(const MixerControl &);
        bool operator==(const MixerControl &) const;
        inline bool operator!=(const MixerControl &rhs) const { return !operator==(rhs); }
        virtual ~MixerControl();

        enum Type {
            Invalid = -1,
            Toggle,
            Integer,
            Enum
        };

        int id() const;
        bool isValid() const;
        Type type() const;
        MixerControlSet parentSet() const;
        bool isRemovable() const;

        QString extraInfo() const;

    protected:
        MixerControlPrivate *const d_ptr;
        MixerControl(MixerControlPrivate &);
};

template<typename T> T mixercontrol_cast(const MixerControl &mc)
{
    MixerControl you_can_not_cast_a_MixerControl_to_the_requested_type(mc);
    return you_can_not_cast_a_MixerControl_to_the_requested_type;
}

} // namespace Mixer
} // namespace Phonon
#endif // PHONON_MIXERCONTROL_H
