kparts Library API Documentation

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:

KRun QObject List of all members.

Public Types

enum  AskSaveResult { Save, Open, Cancel }

Public Member Functions

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

Static Public Member Functions

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

Protected Types

enum  NonEmbeddableResult { Handled, NotHandled, Delayed }
 NotHandled means that foundMimeType should call KRun::foundMimeType, i.e. More...


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 Member Functions

virtual void scanFile ()
 Reimplemented from KRun.

virtual void init ()
 Reimplemented from KRun.

virtual void handleError (KIO::Job *job)
 Called when an error happens.

NonEmbeddableResult handleNonEmbeddable (const QString &mimeType)
 Helper for foundMimeType: call this if the mimetype couldn't be embedded.


Protected Attributes

KParts::URLArgs m_args
KParts::ReadOnlyPartm_part
QWidgetm_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.

Definition at line 39 of file browserrun.h.


Member Enumeration Documentation

enum KParts::BrowserRun::NonEmbeddableResult [protected]
 

NotHandled means that foundMimeType should call KRun::foundMimeType, i.e.

launch an external app.

Definition at line 114 of file browserrun.h.


Constructor & Destructor Documentation

KParts::BrowserRun::BrowserRun const KURL url,
const KParts::URLArgs args,
KParts::ReadOnlyPart part,
QWidget window,
bool  removeReferrer,
bool  trustedSource
 

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.

KParts::BrowserRun::BrowserRun const KURL url,
const KParts::URLArgs args,
KParts::ReadOnlyPart part,
QWidget window,
bool  removeReferrer,
bool  trustedSource,
bool  hideErrorDialog
 

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.


Member Function Documentation

virtual void KParts::BrowserRun::scanFile  )  [protected, virtual]
 

Reimplemented from KRun.

Reimplemented from KRun.

virtual void KParts::BrowserRun::init  )  [protected, virtual]
 

Reimplemented from KRun.

Reimplemented from KRun.

virtual void KParts::BrowserRun::handleError KIO::Job job  )  [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.

NonEmbeddableResult KParts::BrowserRun::handleNonEmbeddable const QString mimeType  )  [protected]
 

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


The documentation for this class was generated from the following file:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 27 22:15:45 2005 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001