khtml Library API Documentation

khtml_run.cpp

00001 /* This file is part of the KDE project 00002 * 00003 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 00004 * 1999 Lars Knoll <knoll@kde.org> 00005 * 1999 Antti Koivisto <koivisto@kde.org> 00006 * 2000 Simon Hausmann <hausmann@kde.org> 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Library General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2 of the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Library General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Library General Public License 00019 * along with this library; see the file COPYING.LIB. If not, write to 00020 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00021 * Boston, MA 02111-1307, USA. 00022 */ 00023 #include "khtml_run.h" 00024 #include <kio/job.h> 00025 #include <kdebug.h> 00026 #include <klocale.h> 00027 #include "khtml_ext.h" 00028 #include <qwidget.h> 00029 00030 KHTMLRun::KHTMLRun( KHTMLPart *part, khtml::ChildFrame *child, const KURL &url, 00031 const KParts::URLArgs &args, bool hideErrorDialog ) 00032 : KParts::BrowserRun( url, args, part, part->widget() ? part->widget()->topLevelWidget() : 0, 00033 false, false, hideErrorDialog ), 00034 m_child( child ) 00035 { 00036 // get the wheel to start spinning 00037 part->started(0L); 00038 } 00039 00040 //KHTMLPart *KHTMLRun::htmlPart() const 00041 //{ return static_cast<KHTMLPart *>(m_part); } 00042 00043 void KHTMLRun::foundMimeType( const QString &_type ) 00044 { 00045 Q_ASSERT(!m_bFinished); 00046 QString mimeType = _type; // this ref comes from the job, we lose it when using KIO again 00047 if ( static_cast<KHTMLPart *>(m_part)->processObjectRequest( m_child, m_strURL, mimeType ) ) 00048 m_bFinished = true; 00049 else { 00050 if ( m_bFinished ) // abort was called (this happens with the activex fallback for instance) 00051 return; 00052 // Couldn't embed -> call BrowserRun::handleNonEmbeddable() 00053 KParts::BrowserRun::NonEmbeddableResult res = handleNonEmbeddable( mimeType ); 00054 if ( res == KParts::BrowserRun::Delayed ) 00055 return; 00056 m_bFinished = ( res == KParts::BrowserRun::Handled ); 00057 if ( m_bFinished ) // saved or canceled -> stop the wheel 00058 emit static_cast<KHTMLPart *>(m_part)->canceled(QString::null); 00059 } 00060 00061 if ( m_bFinished ) 00062 { 00063 m_timer.start( 0, true ); 00064 return; 00065 } 00066 00067 //kdDebug(6050) << "KHTMLRun::foundMimeType " << _type << " couldn't open" << endl; 00068 KRun::foundMimeType( mimeType ); 00069 } 00070 00071 void KHTMLRun::save( const KURL & url, const QString & suggestedFilename ) 00072 { 00073 KHTMLPopupGUIClient::saveURL( m_part->widget(), i18n( "Save As" ), url, m_args.metaData(), QString::null, 0, suggestedFilename ); 00074 } 00075 00076 // KDE4: remove 00077 void KHTMLRun::handleError( KIO::Job *job ) 00078 { 00079 KParts::BrowserRun::handleError( job ); 00080 } 00081 00082 #include "khtml_run.moc"
KDE Logo
This file is part of the documentation for khtml Library Version 3.3.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Oct 17 11:33:56 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003