1*4882a593Smuzhiyun /**************************************************************************** 2*4882a593Smuzhiyun ** 3*4882a593Smuzhiyun ** Copyright (C) 2012 Denis Shienkov <denis.shienkov@gmail.com> 4*4882a593Smuzhiyun ** Copyright (C) 2012 Laszlo Papp <lpapp@kde.org> 5*4882a593Smuzhiyun ** Contact: http://www.qt.io/licensing/ 6*4882a593Smuzhiyun ** 7*4882a593Smuzhiyun ** This file is part of the QtSerialPort module of the Qt Toolkit. 8*4882a593Smuzhiyun ** 9*4882a593Smuzhiyun ** $QT_BEGIN_LICENSE:LGPL21$ 10*4882a593Smuzhiyun ** Commercial License Usage 11*4882a593Smuzhiyun ** Licensees holding valid commercial Qt licenses may use this file in 12*4882a593Smuzhiyun ** accordance with the commercial license agreement provided with the 13*4882a593Smuzhiyun ** Software or, alternatively, in accordance with the terms contained in 14*4882a593Smuzhiyun ** a written agreement between you and The Qt Company. For licensing terms 15*4882a593Smuzhiyun ** and conditions see http://www.qt.io/terms-conditions. For further 16*4882a593Smuzhiyun ** information use the contact form at http://www.qt.io/contact-us. 17*4882a593Smuzhiyun ** 18*4882a593Smuzhiyun ** GNU Lesser General Public License Usage 19*4882a593Smuzhiyun ** Alternatively, this file may be used under the terms of the GNU Lesser 20*4882a593Smuzhiyun ** General Public License version 2.1 or version 3 as published by the Free 21*4882a593Smuzhiyun ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 22*4882a593Smuzhiyun ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 23*4882a593Smuzhiyun ** following information to ensure the GNU Lesser General Public License 24*4882a593Smuzhiyun ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 25*4882a593Smuzhiyun ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 26*4882a593Smuzhiyun ** 27*4882a593Smuzhiyun ** As a special exception, The Qt Company gives you certain additional 28*4882a593Smuzhiyun ** rights. These rights are described in The Qt Company LGPL Exception 29*4882a593Smuzhiyun ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 30*4882a593Smuzhiyun ** 31*4882a593Smuzhiyun ** $QT_END_LICENSE$ 32*4882a593Smuzhiyun ** 33*4882a593Smuzhiyun ****************************************************************************/ 34*4882a593Smuzhiyun 35*4882a593Smuzhiyun #ifndef CONSOLE_H 36*4882a593Smuzhiyun #define CONSOLE_H 37*4882a593Smuzhiyun 38*4882a593Smuzhiyun #include <QPlainTextEdit> 39*4882a593Smuzhiyun 40*4882a593Smuzhiyun class Console : public QPlainTextEdit 41*4882a593Smuzhiyun { 42*4882a593Smuzhiyun Q_OBJECT 43*4882a593Smuzhiyun 44*4882a593Smuzhiyun signals: 45*4882a593Smuzhiyun void getData(const QByteArray &data); 46*4882a593Smuzhiyun 47*4882a593Smuzhiyun public: 48*4882a593Smuzhiyun explicit Console(QWidget *parent = 0); 49*4882a593Smuzhiyun 50*4882a593Smuzhiyun void putData(const QByteArray &data); 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun void setLocalEchoEnabled(bool set); 53*4882a593Smuzhiyun 54*4882a593Smuzhiyun protected: 55*4882a593Smuzhiyun virtual void keyPressEvent(QKeyEvent *e); 56*4882a593Smuzhiyun virtual void mousePressEvent(QMouseEvent *e); 57*4882a593Smuzhiyun virtual void mouseDoubleClickEvent(QMouseEvent *e); 58*4882a593Smuzhiyun virtual void contextMenuEvent(QContextMenuEvent *e); 59*4882a593Smuzhiyun 60*4882a593Smuzhiyun private: 61*4882a593Smuzhiyun bool localEchoEnabled; 62*4882a593Smuzhiyun 63*4882a593Smuzhiyun }; 64*4882a593Smuzhiyun 65*4882a593Smuzhiyun #endif // CONSOLE_H 66