| 1 | // File: assemblerlistingpane.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 ASSEMBLERLISTINGPANE_H |
| 23 | #define ASSEMBLERLISTINGPANE_H |
| 24 | |
| 25 | #include <QWidget> |
| 26 | #include "pephighlighter.h" |
| 27 | #include "enu.h" |
| 28 | |
| 29 | namespace Ui { |
| 30 | class AssemblerListingPane; |
| 31 | } |
| 32 | |
| 33 | class AssemblerListingPane : public QWidget { |
| 34 | Q_OBJECT |
| 35 | Q_DISABLE_COPY(AssemblerListingPane) |
| 36 | public: |
| 37 | explicit AssemblerListingPane(QWidget *parent = 0); |
| 38 | virtual ~AssemblerListingPane(); |
| 39 | void setAssemblerListing(QStringList assemblerListingList); |
| 40 | void clearAssemblerListing(); |
| 41 | |
| 42 | bool isModified(); |
| 43 | // Post: Returns true if the assembler listing pane has been modified |
| 44 | |
| 45 | QString toPlainText(); |
| 46 | // Post: Contents of the source code pane are returned |
| 47 | |
| 48 | void setCurrentFile(QString string); |
| 49 | // Post: Title bar of the window is set to "Assembler Listing - 'string'" |
| 50 | |
| 51 | void highlightOnFocus(); |
| 52 | // Post: Highlights the label based on the label window color saved in the UI file |
| 53 | |
| 54 | bool hasFocus(); |
| 55 | // Post: returns if the pane has focus |
| 56 | |
| 57 | void copy(); |
| 58 | // Copies selected text to the clipboard |
| 59 | |
| 60 | void setFocus(); |
| 61 | // Post: the text edit has focus |
| 62 | |
| 63 | bool isEmpty(); |
| 64 | // Post: returns if the assembler listing is empty |
| 65 | |
| 66 | public slots: |
| 67 | void onFontChanged(QFont font); |
| 68 | |
| 69 | private: |
| 70 | Ui::AssemblerListingPane *ui; |
| 71 | |
| 72 | PepHighlighter *pepHighlighter; |
| 73 | |
| 74 | void mouseReleaseEvent(QMouseEvent *); |
| 75 | |
| 76 | void mouseDoubleClickEvent(QMouseEvent *); |
| 77 | |
| 78 | signals: |
| 79 | |
| 80 | void labelDoubleClicked(Enu::EPane pane); |
| 81 | }; |
| 82 | |
| 83 | #endif // ASSEMBLERLISTINGPANE_H |