Debian Codegraph @

inputpane.h

raw symbols SCIP
1 // File: inputpane.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 INPUTPANE_H
23 #define INPUTPANE_H
24
25 #include <QWidget>
26
27 namespace Ui {
28 class InputPane;
29 }
30
31 class InputPane : public QWidget {
32 Q_OBJECT
33 Q_DISABLE_COPY(InputPane)
34 public:
35 explicit InputPane(QWidget *parent = 0);
36 virtual ~InputPane();
37
38 QString toPlainText();
39 // Post: input text edit text is returned
40
41 void setText(QString input);
42 // Post: the input pane text edit text is set to string
43
44 void highlightOnFocus();
45 // Post: Highlights the label based on the label window color saved in the UI file
46
47 bool hasFocus();
48 // Post: returns if the pane has focus
49
50 void undo();
51 // Post: the last action in the text edit is undone
52
53 void redo();
54 // Post: the last undo in the text edit is redone
55
56 bool isUndoable();
57 // Returns the undoability of the text edit
58
59 bool isRedoable();
60 // Returns the redoability of the text edit
61
62 void cut();
63 // Post: selected text in the text edit is cut to the clipboard
64
65 void copy();
66 // Post: selected text in the text edit is copied to the clipboard
67
68 void paste();
69 // Post: selected text in the clipboard is pasted to the text edit
70
71 void setReadOnly(bool b);
72 // Post: the text edit's read only attribute is set to b
73
74 void tab();
75 // Post: a tab is inserted in the input pane if it is not read only
76
77 public slots:
78 void onFontChanged(QFont font);
79
80 private:
81 Ui::InputPane *ui;
82
83 void mouseReleaseEvent(QMouseEvent *);
84
85 signals:
86 void undoAvailable(bool);
87 void redoAvailable(bool);
88
89 };
90
91 #endif // INPUTPANE_H