1 /****************************************************************************
2 **
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
6 **
7 ** This file is part of the Qt Designer of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** Commercial Usage
11 ** Licensees holding valid Qt Commercial licenses may use this file in
12 ** accordance with the Qt Commercial License Agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and Nokia.
15 **
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file.  Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23 **
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27 **
28 ** GNU General Public License Usage
29 ** Alternatively, this file may be used under the terms of the GNU
30 ** General Public License version 3.0 as published by the Free Software
31 ** Foundation and appearing in the file LICENSE.GPL included in the
32 ** packaging of this file.  Please review the following information to
33 ** ensure the GNU General Public License version 3.0 requirements will be
34 ** met: http://www.gnu.org/copyleft/gpl.html.
35 **
36 ** If you have questions regarding the use of this file, please contact
37 ** Nokia at qt-info@nokia.com.
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "volumesliderplugin.h"
43 
44 #include <phonon/volumeslider.h>
45 
46 static const char *toolTipC = "Phonon Volume Slider";
47 
VolumeSliderPlugin(const QString & group,QObject * parent)48 VolumeSliderPlugin::VolumeSliderPlugin(const QString &group, QObject *parent) :
49     QObject(parent),
50     m_group(group),
51     m_initialized(false)
52 {
53 }
54 
name() const55 QString VolumeSliderPlugin::name() const
56 {
57     return QLatin1String("Phonon::VolumeSlider");
58 }
59 
group() const60 QString VolumeSliderPlugin::group() const
61 {
62     return m_group;
63 }
64 
toolTip() const65 QString VolumeSliderPlugin::toolTip() const
66 {
67     return QString(QLatin1String(toolTipC));
68 }
69 
whatsThis() const70 QString VolumeSliderPlugin::whatsThis() const
71 {
72     return QString(QLatin1String(toolTipC));
73 }
74 
includeFile() const75 QString VolumeSliderPlugin::includeFile() const
76 {
77     return QLatin1String("<phonon/volumeslider.h>");
78 }
79 
icon() const80 QIcon VolumeSliderPlugin::icon() const
81 {
82     return QIcon(QLatin1String(":/trolltech/phononwidgets/images/volumeslider.png"));
83 }
84 
isContainer() const85 bool VolumeSliderPlugin::isContainer() const
86 {
87     return false;
88 }
89 
createWidget(QWidget * parent)90 QWidget *VolumeSliderPlugin::createWidget(QWidget *parent)
91 {
92     return new Phonon::VolumeSlider(parent);
93 }
94 
isInitialized() const95 bool VolumeSliderPlugin::isInitialized() const
96 {
97     return m_initialized;
98 }
99 
initialize(QDesignerFormEditorInterface *)100 void VolumeSliderPlugin::initialize(QDesignerFormEditorInterface *)
101 {
102     if (m_initialized)
103         return;
104     m_initialized = true;
105 }
106 
domXml() const107 QString VolumeSliderPlugin::domXml() const
108 {
109     return QLatin1String("\
110     <ui language=\"c++\">\
111         <widget class=\"Phonon::VolumeSlider\" name=\"volumeSlider\"/>\
112     </ui>");
113 }
114