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

KIO

krun.h

Go to the documentation of this file.
00001 // -*- mode: c++; c-basic-offset: 2 -*-
00002 /* This file is part of the KDE project
00003    Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
00004    Copyright (C) 2006 David Faure <faure@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KRUN_H
00023 #define KRUN_H
00024 
00025 #include <kio/kio_export.h>
00026 
00027 #include <QtCore/QObject>
00028 #include <QtCore/QTimer>
00029 #include <QtCore/QString>
00030 #include <sys/types.h>
00031 #include <kurl.h>
00032 
00033 class KService;
00034 class KStartupInfo;
00035 class KJob;
00036 namespace KIO {
00037    class Job;
00038 }
00039 
00058 class KIO_EXPORT KRun : public QObject
00059 {
00060   Q_OBJECT
00061 public:
00088   KRun( const KUrl& url, QWidget* window, mode_t mode = 0,
00089     bool isLocalFile = false, bool showProgressInfo = true, const QByteArray& asn = QByteArray() );
00090 
00095   virtual ~KRun();
00096 
00103   void abort();
00104 
00110   bool hasError() const;
00111 
00117   bool hasFinished() const;
00118 
00126   bool autoDelete() const;
00127 
00136   void setAutoDelete(bool b);
00137 
00146   void setPreferredService( const QString& desktopEntryName );
00147 
00154   void setRunExecutables(bool b);
00155 
00162   void setEnableExternalBrowser(bool b);
00163 
00171   void setSuggestedFileName( const QString& fileName );
00172 
00176   QString suggestedFileName() const;
00177 
00178 
00192   static bool run( const KService& service, const KUrl::List& urls, QWidget* window,
00193       bool tempFiles = false, const QString& suggestedFileName = QString(), const QByteArray& asn =
00194       QByteArray() );
00195 
00212   static bool run(const QString& exec, const KUrl::List& urls, QWidget* window,
00213                   const QString& name = QString(),
00214                   const QString& icon = QString(),
00215                   const QByteArray& asn = QByteArray());
00216 
00235   static bool runUrl( const KUrl& url, const QString& mimetype, QWidget* window,
00236       bool tempFile = false , bool runExecutables = true,
00237       const QString& suggestedFileName = QString(), const QByteArray& asn = QByteArray() );
00238 
00253   static bool runCommand( const QString &cmd, QWidget* window );
00254 
00267   static bool runCommand( const QString& cmd, const QString & execName,
00268           const QString & icon, QWidget* window, const QByteArray& asn = QByteArray() );
00269 
00280   static bool displayOpenWithDialog( const KUrl::List& lst, QWidget* window,
00281       bool tempFiles = false, const QString& suggestedFileName = QString(),
00282       const QByteArray& asn = QByteArray() );
00283 
00294   static KDE_DEPRECATED void shellQuote( QString &str );
00295 
00306   static QStringList processDesktopExec(const KService &_service, const KUrl::List &_urls, bool tempFiles = false, const QString& suggestedFileName = QString() );
00307 
00315   static QString binaryName( const QString & execLine, bool removePath );
00316 
00321   static bool isExecutable( const QString& serviceType );
00322 
00335    static bool isExecutableFile( const KUrl& url, const QString &mimetype );
00336 
00340     static bool checkStartupNotify( const QString& binName, const KService* service, bool* silent_arg, QByteArray* wmclass_arg );
00341 
00342 Q_SIGNALS:
00347   void finished();
00352   void error();
00353 
00354 protected Q_SLOTS:
00363   void slotTimeout();
00364 
00368   void slotScanFinished( KJob * );
00369 
00374   void slotScanMimeType( KIO::Job *, const QString &type );
00375 
00381   void mimeTypeDetermined(const QString& mimeType);
00382 
00386   virtual void slotStatResult( KJob * );
00387 
00388 protected:
00396   virtual void init();
00397 
00401   virtual void scanFile();
00402 
00409   virtual void foundMimeType( const QString& type );
00410 
00414   virtual void killJob();
00415 
00419   void setUrl( const KUrl &url );
00420 
00424   KUrl url() const;
00425 
00429   void setError( bool error );
00430 
00434   void setProgressInfo( bool progressInfo );
00435 
00439   bool progressInfo() const;
00440 
00444   void setFinished( bool finished );
00445 
00449   void setJob( KIO::Job *job );
00450 
00454   KIO::Job* job();
00455 
00459   QTimer& timer();
00460 
00465   KDE_DEPRECATED void setDoScanFile( bool scanFile );
00466 
00471   KDE_DEPRECATED bool doScanFile() const;
00472 
00477   KDE_DEPRECATED void setIsDirecory( bool isDirectory );
00478 
00482   bool isDirectory() const;
00483 
00487   KDE_DEPRECATED void setInitializeNextAction( bool initialize );
00488 
00492   KDE_DEPRECATED bool initializeNextAction() const;
00493 
00497   void setIsLocalFile( bool isLocalFile );
00498 
00502   bool isLocalFile() const;
00503 
00507   void setMode( mode_t mode );
00508 
00512   mode_t mode() const;
00513 
00514 private:
00515   class KRunPrivate;
00516   KRunPrivate* const d;
00517 };
00518 
00519 #endif

KIO

Skip menu "KIO"
  • 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
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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