File indexing completed on 2024-04-28 16:01:41

0001 /*
0002     Copyright (C) 2011 Harald Sitter <sitter@kde.org>
0003 
0004     This library is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU Lesser General Public
0006     License as published by the Free Software Foundation; either
0007     version 2.1 of the License, or (at your option) version 3, or any
0008     later version accepted by the membership of KDE e.V. (or its
0009     successor approved by the membership of KDE e.V.), Nokia Corporation
0010     (or its successors, if any) and the KDE Free Qt Foundation, which shall
0011     act as a proxy defined in Section 6 of version 3 of the license.
0012 
0013     This library is distributed in the hope that it will be useful,
0014     but WITHOUT ANY WARRANTY; without even the implied warranty of
0015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016     Lesser General Public License for more details.
0017 
0018     You should have received a copy of the GNU Lesser General Public
0019     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
0020 */
0021 
0022 /****************************************************************************
0023 **
0024 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
0025 ** All rights reserved.
0026 ** Contact: Nokia Corporation (qt-info@nokia.com)
0027 **
0028 ** This file is part of the Qt Designer of the Qt Toolkit.
0029 **
0030 ** $QT_BEGIN_LICENSE:LGPL$
0031 ** Commercial Usage
0032 ** Licensees holding valid Qt Commercial licenses may use this file in
0033 ** accordance with the Qt Commercial License Agreement provided with the
0034 ** Software or, alternatively, in accordance with the terms contained in
0035 ** a written agreement between you and Nokia.
0036 **
0037 ** GNU Lesser General Public License Usage
0038 ** Alternatively, this file may be used under the terms of the GNU Lesser
0039 ** General Public License version 2.1 as published by the Free Software
0040 ** Foundation and appearing in the file LICENSE.LGPL included in the
0041 ** packaging of this file.  Please review the following information to
0042 ** ensure the GNU Lesser General Public License version 2.1 requirements
0043 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
0044 **
0045 ** In addition, as a special exception, Nokia gives you certain additional
0046 ** rights.  These rights are described in the Nokia Qt LGPL Exception
0047 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
0048 **
0049 ** GNU General Public License Usage
0050 ** Alternatively, this file may be used under the terms of the GNU
0051 ** General Public License version 3.0 as published by the Free Software
0052 ** Foundation and appearing in the file LICENSE.GPL included in the
0053 ** packaging of this file.  Please review the following information to
0054 ** ensure the GNU General Public License version 3.0 requirements will be
0055 ** met: http://www.gnu.org/copyleft/gpl.html.
0056 **
0057 ** If you have questions regarding the use of this file, please contact
0058 ** Nokia at qt-info@nokia.com.
0059 ** $QT_END_LICENSE$
0060 **
0061 ****************************************************************************/
0062 
0063 #include "seeksliderplugin.h"
0064 #include "videoplayerplugin.h"
0065 #include "videowidgetplugin.h"
0066 #include "volumesliderplugin.h"
0067 
0068 #include <QDesignerCustomWidgetCollectionInterface>
0069 #include <qplugin.h>
0070 
0071 class PhononCollection: public QObject, public QDesignerCustomWidgetCollectionInterface
0072 {
0073     Q_OBJECT
0074     Q_PLUGIN_METADATA(IID "org.kde.phonon.PhononCollection")
0075     Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
0076 public:
0077     explicit PhononCollection(QObject *parent = nullptr);
0078 
0079     QList<QDesignerCustomWidgetInterface*> customWidgets() const override;
0080 
0081 private:
0082     QList<QDesignerCustomWidgetInterface*> m_plugins;
0083 };
0084 
0085 PhononCollection::PhononCollection(QObject *parent) :
0086     QObject(parent)
0087 {
0088     const QString group = QLatin1String("Phonon");
0089     m_plugins.push_back(new SeekSliderPlugin(group, this));
0090     m_plugins.push_back(new VideoPlayerPlugin(group, this));
0091     m_plugins.push_back(new VideoWidgetPlugin(group, this));
0092     m_plugins.push_back(new VolumeSliderPlugin(group, this));
0093 }
0094 
0095 QList<QDesignerCustomWidgetInterface*> PhononCollection::customWidgets() const
0096 {
0097     return m_plugins;
0098 }
0099 
0100 #include "phononcollection.moc"