1 /* 2 * %kadu copyright begin% 3 * Copyright 2009, 2011 Piotr Galiszewski (piotr.galiszewski@kadu.im) 4 * Copyright 2009 Michał Podsiadlik (michal@kadu.net) 5 * Copyright 2014 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 #pragma once 24 25 #include "misc/memory.h" 26 #include "notification/notifier.h" 27 28 #include <QtCore/QPointer> 29 #include <QtWidgets/QWidget> 30 #include <injeqt/injeqt.h> 31 32 class IconsManager; 33 34 class QCheckBox; 35 36 class KADUAPI NotifyGroupBox : public QWidget 37 { 38 Q_OBJECT 39 40 public: 41 explicit NotifyGroupBox(Notifier *Notificator, const QString &caption, QWidget *parent = nullptr); 42 virtual ~NotifyGroupBox(); 43 notificator()44 Notifier * notificator() { return m_notificator; } 45 46 void setChecked(bool checked); 47 void addWidget(QWidget *widget); 48 49 signals: 50 void toggled(Notifier *notificator, bool toggled); 51 52 private: 53 QPointer<IconsManager> m_iconsManager; 54 55 owned_qptr<QCheckBox> m_notifierCheckBox; 56 Notifier *m_notificator; 57 58 private slots: 59 INJEQT_SET void setIconsManager(IconsManager *iconsManager); 60 INJEQT_INIT void init(); 61 62 void toggledSlot(bool toggled); 63 void iconThemeChanged(); 64 65 }; 66