1 /* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
23 #include <kparts/browserrun.h>
24 #include <QtCore/QPointer>
26 #include "konqopenurlrequest.h"
31 class KonqRun
: public KParts::BrowserRun
36 * Create a KonqRun instance, associated to the main view and an
37 * optional child view.
39 KonqRun( KonqMainWindow
* mainWindow
, KonqView
*childView
,
40 const KUrl
&url
, const KonqOpenURLRequest
& req
= KonqOpenURLRequest(),
41 bool trustedSource
= false );
46 * Returns true if we found the mimetype for the given url.
48 bool wasMimeTypeFound() const { return m_bFoundMimeType
; }
50 KonqView
*childView() const;
52 const QString
& typedUrl() const { return m_req
.typedUrl
; }
54 KUrl
mailtoURL() const { return m_mailto
; }
57 virtual void foundMimeType( const QString
& _type
);
58 virtual void handleError( KJob
* job
);
60 virtual void scanFile();
63 void slotRedirection( KIO::Job
*, const KUrl
& );
66 bool tryOpenView(const QString
& mimeType
, bool associatedAppIsKonqueror
);
67 QPointer
<KonqMainWindow
> m_pMainWindow
;
68 QPointer
<KonqView
> m_pView
;
69 bool m_bFoundMimeType
;
70 KonqOpenURLRequest m_req
;