File indexing completed on 2025-02-16 04:47:58
0001 /* 0002 SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net> 0003 SPDX-FileContributor: Kevin Krammer <krake@kdab.com> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #pragma once 0009 0010 #include "ui_mainwindow.h" 0011 0012 #include <Akonadi/CollectionCalendar> 0013 0014 #include <QList> 0015 #include <QMainWindow> 0016 0017 namespace Akonadi 0018 { 0019 class IncidenceChanger; 0020 class Collection; 0021 class EntityTeeModel; 0022 class Monitor; 0023 } 0024 0025 namespace EventViews 0026 { 0027 class EventView; 0028 class Prefs; 0029 typedef QSharedPointer<Prefs> PrefsPtr; 0030 } 0031 0032 class QAction; 0033 class Settings; 0034 0035 class MainWindow : public QMainWindow 0036 { 0037 Q_OBJECT 0038 public: 0039 explicit MainWindow(const QStringList &viewNames); 0040 0041 ~MainWindow(); 0042 0043 private Q_SLOTS: 0044 void collectionSelected(const Akonadi::Collection &col); 0045 void collectionDeselected(const Akonadi::Collection &col); 0046 0047 private: 0048 const QStringList mViewNames; 0049 0050 Ui_MainWindow mUi; 0051 0052 Akonadi::Monitor *mMonitor; 0053 Akonadi::EntityTreeModel *mEtm; 0054 Akonadi::IncidenceChanger *mIncidenceChanger = nullptr; 0055 Settings *mSettings = nullptr; 0056 EventViews::PrefsPtr *mViewPreferences = nullptr; 0057 QList<EventViews::EventView *> mEventViews; 0058 QList<Akonadi::CollectionCalendar::Ptr> mCalendars; 0059 0060 private: 0061 void addView(const QString &viewName); 0062 0063 private Q_SLOTS: 0064 void delayedInit(); 0065 void addViewTriggered(QAction *action); 0066 0067 private: 0068 };