1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QWIDGETPLATFORMSYSTEMTRAYICON_P_H
5#define QWIDGETPLATFORMSYSTEMTRAYICON_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtGui/qpa/qplatformsystemtrayicon.h>
19#include <QtCore/private/qglobal_p.h>
20
21QT_REQUIRE_CONFIG(systemtrayicon);
22
23QT_BEGIN_NAMESPACE
24
25class QSystemTrayIcon;
26
27class QWidgetPlatformSystemTrayIcon : public QPlatformSystemTrayIcon
28{
29 Q_OBJECT
30
31public:
32 explicit QWidgetPlatformSystemTrayIcon(QObject *parent = nullptr);
33 ~QWidgetPlatformSystemTrayIcon();
34
35 void init() override;
36 void cleanup() override;
37 void updateIcon(const QIcon &icon) override;
38 void updateToolTip(const QString &tooltip) override;
39 void updateMenu(QPlatformMenu *menu) override;
40 QRect geometry() const override;
41 void showMessage(const QString &title, const QString &msg,
42 const QIcon &icon, MessageIcon iconType, int msecs) override;
43
44 bool isSystemTrayAvailable() const override;
45 bool supportsMessages() const override;
46
47 QPlatformMenu *createMenu() const override;
48
49private:
50 QScopedPointer<QSystemTrayIcon> m_systray;
51};
52
53QT_END_NAMESPACE
54
55#endif // QWIDGETPLATFORMSYSTEMTRAYICON_P_H
56

source code of qtdeclarative/src/labs/platform/widgets/qwidgetplatformsystemtrayicon_p.h