GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QWinTerminalImpl.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2011, 2013 Michael Goffioul.
4 
5 This file is part of QConsole.
6 
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program. If not,
19 see <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #ifndef __QConsole_h__
24 #define __QConsole_h__ 1
25 
26 #include <QWidget>
27 #include "QTerminal.h"
28 class QFocusEvent;
29 class QKeyEvent;
30 class QPainter;
31 class QPaintEvent;
32 class QResizeEvent;
33 class QWheelEvent;
34 class QPoint;
35 
36 class QConsolePrivate;
37 class QConsoleThread;
38 class QConsoleView;
39 
40 //////////////////////////////////////////////////////////////////////////////
41 
43 {
44  Q_OBJECT
45  friend class QConsolePrivate;
46  friend class QConsoleThread;
47  friend class QConsoleView;
48 
49 public:
50  QWinTerminalImpl (QWidget* parent = 0);
51  QWinTerminalImpl (const QString& cmd, QWidget* parent = 0);
52  ~QWinTerminalImpl (void);
53 
54  void setTerminalFont (const QFont& font);
55  void setSize (int columns, int lines);
56  void sendText (const QString& s);
57  void setCursorType (CursorType type, bool blinking);
58 
59  void setBackgroundColor (const QColor& color);
60  void setForegroundColor (const QColor& color);
61  void setSelectionColor (const QColor& color);
62  void setCursorColor (bool useForegoundColor, const QColor& color);
63 
64  QString selectedText ();
65 
66 public slots:
67  void copyClipboard (void);
68  void pasteClipboard (void);
69  void blinkCursorEvent (void);
70 
71 signals:
72  void terminated (void);
73  void titleChanged (const QString&);
74  void set_global_shortcuts_signal (bool);
75 
76 protected:
77  void viewPaintEvent (QConsoleView*, QPaintEvent*);
78  void setBlinkingCursor (bool blink);
79  void setBlinkingCursorState (bool blink);
80  void viewResizeEvent (QConsoleView*, QResizeEvent*);
81  void wheelEvent (QWheelEvent*);
82  void focusInEvent (QFocusEvent*);
83  void focusOutEvent (QFocusEvent*);
84  void keyPressEvent (QKeyEvent*);
85  virtual void start (void);
86  void mouseMoveEvent (QMouseEvent *event);
87  void mousePressEvent (QMouseEvent *event);
88  void mouseReleaseEvent (QMouseEvent *event);
89 
90  bool eventFilter(QObject *obj, QEvent *ev);
91 
92 private slots:
93  void scrollValueChanged (int value);
94  void monitorConsole (void);
95  void updateSelection (void);
96 
97 private:
99 };
100 
101 //////////////////////////////////////////////////////////////////////////////
102 
103 #endif // __QConsole_h__