KParts::BrowserOpenOrSaveQuestion

Search for usage in LXR

KParts::BrowserOpenOrSaveQuestion Class Reference

#include <KParts/BrowserOpenOrSaveQuestion>

Public Types

enum  AskEmbedOrSaveFlags { InlineDisposition = 0, AttachmentDisposition = 1 }
 
enum  Feature { BasicFeatures = 0, ServiceSelection = 1 }
 
typedef QFlags< FeatureFeatures
 
enum  Result { Save, Open, Embed, Cancel }
 

Public Member Functions

 BrowserOpenOrSaveQuestion (QWidget *parent, const QUrl &url, const QString &mimeType)
 
Result askEmbedOrSave (int flags=0)
 
Result askOpenOrSave ()
 
KService::Ptr selectedService () const
 
void setFeatures (Features features)
 
void setSuggestedFileName (const QString &suggestedFileName)
 

Detailed Description

This class shows the dialog that asks the user whether to save a url or open a url in another application.

It also has the variant which asks "save or embed" (e.g. into konqueror).

Since
4.4

Definition at line 30 of file browseropenorsavequestion.h.

Member Typedef Documentation

Stores a combination of Feature values.

Definition at line 61 of file browseropenorsavequestion.h.

Member Enumeration Documentation

Set of features that should be enabled in this dialog.

This allows to add features before making all applications ready for those features (e.g. applications need to read selectedService() otherwise the dialog should not show the service selection button)

See also
Features
Enumerator
BasicFeatures 

Only the basic save, open, embed, cancel button.

ServiceSelection 

Shows "Open With..." with the associated applications for the mimetype.

Definition at line 54 of file browseropenorsavequestion.h.

Constructor & Destructor Documentation

BrowserOpenOrSaveQuestion::BrowserOpenOrSaveQuestion ( QWidget parent,
const QUrl url,
const QString mimeType 
)

Constructor, for all kinds of dialogs shown in this class.

Parameters
urlthe URL in question
mimeTypethe mimetype of the URL

Definition at line 203 of file browseropenorsavequestion.cpp.

Member Function Documentation

BrowserOpenOrSaveQuestion::Result BrowserOpenOrSaveQuestion::askEmbedOrSave ( int  flags = 0)

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

Parameters
flagsset to AttachmentDisposition if suggested by the server This is used because by default text/html files are opened embedded in browsers, not saved. But if the server said "attachment", it means the user is download a file for saving it.
Returns
Save, Embed or Cancel.

Definition at line 309 of file browseropenorsavequestion.cpp.

BrowserOpenOrSaveQuestion::Result BrowserOpenOrSaveQuestion::askOpenOrSave ( )

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

Returns
Save, Open or Cancel.

Definition at line 222 of file browseropenorsavequestion.cpp.

KService::Ptr BrowserOpenOrSaveQuestion::selectedService ( ) const
Returns
the service that was selected during askOpenOrSave, if it returned Open. In all other cases (no associated application, Save or Cancel selected), this returns 0.

Requires setFeatures(BrowserOpenOrSaveQuestion::ServiceSelection).

Definition at line 275 of file browseropenorsavequestion.cpp.

void BrowserOpenOrSaveQuestion::setFeatures ( Features  features)

Enables the given features in the dialog.

Definition at line 329 of file browseropenorsavequestion.cpp.

void BrowserOpenOrSaveQuestion::setSuggestedFileName ( const QString suggestedFileName)

Sets the suggested filename, shown in the dialog.

Parameters
suggestedFileNameoptional file name suggested by the server (HTTP Content-Disposition)

Definition at line 334 of file browseropenorsavequestion.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 19 2021 22:56:36 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.