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

tdehtml

  • tdehtml
tdehtml_run.cpp
1/* This file is part of the KDE project
2 *
3 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
4 * 1999 Lars Knoll <knoll@kde.org>
5 * 1999 Antti Koivisto <koivisto@kde.org>
6 * 2000 Simon Hausmann <hausmann@kde.org>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 */
23#include "tdehtmlpart_p.h"
24#include "tdehtml_run.h"
25#include <tdeio/job.h>
26#include <kdebug.h>
27#include <tdelocale.h>
28#include "tdehtml_ext.h"
29#include <tqwidget.h>
30
31TDEHTMLRun::TDEHTMLRun( TDEHTMLPart *part, tdehtml::ChildFrame *child, const KURL &url,
32 const KParts::URLArgs &args, bool hideErrorDialog )
33 : KParts::BrowserRun( url, args, part, part->widget() ? part->widget()->topLevelWidget() : 0,
34 false, false, hideErrorDialog ),
35 m_child( child )
36{
37 // Don't use an external browser for parts of a webpage we are rendering. (iframes at least are one example)
38 setEnableExternalBrowser(false);
39
40 // get the wheel to start spinning
41 part->started(0L);
42}
43
44//TDEHTMLPart *TDEHTMLRun::htmlPart() const
45//{ return static_cast<TDEHTMLPart *>(m_part); }
46
47void TDEHTMLRun::foundMimeType( const TQString &_type )
48{
49 Q_ASSERT(!m_bFinished);
50 TQString mimeType = _type; // this ref comes from the job, we lose it when using TDEIO again
51 if ( static_cast<TDEHTMLPart *>(m_part)->processObjectRequest( m_child, m_strURL, mimeType ) )
52 m_bFinished = true;
53 else {
54 if ( m_bFinished ) // abort was called (this happens with the activex fallback for instance)
55 return;
56 // Couldn't embed -> call BrowserRun::handleNonEmbeddable()
57 KParts::BrowserRun::NonEmbeddableResult res = handleNonEmbeddable( mimeType );
58 if ( res == KParts::BrowserRun::Delayed )
59 return;
60 m_bFinished = ( res == KParts::BrowserRun::Handled );
61 if ( m_bFinished ) { // saved or canceled -> flag completed
62 m_child->m_bCompleted = true;
63 static_cast<TDEHTMLPart *>(m_part)->checkCompleted();
64 }
65 }
66
67 if ( m_bFinished )
68 {
69 m_timer.start( 0, true );
70 return;
71 }
72
73 //kdDebug(6050) << "TDEHTMLRun::foundMimeType " << _type << " couldn't open" << endl;
74 KRun::foundMimeType( mimeType );
75
76 // "open" is finished -> flag completed
77 m_child->m_bCompleted = true;
78 static_cast<TDEHTMLPart *>(m_part)->checkCompleted();
79}
80
81void TDEHTMLRun::save( const KURL & url, const TQString & suggestedFilename )
82{
83 TDEHTMLPopupGUIClient::saveURL( m_part->widget(), i18n( "Save As" ), url, m_args.metaData(), TQString::null, 0, suggestedFilename );
84}
85
86// KDE4: remove
87void TDEHTMLRun::handleError( TDEIO::Job *job )
88{
89 KParts::BrowserRun::handleError( job );
90}
91
92#include "tdehtml_run.moc"
KParts::BrowserRun::handleError
virtual void handleError(TDEIO::Job *job)
KParts::BrowserRun::NonEmbeddableResult
NonEmbeddableResult
KParts::ReadOnlyPart::started
void started(TDEIO::Job *)
KURL
TDEHTMLPart
This class is tdehtml's main class.
Definition: tdehtml_part.h:184
KParts::URLArgs
tdelocale.h

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.9.4
This website is maintained by Timothy Pearson.