browserinterface.cpp

00001 
00002 #include "browserinterface.h"
00003 
00004 #include <qmetaobject.h>
00005 
00006 #include <config.h>
00007 #include <private/qucomextra_p.h>
00008 
00009 using namespace KParts;
00010 
00011 BrowserInterface::BrowserInterface( QObject *parent, const char *name )
00012     : QObject( parent, name )
00013 {
00014 }
00015 
00016 BrowserInterface::~BrowserInterface()
00017 {
00018 }
00019 
00020 void BrowserInterface::callMethod( const char *name, const QVariant &argument )
00021 {
00022     int slot = metaObject()->findSlot( name );
00023 
00024     if ( slot == -1 )
00025         return;
00026 
00027     QUObject o[ 2 ];
00028     QStringList strLst;
00029     uint i;
00030 
00031     switch ( argument.type() )
00032     {
00033         case QVariant::Invalid:
00034             break;
00035         case QVariant::String:
00036             static_QUType_QString.set( o + 1, argument.toString() );
00037             break;
00038         case QVariant::StringList:
00039         strLst = argument.toStringList();
00040             static_QUType_ptr.set( o + 1, &strLst );
00041             break;
00042         case QVariant::Int:
00043             static_QUType_int.set( o + 1, argument.toInt() );
00044             break;
00045         case QVariant::UInt:
00046         i = argument.toUInt();
00047         static_QUType_ptr.set( o + 1, &i );
00048             break;
00049         case QVariant::Bool:
00050         static_QUType_bool.set( o + 1, argument.toBool() );
00051             break;
00052         default: return;
00053     }
00054   
00055     qt_invoke( slot, o );
00056 }
00057 
00058 #include "browserinterface.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys