25 #include <sys/types.h>
31 #include <tdestartupinfo.h>
58 class TDEIO_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 );
405 void slotScanMimeType(
TDEIO::Job *,
const TQString &type );
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 TDEIO_EXPORT TDEProcessRunner :
public TQObject
484 static pid_t run(TDEProcess *,
const TQString & binName);
486 static pid_t run(TDEProcess *,
const TQString & binName,
const TDEStartupInfoId&
id );
489 virtual ~TDEProcessRunner();
495 void slotProcessExited(TDEProcess *);
499 TDEProcessRunner(TDEProcess *,
const TQString & binName);
501 TDEProcessRunner(TDEProcess *,
const TQString & binName,
const TDEStartupInfoId&
id );
505 TDEProcess * process_;
508 TDEStartupInfoId id_;
To open files with their associated applications in KDE, use KRun.
void finished()
Emitted when the operation finished.
bool m_bScanFile
Used to indicate that the next action is to scan the file.
bool autoDelete() const
Checks whether auto delete is activated.
bool m_bInit
USed to indicate that the next action is to initialize.
bool hasError() const
Returns true if the KRun instance has an error.
void error()
Emitted when the operation had an error.
bool hasFinished() const
Returns true if the KRun instance has finished.
void setAutoDelete(bool b)
Enables or disabled auto deletion.
Represent a service, i.e.
The base class for all jobs.
A namespace for TDEIO globals.