Eventviews

journalframe.h
1/*
2 This file is part of KOrganizer.
3
4 SPDX-FileCopyrightText: 2001 Cornelius Schumacher <schumacher@kde.org>
5 SPDX-FileCopyrightText: 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 SPDX-FileCopyrightText: 2007 Mike McQuaid <mike@mikemcquaid.com>
7
8 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
9*/
10
11#pragma once
12
13#include <Akonadi/CollectionCalendar>
14#include <Akonadi/IncidenceChanger>
15#include <Akonadi/Item>
16
17#include <QDate>
18#include <QFrame>
19
20class QTextBrowser;
21class QPushButton;
22
23namespace EventViews
24{
25class JournalFrame : public QFrame
26{
28public:
29 using List = QList<JournalFrame *>;
30
31 JournalFrame(const Akonadi::Item &journal, const Akonadi::CollectionCalendar::Ptr &calendar, QWidget *parent);
32
33 ~JournalFrame() override;
34 bool eventFilter(QObject *, QEvent *) override;
35
36 void setJournal(const Akonadi::Item &journal);
37 [[nodiscard]] Akonadi::Item journal() const
38 {
39 return mJournal;
40 }
41
42 void setCalendar(const Akonadi::CollectionCalendar::Ptr &);
43 [[nodiscard]] QDate date() const
44 {
45 return mDate;
46 }
47
48 void clear();
49 void readJournal(const Akonadi::Item &journal);
50
51protected Q_SLOTS:
52 void setDirty();
53 void deleteItem();
54 void editItem();
55 void printJournal();
56 void printPreviewJournal();
57
58public Q_SLOTS:
59 void setIncidenceChanger(Akonadi::IncidenceChanger *changer)
60 {
61 mChanger = changer;
62 }
63
64 void setDate(QDate date);
65
67 void printJournal(const KCalendarCore::Journal::Ptr &, bool preview);
68 void deleteIncidence(const Akonadi::Item &);
69 void editIncidence(const Akonadi::Item &);
70 void incidenceSelected(const Akonadi::Item &, const QDate &);
71
72private:
73 Akonadi::Item mJournal;
75 QDate mDate;
76
77 QTextBrowser *mBrowser = nullptr;
78 QPushButton *mEditButton = nullptr;
79 QPushButton *mDeleteButton = nullptr;
80 QPushButton *mPrintButton = nullptr;
81 QPushButton *mPrintPreviewButton = nullptr;
82
83 bool mDirty;
84 bool mWriteInProgress;
85 Akonadi::IncidenceChanger *mChanger = nullptr;
86};
87
88class JournalDateView : public QWidget
89{
91public:
92 using List = QList<JournalDateView *>;
93
94 JournalDateView(const Akonadi::CollectionCalendar::Ptr &, QWidget *parent);
95 ~JournalDateView() override;
96
97 void addJournal(const Akonadi::Item &journal);
98 [[nodiscard]] Akonadi::Item::List journals() const;
99
100 void setDate(QDate date);
101 [[nodiscard]] QDate date() const
102 {
103 return mDate;
104 }
105
106 void clear();
107
109 void setIncidenceChangerSignal(Akonadi::IncidenceChanger *changer);
110 void setDateSignal(const QDate &);
111 void flushEntries();
112 void editIncidence(const Akonadi::Item &journal);
113 void deleteIncidence(const Akonadi::Item &journal);
114 void newJournal(const QDate &);
115 void incidenceSelected(const Akonadi::Item &, const QDate &);
116 void printJournal(const KCalendarCore::Journal::Ptr &, bool preview);
117
118public Q_SLOTS:
119 void emitNewJournal();
120 void setIncidenceChanger(Akonadi::IncidenceChanger *changer);
121 void journalEdited(const Akonadi::Item &);
122 void journalDeleted(const Akonadi::Item &);
123
124private:
126 QDate mDate;
128
129 Akonadi::IncidenceChanger *mChanger = nullptr;
130};
131}
Namespace EventViews provides facilities for displaying incidences, including events,...
Definition agenda.h:33
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
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.