• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeparts
 

tdeparts

browserrun.h
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 tdeparts_browserrun_h
00020 #define tdeparts_browserrun_h
00021 
00022 #include <krun.h>
00023 #include <kservice.h>
00024 #include <tdeparts/browserextension.h>
00025 
00026 namespace KParts {
00027 
00042     class TDEPARTS_EXPORT BrowserRun : public KRun
00043     {
00044         Q_OBJECT
00045     public:
00055         BrowserRun( const KURL& url, const KParts::URLArgs& args,
00056                     KParts::ReadOnlyPart *part, TQWidget *window,
00057                     bool removeReferrer, bool trustedSource );
00058 
00059         // BIC: merge with above constructor
00071         BrowserRun( const KURL& url, const KParts::URLArgs& args,
00072                     KParts::ReadOnlyPart *part, TQWidget *window,
00073                     bool removeReferrer, bool trustedSource, bool hideErrorDialog );
00074 
00075         virtual ~BrowserRun();
00076 
00077         //KParts::URLArgs urlArgs() const { return m_args; }
00078         //KParts::ReadOnlyPart* part() const { return m_part; }
00079 
00083         KURL url() const { return m_strURL; }
00084 
00088         bool hideErrorDialog() const;
00089 
00093         TQString suggestedFilename() const { return m_suggestedFilename; }
00094 
00099         TQString contentDisposition() const;
00100 
00101         bool serverSuggestsSave() const { return contentDisposition() == TQString::fromLatin1("attachment"); }
00102 
00103         enum AskSaveResult { Save, Open, Cancel };
00112         static AskSaveResult askSave( const KURL & url, KService::Ptr offer, const TQString& mimeType, const TQString & suggestedFilename = TQString::null );
00113 
00114         enum AskEmbedOrSaveFlags { InlineDisposition = 0, AttachmentDisposition = 1 };
00124         static AskSaveResult askEmbedOrSave( const KURL & url, const TQString& mimeType, const TQString & suggestedFilename = TQString::null, int flags = 0 );
00125 
00126         // virtual so that TDEHTML can implement differently (HTML cache)
00127         virtual void save( const KURL & url, const TQString & suggestedFilename );
00128 
00129         // static so that it can be called from other classes
00130         static void simpleSave( const KURL & url, const TQString & suggestedFilename,
00131                                 TQWidget* window );
00132 
00134         static void simpleSave( const KURL & url, const TQString & suggestedFilename );
00135 
00136         static bool allowExecution( const TQString &serviceType, const KURL &url );
00137 
00139         static bool isExecutable( const TQString &serviceType );
00140         static bool isTextExecutable( const TQString &serviceType );
00141 
00142     protected:
00146         virtual void scanFile();
00150         virtual void init();
00158         virtual void handleError( TDEIO::Job * job );
00159 
00164         enum NonEmbeddableResult { Handled, NotHandled, Delayed };
00165 
00169         NonEmbeddableResult handleNonEmbeddable( const TQString& mimeType );
00170 
00171     protected slots:
00172         void slotBrowserScanFinished(TDEIO::Job *job);
00173         void slotBrowserMimetype(TDEIO::Job *job, const TQString &type);
00174         void slotCopyToTempFileResult(TDEIO::Job *job);
00175         virtual void slotStatResult( TDEIO::Job *job );
00176 
00177     protected:
00178         KParts::URLArgs m_args;
00179         KParts::ReadOnlyPart *m_part; // QGuardedPtr?
00180         TQGuardedPtr<TQWidget> m_window;
00181         // Suggested filename given by the server (e.g. HTTP content-disposition)
00182         // When set, we should really be saving instead of embedding
00183         TQString m_suggestedFilename;
00184         TQString m_sMimeType;
00185         bool m_bRemoveReferrer;
00186         bool m_bTrustedSource;
00187     private:
00188         void redirectToError( int error, const TQString& errorText );
00189         class BrowserRunPrivate;
00190         BrowserRunPrivate* d;
00191 
00192     };
00193 }
00194 #endif

tdeparts

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

tdeparts

Skip menu "tdeparts"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeparts by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.