aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/x11vkbwrapper/vkbnativehost/sendertodbus.h
blob: cfd5f03a1f38c126a4dde24720fc9961a2043e68 (plain)
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
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef SENDERTODBUS_H
#define SENDERTODBUS_H

#include <QtCore/QObject>
#include <QtCore/QFile>
#include <QtDBus/QDBusInterface>

class SenderToDbus: public QObject
{
    Q_OBJECT

public:
    explicit SenderToDbus(QObject *parent = nullptr);

private:
    //!
    //! \brief forwardMessages
    //! reads stdin where Chromium sends messages
    //! and forwards them to dbus by setting value
    //!
    void forwardMessages();

    //!
    //! \brief quit
    //! sets singleShot of timer
    //! when the application is going to quit
    //!
    Q_NOREPLY void quit();

private:
    QFile m_qstdin;
    QDBusInterface *m_iface;
};

#endif // SENDERTODBUS_H