2017-12-12 03:15:23 -05:00
|
|
|
/*
|
2020-05-10 21:20:00 -04:00
|
|
|
* Copyright (C) 2020 KeePassXC Team <team@keepassxc.org>
|
2018-10-31 23:27:38 -04:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2017-12-12 03:15:23 -05:00
|
|
|
|
2020-05-10 21:20:00 -04:00
|
|
|
#ifndef NATIVEMESSAGINGPROXY_H
|
|
|
|
#define NATIVEMESSAGINGPROXY_H
|
2017-12-12 03:15:23 -05:00
|
|
|
|
2020-05-10 21:20:00 -04:00
|
|
|
#include <QLocalSocket>
|
2017-12-12 03:15:23 -05:00
|
|
|
|
2020-05-10 21:20:00 -04:00
|
|
|
class QWinEventNotifier;
|
|
|
|
class QSocketNotifier;
|
2017-12-12 03:15:23 -05:00
|
|
|
|
2020-05-10 21:20:00 -04:00
|
|
|
class NativeMessagingProxy : public QObject
|
2017-12-12 03:15:23 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2020-05-10 21:20:00 -04:00
|
|
|
NativeMessagingProxy();
|
|
|
|
~NativeMessagingProxy() override = default;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void stdinMessage(QString msg);
|
2017-12-12 03:15:23 -05:00
|
|
|
|
|
|
|
public slots:
|
2020-05-10 21:20:00 -04:00
|
|
|
void transferSocketMessage();
|
|
|
|
void transferStdinMessage(const QString& msg);
|
|
|
|
void socketDisconnected();
|
2017-12-12 03:15:23 -05:00
|
|
|
|
2020-05-10 21:20:00 -04:00
|
|
|
private:
|
|
|
|
void setupStandardInput();
|
|
|
|
void setupLocalSocket();
|
2018-01-16 15:45:31 -05:00
|
|
|
|
2017-12-12 03:15:23 -05:00
|
|
|
private:
|
2020-05-10 21:20:00 -04:00
|
|
|
QScopedPointer<QLocalSocket> m_localSocket;
|
|
|
|
|
|
|
|
Q_DISABLE_COPY(NativeMessagingProxy)
|
2017-12-12 03:15:23 -05:00
|
|
|
};
|
|
|
|
|
2020-05-10 21:20:00 -04:00
|
|
|
#endif // NATIVEMESSAGINGPROXY_H
|