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

KParts

  • KParts
  • BrowserOpenOrSaveQuestion
Public Types | Public Member Functions | List of all members
KParts::BrowserOpenOrSaveQuestion Class Reference

#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

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 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
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 285 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 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
suggestedFileNameoptional 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:
  • browseropenorsavequestion.h
  • browseropenorsavequestion.cpp
This file is part of the KDE documentation.
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.

KParts

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • 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

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal