25 #include <sys/types.h> 31 #include <kstartupinfo.h> 58 class KIO_EXPORT
KRun :
public TQObject
85 KRun(
const KURL& url, mode_t mode = 0,
86 bool isLocalFile =
false,
bool showProgressInfo =
true );
112 KRun(
const KURL& url, TQWidget* window, mode_t mode = 0,
113 bool isLocalFile =
false,
bool showProgressInfo =
true );
114 KRun(
const KURL& url, TQWidget* window,
const TQCString& asn, mode_t mode = 0,
115 bool isLocalFile =
false,
bool showProgressInfo =
true );
172 void setPreferredService(
const TQString& desktopEntryName );
181 void setRunExecutables(
bool b);
190 void setEnableExternalBrowser(
bool b);
200 void setSuggestedFileName(
const TQString& fileName );
214 static pid_t run(
const KService& _service,
const KURL::List& _urls, TQWidget* window,
bool tempFiles =
false );
215 static pid_t run(
const KService& _service,
const KURL::List& _urls, TQWidget* window,
216 const TQCString& asn,
bool tempFiles =
false );
228 static pid_t run(
const KService& _service,
const KURL::List& _urls,
bool tempFiles );
229 static pid_t run(
const KService& _service,
const KURL::List& _urls );
232 static pid_t run(
const KService& _service,
const KURL::List& _urls, TQWidget* window,
bool tempFiles,
const TQString& suggestedFileName );
233 static pid_t run(
const KService& _service,
const KURL::List& _urls, TQWidget* window,
234 const TQCString& asn,
bool tempFiles,
const TQString& suggestedFileName );
249 static pid_t run(
const TQString& _exec,
const KURL::List& _urls,
250 const TQString& _name = TQString::null,
251 const TQString& _icon = TQString::null,
252 const TQString& _obsolete1 = TQString::null,
253 const TQString& _obsolete2 = TQString::null );
273 static pid_t runURL(
const KURL& _url,
const TQString& _mimetype,
bool tempFile,
bool runExecutables);
274 static pid_t runURL(
const KURL& _url,
const TQString& _mimetype,
bool tempFile);
275 static pid_t runURL(
const KURL& _url,
const TQString& _mimetype );
278 static pid_t runURL(
const KURL& _url,
const TQString& _mimetype, TQWidget* window,
const TQCString& asn,
bool tempFile,
bool runExecutables,
const TQString& suggestedFileName );
279 static pid_t runURL(
const KURL& _url,
const TQString& _mimetype,
bool tempFile,
bool runExecutables,
const TQString& suggestedFileName );
295 static pid_t runCommand( TQString cmd );
308 static pid_t runCommand(
const TQString& cmd,
const TQString & execName,
const TQString & icon );
309 static pid_t runCommand(
const TQString& cmd,
const TQString & execName,
const TQString & icon,
310 TQWidget* window,
const TQCString& asn );
320 static bool displayOpenWithDialog(
const KURL::List& lst,
bool tempFiles );
321 static bool displayOpenWithDialog(
const KURL::List& lst );
324 static bool displayOpenWithDialog(
const KURL::List& lst,
bool tempFiles,
const TQString& suggestedFileName );
330 static void shellQuote( TQString &_str );
346 static TQStringList processDesktopExec(
const KService &_service,
const KURL::List &_urls,
bool has_shell,
bool tempFiles);
347 static TQStringList processDesktopExec(
const KService &_service,
const KURL::List &_urls,
bool has_shell);
350 static TQStringList processDesktopExec(
const KService &_service,
const KURL::List &_urls,
bool has_shell,
bool tempFiles,
const TQString& suggestedFileName);
360 static TQString binaryName(
const TQString & execLine,
bool removePath );
367 static bool isExecutable(
const TQString& serviceType );
382 static bool isExecutableFile(
const KURL& url,
const TQString &
mimetype );
388 static bool checkStartupNotify(
const TQString& binName,
const KService* service,
bool* silent_arg, TQCString* wmclass_arg );
404 void slotScanFinished(
KIO::Job * );
405 void slotScanMimeType(
KIO::Job *,
const TQString &type );
406 virtual void slotStatResult(
KIO::Job * );
411 virtual void scanFile();
418 virtual void foundMimeType(
const TQString& _type );
420 virtual void killJob();
425 bool m_bProgressInfo;
447 virtual void virtual_hook(
int id,
void* data );
450 void init (
const KURL& url, TQWidget* window,
const TQCString& asn, mode_t mode,
451 bool isLocalFile,
bool showProgressInfo);
457 #ifndef KDE_NO_COMPAT 468 static bool exists() {
return true; }
478 class KIO_EXPORT KProcessRunner :
public TQObject
484 static pid_t run(KProcess *,
const TQString & binName);
485 #ifdef Q_WS_X11 // We don't have KStartupInfo in Qt/Embedded 486 static pid_t run(KProcess *,
const TQString & binName,
const KStartupInfoId&
id );
489 virtual ~KProcessRunner();
495 void slotProcessExited(KProcess *);
499 KProcessRunner(KProcess *,
const TQString & binName);
500 #ifdef Q_WS_X11 // We don't have KStartupInfo in Qt/Embedded 501 KProcessRunner(KProcess *,
const TQString & binName,
const KStartupInfoId&
id );
507 #ifdef Q_WS_X11 // We don't have KStartupInfo in Qt/Embedded A namespace for KIO globals.
Represent a service, i.e.
bool hasError() const
Returns true if the KRun instance has an error.
To open files with their associated applications in KDE, use KRun.
KIO_EXPORT MimetypeJob * mimetype(const KURL &url, bool showProgressInfo=true)
Find mimetype for one file or directory.
bool autoDelete() const
Checks whether auto delete is activated.
void setAutoDelete(bool b)
Enables or disabled auto deletion.
bool m_bScanFile
Used to indicate that the next action is to scan the file.
The base class for all jobs.
bool m_bInit
USed to indicate that the next action is to initialize.
bool hasFinished() const
Returns true if the KRun instance has finished.