1 /***************************************************************************
2 * copyright : (C) 2007 Shane King <kde@dontletsstart.com> *
3 **************************************************************************/
5 /***************************************************************************
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
12 ***************************************************************************/
14 #ifndef AMAROK_PROCESS_H
15 #define AMAROK_PROCESS_H
17 #include "amarok_export.h"
23 // Classes needed to wrap some KProcess stuff to make it more like K3Process
24 // Also need to close fds on fork under unix
26 ////////////////////////////////////////////////////////////////////////////////
28 ////////////////////////////////////////////////////////////////////////////////
30 class AMAROK_EXPORT Process
: public KProcess
35 explicit Process(QObject
*parent
= 0);
37 void setLowPriority(bool lowPriority
) { this->lowPriority
= lowPriority
; }
41 // for K3Process compat
43 void processExited(Process
*proc
);
44 void receivedStdout(Process
*proc
);
45 void receivedStderr(Process
*proc
);
48 virtual void setupChildProcess();
52 void readyReadStandardOutput();
53 void readyReadStandardError();
59 ////////////////////////////////////////////////////////////////////////////////
61 ////////////////////////////////////////////////////////////////////////////////
63 class AMAROK_EXPORT ProcIO
: public Process
70 int readln (QString
&line
);
71 bool writeStdin(const QString
&line
);
76 void readReady(ProcIO
*pio
);
79 void readyReadStandardOutput();
85 ////////////////////////////////////////////////////////////////////////////////
87 ////////////////////////////////////////////////////////////////////////////////
89 class AMAROK_EXPORT ShellProcess
: public Process
92 explicit ShellProcess(QObject
*parent
= 0) : Process(parent
) {}
94 ShellProcess
&operator<<(const QString
& arg
);
95 ShellProcess
&operator<<(const QStringList
& args
);
98 #endif // AMAROK_PROCESS_H