2 #ifndef PYCONSOLE_CONSOLE_H
3 #define PYCONSOLE_CONSOLE_H
7 //#include <SUIT_PopupClient.h>
11 class PyConsole_Interp;
12 class PyConsole_Editor;
13 class PyConsole_EnhInterp;
17 class PyConsole_Console : public QWidget//, public SUIT_PopupClient
22 //! Context popup menu actions flags
25 CopyId = 0x01, //!< "Copy" menu action
26 PasteId = 0x02, //!< "Paste" menu action
27 ClearId = 0x04, //!< "Clear" menu action
28 SelectAllId = 0x08, //!< "Select All" menu action
29 DumpCommandsId = 0x16, //!< "DumpCommands" menu action
30 All = CopyId | PasteId | ClearId | SelectAllId | DumpCommandsId //!< all menu actions
34 PyConsole_Console( QWidget* parent, PyConsole_Interp* interp = 0 );
35 virtual ~PyConsole_Console();
37 //! \brief Get python interperter
38 PyConsole_Interp* getInterp() { return myInterp; }
40 virtual void setFont( const QFont& );
43 void setIsSync( const bool );
45 bool isSuppressOutput() const;
46 void setIsSuppressOutput( const bool );
48 bool isShowBanner() const;
49 void setIsShowBanner( const bool );
51 void exec( const QString& );
52 void execAndWait( const QString& );
54 virtual bool eventFilter( QObject*, QEvent* );
56 //! \brief Get popup client symbolic name
57 virtual QString popupClientType() const { return QString( "PyConsole" ); }
58 virtual void contextMenuPopup( QMenu* );
60 void setMenuActions( const int );
61 int menuActions() const;
67 PyConsole_Console( QWidget* parent, PyConsole_Interp*, PyConsole_Editor*);
70 PyConsole_Interp* myInterp; //!< python interpreter
71 PyConsole_Editor* myEditor; //!< python console editor widget
72 QMap<int, QAction*> myActions; //!< menu actions list
76 * Enhance console object providing auto-completion.
77 * Similar to PyConsole_Console except that an enhanced interpreter and enhanced editor
81 class PyConsole_EnhConsole: public PyConsole_Console
86 PyConsole_EnhConsole( QWidget* parent, PyConsole_EnhInterp* interp = 0);
87 virtual ~PyConsole_EnhConsole() {}
90 #endif // PYCONSOLE_CONSOLE_H