File indexing completed on 2024-05-19 13:35:06
0001 /*************************************************************************** 0002 * Copyright © 2009 Harald Sitter <apachelogger@ubuntu.com> * 0003 * Copyright © 2009 Jonathan Thomas <echidnaman@kubuntu.org> * 0004 * * 0005 * This program is free software; you can redistribute it and/or * 0006 * modify it under the terms of the GNU General Public License as * 0007 * published by the Free Software Foundation; either version 2 of * 0008 * the License or (at your option) version 3 or any later version * 0009 * accepted by the membership of KDE e.V. (or its successor approved * 0010 * by the membership of KDE e.V.), which shall act as a proxy * 0011 * defined in Section 14 of version 3 of the license. * 0012 * * 0013 * This program is distributed in the hope that it will be useful, * 0014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0016 * GNU General Public License for more details. * 0017 * * 0018 * You should have received a copy of the GNU General Public License * 0019 * along with this program. If not, see <http://www.gnu.org/licenses/>. * 0020 ***************************************************************************/ 0021 0022 #ifndef EVENT_H 0023 #define EVENT_H 0024 0025 #include <QtCore/QObject> 0026 0027 // #include <KDebug> 0028 #include <KLocalizedString> 0029 0030 class KStatusNotifierItem; 0031 0032 #define NOTIFICATION_ICON_SIZE 32,32 0033 0034 class Event : public QObject 0035 { 0036 Q_OBJECT 0037 public: 0038 Event(QObject* parent, const QString &name); 0039 0040 virtual ~Event(); 0041 0042 public slots: 0043 bool isHidden() const; 0044 void show(const QString &icon, const QString &text, const QStringList &actions); 0045 void run(); 0046 void reloadConfig(); 0047 0048 private slots: 0049 bool readHiddenConfig(); 0050 void writeHiddenConfig(bool value); 0051 void readNotifyConfig(); 0052 void ignore(); 0053 void hide(); 0054 void notifyClosed(); 0055 0056 private: 0057 QString m_hiddenCfgString; 0058 const QString m_name; 0059 bool m_hidden; 0060 bool m_useKNotify; 0061 bool m_useTrayIcon; 0062 bool m_active; 0063 0064 KStatusNotifierItem *m_notifierItem; 0065 }; 0066 0067 #endif