• Skip to content
  • Skip to link menu
KDE 4.1 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 = "" );
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 
00208   static bool run( const QString& exec, const KUrl::List& urls, QWidget* window,
00209                     const QString& name = QString(),
00210                     const QString& icon = QString(),
00211                     const QByteArray& asn = "" );
00212 
00231   static bool runUrl( const KUrl& url, const QString& mimetype, QWidget* window,
00232       bool tempFile = false , bool runExecutables = true, const QString& suggestedFileName = QString(), const QByteArray& asn = "" );
00233 
00248   static bool runCommand( const QString &cmd, QWidget* window );
00249 
00262   static bool runCommand( const QString& cmd, const QString & execName, const QString & icon, QWidget* window, const QByteArray& asn = "" );
00263 
00274   static bool displayOpenWithDialog( const KUrl::List& lst, QWidget* window,
00275       bool tempFiles = false, const QString& suggestedFileName = QString(), const QByteArray& asn = "" );
00276 
00287   static KDE_DEPRECATED void shellQuote( QString &str );
00288 
00299   static QStringList processDesktopExec(const KService &_service, const KUrl::List &_urls, bool tempFiles = false, const QString& suggestedFileName = QString() );
00300 
00308   static QString binaryName( const QString & execLine, bool removePath );
00309 
00314   static bool isExecutable( const QString& serviceType );
00315 
00328    static bool isExecutableFile( const KUrl& url, const QString &mimetype );
00329 
00333     static bool checkStartupNotify( const QString& binName, const KService* service, bool* silent_arg, QByteArray* wmclass_arg );
00334 
00335 Q_SIGNALS:
00340   void finished();
00345   void error();
00346 
00347 protected Q_SLOTS:
00356   void slotTimeout();
00357 
00361   void slotScanFinished( KJob * );
00362 
00367   void slotScanMimeType( KIO::Job *, const QString &type );
00368 
00374   void mimeTypeDetermined(const QString& mimeType);
00375 
00379   virtual void slotStatResult( KJob * );
00380 
00381 protected:
00389   virtual void init();
00390 
00394   virtual void scanFile();
00395 
00402   virtual void foundMimeType( const QString& type );
00403 
00407   virtual void killJob();
00408 
00412   void setUrl( const KUrl &url );
00413 
00417   KUrl url() const;
00418 
00422   void setError( bool error );
00423 
00427   void setProgressInfo( bool progressInfo );
00428 
00432   bool progressInfo() const;
00433 
00437   void setFinished( bool finished );
00438 
00442   void setJob( KIO::Job *job );
00443 
00447   KIO::Job* job();
00448 
00452   QTimer& timer();
00453 
00458   KDE_DEPRECATED void setDoScanFile( bool scanFile );
00459 
00464   KDE_DEPRECATED bool doScanFile() const;
00465 
00470   KDE_DEPRECATED void setIsDirecory( bool isDirectory );
00471 
00475   bool isDirectory() const;
00476 
00480   KDE_DEPRECATED void setInitializeNextAction( bool initialize );
00481 
00485   KDE_DEPRECATED bool initializeNextAction() const;
00486 
00490   void setIsLocalFile( bool isLocalFile );
00491 
00495   bool isLocalFile() const;
00496 
00500   void setMode( mode_t mode );
00501 
00505   mode_t mode() const;
00506 
00507 private:
00508   class KRunPrivate;
00509   KRunPrivate* const d;
00510 };
00511 
00512 #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
  • 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