• Skip to content
  • Skip to link menu
KDE 4.3 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 {
00038 class Job;
00039 }
00040 
00059 class KIO_EXPORT KRun : public QObject
00060 {
00061     Q_OBJECT
00062 public:
00089     KRun(const KUrl& url, QWidget* window, mode_t mode = 0,
00090          bool isLocalFile = false, bool showProgressInfo = true,
00091          const QByteArray& asn = QByteArray());
00092 
00097     virtual ~KRun();
00098 
00105     void abort();
00106 
00112     bool hasError() const;
00113 
00119     bool hasFinished() const;
00120 
00128     bool autoDelete() const;
00129 
00138     void setAutoDelete(bool b);
00139 
00148     void setPreferredService(const QString& desktopEntryName);
00149 
00156     void setRunExecutables(bool b);
00157 
00164     void setEnableExternalBrowser(bool b);
00165 
00173     void setSuggestedFileName(const QString& fileName);
00174 
00178     QString suggestedFileName() const;
00179 
00180 
00194     static bool run(const KService& service, const KUrl::List& urls, QWidget* window,
00195                     bool tempFiles = false, const QString& suggestedFileName = QString(),
00196                     const QByteArray& asn = QByteArray());
00197 
00214     static bool run(const QString& exec, const KUrl::List& urls, QWidget* window,
00215                     const QString& name = QString(),
00216                     const QString& icon = QString(),
00217                     const QByteArray& asn = QByteArray());
00218 
00237     static bool runUrl(const KUrl& url, const QString& mimetype, QWidget* window,
00238                        bool tempFile = false , bool runExecutables = true,
00239                        const QString& suggestedFileName = QString(), const QByteArray& asn = QByteArray());
00240 
00255     static bool runCommand(const QString &cmd, QWidget* window);
00256 
00269     static bool runCommand(const QString& cmd, const QString & execName,
00270                            const QString & icon, QWidget* window, const QByteArray& asn = QByteArray());
00271 
00282     static bool displayOpenWithDialog(const KUrl::List& lst, QWidget* window,
00283                                       bool tempFiles = false, const QString& suggestedFileName = QString(),
00284                                       const QByteArray& asn = QByteArray());
00285 
00296     static KDE_DEPRECATED void shellQuote(QString &str);
00297 
00308     static QStringList processDesktopExec(const KService &_service, const KUrl::List &_urls,
00309                                           bool tempFiles = false,
00310                                           const QString& suggestedFileName = QString());
00311 
00319     static QString binaryName(const QString & execLine, bool removePath);
00320 
00325     static bool isExecutable(const QString& serviceType);
00326 
00339     static bool isExecutableFile(const KUrl& url, const QString &mimetype);
00340 
00344     static bool checkStartupNotify(const QString& binName, const KService* service, bool* silent_arg,
00345                                    QByteArray* wmclass_arg);
00346 
00347 Q_SIGNALS:
00352     void finished();
00357     void error();
00358 
00359 protected Q_SLOTS:
00368     void slotTimeout(); // KDE5: rename to slotNextStep() or something like that
00369 
00373     void slotScanFinished(KJob *);
00374 
00379     void slotScanMimeType(KIO::Job *, const QString &type);
00380 
00386     void mimeTypeDetermined(const QString& mimeType);
00387 
00391     virtual void slotStatResult(KJob *);
00392 
00393 protected:
00401     virtual void init();
00402 
00406     virtual void scanFile();
00407 
00414     virtual void foundMimeType(const QString& type);
00415 
00419     virtual void killJob();
00420 
00424     void setUrl(const KUrl &url);
00425 
00429     KUrl url() const;
00430 
00434     void setError(bool error);
00435 
00439     void setProgressInfo(bool progressInfo);
00440 
00444     bool progressInfo() const;
00445 
00449     void setFinished(bool finished);
00450 
00454     void setJob(KIO::Job *job);
00455 
00459     KIO::Job* job();
00460 
00464     QTimer& timer();
00465 
00470     KDE_DEPRECATED void setDoScanFile(bool scanFile);
00471 
00476     KDE_DEPRECATED bool doScanFile() const;
00477 
00482     KDE_DEPRECATED void setIsDirecory(bool isDirectory);
00483 
00487     bool isDirectory() const;
00488 
00492     KDE_DEPRECATED void setInitializeNextAction(bool initialize);
00493 
00497     KDE_DEPRECATED bool initializeNextAction() const;
00498 
00502     void setIsLocalFile(bool isLocalFile);
00503 
00507     bool isLocalFile() const;
00508 
00512     void setMode(mode_t mode);
00513 
00517     mode_t mode() const;
00518 
00519 private:
00520     class KRunPrivate;
00521     KRunPrivate* const d;
00522 };
00523 
00524 #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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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