| 1 | /**************************************************************************** |
| 2 | ** SASM - simple IDE for assembler development |
| 3 | ** Copyright (C) 2013 Dmitriy Manushin |
| 4 | ** Contact: site: http://dman95.github.io/SASM/ |
| 5 | ** e-mail: [email protected] |
| 6 | ** |
| 7 | ** This file is part of SASM. |
| 8 | ** |
| 9 | ** SASM is free software: you can redistribute it and/or modify |
| 10 | ** it under the terms of the GNU General Public License as published by |
| 11 | ** the Free Software Foundation, either version 3 of the License, or |
| 12 | ** (at your option) any later version. |
| 13 | ** |
| 14 | ** SASM is distributed in the hope that it will be useful, |
| 15 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | ** GNU General Public License for more details. |
| 18 | ** |
| 19 | ** You should have received a copy of the GNU General Public License |
| 20 | ** along with SASM. If not, see <http://www.gnu.org/licenses/>. |
| 21 | ** |
| 22 | ** Этот файл — часть SASM. |
| 23 | ** |
| 24 | ** SASM - свободная программа: вы можете перераспространять ее и/или |
| 25 | ** изменять ее на условиях Стандартной общественной лицензии GNU в том виде, |
| 26 | ** в каком она была опубликована Фондом свободного программного обеспечения; |
| 27 | ** либо версии 3 лицензии, либо (по вашему выбору) любой более поздней |
| 28 | ** версии. |
| 29 | ** |
| 30 | ** SASM распространяется в надежде, что она будет полезной, |
| 31 | ** но БЕЗО ВСЯКИХ ГАРАНТИЙ; даже без неявной гарантии ТОВАРНОГО ВИДА |
| 32 | ** или ПРИГОДНОСТИ ДЛЯ ОПРЕДЕЛЕННЫХ ЦЕЛЕЙ. Подробнее см. в Стандартной |
| 33 | ** общественной лицензии GNU. |
| 34 | ** |
| 35 | ** Вы должны были получить копию Стандартной общественной лицензии GNU |
| 36 | ** вместе с этой программой. Если это не так, см. |
| 37 | ** <http://www.gnu.org/licenses/>.) |
| 38 | ** |
| 39 | ****************************************************************************/ |
| 40 | |
| 41 | #ifndef DEBUGANYCOMMANDWIDGET_H |
| 42 | #define DEBUGANYCOMMANDWIDGET_H |
| 43 | |
| 44 | #include <QWidget> |
| 45 | #include <QLabel> |
| 46 | #include <QLineEdit> |
| 47 | #include <QPushButton> |
| 48 | #include <QHBoxLayout> |
| 49 | #include <QKeyEvent> |
| 50 | #include <QCheckBox> |
| 51 | |
| 52 | /** |
| 53 | * @file debuganycommandwidget.h |
| 54 | * |
| 55 | * File for the GDB arbitrary command widget. |
| 56 | */ |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | /*! \brief This class represents the GDB arbitrary command widget. |
| 62 | */ |
| 63 | |
| 64 | class DebugAnyCommandWidget : public QWidget |
| 65 | { |
| 66 | Q_OBJECT |
| 67 | public: |
| 68 | explicit DebugAnyCommandWidget(QWidget *parent = 0); |
| 69 | ~DebugAnyCommandWidget(); |
| 70 | void setFocusOnLineEdit(); |
| 71 | void showPreviousCommand(); |
| 72 | void showNextCommand(); |
| 73 | int height(); |
| 74 | |
| 75 | signals: |
| 76 | void performCommand(const QString command, bool print); |
| 77 | |
| 78 | public slots: |
| 79 | void processCommand(); |
| 80 | |
| 81 | protected: |
| 82 | void keyPressEvent(QKeyEvent *event); |
| 83 | |
| 84 | private: |
| 85 | QLabel *anyCommandLabel; |
| 86 | QLineEdit *command; |
| 87 | QPushButton *performButton; |
| 88 | QHBoxLayout *layout; |
| 89 | QCheckBox *printCheckBox; |
| 90 | QStringList commands; |
| 91 | int currentCommandPos; |
| 92 | }; |
| 93 | |
| 94 | #endif // DEBUGANYCOMMANDWIDGET_H |