| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qplatformsystemtrayicon.cpp |
| Source code | Switch to Preprocessed file |
| Line | Source | Count |
|---|---|---|
| 1 | /**************************************************************************** | - |
| 2 | ** | - |
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. | - |
| 4 | ** Copyright (C) 2012 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com> | - |
| 5 | ** Contact: https://www.qt.io/licensing/ | - |
| 6 | ** | - |
| 7 | ** This file is part of the QtGui module of the Qt Toolkit. | - |
| 8 | ** | - |
| 9 | ** $QT_BEGIN_LICENSE:LGPL$ | - |
| 10 | ** Commercial License Usage | - |
| 11 | ** Licensees holding valid commercial Qt licenses may use this file in | - |
| 12 | ** accordance with the commercial license agreement provided with the | - |
| 13 | ** Software or, alternatively, in accordance with the terms contained in | - |
| 14 | ** a written agreement between you and The Qt Company. For licensing terms | - |
| 15 | ** and conditions see https://www.qt.io/terms-conditions. For further | - |
| 16 | ** information use the contact form at https://www.qt.io/contact-us. | - |
| 17 | ** | - |
| 18 | ** GNU Lesser General Public License Usage | - |
| 19 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - |
| 20 | ** General Public License version 3 as published by the Free Software | - |
| 21 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - |
| 22 | ** packaging of this file. Please review the following information to | - |
| 23 | ** ensure the GNU Lesser General Public License version 3 requirements | - |
| 24 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - |
| 25 | ** | - |
| 26 | ** GNU General Public License Usage | - |
| 27 | ** Alternatively, this file may be used under the terms of the GNU | - |
| 28 | ** General Public License version 2.0 or (at your option) the GNU General | - |
| 29 | ** Public license version 3 or any later version approved by the KDE Free | - |
| 30 | ** Qt Foundation. The licenses are as published by the Free Software | - |
| 31 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - |
| 32 | ** included in the packaging of this file. Please review the following | - |
| 33 | ** information to ensure the GNU General Public License requirements will | - |
| 34 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - |
| 35 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - |
| 36 | ** | - |
| 37 | ** $QT_END_LICENSE$ | - |
| 38 | ** | - |
| 39 | ****************************************************************************/ | - |
| 40 | - | |
| 41 | #include "qplatformsystemtrayicon.h" | - |
| 42 | - | |
| 43 | #ifndef QT_NO_SYSTEMTRAYICON | - |
| 44 | - | |
| 45 | QT_BEGIN_NAMESPACE | - |
| 46 | - | |
| 47 | /*! | - |
| 48 | \class QPlatformSystemTrayIcon | - |
| 49 | \inmodule QtGui | - |
| 50 | \brief The QPlatformSystemTrayIcon class abstracts the system tray icon and interaction. | - |
| 51 | - | |
| 52 | \sa QSystemTrayIcon | - |
| 53 | */ | - |
| 54 | - | |
| 55 | /*! | - |
| 56 | \enum QPlatformSystemTrayIcon::MessageIcon | - |
| 57 | - | |
| 58 | This enum describes the icon that is shown when a balloon message is displayed. | - |
| 59 | - | |
| 60 | \value NoIcon No icon is shown. | - |
| 61 | \value Information An information icon is shown. | - |
| 62 | \value Warning A standard warning icon is shown. | - |
| 63 | \value Critical A critical warning icon is shown. | - |
| 64 | - | |
| 65 | \sa updateIcon(), showMessage(), QMessageBox | - |
| 66 | */ | - |
| 67 | - | |
| 68 | /*! | - |
| 69 | \enum QPlatformSystemTrayIcon::ActivationReason | - |
| 70 | - | |
| 71 | This enum describes the reason the system tray was activated. | - |
| 72 | - | |
| 73 | \value Unknown Unknown reason | - |
| 74 | \value Context The context menu for the system tray entry was requested | - |
| 75 | \value DoubleClick The system tray entry was double clicked | - |
| 76 | \value Trigger The system tray entry was clicked | - |
| 77 | \value MiddleClick The system tray entry was clicked with the middle mouse button | - |
| 78 | - | |
| 79 | \sa activated() | - |
| 80 | */ | - |
| 81 | - | |
| 82 | /*! | - |
| 83 | \internal | - |
| 84 | */ | - |
| 85 | QPlatformSystemTrayIcon::QPlatformSystemTrayIcon() | - |
| 86 | { | - |
| 87 | } | - |
| 88 | - | |
| 89 | /*! | - |
| 90 | \internal | - |
| 91 | */ | - |
| 92 | QPlatformSystemTrayIcon::~QPlatformSystemTrayIcon() | - |
| 93 | { | - |
| 94 | } | - |
| 95 | - | |
| 96 | /*! | - |
| 97 | \fn void QPlatformSystemTrayIcon::init() | - |
| 98 | This method is called to initialize the platform dependent implementation. | - |
| 99 | */ | - |
| 100 | - | |
| 101 | /*! | - |
| 102 | \fn void QPlatformSystemTrayIcon::cleanup() | - |
| 103 | This method is called to cleanup the platform dependent implementation. | - |
| 104 | */ | - |
| 105 | - | |
| 106 | /*! | - |
| 107 | \fn void QPlatformSystemTrayIcon::updateIcon(const QIcon &icon) | - |
| 108 | This method is called when the \a icon did change. | - |
| 109 | */ | - |
| 110 | - | |
| 111 | /*! | - |
| 112 | \fn void QPlatformSystemTrayIcon::updateToolTip(const QString &tooltip) | - |
| 113 | This method is called when the \a tooltip text did change. | - |
| 114 | */ | - |
| 115 | - | |
| 116 | /*! | - |
| 117 | \fn void QPlatformSystemTrayIcon::updateMenu(QPlatformMenu *menu) | - |
| 118 | This method is called when the system tray \a menu did change. | - |
| 119 | */ | - |
| 120 | - | |
| 121 | /*! | - |
| 122 | \fn QRect QPlatformSystemTrayIcon::geometry() const | - |
| 123 | This method returns the geometry of the platform dependent system tray icon on the screen. | - |
| 124 | */ | - |
| 125 | - | |
| 126 | /*! | - |
| 127 | \fn void QPlatformSystemTrayIcon::showMessage(const QString &title, const QString &msg, | - |
| 128 | const QIcon &icon, MessageIcon iconType, int msecs) | - |
| 129 | Shows a balloon message for the entry with the given \a title, message \a msg and \a icon for | - |
| 130 | the time specified in \a msecs. \a iconType is used as a hint for the implementing platform. | - |
| 131 | \sa QSystemTrayIcon::showMessage() | - |
| 132 | */ | - |
| 133 | - | |
| 134 | /*! | - |
| 135 | \fn bool QPlatformSystemTrayIcon::isSystemTrayAvailable() const | - |
| 136 | Returns \c true if the system tray is available on the platform. | - |
| 137 | */ | - |
| 138 | - | |
| 139 | /*! | - |
| 140 | \fn bool QPlatformSystemTrayIcon::supportsMessages() const | - |
| 141 | Returns \c true if the system tray supports messages on the platform. | - |
| 142 | */ | - |
| 143 | - | |
| 144 | /*! | - |
| 145 | \fn void QPlatformSystemTrayIcon::activated(QPlatformSystemTrayIcon::ActivationReason reason) | - |
| 146 | This signal is emitted when the user activates the system tray icon. | - |
| 147 | \a reason specifies the reason for activation. | - |
| 148 | \sa QSystemTrayIcon::ActivationReason | - |
| 149 | */ | - |
| 150 | - | |
| 151 | /*! | - |
| 152 | \fn void QPlatformSystemTrayIcon::messageClicked() | - |
| 153 | - | |
| 154 | This signal is emitted when the message displayed using showMessage() | - |
| 155 | was clicked by the user. | - |
| 156 | - | |
| 157 | \sa activated() | - |
| 158 | */ | - |
| 159 | - | |
| 160 | /*! | - |
| 161 | This method is called in case there is no QPlatformMenu available when | - |
| 162 | updating the menu. This allows the abstraction to provide a menu for the | - |
| 163 | system tray icon even if normally a non-native menu is used. | - |
| 164 | - | |
| 165 | The default implementation returns a null pointer. | - |
| 166 | - | |
| 167 | \sa updateMenu() | - |
| 168 | \since 5.3 | - |
| 169 | */ | - |
| 170 | - | |
| 171 | QPlatformMenu *QPlatformSystemTrayIcon::createMenu() const | - |
| 172 | { | - |
| 173 | return Q_NULLPTR; never executed: return nullptr; | 0 |
| 174 | } | - |
| 175 | - | |
| 176 | QT_END_NAMESPACE | - |
| 177 | - | |
| 178 | #include "moc_qplatformsystemtrayicon.cpp" | - |
| 179 | - | |
| 180 | #endif // QT_NO_SYSTEMTRAYICON | - |
| Source code | Switch to Preprocessed file |