KDevelop API Documentation

ProcessWidget Class Reference

This class is designed to share code between the grep and application output widgets. More...

#include <processwidget.h>

Inheritance diagram for ProcessWidget:

KListBox QListBox AppOutputWidget GrepViewWidget List of all members.

Public Slots

void startJob (const QString &dir, const QString &command)
 Starts the child process.

void killJob (int signo=SIGTERM)
 Kills the child processss.

virtual void insertStdoutLine (const QString &line)
 Inserts one line from stdin into the listbox.

virtual void insertStderrLine (const QString &line)
 Inserts one line from stderr into the listbox.


Signals

void processExited (KProcess *)
void rowSelected (int row)

Public Member Functions

 ProcessWidget (QWidget *parent, const char *name=0)
 ~ProcessWidget ()
bool isRunning ()
 Returns whether a process is running in this view.


Protected Slots

void slotProcessExited (KProcess *)

Protected Member Functions

virtual void childFinished (bool normal, int status)
 This is called when the child process exits.

virtual QSize minimumSizeHint () const
void maybeScrollToBottom ()
 Should be called right after an insertItem(), will automatic scroll the listbox if it is already at the bottom to prevent automatic scrolling when the user has scrolled up.


Private Attributes

KProcesschildproc
ProcessLineMakerprocLineMaker

Detailed Description

This class is designed to share code between the grep and application output widgets.

Definition at line 47 of file processwidget.h.


Constructor & Destructor Documentation

ProcessWidget::ProcessWidget QWidget parent,
const char *  name = 0
 

Definition at line 51 of file processwidget.cpp.

References childproc, insertStderrLine(), insertStdoutLine(), processExited(), ProcessWidget(), procLineMaker, KProcess::setUseShell(), and slotProcessExited().

Referenced by ProcessWidget().

ProcessWidget::~ProcessWidget  ) 
 

Definition at line 81 of file processwidget.cpp.

References childproc, and procLineMaker.


Member Function Documentation

void ProcessWidget::childFinished bool  normal,
int  status
[protected, virtual]
 

This is called when the child process exits.

The flag 'normal' is true if the process exited normally (i.e. not by a signal or similar), otherwise the exit status can be taken from 'status'.

Reimplemented in GrepViewWidget, and AppOutputWidget.

Definition at line 144 of file processwidget.cpp.

References childFinished().

Referenced by childFinished(), and slotProcessExited().

void ProcessWidget::insertStderrLine const QString line  )  [virtual, slot]
 

Inserts one line from stderr into the listbox.

This can be overridden by subclasses to implement syntax highlighting. By default, a ProcessListBoxItem is used.

Definition at line 136 of file processwidget.cpp.

References insertStderrLine(), and maybeScrollToBottom().

Referenced by insertStderrLine(), and ProcessWidget().

void ProcessWidget::insertStdoutLine const QString line  )  [virtual, slot]
 

Inserts one line from stdin into the listbox.

This can be overridden by subclasses to implement syntax highlighting.

Reimplemented in GrepViewWidget.

Definition at line 128 of file processwidget.cpp.

References insertStdoutLine(), and maybeScrollToBottom().

Referenced by insertStdoutLine(), and ProcessWidget().

bool ProcessWidget::isRunning  ) 
 

Returns whether a process is running in this view.

Definition at line 114 of file processwidget.cpp.

References childproc, and KProcess::isRunning().

void ProcessWidget::killJob int  signo = SIGTERM  )  [slot]
 

Kills the child processss.

Definition at line 106 of file processwidget.cpp.

References childproc, KProcess::kill(), killJob(), and procLineMaker.

Referenced by killJob().

void ProcessWidget::maybeScrollToBottom  )  [protected]
 

Should be called right after an insertItem(), will automatic scroll the listbox if it is already at the bottom to prevent automatic scrolling when the user has scrolled up.

Definition at line 179 of file processwidget.cpp.

Referenced by GrepViewWidget::childFinished(), insertStderrLine(), GrepViewWidget::insertStdoutLine(), insertStdoutLine(), and slotProcessExited().

QSize ProcessWidget::minimumSizeHint  )  const [protected, virtual]
 

Definition at line 166 of file processwidget.cpp.

void ProcessWidget::processExited KProcess  )  [signal]
 

Referenced by ProcessWidget(), and slotProcessExited().

void ProcessWidget::rowSelected int  row  )  [signal]
 

void ProcessWidget::slotProcessExited KProcess  )  [protected, slot]
 

Definition at line 120 of file processwidget.cpp.

References childFinished(), childproc, KProcess::exitStatus(), maybeScrollToBottom(), KProcess::normalExit(), processExited(), and slotProcessExited().

Referenced by ProcessWidget(), and slotProcessExited().

void ProcessWidget::startJob const QString dir,
const QString command
[slot]
 

Starts the child process.

Definition at line 88 of file processwidget.cpp.

References childproc, KProcess::clearArguments(), ProcessLineMaker::clearBuffers(), endl(), kdDebug(), procLineMaker, KProcess::start(), and startJob().

Referenced by startJob().


Member Data Documentation

KProcess* ProcessWidget::childproc [private]
 

Definition at line 104 of file processwidget.h.

Referenced by isRunning(), killJob(), ProcessWidget(), slotProcessExited(), startJob(), and ~ProcessWidget().

ProcessLineMaker* ProcessWidget::procLineMaker [private]
 

Definition at line 105 of file processwidget.h.

Referenced by killJob(), ProcessWidget(), startJob(), and ~ProcessWidget().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Oct 19 08:02:05 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003