andre@871: #ifndef TRAYICON_H andre@871: #define TRAYICON_H andre@871: /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik andre@871: * Software engineering by Intevation GmbH andre@871: * andre@871: * This file is Free Software under the GNU GPL (v>=2) andre@871: * and comes with ABSOLUTELY NO WARRANTY! andre@871: * See LICENSE.txt for details. andre@871: */ andre@871: andre@871: #include andre@871: #include andre@871: andre@871: andre@1255: class QMessageBox; andre@1255: andre@1255: /**@brief User notification interface andre@871: * andre@871: * This class provides an inherited implmentation of QSystemTrayIcon andre@871: * to be more flexible on platforms where no SystemTray is available. andre@871: * andre@871: * This class should become obsolete once Qt improves the support for andre@871: * StatusNotifier icons that are used in Plasma 5 and Unity. andre@871: */ andre@871: class TrayIcon : public QSystemTrayIcon andre@871: { andre@871: Q_OBJECT andre@871: public: andre@871: TrayIcon (QObject *parent); andre@871: andre@871: void show(); andre@871: bool isAlternative() {return useAlt;} andre@871: andre@871: public Q_SLOTS: andre@871: void showMessage(const QString &title, const QString &msg, andre@1144: QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information, int msecs = 10000, andre@1144: const QString &okBtnText = QString()); andre@969: private Q_SLOTS: andre@969: void messageDestroyed(); andre@969: andre@871: private: andre@871: bool useAlt; andre@969: QMessageBox *mMessageBox; andre@871: }; andre@871: andre@871: #endif // TRAYICON_H