class BrowserRun

# class BrowserRun | 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. More...
Full name | `KParts::BrowserRun`
Definition | `#include <browserrun.h>`
Inherits | KRun (kio) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Types

- enum AskSaveResult { Save, Open, Cancel }

#### 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 )
- virtual ~BrowserRun ()
- KURL url () const
- bool hideErrorDialog () const
- virtual void save ( const KURL & url, const QString & suggestedFilename )

#### Public Static Methods

- static AskSaveResult askSave ( const KURL & url, KService::Ptr offer, const QString& mimeType, const QString & suggestedFilename = QString::null )
- static void simpleSave ( const KURL & url, const QString & suggestedFilename )
- static bool allowExecution ( const QString &serviceType, const KURL &url )
- static bool isExecutable ( const QString &serviceType )
- static bool isTextExecutable ( const QString &serviceType )

#### Protected Types

- enum NonEmbeddableResult { Handled, NotHandled, Delayed }

#### Protected Methods

- virtual void scanFile ()
- virtual void init ()
- virtual void handleError ( KIO::Job * job )
- NonEmbeddableResult handleNonEmbeddable ( const QString& mimeType )

#### Protected Slots

- void slotBrowserScanFinished (KIO::Job *job)
- void slotBrowserMimetype (KIO::Job *job, const QString &type)
- void slotCopyToTempFileResult (KIO::Job *job)
- virtual void slotStatResult ( KIO::Job *job )

#### Protected Members

- KParts::URLArgs m_args
- KParts::ReadOnlyPart *m_part
- QWidget *m_window
- QString m_suggestedFilename
- QString m_sMimeType
- bool m_bRemoveReferrer
- bool m_bTrustedSource

## 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

BrowserRun ( const KURL& url, const KParts::URLArgs& args, KParts::ReadOnlyPart *part, QWidget *window, bool removeReferrer, bool trustedSource ) | ### BrowserRun

Parameters:

url | the URL we're probing
args | URL args - includes data for a HTTP POST, etc.
part | the part going to open this URL - can be 0L if not created yet
window | the mainwindow - passed to KIO::Job::setWindow()
removeReferrer | if true, the "referrer" metadata from `args` isn't passed on
trustedSource | if false, a warning will be shown before launching an executable Always pass false for `trustedSource`, except for local directory views.

BrowserRun ( const KURL& url, const KParts::URLArgs& args, KParts::ReadOnlyPart *part, QWidget *window, bool removeReferrer, bool trustedSource, bool hideErrorDialog ) | ### BrowserRun

Parameters:

url | the URL we're probing
args | URL args - includes data for a HTTP POST, etc.
part | the part going to open this URL - can be 0L if not created yet
window | the mainwindow - passed to KIO::Job::setWindow()
removeReferrer | if true, the "referrer" metadata from `args` isn't passed on
trustedSource | if false, a warning will be shown before launching an executable
hideErrorDialog | if true, no dialog will be shown in case of errors. Always pass false for `trustedSource`, except for local directory views.

~BrowserRun () | ### ~BrowserRun

[virtual]

KURL url () | ### url

[const]

bool hideErrorDialog () | ### hideErrorDialog

[const]

enum AskSaveResult { Save, Open, Cancel } | ### AskSaveResult

AskSaveResult askSave ( const KURL & url, KService::Ptr offer, const QString& mimeType, const QString & suggestedFilename = QString::null ) | ### askSave

[static]

void save ( const KURL & url, const QString & suggestedFilename ) | ### save

[virtual]

void simpleSave ( const KURL & url, const QString & suggestedFilename ) | ### simpleSave

[static]

bool allowExecution ( const QString &serviceType, const KURL &url ) | ### allowExecution

[static]

bool isExecutable ( const QString &serviceType ) | ### isExecutable

[static]

bool isTextExecutable ( const QString &serviceType ) | ### isTextExecutable

[static]

void scanFile () | ### scanFile

[protected virtual]

Reimplemented from KRun

Reimplemented from KRun.

void init () | ### init

[protected virtual]

Reimplemented from KRun

Reimplemented from KRun.

void handleError ( KIO::Job * job ) | ### handleError

[protected virtual]

Called when an error happens. NOTE: `job` could be 0L, if you passed hideErrorDialog=true. The default implementation shows a message box, but only when job != 0 .... It is strongly recommended to reimplement this method if you passed hideErrorDialog=true.

enum NonEmbeddableResult { Handled, NotHandled, Delayed } | ### NonEmbeddableResult

[protected]

NotHandled means that foundMimeType should call KRun::foundMimeType, i.e. launch an external app.

NonEmbeddableResult handleNonEmbeddable ( const QString& mimeType ) | ### handleNonEmbeddable

[protected]

Helper for foundMimeType: call this if the mimetype couldn't be embedded

void slotBrowserScanFinished (KIO::Job *job) | ### slotBrowserScanFinished

[protected slots slot]

void slotBrowserMimetype (KIO::Job *job, const QString &type) | ### slotBrowserMimetype

[protected slots slot]

void slotCopyToTempFileResult (KIO::Job *job) | ### slotCopyToTempFileResult

[protected slots slot]

void slotStatResult ( KIO::Job *job ) | ### slotStatResult

[protected slots virtual slot]

Reimplemented from KRun.

KParts::URLArgs m_args | ### m_args

[protected]

KParts::ReadOnlyPart * m_part | ### m_part

[protected]

QWidget * m_window | ### m_window

[protected]

QString m_suggestedFilename | ### m_suggestedFilename

[protected]

QString m_sMimeType | ### m_sMimeType

[protected]

bool m_bRemoveReferrer | ### m_bRemoveReferrer

[protected]

bool m_bTrustedSource | ### m_bTrustedSource

[protected]

- Author: David Faure
- Generated: root on macppc.ports.openbsd.org on Sat Sep 6 10:37:24 2003, using kdoc 2.0a54.