1// qsystemtrayicon.sip generated by MetaSIP 2// 3// This file is part of the QtWidgets Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23class QSystemTrayIcon : QObject 24{ 25%TypeHeaderCode 26#include <qsystemtrayicon.h> 27%End 28 29public: 30 enum ActivationReason 31 { 32 Unknown, 33 Context, 34 DoubleClick, 35 Trigger, 36 MiddleClick, 37 }; 38 39 enum MessageIcon 40 { 41 NoIcon, 42 Information, 43 Warning, 44 Critical, 45 }; 46 47 QSystemTrayIcon(QObject *parent /TransferThis/ = 0); 48 QSystemTrayIcon(const QIcon &icon, QObject *parent /TransferThis/ = 0); 49 virtual ~QSystemTrayIcon(); 50 void setContextMenu(QMenu *menu /KeepReference/); 51 QMenu *contextMenu() const; 52 QRect geometry() const; 53 QIcon icon() const; 54 void setIcon(const QIcon &icon); 55 QString toolTip() const; 56 void setToolTip(const QString &tip); 57 static bool isSystemTrayAvailable(); 58 static bool supportsMessages(); 59 60public slots: 61 void showMessage(const QString &title, const QString &msg, QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information, int msecs = 10000); 62%If (Qt_5_9_0 -) 63 void showMessage(const QString &title, const QString &msg, const QIcon &icon, int msecs = 10000); 64%End 65 66public: 67 bool isVisible() const; 68 69public slots: 70 void hide(); 71 void setVisible(bool visible); 72 void show(); 73 74signals: 75 void activated(QSystemTrayIcon::ActivationReason reason); 76 void messageClicked(); 77 78protected: 79 virtual bool event(QEvent *event); 80}; 81