KIO
krun_p.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_P_H 00023 #define KRUN_P_H 00024 00025 #include <QtCore/QObject> 00026 #include <QtCore/QPointer> 00027 00028 #include "kprocess.h" 00029 #include "kstartupinfo.h" 00030 00037 class KProcessRunner : public QObject 00038 { 00039 Q_OBJECT 00040 00041 public: 00042 00043 #ifndef Q_WS_X11 00044 static int run(KProcess *, const QString & executable); 00045 #else 00046 static int run(KProcess *, const QString & executable, const KStartupInfoId& id); 00047 #endif 00048 00049 virtual ~KProcessRunner(); 00050 00051 int pid() const; 00052 00053 protected Q_SLOTS: 00054 00055 void slotProcessExited(int, QProcess::ExitStatus); 00056 00057 private: 00058 #ifndef Q_WS_X11 00059 KProcessRunner(KProcess *, const QString & binName); 00060 #else 00061 KProcessRunner(KProcess *, const QString & binName, const KStartupInfoId& id); 00062 #endif 00063 00064 void terminateStartupNotification(); 00065 00066 KProcess *process; 00067 QString m_executable; // can be a full path 00068 KStartupInfoId id; 00069 int m_pid; 00070 00071 Q_DISABLE_COPY(KProcessRunner) 00072 }; 00073 00077 class KRun::KRunPrivate 00078 { 00079 public: 00080 KRunPrivate(KRun *parent); 00081 00082 void init (const KUrl& url, QWidget* window, mode_t mode, 00083 bool isLocalFile, bool showProgressInfo, const QByteArray& asn); 00084 00085 // This helper method makes debugging easier: a single breakpoint for all 00086 // the code paths that start the timer - at least from KRun itself. 00087 // TODO: add public method startTimer() and deprecate timer() accessor, 00088 // starting is the only valid use of the timer in subclasses (BrowserRun, KHTMLRun and KonqRun) 00089 void startTimer(); 00090 00091 #ifdef Q_WS_WIN 00092 static bool displayNativeOpenWithDialog( const KUrl::List& lst, QWidget* window, bool tempFiles, 00093 const QString& suggestedFileName, const QByteArray& asn ); 00094 #endif 00095 00096 KRun *q; 00097 bool m_showingDialog; 00098 bool m_runExecutables; 00099 00100 QString m_preferredService; 00101 QString m_externalBrowser; 00102 QString m_localPath; 00103 QString m_suggestedFileName; 00104 QPointer <QWidget> m_window; 00105 QByteArray m_asn; 00106 KUrl m_strURL; 00107 bool m_bFault; 00108 bool m_bAutoDelete; 00109 bool m_bProgressInfo; 00110 bool m_bFinished; 00111 KIO::Job * m_job; 00112 QTimer m_timer; 00113 00118 bool m_bScanFile; 00119 bool m_bIsDirectory; 00120 00125 bool m_bInit; 00126 00127 bool m_bIsLocalFile; 00128 mode_t m_mode; 00129 }; 00130 00131 #endif // KRUN_P_H
KDE 4.6 API Reference