Debian Codegraph @

terminalpane.h

raw symbols SCIP
1 // File: terminalpane.h
2 /*
3 Pep8-1 is a virtual machine for writing machine language and assembly
4 language programs.
5
6 Copyright (C) 2009 J. Stanley Warford, Pepperdine University
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #ifndef TERMINALPANE_H
23 #define TERMINALPANE_H
24
25 #include <QWidget>
26 #include <QKeyEvent>
27
28 namespace Ui {
29 class TerminalPane;
30 }
31
32 class TerminalPane : public QWidget {
33 Q_OBJECT
34 Q_DISABLE_COPY(TerminalPane)
35 public:
36 explicit TerminalPane(QWidget *parent = 0);
37 virtual ~TerminalPane();
38
39 void appendOutput(QString str);
40 // Post: str is appended to the text edit
41
42 void waitingForInput();
43 // Post: Sets the writability of the text edit to true, and prevents previously entered text from being modified
44
45 void clearTerminal();
46 // Post: Clears the terminal
47
48 void highlightOnFocus();
49 // Post: Highlights the label based on the label window color saved in the UI file
50
51 bool hasFocus();
52 // Post: returns if the pane has focus
53
54 void copy();
55 // Post: selected text in the text edit is copied to the clipboard
56
57 public slots:
58 void onFontChanged(QFont font);
59
60 private:
61 Ui::TerminalPane *ui;
62
63 bool waiting;
64
65 QString strokeString;
66 QString retString;
67
68 void displayTerminal();
69
70 bool eventFilter(QObject *, QEvent *event);
71
72 private slots:
73 void mouseReleaseEvent(QMouseEvent *);
74
75 signals:
76 void undoAvailable(bool);
77 void redoAvailable(bool);
78 void inputReceived();
79
80 };
81
82 #endif // TERMINALPANE_H