KParts::BrowserRun Class Reference
This class extends KRun to provide additional functionality for browsers: "save or open" dialog boxes "save" functionality support for HTTP POST (including saving the result to a temp file if opening a separate application) warning before launching executables off the web custom error handling (i.e. More...
#include <browserrun.h>
Inheritance diagram for KParts::BrowserRun:

Public Methods | |
BrowserRun (const KURL &url, const KParts::URLArgs &args, KParts::ReadOnlyPart *part, QWidget *window, bool removeReferrer, bool trustedSource) | |
BrowserRun (const KURL &url, const KParts::URLArgs &args, KParts::ReadOnlyPart *part, QWidget *window, bool removeReferrer, bool trustedSource, bool hideErrorDialog) | |
Static Public Methods | |
AskSaveResult | askSave (const KURL &url, KService::Ptr offer, const QString &mimeType, const QString &suggestedFilename=QString::null) |
AskSaveResult | askEmbedOrSave (const KURL &url, const QString &mimeType, const QString &suggestedFilename=QString::null, int flags=0) |
void | simpleSave (const KURL &url, const QString &suggestedFilename) |
bool | isExecutable (const QString &serviceType) |
Protected Types | |
enum | NonEmbeddableResult |
Protected Slots | |
void | slotCopyToTempFileResult (KIO::Job *job) |
Protected Methods | |
virtual void | scanFile () |
virtual void | init () |
virtual void | handleError (KIO::Job *job) |
NonEmbeddableResult | handleNonEmbeddable (const QString &mimeType) |
Detailed Description
This class extends KRun to provide additional functionality for browsers: "save or open" dialog boxes "save" functionality support for HTTP POST (including saving the result to a temp file if opening a separate application) warning before launching executables off the web custom error handling (i.e.
- * - * - * - * - treating errors as HTML pages)
- generation of SSL metadata depending on the previous URL shown by the part
- Author:
- David Faure <faure@kde.org>
Definition at line 39 of file browserrun.h.
Member Enumeration Documentation
|
NotHandled means that foundMimeType should call KRun::foundMimeType, i.e. launch an external app. Definition at line 141 of file browserrun.h. |
Constructor & Destructor Documentation
|
Definition at line 41 of file browserrun.cpp. |
|
Definition at line 53 of file browserrun.cpp. |
Member Function Documentation
|
Ask the user whether to save or open a url in another application.
Definition at line 295 of file browserrun.cpp. References QString::fromLatin1(), and KMessageBox::questionYesNoCancel(). Referenced by handleNonEmbeddable(). |
|
Similar to askSave but for the case where the current application is able to embed the url itself (instead of passing it to another app).
Definition at line 312 of file browserrun.cpp. References QString::fromLatin1(), KMimeType::mimeType(), KMimeType::Ptr, KMessageBox::questionYesNoCancel(), and QString::startsWith(). |
|
BIC: Combine with the above function for KDE 4.0.
Definition at line 348 of file browserrun.cpp. |
|
BIC: Obsoleted by KRun::isExecutable( const QString &serviceType );.
Reimplemented from KRun. Definition at line 482 of file browserrun.cpp. References KRun::isExecutable(). |
|
|
Reimplemented from KRun.
Definition at line 69 of file browserrun.cpp. References QFile::encodeName(). |
|
Called when an error happens.
NOTE: Definition at line 419 of file browserrun.cpp. References KIO::Job::error(), and KIO::Job::errorText(). |
|
Helper for foundMimeType: call this if the mimetype couldn't be embedded.
Definition at line 199 of file browserrun.cpp. References askSave(), QObject::connect(), KParts::URLArgs::doPost(), KIO::file_copy(), QString::findRev(), QString::fromLatin1(), QString::isEmpty(), QString::mid(), KTempFile::name(), KServiceTypeProfile::preferredService(), KIO::SimpleJob::removeOnHold(), KURL::setPath(), KIO::Job::setWindow(), and slotCopyToTempFileResult(). |
|
To display this error in KHTMLPart instead of inside a dialog box, we tell konq that the mimetype is text/html, and we redirect to an error:/ URL that sends the info to khtml. The format of the error:/ URL is error:/?query::url, where two variables are passed in the query: error = int kio error code, errText = QString error text from kio The sub-url is the URL that we were trying to open. Definition at line 463 of file browserrun.cpp. References KIO::Job::error(), KRun::runURL(), and KIO::Job::showErrorDialog(). Referenced by handleNonEmbeddable(). |
The documentation for this class was generated from the following files: