1 // Copyright (C) 2007-2015 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 "PyInterp_Request.h"
32 class PyInterp_Interp;
36 \brief Python command execution request.
39 class ExecCommand : public PyInterp_LockRequest
45 Creates new python command execution request.
46 \param theInterp python interpreter
47 \param theCommand python command
48 \param theListener widget to get the notification messages
49 \param sync if True the request is processed synchronously
51 ExecCommand( PyInterp_Interp* theInterp,
52 const QString& theCommand,
54 bool theSync = false );
58 \brief Execute the python command in the interpreter and
59 get its execution status.
61 virtual void execute();
64 \brief Create and return a notification event.
65 \return new notification event
67 virtual QEvent* createEvent();
70 QString myCommand; //!< Python command
71 int myState; //!< Python command execution status
74 class CompletionCommand : public PyInterp_LockRequest
77 CompletionCommand( PyInterp_Interp* theInterp,
78 const QString& theInput,
79 const QString& theStartMatch,
81 bool theSync = false );
85 /** List of separators identifying the last parsable token for completion */
86 static const std::vector<QString> SEPARATORS;
88 /** String to be passed to the dir() command */
90 /** Begining of the command (as typed by the user) */
92 /** was the completion command successful */
95 virtual void execute();
96 virtual QEvent* createEvent();
99 #endif /* PYCONSOLE_REQUEST_H_ */