Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
DaemonIpcServer.h
Go to the documentation of this file.
1/*
2 * Deskflow -- mouse and keyboard sharing utility
3 * SPDX-FileCopyrightText: (C) 2025 Symless Ltd.
4 * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
5 */
6
7#pragma once
8
9#include <QObject>
10#include <QSet>
11
12class QLocalServer;
13class QLocalSocket;
14
15namespace deskflow::core::ipc {
16
17class DaemonIpcServer : public QObject
18{
19 Q_OBJECT
20
21public:
22 explicit DaemonIpcServer(QObject *parent, const QString &logFilename);
23 ~DaemonIpcServer() override;
24
25 void listen();
26
27Q_SIGNALS:
28 void logLevelChanged(const QString &logLevel);
29 void elevateModeChanged(bool elevate);
30 void commandChanged(const QString &command);
34
35private:
36 void processMessage(QLocalSocket *clientSocket, const QString &message);
37 void processLogLevel(QLocalSocket *&clientSocket, const QStringList &messageParts);
38 void processElevate(QLocalSocket *&clientSocket, const QStringList &messageParts);
39 void processCommand(QLocalSocket *&clientSocket, const QStringList &messageParts);
40
41private Q_SLOTS:
42 void handleNewConnection();
43 void handleReadyRead();
44 void handleDisconnected();
45 void handleErrorOccurred();
46
47private:
48 const QString m_logFilename;
49 QLocalServer *m_server;
50 QSet<QLocalSocket *> m_clients;
51};
52
53} // namespace deskflow::core::ipc
void logLevelChanged(const QString &logLevel)
void listen()
Definition DaemonIpcServer.cpp:33
DaemonIpcServer(QObject *parent, const QString &logFilename)
Definition DaemonIpcServer.cpp:20
void commandChanged(const QString &command)
~DaemonIpcServer() override
Definition DaemonIpcServer.cpp:28
Definition DaemonApp.h:22