1 /* 2 * %kadu copyright begin% 3 * Copyright 2009, 2011 Piotr Galiszewski (piotr.galiszewski@kadu.im) 4 * Copyright 2012 Wojciech Treter (juzefwt@gmail.com) 5 * Copyright 2010, 2011 Bartosz Brachaczek (b.brachaczek@gmail.com) 6 * Copyright 2009, 2010, 2011, 2013, 2014 Rafał Przemysław Malinowski (rafal.przemyslaw.malinowski@gmail.com) 7 * %kadu copyright end% 8 * 9 * This program is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU General Public License as 11 * published by the Free Software Foundation; either version 2 of 12 * the License, or (at your option) any later version. 13 * 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with this program. If not, see <http://www.gnu.org/licenses/>. 21 */ 22 23 #ifndef NOTIFIER_H 24 #define NOTIFIER_H 25 26 #include "icons/kadu-icon.h" 27 #include "exports.h" 28 29 struct Notification; 30 class NotifierConfigurationWidget; 31 32 class QWidget; 33 34 /** 35 @class Notifier 36 @brief Klasa abstrakcyjna opisuj�ca notifikator. 37 38 Notifykatory zajmuj� si� wy�wietlaniem lub informowaniem w inny spos�b u�ytkownika o wyst�puj�cych 39 w programie zdarzeniach (nowa rozmowa, nowy transfer pliku, b��d...). 40 41 Notyfikatory mog� umo�liwia� u�ytkownikowi podj�cie akcji jak odebranie lub zignorownie rozmowy, 42 odebranie pliku, kontynuacje odbierania pliku i inne. Niekt�ry notifikatory nie b�d� 43 implementowa� akcji, dlatego te� niekt�re zdarzenia nie mog� by� przez nie obs�ugiwane. 44 **/ 45 class KADUAPI Notifier 46 { 47 QString Name; 48 QString Description; 49 KaduIcon Icon; 50 51 public: 52 Notifier(const QString &name, const QString &description, const KaduIcon &icon); 53 virtual ~Notifier(); 54 name()55 const QString & name() const { return Name; } description()56 const QString & description() const { return Description; } icon()57 const KaduIcon & icon() const { return Icon; } 58 59 /** 60 Metoda informuj�ca notifikator o nowym zdarzeniu. Zdarzenie mo�e wywo�a� 61 sygna� closed(), po kt�rym notyfikator musi przesta� informowa� u�ytkownika 62 o danym zdarzeniu (na przyk�ad, musi zamkn�� skojarzone ze zdarzeniem okno). 63 **/ 64 virtual void notify(const Notification ¬ification) = 0; 65 66 /** 67 Zwraca widget, jaki zostanie dodany do okna konfiguracyjnego 68 na prawo od odpowiedniego CheckBoxa. 69 Mo�e zwr�ci� zero. 70 **/ 71 virtual NotifierConfigurationWidget *createConfigurationWidget(QWidget *parent = nullptr) = 0; 72 73 }; 74 75 #endif // NOTIFEIR_H 76