1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Adrien Bruneton (CEA/DEN)
20 // Created on: 3 avr. 2013
23 #ifndef PYCONSOLE_REQUEST_H_
24 #define PYCONSOLE_REQUEST_H_
26 #include "PyConsole.h"
27 #include "PyInterp_Request.h"
33 class PyInterp_Interp;
34 class PyConsole_Editor;
38 \brief Python command execution request.
41 class ExecCommand : public PyInterp_LockRequest
47 Creates new python command execution request.
48 \param theInterp python interpreter
49 \param theCommand python command
50 \param theListener widget to get the notification messages
51 \param sync if True the request is processed synchronously
53 ExecCommand( PyInterp_Interp* theInterp,
54 const QString& theCommand,
55 PyConsole_Editor* theListener,
60 \brief Execute the python command in the interpreter and
61 get its execution status.
63 virtual void execute();
66 \brief Create and return a notification event.
67 \return new notification event
69 virtual QEvent* createEvent();
72 QString myCommand; //!< Python command
73 int myState; //!< Python command execution status
76 class PyConsole_EnhInterp;
77 class PyConsole_EnhEditor;
79 class CompletionCommand : public PyInterp_LockRequest
82 CompletionCommand( PyConsole_EnhInterp* theInterp,
84 const QString& startMatch,
85 PyConsole_EnhEditor* theListener,
90 /** List of separators identifying the last parsable token for completion */
91 static const std::vector<QString> SEPARATORS;
93 /** String to be passed to the dir() command */
95 /** Begining of the command (as typed by the user) */
97 /** was the completion command successful */
100 virtual void execute();
101 virtual QEvent* createEvent();
105 #endif /* PYCONSOLE_REQUEST_H_ */