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

KParts

  • sources
  • kde-4.14
  • kdelibs
  • kparts
browserrun.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  *
3  * Copyright (C) 2002 David Faure <faure@kde.org>
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License version 2, as published by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Library General Public License for more details.
12  *
13  * You should have received a copy of the GNU Library General Public License
14  * along with this library; see the file COPYING.LIB. If not, write to
15  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  * Boston, MA 02110-1301, USA.
17  */
18 
19 #ifndef kparts_browserrun_h
20 #define kparts_browserrun_h
21 
22 #include <krun.h>
23 #include <kservice.h>
24 #include <kparts/browserextension.h>
25 
26 namespace KParts {
27 
39  class KPARTS_EXPORT BrowserRun : public KRun
40  {
41  Q_OBJECT
42  public:
54  BrowserRun( const KUrl& url,
55  const KParts::OpenUrlArguments& args,
56  const KParts::BrowserArguments& browserArgs,
57  KParts::ReadOnlyPart *part,
58  QWidget *window,
59  bool removeReferrer, bool trustedSource, bool hideErrorDialog = false );
60 
61  virtual ~BrowserRun();
62 
63  KParts::OpenUrlArguments& arguments();
64  KParts::BrowserArguments& browserArguments();
65  KParts::ReadOnlyPart* part() const;
66  KUrl url() const;
67 
68  bool hideErrorDialog() const;
69 
73  QString contentDisposition() const;
74 
78  bool serverSuggestsSave() const;
79 
80  enum AskSaveResult { Save, Open, Cancel };
94 #ifndef KDE_NO_DEPRECATED
95  static KDE_DEPRECATED AskSaveResult askSave( const KUrl & url, KService::Ptr offer, const QString& mimeType, const QString & suggestedFileName = QString() );
96 #endif
97 
98  enum AskEmbedOrSaveFlags { InlineDisposition = 0, AttachmentDisposition = 1 };
114 #ifndef KDE_NO_DEPRECATED
115  static KDE_DEPRECATED AskSaveResult askEmbedOrSave( const KUrl & url, const QString& mimeType, const QString & suggestedFileName = QString(), int flags = 0 );
116 #endif
117 
118  // virtual so that KHTML can implement differently (HTML cache)
119  virtual void save( const KUrl & url, const QString & suggestedFileName );
120 
121  // static so that it can be called from other classes
122  static void simpleSave( const KUrl & url, const QString & suggestedFileName,
123  QWidget* window =0 ); // KDE5: remove
129  static void saveUrl(const KUrl & url, const QString & suggestedFileName,
130  QWidget* window, const KParts::OpenUrlArguments& args);
131 
136  static void saveUrlUsingKIO(const KUrl & srcUrl, const KUrl& destUrl,
137  QWidget* window, const QMap<QString, QString> &metaData);
138 
139  static bool allowExecution( const QString &mimeType, const KUrl &url );
140 
141  static bool isTextExecutable( const QString &mimeType );
142 
152  static KUrl makeErrorUrl(int error, const QString& errorText, const QString& initialUrl);
153 
154  protected:
158  virtual void scanFile();
162  virtual void init();
170  virtual void handleError( KJob * job );
171 
176  enum NonEmbeddableResult { Handled, NotHandled, Delayed };
177 
181  NonEmbeddableResult handleNonEmbeddable( const QString& mimeType ); // TODO KDE5: remove, and add =0 to the other overload
182 
203  NonEmbeddableResult handleNonEmbeddable(const QString& mimeType, KService::Ptr* pSelectedService);
204 
205  protected Q_SLOTS:
206  void slotBrowserScanFinished(KJob *job);
207  void slotBrowserMimetype(KIO::Job *job, const QString &type);
208  void slotCopyToTempFileResult(KJob *job);
209  virtual void slotStatResult( KJob *job );
210 
211  private:
212  void redirectToError( int error, const QString& errorText );
213  class BrowserRunPrivate;
214  BrowserRunPrivate* const d;
215 
216  };
217 }
218 #endif
KSharedPtr< KService >
QWidget
KParts::BrowserArguments
BrowserArguments is a set of web-browsing-specific arguments, which allow specifying how a URL should...
Definition: browserextension.h:64
KParts::BrowserRun
This class extends KRun to provide additional functionality for browsers:
Definition: browserrun.h:39
QMap< QString, QString >
KParts::BrowserRun::NonEmbeddableResult
NonEmbeddableResult
NotHandled means that foundMimeType should call KRun::foundMimeType, i.e.
Definition: browserrun.h:176
KParts::BrowserRun::AskSaveResult
AskSaveResult
Definition: browserrun.h:80
KUrl
KRun
KParts::BrowserRun::NotHandled
Definition: browserrun.h:176
QString
kservice.h
Cancel
Open
KParts::BrowserRun::AskEmbedOrSaveFlags
AskEmbedOrSaveFlags
Definition: browserrun.h:98
krun.h
KParts::BrowserRun::Save
Definition: browserrun.h:80
KIO::Job
browserextension.h
save
KAction * save(const QObject *recvr, const char *slot, QObject *parent)
KJob
KParts::OpenUrlArguments
OpenUrlArguments is the set of arguments that specify how a URL should be opened by KParts::ReadOnlyP...
Definition: part.h:404
KParts::ReadOnlyPart
Base class for any "viewer" part.
Definition: part.h:488
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