Salome HOME
1e15c0fdddf2a2ff7adf6e820ed66a03cb925b0a
[modules/gui.git] / tools / PyConsole / src / python / PyConsolePy.sip
1 // Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File   : PyConsolePy.sip
23 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
24 //
25
26 %Module PyConsolePy
27
28 %Import QtCore/QtCoremod.sip
29 %Import QtGui/QtGuimod.sip
30 %If (Qt_5_0_0 -)
31 %Import QtWidgets/QtWidgetsmod.sip
32 %End
33
34 class PyConsole_Editor : QTextEdit
35
36 %TypeHeaderCode
37 #include <PyConsole_Editor.h>
38 %End
39
40 public:
41   explicit PyConsole_Editor( QWidget* /TransferThis/ = 0 );
42   virtual ~PyConsole_Editor();
43
44   virtual void   addText( const QString&, const bool = false, const bool = false );
45   bool           isCommand( const QString& ) const;
46
47   virtual void   exec( const QString& );
48   void           execAndWait( const QString& );
49
50   bool           isSync() const;
51   void           setIsSync( const bool );
52
53   bool           isSuppressOutput() const;
54   void           setIsSuppressOutput( const bool );
55
56   bool           isShowBanner() const;
57   void           setIsShowBanner( const bool );
58
59   void           setAutoCompletion( bool );
60   bool           autoCompletion() const;
61
62   bool           isLogging() const;
63
64   virtual QSize  sizeHint() const;
65
66   bool           startLog( const QString& );
67   bool           dump( const QString& );
68
69 signals:
70   void updateDoc( const QString& );
71
72 public slots:
73   void           cut();
74   void           paste();
75   void           clear();
76   void           dump();
77   void           startLog();
78   void           stopLog();
79
80 protected:
81   virtual void   dropEvent( QDropEvent* );
82   virtual void   mousePressEvent( QMouseEvent* );
83   virtual void   mouseReleaseEvent( QMouseEvent* );
84   virtual void   keyPressEvent ( QKeyEvent* );
85   virtual void   customEvent( QEvent* );
86   virtual void   insertFromMimeData( const QMimeData* );
87   void           putLog( const QString& );
88
89   virtual QString getDumpFileName();
90   virtual QString getLogFileName();
91
92 private:
93   PyConsole_Editor( const PyConsole_Editor& );
94   PyConsole_Editor& operator=( const PyConsole_Editor& );
95 };
96
97 class PyConsole_Console : QWidget
98
99 %TypeHeaderCode
100 #include <PyConsole_Console.h>
101 %End
102
103 public:
104   explicit PyConsole_Console( QWidget* /TransferThis/ = 0 );
105   virtual ~PyConsole_Console();
106
107   QFont               font() const;
108   virtual void        setFont( const QFont& );
109
110   bool                isSync() const;
111   void                setIsSync( const bool );
112
113   bool                isSuppressOutput() const;
114   void                setIsSuppressOutput( const bool );
115
116   bool                isShowBanner() const;
117   void                setIsShowBanner( const bool );
118
119   void                setAutoCompletion( bool );
120   bool                autoCompletion() const;
121
122   void                exec( const QString& );
123   void                execAndWait( const QString& );
124
125   void                setMenuActions( const int );
126   int                 menuActions() const;
127
128   void                startLog( const QString& );
129   void                stopLog();
130
131 protected:
132   virtual void        contextMenuEvent( QContextMenuEvent* );
133
134 private:
135   PyConsole_Console( const PyConsole_Console& );
136   PyConsole_Console& operator=( const PyConsole_Console& );
137 };