1 /***************************************************************************
2 * Copyright (C) 2011-2013 by Patrick von Reth *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #ifndef SNORENOTIFICATIONBACKEND_H_
22 #define SNORENOTIFICATIONBACKEND_H_
24 #include "abstractnotificationbackend.h"
26 #include "settingspage.h"
28 #include "ui_snorentificationconfigwidget.h"
34 class SystrayNotificationBackend;
36 #include <snore/core/notification/notification.h>
38 class SnoreNotificationBackend : public AbstractNotificationBackend {
41 SnoreNotificationBackend (QObject *parent);
42 ~SnoreNotificationBackend();
44 void notify(const Notification &);
45 void close(uint notificationId);
47 virtual SettingsPage *createConfigWidget()const;
50 void activated(uint notificationId = 0);
53 void actionInvoked(Snore::Notification);
55 void backendChanged(const QVariant &);
56 void timeoutChanged(const QVariant &);
59 void setTraybackend();
60 bool setSnoreBackend(const QString &backend);
63 SystrayNotificationBackend * m_systrayBackend;
64 Snore::SnoreCore *m_snore;
65 QHash<uint, uint> m_notificationIds;
70 class SnoreNotificationBackend::ConfigWidget : public SettingsPage {
74 ConfigWidget(Snore::SnoreCore *snore, QWidget *parent = 0);
77 bool hasDefaults() const;
81 void backendChanged(const QString&);
82 void timeoutChanged(int);
85 Ui::SnoreNotificationConfigWidget ui;
86 Snore::SnoreCore *m_snore;
88 // QSpinBox *timeoutBox;