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;
16 class PYCONSOLE_EXPORT PyConsole_Console : public QWidget//, public SUIT_PopupClient
21 //! Context popup menu actions flags
24 CopyId = 0x01, //!< "Copy" menu action
25 PasteId = 0x02, //!< "Paste" menu action
26 ClearId = 0x04, //!< "Clear" menu action
27 SelectAllId = 0x08, //!< "Select All" menu action
28 DumpCommandsId = 0x16, //!< "DumpCommands" menu action
29 All = CopyId | PasteId | ClearId | SelectAllId | DumpCommandsId //!< all menu actions
33 PyConsole_Console( QWidget* parent, PyConsole_Interp* interp = 0 );
34 virtual ~PyConsole_Console();
36 //! \brief Get python interperter
37 PyConsole_Interp* getInterp() { return myInterp; }
39 virtual void setFont( const QFont& );
42 void setIsSync( const bool );
44 bool isSuppressOutput() const;
45 void setIsSuppressOutput( const bool );
47 bool isShowBanner() const;
48 void setIsShowBanner( const bool );
50 void exec( const QString& );
51 void execAndWait( const QString& );
53 virtual bool eventFilter( QObject*, QEvent* );
55 //! \brief Get popup client symbolic name
56 virtual QString popupClientType() const { return QString( "PyConsole" ); }
57 virtual void contextMenuPopup( QMenu* );
59 void setMenuActions( const int );
60 int menuActions() const;
66 PyConsole_Console( QWidget* parent, PyConsole_Interp*, PyConsole_Editor*);
69 PyConsole_Interp* myInterp; //!< python interpreter
70 PyConsole_Editor* myEditor; //!< python console editor widget
71 QMap<int, QAction*> myActions; //!< menu actions list
75 * Enhance console object providing auto-completion.
76 * Similar to PyConsole_Console except that an enhanced interpreter and enhanced editor
80 class PYCONSOLE_EXPORT PyConsole_EnhConsole: public PyConsole_Console
85 PyConsole_EnhConsole( QWidget* parent, PyConsole_EnhInterp* interp = 0);
86 virtual ~PyConsole_EnhConsole() {}
89 #endif // PYCONSOLE_CONSOLE_H