CalendarSupport

freebusycalendar.h
1/*
2 * SPDX-FileCopyrightText: 2014 Sandro Knauß <knauss@kolabsys.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
5 *
6 */
7
8#pragma once
9
10#include "calendarsupport_export.h"
11
12#include "freebusyitemmodel.h"
13
14#include <KCalendarCore/Calendar>
15#include <KCalendarCore/Event>
16
17#include <memory>
18
19namespace CalendarSupport
20{
21class FreeBusyCalendarPrivate;
22
23/// A FreeBusyCalendar exposes a FreeBusyItemModel as a KCalendarCore::Calendar::Ptr.
24class CALENDARSUPPORT_EXPORT FreeBusyCalendar : public QObject
25{
26 Q_OBJECT
27public:
28 /// Constructor
29 explicit FreeBusyCalendar(QObject *parent = nullptr);
30
31 ~FreeBusyCalendar() override;
32
33 /// Set the FreeBusyItemModel used by the FreeBusyCalendar.
34 void setModel(FreeBusyItemModel *model);
35
36 /// Get the FreeBusyItemModel used by the FreeBusyCalendar.
37 FreeBusyItemModel *model() const;
38
39 /// Get the calendar created from the FreeBusyItemModel.
40 KCalendarCore::Calendar::Ptr calendar() const;
41
42private:
43 CALENDARSUPPORT_NO_EXPORT void onRowsChanged(const QModelIndex &, const QModelIndex &);
44 CALENDARSUPPORT_NO_EXPORT void onRowsInserted(const QModelIndex &, int, int);
45 CALENDARSUPPORT_NO_EXPORT void onRowsRemoved(const QModelIndex &, int, int);
46 CALENDARSUPPORT_NO_EXPORT void onLayoutChanged();
47 CALENDARSUPPORT_NO_EXPORT void deleteAllEvents();
48
49 std::unique_ptr<FreeBusyCalendarPrivate> const d;
50};
51}
A FreeBusyCalendar exposes a FreeBusyItemModel as a KCalendarCore::Calendar::Ptr.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.