tdeparts
browserinterface.cpp
00001
00002 #include "browserinterface.h"
00003
00004 #include <tqmetaobject.h>
00005
00006 #include <config.h>
00007 #include <tqucomextra_p.h>
00008
00009 using namespace KParts;
00010
00011 BrowserInterface::BrowserInterface( TQObject *parent, const char *name )
00012 : TQObject( parent, name )
00013 {
00014 }
00015
00016 BrowserInterface::~BrowserInterface()
00017 {
00018 }
00019
00020 void BrowserInterface::callMethod( const char *name, const TQVariant &argument )
00021 {
00022 int slot = metaObject()->findSlot( name );
00023
00024 if ( slot == -1 )
00025 return;
00026
00027 TQUObject o[ 2 ];
00028 TQStringList strLst;
00029 uint i;
00030
00031 switch ( argument.type() )
00032 {
00033 case TQVariant::Invalid:
00034 break;
00035 case TQVariant::String:
00036 static_TQUType_TQString.set( o + 1, argument.toString() );
00037 break;
00038 case TQVariant::StringList:
00039 strLst = argument.toStringList();
00040 static_TQUType_ptr.set( o + 1, &strLst );
00041 break;
00042 case TQVariant::Int:
00043 static_TQUType_int.set( o + 1, argument.toInt() );
00044 break;
00045 case TQVariant::UInt:
00046 i = argument.toUInt();
00047 static_TQUType_ptr.set( o + 1, &i );
00048 break;
00049 case TQVariant::Bool:
00050 static_TQUType_bool.set( o + 1, argument.toBool() );
00051 break;
00052 default: return;
00053 }
00054
00055 tqt_invoke( slot, o );
00056 }
00057
00058 #include "browserinterface.moc"