forked from CPP-Final-Project/Chat_Server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAsyncConsoleWin.h
More file actions
40 lines (32 loc) · 746 Bytes
/
AsyncConsoleWin.h
File metadata and controls
40 lines (32 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include <QCoreApplication>
#include <QObject>
#include <iostream>
#include <QTextStream>
#include <QDebug>
#include <QTimer>
#include <plog/Log.h>
#include "server.h"
#if defined (Q_OS_WIN)
# include <windows.h>
# include <QWinEventNotifier>
class AsyncConsoleWin : public QObject
{
Q_OBJECT
public:
AsyncConsoleWin(QObject *parent);
~AsyncConsoleWin() override = default;
signals:
void startServer();
void stopServer();
public slots:
void handleInput(HANDLE h);
void logMessage(enum Severity log_lvl, const QString& msg);
private :
void processInputText(const QString& input);
void processInputCommand(const QString& input);
HANDLE inputHandle;
QWinEventNotifier* notifier;
QString lineBuffer;
};
#endif