KParts
browserinterface.cpp
Go to the documentation of this file.
00001 /* This file is part of the KDE project 00002 Copyright (C) 2001 Simon Hausmann <hausmann@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to the 00016 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #include "browserinterface.h" 00021 00022 #include <QtCore/QMetaEnum> 00023 #include <QtCore/QStringList> 00024 00025 #include <config.h> 00026 00027 using namespace KParts; 00028 00029 BrowserInterface::BrowserInterface( QObject *parent ) 00030 : QObject( parent ) 00031 { 00032 } 00033 00034 BrowserInterface::~BrowserInterface() 00035 { 00036 } 00037 00038 void BrowserInterface::callMethod( const char *name, const QVariant &argument ) 00039 { 00040 switch ( argument.type() ) 00041 { 00042 case QVariant::Invalid: 00043 break; 00044 case QVariant::String: 00045 QMetaObject::invokeMethod( this, name, 00046 Q_ARG( QString, argument.toString() ) ); 00047 break; 00048 case QVariant::StringList: 00049 { 00050 QStringList strLst = argument.toStringList(); 00051 QMetaObject::invokeMethod( this, name, 00052 Q_ARG( QStringList *, &strLst ) ); 00053 break; 00054 } 00055 case QVariant::Int: 00056 QMetaObject::invokeMethod( this, name, 00057 Q_ARG( int, argument.toInt() ) ); 00058 break; 00059 case QVariant::UInt: 00060 { 00061 unsigned int i = argument.toUInt(); 00062 QMetaObject::invokeMethod( this, name, 00063 Q_ARG( unsigned int *, &i ) ); 00064 break; 00065 } 00066 case QVariant::Bool: 00067 QMetaObject::invokeMethod( this, name, 00068 Q_ARG( bool, argument.toBool() ) ); 00069 break; 00070 default: 00071 break; 00072 } 00073 } 00074 00075 #include "browserinterface.moc"
KDE 4.6 API Reference