serverconsole.h
1 //------------------------------------------------------------------------------
2 // serverconsole.h
3 //------------------------------------------------------------------------------
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 // 02110-1301 USA
19 //
20 //------------------------------------------------------------------------------
21 // Copyright (C) 2009 Braden "Blzut3" Obrzut <admin@maniacsvault.net>
22 //------------------------------------------------------------------------------
23 #ifndef SERVERCONSOLE_H
24 #define SERVERCONSOLE_H
25 
26 #include "dptr.h"
27 
28 #include <QWidget>
29 
30 class ServerConsole : public QWidget
31 {
32  Q_OBJECT
33  Q_DISABLE_COPY(ServerConsole)
34 
35 public:
36  ServerConsole(QWidget *parent = nullptr, Qt::WindowFlags f = {});
37  ~ServerConsole() override;
38 
42  void setFocus();
43 
44 public slots:
45  void appendMessage(const QString &message);
46 
47 signals:
48  void messageSent(const QString &message);
49 
50 private:
52 
53 private slots:
54  void flushBuffer();
55  void forwardMessage();
56 };
57 
58 #endif // SERVERCONSOLE_H