diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2014-05-25 15:37:31 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2014-05-25 15:37:31 +0900 |
commit | 6392f5a9dfce2bf83617d49bb7f332181ec6004e (patch) | |
tree | ab69e390f7962b7e7dda1a3a64f035c61c751cf4 /lib/util/kdevshellwidget.h | |
parent | aba2788b428dc53243407902e9ccbb20b97a69fd (diff) | |
download | tdevelop-6392f5a9dfce2bf83617d49bb7f332181ec6004e.tar.gz tdevelop-6392f5a9dfce2bf83617d49bb7f332181ec6004e.zip |
Revert "Finish renaming tdevelop components"
This reverts commit 722ce1efbac31c61b1d4b13f7e075c9f311e3e73.
Diffstat (limited to 'lib/util/kdevshellwidget.h')
-rw-r--r-- | lib/util/kdevshellwidget.h | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/lib/util/kdevshellwidget.h b/lib/util/kdevshellwidget.h new file mode 100644 index 00000000..6bb6a8d7 --- /dev/null +++ b/lib/util/kdevshellwidget.h @@ -0,0 +1,101 @@ +/*************************************************************************** + * Copyright (C) 2006 by Jens Dagerbo * + * jens.dagerbo@swipnet.se * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + + +#ifndef KDEVSHELLWIDGET_H +#define KDEVSHELLWIDGET_H + +#include <tqstrlist.h> +#include <tqvbox.h> +#include <tqguardedptr.h> + +class TDEProcess; +namespace KParts +{ + class ReadOnlyPart; +} + +class KDevShellWidget : public TQVBox +{ + +Q_OBJECT + + +public: + KDevShellWidget(TQWidget *parent = 0, const char *name = 0); + virtual ~KDevShellWidget(); + + /** + * Stores the shell name and arguments, that will be used in @ref activate() + * @param shell The shell name, for example 'irb' or '/bin/bash' + * @param arguments Any optional arguments + */ + void setShell( const TQString & shell, const TQStrList & arguments = TQStrList() ); + + /** + * Executes the previously set shell. If @ref setShell wasn't called before + * konsolepart will decide what to use. + */ + void activate(); + + /** + * Should we auto launch the shell again if it was terminated? + * @param doAutoActivate + */ + void setAutoReactivateOnClose( bool doAutoActivate ); + + /** + * Send text to the running shell + * @param text The text to send to the shell + */ + void sendInput( const TQString & text ); + + /** + * Call to check if the shell is currently running + * @return true if the shell is currently running + */ + bool isRunning(); + +signals: + /** + * This signal will be emmitted when the started shell exits normally + * @param exitcode The return code of the process + */ + void shellExited( int exitcode ); + + /** + * This signal will be emitted when the started shell is terminated by a signal + * @param signalcode The signal the process was killed with + */ + void shellSignalled( int signalcode ); + + /** + * This signal will be emitted when the process receives data + * @param text received data + */ + void receivedData( const TQString & ); + +private slots: + void partDestroyed(); + void processExited( TDEProcess * ); + void setAutoReactivateOnCloseDelayed( ); + +private: + TQGuardedPtr<KParts::ReadOnlyPart> m_konsolePart; + TQString m_shellName; + TQStrList m_shellArguments; + bool m_doAutoActivate; + bool m_isRunning; +}; + +#endif + +// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off; |