• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

KParts

  • KParts
  • BrowserOpenOrSaveQuestion
Public Types | Public Member Functions

KParts::BrowserOpenOrSaveQuestion Class Reference

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

#include <browseropenorsavequestion.h>

List of all members.

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

enum KParts::BrowserOpenOrSaveQuestion::Feature

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.

enum KParts::BrowserOpenOrSaveQuestion::Result
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:
urlthe URL in question
mimeTypethe mimetype of the URL

Definition at line 174 of file browseropenorsavequestion.cpp.

BrowserOpenOrSaveQuestion::~BrowserOpenOrSaveQuestion ( )

Definition at line 179 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:
parentparent widget for the dialog
flagsset 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 282 of file browseropenorsavequestion.cpp.

BrowserOpenOrSaveQuestion::Result BrowserOpenOrSaveQuestion::askOpenOrSave ( )

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

Parameters:
parentparent widget for the dialog
Returns:
Save, Open or Cancel.

Definition at line 196 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 251 of file browseropenorsavequestion.cpp.

void BrowserOpenOrSaveQuestion::setFeatures ( Features  features)

Enables the given features in the dialog.

Definition at line 301 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 306 of file browseropenorsavequestion.cpp.


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

KParts

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal