• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeparts
 

tdeparts

  • KParts
  • BrowserRun
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
KParts::BrowserRun Class Reference

#include <browserrun.h>

Inherits KRun.

Public Types

enum  AskSaveResult { Save , Open , Cancel }
 
enum  AskEmbedOrSaveFlags { InlineDisposition = 0 , AttachmentDisposition = 1 }
 

Public Member Functions

 BrowserRun (const KURL &url, const KParts::URLArgs &args, KParts::ReadOnlyPart *part, TQWidget *window, bool removeReferrer, bool trustedSource)
 
 BrowserRun (const KURL &url, const KParts::URLArgs &args, KParts::ReadOnlyPart *part, TQWidget *window, bool removeReferrer, bool trustedSource, bool hideErrorDialog)
 
KURL url () const
 
bool hideErrorDialog () const
 
TQString suggestedFilename () const
 
TQString contentDisposition () const
 
bool serverSuggestsSave () const
 
virtual void save (const KURL &url, const TQString &suggestedFilename)
 

Static Public Member Functions

static AskSaveResult askSave (const KURL &url, KService::Ptr offer, const TQString &mimeType, const TQString &suggestedFilename=TQString::null)
 
static AskSaveResult askEmbedOrSave (const KURL &url, const TQString &mimeType, const TQString &suggestedFilename=TQString::null, int flags=0)
 
static void simpleSave (const KURL &url, const TQString &suggestedFilename, TQWidget *window)
 
static void simpleSave (const KURL &url, const TQString &suggestedFilename)
 
static bool allowExecution (const TQString &serviceType, const KURL &url)
 
static bool isExecutable (const TQString &serviceType)
 
static bool isTextExecutable (const TQString &serviceType)
 

Protected Types

enum  NonEmbeddableResult { Handled , NotHandled , Delayed }
 

Protected Slots

void slotBrowserScanFinished (TDEIO::Job *job)
 
void slotBrowserMimetype (TDEIO::Job *job, const TQString &type)
 
void slotCopyToTempFileResult (TDEIO::Job *job)
 
virtual void slotStatResult (TDEIO::Job *job)
 

Protected Member Functions

virtual void scanFile ()
 
virtual void init ()
 
virtual void handleError (TDEIO::Job *job)
 
NonEmbeddableResult handleNonEmbeddable (const TQString &mimeType)
 

Protected Attributes

KParts::URLArgs m_args
 
KParts::ReadOnlyPart * m_part
 
TQGuardedPtr< TQWidget > m_window
 
TQString m_suggestedFilename
 
TQString 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
Author
David Faure faure.nosp@m.@kde.nosp@m..org

Definition at line 42 of file browserrun.h.

Member Enumeration Documentation

◆ AskEmbedOrSaveFlags

enum KParts::BrowserRun::AskEmbedOrSaveFlags

Definition at line 114 of file browserrun.h.

◆ AskSaveResult

enum KParts::BrowserRun::AskSaveResult

Definition at line 103 of file browserrun.h.

◆ NonEmbeddableResult

enum KParts::BrowserRun::NonEmbeddableResult
protected

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

launch an external app.

Definition at line 164 of file browserrun.h.

Constructor & Destructor Documentation

◆ BrowserRun() [1/2]

BrowserRun::BrowserRun ( const KURL &  url,
const KParts::URLArgs &  args,
KParts::ReadOnlyPart *  part,
TQWidget *  window,
bool  removeReferrer,
bool  trustedSource 
)
Parameters
urlthe URL we're probing
argsURL args - includes data for a HTTP POST, etc.
partthe part going to open this URL - can be 0L if not created yet
windowthe mainwindow - passed to TDEIO::Job::setWindow()
removeReferrerif true, the "referrer" metadata from args isn't passed on
trustedSourceif false, a warning will be shown before launching an executable Always pass false for trustedSource, except for local directory views.

Definition at line 42 of file browserrun.cpp.

◆ BrowserRun() [2/2]

BrowserRun::BrowserRun ( const KURL &  url,
const KParts::URLArgs &  args,
KParts::ReadOnlyPart *  part,
TQWidget *  window,
bool  removeReferrer,
bool  trustedSource,
bool  hideErrorDialog 
)
Parameters
urlthe URL we're probing
argsURL args - includes data for a HTTP POST, etc.
partthe part going to open this URL - can be 0L if not created yet
windowthe mainwindow - passed to TDEIO::Job::setWindow()
removeReferrerif true, the "referrer" metadata from args isn't passed on
trustedSourceif false, a warning will be shown before launching an executable. Always pass false for trustedSource, except for local directory views.
hideErrorDialogif true, no dialog will be shown in case of errors.

Definition at line 54 of file browserrun.cpp.

◆ ~BrowserRun()

BrowserRun::~BrowserRun ( )
virtual

Definition at line 65 of file browserrun.cpp.

Member Function Documentation

◆ allowExecution()

bool BrowserRun::allowExecution ( const TQString &  serviceType,
const KURL &  url 
)
static

Definition at line 267 of file browserrun.cpp.

◆ askEmbedOrSave()

BrowserRun::AskSaveResult BrowserRun::askEmbedOrSave ( const KURL &  url,
const TQString &  mimeType,
const TQString &  suggestedFilename = TQString::null,
int  flags = 0 
)
static

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).

Parameters
urlthe URL in question
mimeTypethe mimetype of the URL
suggestedFilenameoptional filename suggested by the server
flagsset to AttachmentDisposition if suggested by the server
Returns
Save, Open or Cancel.

Definition at line 323 of file browserrun.cpp.

◆ askSave()

BrowserRun::AskSaveResult BrowserRun::askSave ( const KURL &  url,
KService::Ptr  offer,
const TQString &  mimeType,
const TQString &  suggestedFilename = TQString::null 
)
static

Ask the user whether to save or open a url in another application.

Parameters
urlthe URL in question
offerthe application that will be used to open the URL
mimeTypethe mimetype of the URL
suggestedFilenameoptional filename suggested by the server
Returns
Save, Open or Cancel.

Definition at line 300 of file browserrun.cpp.

◆ contentDisposition()

TQString BrowserRun::contentDisposition ( ) const
Returns
Suggested disposition by the server (e.g. HTTP content-disposition)
Since
3.5.2

Definition at line 521 of file browserrun.cpp.

◆ handleError()

void BrowserRun::handleError ( TDEIO::Job *  job)
protectedvirtual

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.

Definition at line 444 of file browserrun.cpp.

◆ handleNonEmbeddable()

BrowserRun::NonEmbeddableResult BrowserRun::handleNonEmbeddable ( const TQString &  mimeType)
protected

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

Definition at line 203 of file browserrun.cpp.

◆ hideErrorDialog()

bool BrowserRun::hideErrorDialog ( ) const
Returns
true if no dialog will be shown in case of errors

Definition at line 516 of file browserrun.cpp.

◆ init()

void BrowserRun::init ( )
protectedvirtual

Reimplemented from KRun.

Definition at line 70 of file browserrun.cpp.

◆ isExecutable()

bool BrowserRun::isExecutable ( const TQString &  serviceType)
static

BIC: Obsoleted by KRun::isExecutable( const TQString &serviceType );.

Definition at line 511 of file browserrun.cpp.

◆ isTextExecutable()

bool BrowserRun::isTextExecutable ( const TQString &  serviceType)
static

Definition at line 499 of file browserrun.cpp.

◆ save()

void BrowserRun::save ( const KURL &  url,
const TQString &  suggestedFilename 
)
virtual

Definition at line 360 of file browserrun.cpp.

◆ scanFile()

void BrowserRun::scanFile ( )
protectedvirtual

Reimplemented from KRun.

Definition at line 98 of file browserrun.cpp.

◆ serverSuggestsSave()

bool KParts::BrowserRun::serverSuggestsSave ( ) const
inline

Definition at line 101 of file browserrun.h.

◆ simpleSave() [1/2]

void BrowserRun::simpleSave ( const KURL &  url,
const TQString &  suggestedFilename 
)
static

BIC: Combine with the above function for KDE 4.0.

Definition at line 366 of file browserrun.cpp.

◆ simpleSave() [2/2]

void BrowserRun::simpleSave ( const KURL &  url,
const TQString &  suggestedFilename,
TQWidget *  window 
)
static

Definition at line 371 of file browserrun.cpp.

◆ slotBrowserMimetype

void BrowserRun::slotBrowserMimetype ( TDEIO::Job *  job,
const TQString &  type 
)
protectedslot

Definition at line 179 of file browserrun.cpp.

◆ slotBrowserScanFinished

void BrowserRun::slotBrowserScanFinished ( TDEIO::Job *  job)
protectedslot

Definition at line 156 of file browserrun.cpp.

◆ slotCopyToTempFileResult

void BrowserRun::slotCopyToTempFileResult ( TDEIO::Job *  job)
protectedslot

Definition at line 486 of file browserrun.cpp.

◆ slotStatResult

void BrowserRun::slotStatResult ( TDEIO::Job *  job)
protectedvirtualslot

Definition at line 435 of file browserrun.cpp.

◆ suggestedFilename()

TQString KParts::BrowserRun::suggestedFilename ( ) const
inline
Returns
Suggested filename given by the server (e.g. HTTP content-disposition filename)

Definition at line 93 of file browserrun.h.

◆ url()

KURL KParts::BrowserRun::url ( ) const
inline
Returns
the URL we're probing

Definition at line 83 of file browserrun.h.

Member Data Documentation

◆ m_args

KParts::URLArgs KParts::BrowserRun::m_args
protected

Definition at line 178 of file browserrun.h.

◆ m_bRemoveReferrer

bool KParts::BrowserRun::m_bRemoveReferrer
protected

Definition at line 185 of file browserrun.h.

◆ m_bTrustedSource

bool KParts::BrowserRun::m_bTrustedSource
protected

Definition at line 186 of file browserrun.h.

◆ m_part

KParts::ReadOnlyPart* KParts::BrowserRun::m_part
protected

Definition at line 179 of file browserrun.h.

◆ m_sMimeType

TQString KParts::BrowserRun::m_sMimeType
protected

Definition at line 184 of file browserrun.h.

◆ m_suggestedFilename

TQString KParts::BrowserRun::m_suggestedFilename
protected

Definition at line 183 of file browserrun.h.

◆ m_window

TQGuardedPtr<TQWidget> KParts::BrowserRun::m_window
protected

Definition at line 180 of file browserrun.h.


The documentation for this class was generated from the following files:
  • browserrun.h
  • browserrun.cpp

tdeparts

Skip menu "tdeparts"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeparts

Skip menu "tdeparts"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeparts by doxygen 1.9.4
This website is maintained by Timothy Pearson.