qCTKPythonShell.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Library:   qCTK
00004 
00005   Copyright (c) Kitware Inc. 
00006   All rights reserved.
00007   Distributed under a BSD License. See LICENSE.txt file.
00008 
00009   This software is distributed "AS IS" WITHOUT ANY WARRANTY; without even
00010   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00011   See the above copyright notice for more information.
00012 
00013 =========================================================================*/
00014 /*=========================================================================
00015 
00016    Program: ParaView
00017    Module:    $RCSfile$
00018 
00019    Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
00020    All rights reserved.
00021 
00022    ParaView is a free software; you can redistribute it and/or modify it
00023    under the terms of the ParaView license version 1.2. 
00024 
00025    See License_v1.2.txt for the full ParaView license.
00026    A copy of this license can be obtained by contacting
00027    Kitware Inc.
00028    28 Corporate Drive
00029    Clifton Park, NY 12065
00030    USA
00031 
00032 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00033 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00034 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00035 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
00036 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00037 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00038 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00039 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00040 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00041 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00042 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00043 
00044 =========================================================================*/
00045 
00046 #ifndef __qCTKPythonShell_h
00047 #define __qCTKPythonShell_h
00048 
00049 // QT includes
00050 #include <QWidget>
00051 
00052 #include "qCTKWidgetsExport.h"
00053 
00062 class qCTKAbstractPythonManager; 
00063 
00064 class QCTK_WIDGETS_EXPORT qCTKPythonShell :
00065   public QWidget
00066 {
00067   Q_OBJECT
00068   
00069 public:
00070   typedef QWidget Superclass; 
00071   qCTKPythonShell(qCTKAbstractPythonManager* pythonManager, QWidget* _parent = 0);
00072   ~qCTKPythonShell();
00073 
00074 
00077 //   void initializeInterpretor(int argc, char* argv[]);
00078 //   void initializeInterpretor();
00079 
00081   void printMessage(const QString&);
00082 
00084 //   void makeCurrent();
00085 
00087 //   void releaseControl();
00088 
00091   QStringList getPythonAttributes(const QString& pythonVariableName);
00092 
00093 signals:
00094   void executing(bool);
00095 
00096 public slots:
00097   void clear();
00098   void executeScript(const QString&);
00099 
00100 protected slots:
00101   void printStderr(const QString&);
00102   void printStdout(const QString&);
00103 
00104   void onExecuteCommand(const QString&);
00105 
00106 private:
00107   qCTKPythonShell(const qCTKPythonShell&);
00108   qCTKPythonShell& operator=(const qCTKPythonShell&);
00109 
00110   void promptForInput();
00111   void internalExecuteCommand(const QString&);
00112 
00113   struct pqImplementation;
00114   pqImplementation* const Implementation;
00115 };
00116 
00117 #endif // !__qCTKPythonShell_h

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1