24 #include "embeddedurlpage.h"
25 #include <tdeparts/componentfactory.h>
26 #include <tdeparts/browserextension.h>
27 #include <tdeparts/part.h>
28 #include <kmimetype.h>
29 #include <tdelocale.h>
35 EmbeddedURLPage::EmbeddedURLPage( const TQString &url, const TQString &mimetype,
36 TQWidget *parent, const char *name )
37 : TQWidget( parent, name ), mUri(url), mMimeType( mimetype ), mPart( 0 )
39 initGUI( url, mimetype );
42 void EmbeddedURLPage::initGUI( const TQString &url, const TQString & )
44 TQVBoxLayout *layout = new TQVBoxLayout( this );
45 layout->setAutoAdd( true );
46 new TQLabel( i18n( "Showing URL %1").arg( url ), this );
49 void EmbeddedURLPage::loadContents()
52 if ( mMimeType.isEmpty() || mUri.isEmpty() )
54 TQString mimetype = mMimeType;
55 if ( mimetype == "auto" )
56 mimetype == KMimeType::findByURL( mUri )->name();
58 mPart = KParts::ComponentFactory::createPartInstanceFromQuery<KParts::ReadOnlyPart>( mimetype, TQString(), this, 0, this, 0 );
60 mPart->openURL( mUri );
61 mPart->widget()->show();
64 KParts::BrowserExtension* be = KParts::BrowserExtension::childObject( mPart );
65 connect( be, TQ_SIGNAL( openURLRequestDelayed( const KURL &, const KParts::URLArgs & ) ),
67 this, TQ_SIGNAL( openURL( const KURL & ) ) );
71 #include "embeddedurlpage.moc"
TDEPIM classes for drag and drop of mails.
|