File indexing completed on 2024-05-12 17:10:47
0001 /*************************************************************************** 0002 * Copyright (C) 2011 by Dario Freddi <drf@kde.org> * 0003 * * 0004 * This program is free software; you can redistribute it and/or modify * 0005 * it under the terms of the GNU General Public License as published by * 0006 * the Free Software Foundation; either version 2 of the License, or * 0007 * (at your option) any later version. * 0008 * * 0009 * This program is distributed in the hope that it will be useful, * 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0012 * GNU General Public License for more details. * 0013 * * 0014 * You should have received a copy of the GNU General Public License * 0015 * along with this program; if not, write to the * 0016 * Free Software Foundation, Inc., * 0017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 0018 ***************************************************************************/ 0019 0020 0021 #ifndef ACTIVITYPAGE_H 0022 #define ACTIVITYPAGE_H 0023 0024 #include <KCModule> 0025 0026 #include <KActivities/Consumer> 0027 0028 class QTabWidget; 0029 0030 class KMessageWidget; 0031 0032 class ErrorOverlay; 0033 class ActivityWidget; 0034 0035 class ActivityPage : public KCModule 0036 { 0037 Q_OBJECT 0038 0039 public: 0040 ActivityPage(QWidget *parent, const QVariantList &args); 0041 ~ActivityPage() override; 0042 void fillUi(); 0043 0044 void load() override; 0045 void save() override; 0046 void defaults() override; 0047 0048 private Q_SLOTS: 0049 void onActivityServiceStatusChanged(KActivities::Consumer::ServiceStatus status); 0050 void onServiceRegistered(const QString &service); 0051 void onServiceUnregistered(const QString &service); 0052 0053 private: 0054 void populateTabs(); 0055 0056 QTabWidget *m_tabWidget = nullptr; 0057 0058 KActivities::Consumer *const m_activityConsumer; 0059 QList< ActivityWidget* > m_activityWidgets; 0060 ErrorOverlay *m_errorOverlay = nullptr; 0061 KMessageWidget *m_messageWidget = nullptr; 0062 KActivities::Consumer::ServiceStatus m_previousServiceStatus; 0063 }; 0064 0065 #endif // ACTIVITYPAGE_H