2015-08-10 22:46:01 +02:00
|
|
|
#ifndef REPOINDEX_SERVER_H
|
|
|
|
#define REPOINDEX_SERVER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2017-01-22 20:47:14 +01:00
|
|
|
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QWebSocketServer)
|
2015-08-10 22:46:01 +02:00
|
|
|
|
2015-09-05 17:25:05 +02:00
|
|
|
namespace RepoIndex {
|
2015-08-10 22:46:01 +02:00
|
|
|
|
|
|
|
class Config;
|
|
|
|
class Manager;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-09-05 17:25:05 +02:00
|
|
|
namespace RepoIndex {
|
2015-08-10 22:46:01 +02:00
|
|
|
|
|
|
|
class Connection;
|
|
|
|
|
|
|
|
class Server : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-09-21 22:16:19 +02:00
|
|
|
Server(RepoIndex::Manager &alpmManager, const RepoIndex::Config &config, QObject *parent = nullptr);
|
2015-08-10 22:46:01 +02:00
|
|
|
~Server();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void closed();
|
|
|
|
void connectionEstablished(Connection *connection);
|
|
|
|
|
2020-03-08 14:12:22 +01:00
|
|
|
private Q_SLOTS:
|
2015-08-10 22:46:01 +02:00
|
|
|
void incomingConnection();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QWebSocketServer *m_server;
|
2015-09-21 22:16:19 +02:00
|
|
|
RepoIndex::Manager &m_alpmManager;
|
2015-08-10 22:46:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // SERVER_H
|