• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdehtml
 

tdehtml

tdehtml_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., 51 Franklin Street, Fifth Floor,
00021  * Boston, MA 02110-1301, USA.
00022  */
00023 #include "tdehtmlpart_p.h"
00024 #include "tdehtml_run.h"
00025 #include <tdeio/job.h>
00026 #include <kdebug.h>
00027 #include <tdelocale.h>
00028 #include "tdehtml_ext.h"
00029 #include <tqwidget.h>
00030 
00031 TDEHTMLRun::TDEHTMLRun( TDEHTMLPart *part, tdehtml::ChildFrame *child, const KURL &url,
00032                     const KParts::URLArgs &args, bool hideErrorDialog )
00033     : KParts::BrowserRun( url, args, part, part->widget() ? part->widget()->topLevelWidget() : 0,
00034                           false, false, hideErrorDialog ),
00035   m_child( child )
00036 {
00037     // Don't use an external browser for parts of a webpage we are rendering. (iframes at least are one example)
00038     setEnableExternalBrowser(false);
00039 
00040     // get the wheel to start spinning
00041     part->started(0L);
00042 }
00043 
00044 //TDEHTMLPart *TDEHTMLRun::htmlPart() const
00045 //{ return static_cast<TDEHTMLPart *>(m_part); }
00046 
00047 void TDEHTMLRun::foundMimeType( const TQString &_type )
00048 {
00049     Q_ASSERT(!m_bFinished);
00050     TQString mimeType = _type; // this ref comes from the job, we lose it when using TDEIO again
00051     if ( static_cast<TDEHTMLPart *>(m_part)->processObjectRequest( m_child, m_strURL, mimeType ) )
00052         m_bFinished = true;
00053     else {
00054         if ( m_bFinished ) // abort was called (this happens with the activex fallback for instance)
00055             return;
00056         // Couldn't embed -> call BrowserRun::handleNonEmbeddable()
00057         KParts::BrowserRun::NonEmbeddableResult res = handleNonEmbeddable( mimeType );
00058         if ( res == KParts::BrowserRun::Delayed )
00059             return;
00060         m_bFinished = ( res == KParts::BrowserRun::Handled );
00061         if ( m_bFinished ) { // saved or canceled -> flag completed
00062             m_child->m_bCompleted = true;
00063             static_cast<TDEHTMLPart *>(m_part)->checkCompleted();
00064         }
00065     }
00066 
00067     if ( m_bFinished )
00068     {
00069         m_timer.start( 0, true );
00070         return;
00071     }
00072 
00073     //kdDebug(6050) << "TDEHTMLRun::foundMimeType " << _type << " couldn't open" << endl;
00074     KRun::foundMimeType( mimeType );
00075 
00076     // "open" is finished -> flag completed
00077     m_child->m_bCompleted = true;
00078     static_cast<TDEHTMLPart *>(m_part)->checkCompleted();
00079 }
00080 
00081 void TDEHTMLRun::save( const KURL & url, const TQString & suggestedFilename )
00082 {
00083     TDEHTMLPopupGUIClient::saveURL( m_part->widget(), i18n( "Save As" ), url, m_args.metaData(), TQString::null, 0, suggestedFilename );
00084 }
00085 
00086 // KDE4: remove
00087 void TDEHTMLRun::handleError( TDEIO::Job *job )
00088 {
00089     KParts::BrowserRun::handleError( job );
00090 }
00091 
00092 #include "tdehtml_run.moc"

tdehtml

Skip menu "tdehtml"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdehtml

Skip menu "tdehtml"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdehtml by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.