CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkPythonConsole.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 /*=========================================================================
21 
22  Program: ParaView
23 
24  Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
25  All rights reserved.
26 
27  ParaView is a free software; you can redistribute it and/or modify it
28  under the terms of the ParaView license version 1.2.
29 
30  See http://www.paraview.org/paraview/project/license.html for the full ParaView license.
31  A copy of this license can be obtained by contacting
32  Kitware Inc.
33  28 Corporate Drive
34  Clifton Park, NY 12065
35  USA
36 
37 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
38 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
39 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
40 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
41 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
42 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
43 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
44 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
45 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
46 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
47 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
48 
49 =========================================================================*/
50 
51 #ifndef __ctkPythonConsole_h
52 #define __ctkPythonConsole_h
53 
54 // CTK includes
55 #include <ctkConsole.h>
56 #include "ctkScriptingPythonWidgetsExport.h"
57 
65 
66 class ctkPythonConsolePrivate;
68 
69 class CTK_SCRIPTING_PYTHON_WIDGETS_EXPORT ctkPythonConsole : public ctkConsole
70 {
71  Q_OBJECT
72 
73 public:
75  ctkPythonConsole(QWidget* parentObject = 0);
76  virtual ~ctkPythonConsole();
77 
79  void initialize(ctkAbstractPythonManager* newPythonManager);
80 
82  virtual QString ps1() const;
83 
85  virtual void setPs1(const QString& newPs1);
86 
88  virtual QString ps2() const;
89 
91  virtual void setPs2(const QString& newPs2);
92 
93 public Q_SLOTS:
94 
95 // void executeScript(const QString&);
96 
98  virtual void reset();
99 
100 protected:
101  virtual void executeCommand(const QString& command);
102 
103 private:
104  Q_DECLARE_PRIVATE(ctkPythonConsole);
105  Q_DISABLE_COPY(ctkPythonConsole);
106 };
107 
108 #endif
109 
void initialize(ctkAbstractPythonManager *newPythonManager)
Initialize.
ctkPythonConsole(QWidget *parentObject=0)
virtual ~ctkPythonConsole()
virtual void reset()
Reset ps1 and ps2, clear the console and print the welcome message.
virtual QString ps2() const
Returns the string used as secondary prompt.
virtual void setPs1(const QString &newPs1)
Set the string used as primary prompt.
virtual void executeCommand(const QString &command)
Called whenever the user enters a command.
virtual QString ps1() const
Returns the string used as primary prompt.
virtual void setPs2(const QString &newPs2)
Set the string used as secondary prompt.
ctkConsole Superclass