KParts
#include <browseropenorsavequestion.h>
Public Types | |
enum | Feature { BasicFeatures = 0, ServiceSelection = 1 } |
enum | Result { Save, Open, Embed, Cancel } |
Public Member Functions | |
BrowserOpenOrSaveQuestion (QWidget *parent, const KUrl &url, const QString &mimeType) | |
~BrowserOpenOrSaveQuestion () | |
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 41 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)
Enumerator | |
---|---|
BasicFeatures |
Only the basic save, open, embed, cancel button. |
ServiceSelection |
Shows "Open With..." with the associated applications for the mimetype. |
Definition at line 64 of file browseropenorsavequestion.h.
Enumerator | |
---|---|
Save | |
Open | |
Embed | |
Cancel |
Definition at line 74 of file browseropenorsavequestion.h.
Constructor & Destructor Documentation
BrowserOpenOrSaveQuestion::BrowserOpenOrSaveQuestion | ( | QWidget * | parent, |
const KUrl & | url, | ||
const QString & | mimeType | ||
) |
Constructor, for all kinds of dialogs shown in this class.
- Parameters
-
url the URL in question mimeType the mimetype of the URL
Definition at line 176 of file browseropenorsavequestion.cpp.
BrowserOpenOrSaveQuestion::~BrowserOpenOrSaveQuestion | ( | ) |
Definition at line 181 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
-
parent parent widget for the dialog flags set to BrowserRun::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 285 of file browseropenorsavequestion.cpp.
BrowserOpenOrSaveQuestion::Result BrowserOpenOrSaveQuestion::askOpenOrSave | ( | ) |
Ask the user whether to save or open a url in another application.
- Parameters
-
parent parent widget for the dialog
- Returns
- Save, Open or Cancel.
Definition at line 198 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 254 of file browseropenorsavequestion.cpp.
void BrowserOpenOrSaveQuestion::setFeatures | ( | Features | features | ) |
Enables the given features in the dialog.
Definition at line 305 of file browseropenorsavequestion.cpp.
void BrowserOpenOrSaveQuestion::setSuggestedFileName | ( | const QString & | suggestedFileName | ) |
Sets the suggested filename, shown in the dialog.
- Parameters
-
suggestedFileName optional file name suggested by the server (HTTP Content-Disposition)
Definition at line 310 of file browseropenorsavequestion.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.