kprocctrl.h
/* This file is part of the KDE libraries
Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __KPROCCTRL_H__
#define __KPROCCTRL_H__
#include <qvaluelist.h>
#include "kprocess.h"
class QSocketNotifier;
class KDECORE_EXPORT KProcessController : public QObject
{
Q_OBJECT
public:
static void ref();
static void deref();
static KProcessController *theKProcessController; // kde4: rename: instance
static void theSigCHLDHandler(int signal); // KDE4: private
bool waitForProcessExit(int timeout);
void unscheduleCheck();
void rescheduleCheck();
/*
* Obtain the file descriptor KProcessController uses to get notified
* about process exits. select() or poll() on it if you create a custom
* event loop that needs to act upon SIGCHLD.
* @return the file descriptor of the reading end of the notification pipe
* @since 3.2
*/
int notifierFd() const;
void addKProcess( KProcess* );
void removeKProcess( KProcess* );
void addProcess( int pid );
private slots:
void slotDoHousekeeping();
private:
friend class I_just_love_gcc;
int fd[2];
bool needcheck;
QSocketNotifier *notifier;
QValueList<KProcess*> kProcessList;
QValueList<int> unixProcessList;
static void setupHandlers();
static void resetHandlers();
static struct sigaction oldChildHandlerData;
static bool handlerSet;
static int refCount;
// Disallow instantiation
KProcessController();
~KProcessController();
// Disallow assignment and copy-construction
KProcessController( const KProcessController& );
KProcessController& operator= ( const KProcessController& );
};
#endif
KProcess
Child process invocation, monitoring and control.
Definition: kprocess.h:125
KProcessController::theKProcessController
static KProcessController * theKProcessController
Only a single instance of this class is allowed at a time, and this static variable is used to track ...
Definition: kprocctrl.h:60
KProcessController
Used internally by KProcess.
Definition: kprocctrl.h:39

KDE Home | KDE Accessibility Home | Description of Access Keys