Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

jsconsolewidget.h

00001 // -*- c++ -*-
00002 
00003 /*
00004  *  Copyright (C) 2001-2003, Richard J. Moore <rich@kde.org>
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Library General Public
00008  *  License as published by the Free Software Foundation; either
00009  *  version 2 of the License, or (at your option) any later version.
00010  *
00011  *  This library is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  *  Library General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU Library General Public License
00017  *  along with this library; see the file COPYING.LIB.  If not, write to
00018  *  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019  *  Boston, MA 02111-1307, USA.
00020  */
00021 
00022 #ifndef KJSEMBEDJSCONSOLEWIDGET_H
00023 #define KJSEMBEDJSCONSOLEWIDGET_H
00024 
00025 #include <qframe.h>
00026 #include <kjs/object.h>
00027 
00028 class QComboBox;
00029 class QPushButton;
00030 class QTextEdit;
00031 
00032 class KPopupTitle;
00033 class KProcess;
00034 class KShellProcess;
00035 
00036 namespace KJS { class Interpreter; };
00037 
00038 namespace KJSEmbed {
00039 
00057 class JSConsoleWidget : public QFrame
00058 {
00059     Q_OBJECT
00060 
00061 public:
00062     JSConsoleWidget( KJS::Interpreter *js, QWidget *parent=0, const char *name=0 );
00063     virtual ~JSConsoleWidget();
00064 
00065     KJS::Interpreter *jscript() const { return js; }
00066     QTextEdit *messages() const { return log; }
00067     KPopupTitle *title() const;
00068 
00069 public slots:
00070     void execute();
00071     virtual bool execute( const QString &cmd );
00072 
00073     virtual void println( const QString &text );
00074     virtual void warn( const QString &text );
00075 
00076     virtual bool run( const QString &shellCmd );
00077 
00078 protected:
00079     void createView();
00080 
00081     void childExited();
00082     void receivedStdOutput(KProcess *, char *, int);
00083     void receivedStdError(KProcess *, char *, int);
00084 
00085 private:
00086     QString msg;
00087     KShellProcess *proc;
00088     KJS::Interpreter *js;
00089 
00090     QTextEdit *log;
00091     QComboBox *cmd;
00092     QPushButton *go;
00093 
00094     class Private *d;
00095 };
00096 
00097 }; // namespace KJSEmbed
00098 
00099 #endif // KJSEMBEDJSCONSOLEWIDGET_H
00100 
00101 // Local Variables:
00102 // c-basic-offset: 4
00103 // End:

Generated at Sat Feb 1 03:23:35 2003 for KJSEmbed by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001