Applets
notification.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 * notification.h * 00003 * * 00004 * Copyright (C) 2008 Jason Stubbs <jasonbstubbs@gmail.com> * 00005 * * 00006 * This program is free software; you can redistribute it and/or modify * 00007 * it under the terms of the GNU General Public License as published by * 00008 * the Free Software Foundation; either version 2 of the License, or * 00009 * (at your option) any later version. * 00010 * * 00011 * This program is distributed in the hope that it will be useful, * 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00014 * GNU General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU General Public License * 00017 * along with this program; if not, write to the * 00018 * Free Software Foundation, Inc., * 00019 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 00020 ***************************************************************************/ 00021 00022 #ifndef SYSTEMTRAYNOTIFICATION_H 00023 #define SYSTEMTRAYNOTIFICATION_H 00024 00025 #include <QtCore/QHash> 00026 #include <QtCore/QObject> 00027 00028 #include <QtGui/QIcon> 00029 00030 00031 namespace SystemTray 00032 { 00033 00034 class Notification : public QObject 00035 { 00036 Q_OBJECT 00037 00038 public: 00039 Notification(QObject *parent = 0); 00040 virtual ~Notification(); 00041 00042 QString applicationName() const; 00043 QIcon applicationIcon() const; 00044 QString eventId() const; 00045 QString message() const; 00046 QString summary() const; 00047 int timeout() const; 00048 00049 QHash<QString, QString> actions() const; 00050 QStringList actionOrder() const; 00051 00052 public slots: 00053 virtual void triggerAction(const QString &actionId); 00054 00055 signals: 00056 void changed(SystemTray::Notification *notification = 0); 00057 00061 void destroyed(SystemTray::Notification *notification = 0); 00062 00063 protected: 00064 void setApplicationName(const QString &applicationName); 00065 void setApplicationIcon(const QIcon &applicationIcon); 00066 void setEventId(const QString &eventId); 00067 void setMessage(const QString &message); 00068 void setSummary(const QString &summary); 00069 void setTimeout(int timeout); 00070 00071 void setActions(const QHash<QString, QString> &actions); 00072 void setActionOrder(const QStringList &actionOrder); 00073 00074 private: 00075 class Private; 00076 Private* const d; 00077 }; 00078 00079 } 00080 00081 00082 #endif