Eventviews

whatsnextview.h
1/*
2 This file is part of KOrganizer.
3
4 SPDX-FileCopyrightText: 2001 Cornelius Schumacher <schumacher@kde.org>
5
6 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
7*/
8#pragma once
9
10#include "eventview.h"
11
12#include <Akonadi/IncidenceChanger>
13
14#include <KIconLoader>
15
16#include <QTextBrowser>
17#include <QUrl>
18
19namespace EventViews
20{
21class WhatsNextTextBrowser : public QTextBrowser
22{
24public:
25 explicit WhatsNextTextBrowser(QWidget *parent)
27 {
28 }
29
30 /** Reimplemented from QTextBrowser to handle links. */
31 void doSetSource(const QUrl &name, QTextDocument::ResourceType type = QTextDocument::UnknownResource) override;
32
34 void showIncidence(const QUrl &url);
35};
36
37/**
38 This class provides a view of the next events and todos
39*/
40class EVENTVIEWS_EXPORT WhatsNextView : public EventViews::EventView
41{
42 Q_OBJECT
43public:
44 explicit WhatsNextView(QWidget *parent = nullptr);
45 ~WhatsNextView() override;
46
47 [[nodiscard]] int currentDateCount() const override;
48 [[nodiscard]] Akonadi::Item::List selectedIncidences() const override
49 {
50 return {};
51 }
52
53 [[nodiscard]] KCalendarCore::DateList selectedIncidenceDates() const override
54 {
55 return {};
56 }
57
58 [[nodiscard]] bool supportsDateNavigation() const
59 {
60 return true;
61 }
62
63public Q_SLOTS:
64 void updateView() override;
65 void showDates(const QDate &start, const QDate &end, const QDate &preferredMonth) override;
66 void showIncidences(const Akonadi::Item::List &incidenceList, const QDate &date) override;
67
68 void changeIncidenceDisplay(const Akonadi::Item &, Akonadi::IncidenceChanger::ChangeType);
69
70protected:
71 void appendEvent(const Akonadi::CollectionCalendar::Ptr &,
73 const QDateTime &start = QDateTime(),
74 const QDateTime &end = QDateTime());
76
77private Q_SLOTS:
78 EVENTVIEWS_NO_EXPORT void showIncidence(const QUrl &);
79
80private:
81 EVENTVIEWS_NO_EXPORT void createTaskRow(KIconLoader *kil);
82 WhatsNextTextBrowser *const mView;
83 QString mText;
84 QDate mStartDate;
85 QDate mEndDate;
86
88};
89}
EventView is the abstract base class from which all other calendar views for event data are derived.
Definition eventview.h:69
This class provides a view of the next events and todos.
KCalendarCore::DateList selectedIncidenceDates() const override
Returns a list of the dates of selected events.
Akonadi::Item::List selectedIncidences() const override
Q_SCRIPTABLE Q_NOREPLY void start()
Namespace EventViews provides facilities for displaying incidences, including events,...
Definition agenda.h:33
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.