File indexing completed on 2024-04-21 14:58:56

0001 /*
0002  *  This file is part of the KDE libraries
0003  *  Copyright (C) 2007 Harri Porten (porten@kde.org)
0004  *
0005  *  This library is free software; you can redistribute it and/or
0006  *  modify it under the terms of the GNU Library General Public
0007  *  License as published by the Free Software Foundation; either
0008  *  version 2 of the License, or (at your option) any later version.
0009  *
0010  *  This library is distributed in the hope that it will be useful,
0011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  *  Library General Public License for more details.
0014  *
0015  *  You should have received a copy of the GNU Library General Public
0016  *  License along with this library; if not, write to the Free
0017  *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018  *  Boston, MA 02110-1301 USA
0019  */
0020 
0021 #include "khtmladaptorpart.h"
0022 #include <kjs/object.h>
0023 #include <QLabel>
0024 #include <klocalizedstring.h>
0025 AdaptorView::AdaptorView(QWidget *wparent, QObject *parent,
0026                          const QStringList & /*args*/)
0027     : KParts::ReadOnlyPart(parent)
0028 {
0029     QLabel *placeHolder = new QLabel(i18n("Inactive"), wparent);
0030     placeHolder->setAlignment(Qt::AlignCenter);
0031     placeHolder->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
0032 
0033     KParts::Part::setWidget(placeHolder);
0034 }
0035 
0036 bool AdaptorView::openFile()
0037 {
0038     return true;
0039 }
0040 
0041 void AdaptorView::initScripting(KJS::ExecState * /*exec*/)
0042 {
0043 }
0044 
0045 KJS::JSObject *AdaptorView::scriptObject()
0046 {
0047     return new KJS::JSObject();
0048 }
0049 
0050 KHTMLAdaptorPartFactory::KHTMLAdaptorPartFactory()
0051 {
0052 }
0053 
0054 QString variant2StringHelper(const QVariant &variant)
0055 {
0056     return variant.toString();
0057 }
0058 
0059 QObject *KHTMLAdaptorPartFactory::create(const char * /*iface*/,
0060         QWidget *wparent,
0061         QObject *parent,
0062         const QVariantList &/*args*/,
0063         const QString & /*keyword*/)
0064 {
0065     return new AdaptorView(wparent, parent, QStringList());
0066 }
0067 
0068 #include "moc_khtmladaptorpart.cpp"