Salome HOME
Copyright update 2022
[modules/gui.git] / tools / PyConsole / src / PyConsole_Request.h
1 // Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // File   : PyConsole_Request.h
20 // Author : Vadim SANDLER (OPEN CASCADE), Adrien Bruneton (CEA/DEN)
21
22 #ifndef PYCONSOLE_REQUEST_H
23 #define PYCONSOLE_REQUEST_H
24
25 #include "PyInterp_Request.h"
26
27 #include <QString>
28 #include <QStringList>
29
30 class QEvent;
31 class PyInterp_Interp;
32
33 class PyConsole_ExecCommand : public PyInterp_LockRequest
34 {
35 public:
36   PyConsole_ExecCommand( PyInterp_Interp*, const QString&, QObject*, bool = false );
37
38 protected:
39   virtual void execute();
40   virtual QEvent* createEvent();
41
42 private:
43   QString myCommand;   //!< Python command
44   int     myState;     //!< Python command execution status
45 };
46
47 class PyConsole_CompletionCommand : public PyInterp_LockRequest
48 {
49 public:
50   PyConsole_CompletionCommand( PyInterp_Interp*, const QString&, const QString&, QObject*, bool = false );
51
52 protected:
53   virtual void execute();
54   virtual QEvent* createEvent();
55
56 private:
57   QString     myDirArg;       //!< String to be passed to the dir() comman
58   QString     myStartMatch;   //!< Begining of the command (as typed by the user)
59   bool        myStatus;       //!< Status of completion command execution
60   QStringList myMatches;      //!< Matches
61   QString     myDoc;          //!< Docstring of single match
62 };
63
64 #endif // PYCONSOLE_REQUEST_H