File indexing completed on 2024-04-14 04:38:20

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 #include "videowidgetplugin.h"
0023 
0024 #include <qplugin.h>
0025 
0026 #include <phonon/videowidget.h>
0027 
0028 static const char *videoWidgetToolTipC = "Phonon Video Widget";
0029 
0030 VideoWidgetPlugin::VideoWidgetPlugin(const QString &group, QObject *parent) :
0031     QObject(parent),
0032     m_group(group),
0033     m_initialized(false)
0034 {
0035 }
0036 
0037 QString VideoWidgetPlugin::name() const
0038 {
0039     return QLatin1String("Phonon::VideoWidget");
0040 }
0041 
0042 QString VideoWidgetPlugin::group() const
0043 {
0044     return m_group;
0045 }
0046 
0047 QString VideoWidgetPlugin::toolTip() const
0048 {
0049     return QString(QLatin1String(videoWidgetToolTipC));
0050 }
0051 
0052 QString VideoWidgetPlugin::whatsThis() const
0053 {
0054     return QString(QLatin1String(videoWidgetToolTipC));
0055 }
0056 
0057 QString VideoWidgetPlugin::includeFile() const
0058 {
0059     return QLatin1String("<phonon/videowidget.h>");
0060 }
0061 
0062 QIcon VideoWidgetPlugin::icon() const
0063 {
0064     // TODO: icon
0065     return QIcon();
0066 }
0067 
0068 bool VideoWidgetPlugin::isContainer() const
0069 {
0070     return false;
0071 }
0072 
0073 QWidget *VideoWidgetPlugin::createWidget(QWidget *parent)
0074 {
0075     return new Phonon::VideoWidget(parent);
0076 }
0077 
0078 bool VideoWidgetPlugin::isInitialized() const
0079 {
0080     return m_initialized;
0081 }
0082 
0083 void VideoWidgetPlugin::initialize(QDesignerFormEditorInterface *formEditor)
0084 {
0085     Q_UNUSED(formEditor);
0086     if (m_initialized)
0087         return;
0088     m_initialized = true;
0089 }
0090 
0091 QString VideoWidgetPlugin::domXml() const
0092 {
0093     return QLatin1String("\
0094     <ui language=\"c++\">\
0095         <widget class=\"Phonon::VideoWidget\" name=\"VideoWidget\">\
0096             <property name=\"geometry\">\
0097                 <rect>\
0098                     <x>0</x>\
0099                     <y>0</y>\
0100                     <width>300</width>\
0101                     <height>200</height>\
0102                 </rect>\
0103             </property>\
0104         </widget>\
0105     </ui>");
0106 }