Eventviews

multiagendaview.h
1/*
2 SPDX-FileCopyrightText: 2007 Volker Krause <vkrause@kde.org>
3 SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
4 SPDX-FileContributor: Sergio Martins <sergio.martins@kdab.com>
5
6 SPDX-License-Identifier: GPL-2.0-or-later
7*/
8
9#pragma once
10
11#include "eventview.h"
12
13#include <QDateTime>
14
15#include <memory>
16
17namespace EventViews
18{
19class ConfigDialogInterface;
20class MultiAgendaViewPrivate;
21
22;
23
24/**
25 Shows one agenda for every resource side-by-side.
26*/
27class EVENTVIEWS_EXPORT MultiAgendaView : public EventView
28{
29 Q_OBJECT
30public:
31 class CalendarFactory
32 {
33 public:
35
36 explicit CalendarFactory() = default;
37 virtual ~CalendarFactory() = default;
38
39 virtual Akonadi::CollectionCalendar::Ptr calendarForCollection(const Akonadi::Collection &collection) = 0;
40 };
41
42 explicit MultiAgendaView(QWidget *parent = nullptr);
43 explicit MultiAgendaView(const CalendarFactory::Ptr &calendarFactory, QWidget *parent = nullptr);
44
45 ~MultiAgendaView() override;
46
47 void setModel(QAbstractItemModel *model) override;
48
49 [[nodiscard]] Akonadi::Item::List selectedIncidences() const override;
50 [[nodiscard]] KCalendarCore::DateList selectedIncidenceDates() const override;
51 [[nodiscard]] int currentDateCount() const override;
52 [[nodiscard]] int maxDatesHint() const;
53
54 [[nodiscard]] bool eventDurationHint(QDateTime &startDt, QDateTime &endDt, bool &allDay) const override;
55
56 void addCalendar(const Akonadi::CollectionCalendar::Ptr &calendar) override;
57 void removeCalendar(const Akonadi::CollectionCalendar::Ptr &calendar) override;
58
59 [[nodiscard]] bool hasConfigurationDialog() const override;
60
61 void setChanges(Changes changes) override;
62
63 [[nodiscard]] bool customColumnSetupUsed() const;
64 [[nodiscard]] int customNumberOfColumns() const;
65 [[nodiscard]] QStringList customColumnTitles() const;
66 [[nodiscard]] QList<KCheckableProxyModel *> collectionSelectionModels() const;
67
68 void setPreferences(const PrefsPtr &prefs) override;
69
70Q_SIGNALS:
71 void showNewEventPopupSignal();
72 void showIncidencePopupSignal(const Akonadi::CollectionCalendar::Ptr &calendar, const Akonadi::Item &, const QDate &);
73 void activeCalendarChanged(const Akonadi::CollectionCalendar::Ptr &calendar);
74
75public Q_SLOTS:
76
77 void customCollectionsChanged(ConfigDialogInterface *dlg);
78
79 void showDates(const QDate &start, const QDate &end, const QDate &preferredMonth = QDate()) override;
80 void showIncidences(const Akonadi::Item::List &incidenceList, const QDate &date) override;
81 void updateView() override;
82 void updateConfig() override;
83
84 void setIncidenceChanger(Akonadi::IncidenceChanger *changer) override;
85
86protected:
87 void resizeEvent(QResizeEvent *event) override;
88 void showEvent(QShowEvent *event) override;
89
90 void doRestoreConfig(const KConfigGroup &configGroup) override;
91 void doSaveConfig(KConfigGroup &configGroup) override;
92
93protected Q_SLOTS:
94 /**
95 * Reimplemented from KOrg::BaseView
96 */
97 void collectionSelectionChanged();
98
99private Q_SLOTS:
100 EVENTVIEWS_NO_EXPORT void slotSelectionChanged();
101 EVENTVIEWS_NO_EXPORT void slotClearTimeSpanSelection();
102 EVENTVIEWS_NO_EXPORT void resizeSplitters();
103 EVENTVIEWS_NO_EXPORT void setupScrollBar();
104 EVENTVIEWS_NO_EXPORT void zoomView(const int delta, QPoint pos, const Qt::Orientation ori);
105 EVENTVIEWS_NO_EXPORT void slotResizeScrollView();
106 EVENTVIEWS_NO_EXPORT void recreateViews();
107 EVENTVIEWS_NO_EXPORT void forceRecreateViews();
108
109private:
110 friend class MultiAgendaViewPrivate;
111 std::unique_ptr<MultiAgendaViewPrivate> const d;
112};
113}
EventView is the abstract base class from which all other calendar views for event data are derived.
Definition eventview.h:69
Shows one agenda for every resource side-by-side.
Q_SCRIPTABLE Q_NOREPLY void start()
Namespace EventViews provides facilities for displaying incidences, including events,...
Definition agenda.h:33
Orientation
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:11 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.