Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qcocoasystemtrayicon.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// Copyright (C) 2012 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QCOCOASYSTEMTRAYICON_P_H
6#define QCOCOASYSTEMTRAYICON_P_H
7
8#include <QtCore/qglobal.h>
9#include <QtGui/qtguiglobal.h>
10
11#if QT_CONFIG(systemtrayicon)
12
13#include <QtCore/qstring.h>
14#include <QtCore/private/qcore_mac_p.h>
15
16#include <QtGui/qpa/qplatformsystemtrayicon.h>
17
18#include "qcocoamenu.h"
19
20QT_FORWARD_DECLARE_CLASS(QCocoaSystemTrayIcon);
21
22QT_DECLARE_NAMESPACED_OBJC_INTERFACE(QStatusItemDelegate, NSObject <NSUserNotificationCenterDelegate>
23- (instancetype)initWithSysTray:(QCocoaSystemTrayIcon *)platformSystemTray;
24@property (nonatomic, assign) QCocoaSystemTrayIcon *platformSystemTray;
25)
26
28
30
31class Q_GUI_EXPORT QCocoaSystemTrayIcon : public QPlatformSystemTrayIcon
32{
33public:
34 QCocoaSystemTrayIcon() {}
35
36 void init() override;
37 void cleanup() override;
38 void updateIcon(const QIcon &icon) override;
39 void updateToolTip(const QString &toolTip) override;
40 void updateMenu(QPlatformMenu *menu) override;
41 QRect geometry() const override;
42 void showMessage(const QString &title, const QString &msg,
43 const QIcon& icon, MessageIcon iconType, int msecs) override;
44
45 bool isSystemTrayAvailable() const override;
46 bool supportsMessages() const override;
47
48 void emitActivated();
49
50private:
51 NSStatusItem *m_statusItem = nullptr;
53};
54
56
57#endif // QT_NO_SYSTEMTRAYICON
58
59#endif // QCOCOASYSTEMTRAYICON_P_H
DarwinBluetooth::DeviceInquiryDelegate * m_delegate
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
\inmodule QtCore\reentrant
Definition qrect.h:30
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
QT_FORWARD_DECLARE_CLASS(QCocoaMenuItem)
#define QT_DECLARE_NAMESPACED_OBJC_INTERFACE(classname, definition)
Definition qcore_mac_p.h:70
#define Q_FORWARD_DECLARE_OBJC_CLASS(classname)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
QString title
[35]
QMenu menu
[5]
splash showMessage("Loaded modules")