KCalUtils

stringify.h
Go to the documentation of this file.
1/*
2 This file is part of the kcalutils library.
3
4 SPDX-FileCopyrightText: 2001-2003 Cornelius Schumacher <schumacher@kde.org>
5 SPDX-FileCopyrightText: 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 SPDX-FileCopyrightText: 2009-2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
7
8 SPDX-License-Identifier: LGPL-2.0-or-later
9*/
10/**
11 @file
12 This file is part of the API for handling calendar data and provides
13 static functions for formatting Incidence properties for various purposes.
14
15 @author Cornelius Schumacher <schumacher@kde.org>
16 @author Reinhold Kainhofer <reinhold@kainhofer.com>
17 @author Allen Winter <allen@kdab.com>
18*/
19#pragma once
20
21#include "kcalutils_export.h"
22
23#include <KCalendarCore/ScheduleMessage>
24#include <KCalendarCore/Todo>
25
26#include <QTimeZone>
27
28namespace KCalendarCore
29{
30class Exception;
31}
32
33namespace KCalUtils
34{
35/**
36 @brief Provides methods to format Incidence properties in various ways for display purposes.
37*/
38namespace Stringify
39{
40[[nodiscard]] KCALUTILS_EXPORT QString incidenceType(KCalendarCore::Incidence::IncidenceType type);
41
42/**
43 Returns the incidence Secrecy as translated string.
44 @see incidenceSecrecyList().
45*/
46[[nodiscard]] KCALUTILS_EXPORT QString incidenceSecrecy(KCalendarCore::Incidence::Secrecy secrecy);
47
48/**
49 Returns a list of all available Secrecy types as a list of translated strings.
50 @see incidenceSecrecy().
51*/
52[[nodiscard]] KCALUTILS_EXPORT QStringList incidenceSecrecyList();
53
54[[nodiscard]] KCALUTILS_EXPORT QString incidenceStatus(KCalendarCore::Incidence::Status status);
55[[nodiscard]] KCALUTILS_EXPORT QString incidenceStatus(const KCalendarCore::Incidence::Ptr &incidence);
56[[nodiscard]] KCALUTILS_EXPORT QString scheduleMessageStatus(KCalendarCore::ScheduleMessage::Status status);
57
58/**
59 Returns string containing the date/time when the to-do was completed,
60 formatted according to the user's locale settings.
61 @param shortfmt If true, use a short date format; else use a long format.
62*/
63[[nodiscard]] KCALUTILS_EXPORT QString todoCompletedDateTime(const KCalendarCore::Todo::Ptr &todo, bool shortfmt = false);
64
65[[nodiscard]] KCALUTILS_EXPORT QString attendeeRole(KCalendarCore::Attendee::Role role);
66[[nodiscard]] KCALUTILS_EXPORT QString attendeeStatus(KCalendarCore::Attendee::PartStat status);
67
68/**
69 Returns a string containing the UTC offset of the specified QTimeZone @p tz (relative to the current date).
70 The format is [+-]HH::MM, according to standards.
71 @since 5.8
72*/
73[[nodiscard]] KCALUTILS_EXPORT QString tzUTCOffsetStr(const QTimeZone &tz);
74
75/**
76 Build a translated message representing an exception
77*/
78[[nodiscard]] KCALUTILS_EXPORT QString errorMessage(const KCalendarCore::Exception &exception);
79} // namespace Stringify
80} // namespace KCalUtils
Q_SCRIPTABLE CaptureState status()
KCALUTILS_EXPORT QString errorMessage(const KCalendarCore::Exception &exception)
Build a translated message representing an exception.
KCALUTILS_EXPORT QString todoCompletedDateTime(const KCalendarCore::Todo::Ptr &todo, bool shortfmt=false)
Returns string containing the date/time when the to-do was completed, formatted according to the user...
Definition stringify.cpp:52
KCALUTILS_EXPORT QString tzUTCOffsetStr(const QTimeZone &tz)
Returns a string containing the UTC offset of the specified QTimeZone tz (relative to the current dat...
KCALUTILS_EXPORT QString incidenceSecrecy(KCalendarCore::Incidence::Secrecy secrecy)
Returns the incidence Secrecy as translated string.
Definition stringify.cpp:57
KCALUTILS_EXPORT QStringList incidenceSecrecyList()
Returns a list of all available Secrecy types as a list of translated strings.
Definition stringify.cpp:70
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:09:16 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.