Fix crash if key bindings specified in profile cannot be found. Improve
[personal-kdebase.git] / apps / konqueror / src / konqrun.h
blob601a702d26fa75de336dc6432ad6b8e592423cdf
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.
20 #ifndef KONQRUN_H
21 #define KONQRUN_H
23 #include <kparts/browserrun.h>
24 #include <QtCore/QPointer>
25 #include <kservice.h>
26 #include "konqopenurlrequest.h"
28 class KonqMainWindow;
29 class KonqView;
31 class KonqRun : public KParts::BrowserRun
33 Q_OBJECT
34 public:
35 /**
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 );
43 virtual ~KonqRun();
45 /**
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; }
56 protected:
57 virtual void foundMimeType( const QString & _type );
58 virtual void handleError( KJob * job );
59 virtual void init();
60 virtual void scanFile();
62 protected Q_SLOTS:
63 void slotRedirection( KIO::Job *, const KUrl& );
65 private:
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;
71 KUrl m_mailto;
74 #endif // KONQRUN_H