• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Widgets Library
 

KDevelop Widgets Library

  • lib
  • widgets
processwidget.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 1999-2001 Bernd Gehrmann <bernd@kdevelop.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef _PROCESSWIDGET_H_
21#define _PROCESSWIDGET_H_
22
23#include <tdelistbox.h>
24#include <kprocess.h>
25
30
31class ProcessLineMaker;
32
36class ProcessListBoxItem : public TQListBoxText
37{
38public:
39 enum Type { Diagnostic, Normal, Error };
40
41 ProcessListBoxItem(const TQString &s, Type type);
42
43 virtual bool isCustomItem();
44
45protected:
46 TQColor blend(const TQColor &c1, const TQColor &c2, double k = 0.25) const;
47
48private:
49 virtual void paint(TQPainter *p);
50 Type t;
51};
52
53
58class ProcessWidget : public TDEListBox
59{
60 TQ_OBJECT
61
62
63public:
64 ProcessWidget(TQWidget *parent, const char *name=0);
65 ~ProcessWidget();
66
70 bool isRunning();
71
72public slots:
76 void startJob(const TQString &dir, const TQString &command);
80 void killJob( int signo = SIGTERM );
86 virtual void insertStdoutLine(const TQCString &line);
93 virtual void insertStderrLine(const TQCString &line);
94
95 virtual void addPartialStdoutLine(const TQCString&);
96 virtual void addPartialStderrLine(const TQCString&);
97
98protected:
105 virtual void childFinished(bool normal, int status);
106
107signals:
108 void processExited(TDEProcess *);
109 void rowSelected(int row);
110
111protected:
112 virtual TQSize minimumSizeHint() const;
113 void maybeScrollToBottom();
114
115protected slots:
116 void slotProcessExited(TDEProcess*);
117
118private:
119 TDEProcess *childproc;
120 ProcessLineMaker* procLineMaker;
121 TQCString stderrbuf;
122 TQCString stdoutbuf;
123 int lastRowStdout;
124 int lastRowStderr;
125};
126
127
128#endif
ProcessLineMaker
Convenience class to catch output of TDEProcess.
Definition processlinemaker.h:36
ProcessWidget::startJob
void startJob(const TQString &dir, const TQString &command)
Starts the child process.
Definition processwidget.cpp:140
ProcessWidget::insertStdoutLine
virtual void insertStdoutLine(const TQCString &line)
Inserts one line from stdin into the listbox.
Definition processwidget.cpp:184
ProcessWidget::childFinished
virtual void childFinished(bool normal, int status)
This is called when the child process exits.
Definition processwidget.cpp:222
ProcessWidget::insertStderrLine
virtual void insertStderrLine(const TQCString &line)
Inserts one line from stderr into the listbox.
Definition processwidget.cpp:203
ProcessWidget::isRunning
bool isRunning()
Returns whether a process is running in this view.
Definition processwidget.cpp:165
ProcessWidget::maybeScrollToBottom
void maybeScrollToBottom()
Should be called right after an insertItem(), will automatic scroll the listbox if it is already at t...
Definition processwidget.cpp:264
ProcessWidget::killJob
void killJob(int signo=SIGTERM)
Kills the child processss.
Definition processwidget.cpp:157

KDevelop Widgets Library

Skip menu "KDevelop Widgets Library"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

KDevelop Widgets Library

Skip menu "KDevelop Widgets Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Widgets Library by doxygen 1.15.0
This website is maintained by Timothy Pearson.