Akonadi Calendar

calendarutils.h
1/*
2 SPDX-FileCopyrightText: 2009, 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
3 SPDX-FileContributor: Frank Osterfeld <osterfeld@kde.org>
4 SPDX-FileContributor: Andras Mantia <andras@kdab.com>
5 SPDX-FileCopyrightText: 2010-2012 SĂ©rgio Martins <iamsergio@gmail.com>
6 SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
7
8 SPDX-License-Identifier: LGPL-2.0-or-later
9*/
10
11#pragma once
12
13#include "akonadi-calendar_export.h"
14
15#include <Akonadi/Item>
16
17#include <KCalendarCore/Event>
18#include <KCalendarCore/Journal>
19#include <KCalendarCore/Todo>
20
21class QMimeData;
22
23namespace Akonadi
24{
25
26class Collection;
27class ETMCalendar;
28class EntityTreeModel;
29class Item;
30
31/** Utility methods for dealing with calendar content in Akonadi items.
32 * @since 5.20.42
33 */
34namespace CalendarUtils
35{
36/**
37 * Returns the incidence from an Akonadi item, or a null pointer if the item has no such payload.
38 */
39AKONADI_CALENDAR_EXPORT KCalendarCore::Incidence::Ptr incidence(const Akonadi::Item &item);
40
41/**
42 * Returns the event from an Akonadi item, or a null pointer if the item has no such payload.
43 */
44AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item);
45
46/**
47 * Returns the todo from an Akonadi item, or a null pointer if the item has no such payload.
48 */
49AKONADI_CALENDAR_EXPORT KCalendarCore::Todo::Ptr todo(const Akonadi::Item &item);
50
51/**
52 * Returns the journal from an Akonadi item, or a null pointer if the item has no such payload.
53 */
54AKONADI_CALENDAR_EXPORT KCalendarCore::Journal::Ptr journal(const Akonadi::Item &item);
55
56/**
57 * Returns a suitable display name for the calendar (or calendar folder) @p collection.
58 * This takes backend-specific special cases into account.
59 */
60[[nodiscard]] AKONADI_CALENDAR_EXPORT QString displayName(Akonadi::ETMCalendar *calendar, const Akonadi::Collection &collection);
61[[nodiscard]] AKONADI_CALENDAR_EXPORT QString displayName(const Akonadi::EntityTreeModel *model, const Akonadi::Collection &collection);
62[[nodiscard]] AKONADI_CALENDAR_EXPORT QString displayName(const Akonadi::Collection &collection);
63
64/**
65 * Creates a MIME data object for dragging Akonadi items containing calendar incidences.
66 * @since 5.23.41
67 */
68AKONADI_CALENDAR_EXPORT QMimeData *createMimeData(const Akonadi::Item::List &items);
69}
70
71}
A KCalendarCore::Calendar that uses an EntityTreeModel to populate itself.
Definition etmcalendar.h:41
AKONADI_CALENDAR_EXPORT KCalendarCore::Incidence::Ptr incidence(const Akonadi::Item &item)
Returns the incidence from an Akonadi item, or a null pointer if the item has no such payload.
AKONADI_CALENDAR_EXPORT KCalendarCore::Journal::Ptr journal(const Akonadi::Item &item)
Returns the journal from an Akonadi item, or a null pointer if the item has no such payload.
AKONADI_CALENDAR_EXPORT KCalendarCore::Todo::Ptr todo(const Akonadi::Item &item)
Returns the todo from an Akonadi item, or a null pointer if the item has no such payload.
AKONADI_CALENDAR_EXPORT QString displayName(Akonadi::ETMCalendar *calendar, const Akonadi::Collection &collection)
Returns a suitable display name for the calendar (or calendar folder) collection.
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
Returns the event from an Akonadi item, or a null pointer if the item has no such payload.
AKONADI_CALENDAR_EXPORT QMimeData * createMimeData(const Akonadi::Item::List &items)
Creates a MIME data object for dragging Akonadi items containing calendar incidences.
FreeBusyManager::Singleton.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 19 2024 11:52:11 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.