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

KParts

browserrun.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002  *
00003  * Copyright (C) 2002 David Faure <faure@kde.org>
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Library General Public
00006  * License version 2, as published by the Free Software Foundation.
00007  *
00008  * This library is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011  * Library General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU Library General Public License
00014  * along with this library; see the file COPYING.LIB.  If not, write to
00015  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016  * Boston, MA 02110-1301, USA.
00017  */
00018 
00019 #ifndef kparts_browserrun_h
00020 #define kparts_browserrun_h
00021 
00022 #include <krun.h>
00023 #include <kservice.h>
00024 #include <kparts/browserextension.h>
00025 
00026 namespace KParts {
00027 
00039     class KPARTS_EXPORT BrowserRun : public KRun
00040     {
00041         Q_OBJECT
00042     public:
00054         BrowserRun( const KUrl& url,
00055                     const KParts::OpenUrlArguments& args,
00056                     const KParts::BrowserArguments& browserArgs,
00057                     KParts::ReadOnlyPart *part,
00058                     QWidget *window,
00059                     bool removeReferrer, bool trustedSource, bool hideErrorDialog = false );
00060 
00061         virtual ~BrowserRun();
00062 
00063         KParts::OpenUrlArguments& arguments();
00064         KParts::BrowserArguments& browserArguments();
00065         KParts::ReadOnlyPart* part() const;
00066         KUrl url() const;
00067 
00068         bool hideErrorDialog() const;
00069 
00073         QString contentDisposition() const;
00074 
00075         bool serverSuggestsSave() const { return contentDisposition() == QString::fromLatin1("attachment"); }
00076 
00077         enum AskSaveResult { Save, Open, Cancel };
00086         static AskSaveResult askSave( const KUrl & url, KService::Ptr offer, const QString& mimeType, const QString & suggestedFileName = QString() );
00087 
00088         enum AskEmbedOrSaveFlags { InlineDisposition = 0, AttachmentDisposition = 1 };
00098         static AskSaveResult askEmbedOrSave( const KUrl & url, const QString& mimeType, const QString & suggestedFileName = QString(), int flags = 0 );
00099 
00100         // virtual so that KHTML can implement differently (HTML cache)
00101         virtual void save( const KUrl & url, const QString & suggestedFileName );
00102 
00103         // static so that it can be called from other classes
00104         static void simpleSave( const KUrl & url, const QString & suggestedFileName,
00105                                 QWidget* window =0 );
00106 
00107 
00108         static bool allowExecution( const QString &mimeType, const KUrl &url );
00109 
00110         static bool isTextExecutable( const QString &mimeType );
00111 
00112     protected:
00116         virtual void scanFile();
00120         virtual void init();
00128         virtual void handleError( KJob * job );
00129 
00134         enum NonEmbeddableResult { Handled, NotHandled, Delayed };
00135 
00139         NonEmbeddableResult handleNonEmbeddable( const QString& mimeType );
00140 
00141     protected Q_SLOTS:
00142         void slotBrowserScanFinished(KJob *job);
00143         void slotBrowserMimetype(KIO::Job *job, const QString &type);
00144         void slotCopyToTempFileResult(KJob *job);
00145         virtual void slotStatResult( KJob *job );
00146 
00147     private:
00148         void redirectToError( int error, const QString& errorText );
00149         class BrowserRunPrivate;
00150         BrowserRunPrivate* const d;
00151 
00152     };
00153 }
00154 #endif

KParts

Skip menu "KParts"
  • Main Page
  • 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
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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