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 <[email protected]>
5  SPDX-FileCopyrightText: 2004 Reinhold Kainhofer <[email protected]>
6  SPDX-FileCopyrightText: 2009-2010 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
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 <[email protected]>
16  @author Reinhold Kainhofer <[email protected]>
17  @author Allen Winter <[email protected]>
18 */
19 #pragma once
20 
21 #include "kcalutils_export.h"
22 
23 #include <KCalendarCore/ScheduleMessage>
24 #include <KCalendarCore/Todo>
25 
26 #include <QTimeZone>
27 
28 namespace KCalendarCore
29 {
30 class Exception;
31 }
32 
33 namespace KCalUtils
34 {
35 /**
36  @brief Provides methods to format Incidence properties in various ways for display purposes.
37 */
38 namespace Stringify
39 {
40 Q_REQUIRED_RESULT KCALUTILS_EXPORT QString incidenceType(KCalendarCore::Incidence::IncidenceType type);
41 
42 /**
43  Returns the incidence Secrecy as translated string.
44  @see incidenceSecrecyList().
45 */
46 Q_REQUIRED_RESULT 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 Q_REQUIRED_RESULT KCALUTILS_EXPORT QStringList incidenceSecrecyList();
53 
54 Q_REQUIRED_RESULT KCALUTILS_EXPORT QString incidenceStatus(KCalendarCore::Incidence::Status status);
55 Q_REQUIRED_RESULT KCALUTILS_EXPORT QString incidenceStatus(const KCalendarCore::Incidence::Ptr &incidence);
56 Q_REQUIRED_RESULT 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 Q_REQUIRED_RESULT KCALUTILS_EXPORT QString todoCompletedDateTime(const KCalendarCore::Todo::Ptr &todo, bool shortfmt = false);
64 
65 Q_REQUIRED_RESULT KCALUTILS_EXPORT QString attendeeRole(KCalendarCore::Attendee::Role role);
66 Q_REQUIRED_RESULT 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 Q_REQUIRED_RESULT KCALUTILS_EXPORT QString tzUTCOffsetStr(const QTimeZone &tz);
74 
75 /**
76  Build a translated message representing an exception
77 */
78 Q_REQUIRED_RESULT KCALUTILS_EXPORT QString errorMessage(const KCalendarCore::Exception &exception);
79 } // namespace Stringify
80 } // namespace KCalUtils
KCALUTILS_EXPORT QString incidenceSecrecy(KCalendarCore::Incidence::Secrecy secrecy)
Returns the incidence Secrecy as translated string.
Definition: stringify.cpp:57
KCALUTILS_EXPORT QString errorMessage(const KCalendarCore::Exception &exception)
Build a translated message representing an exception.
Definition: stringify.cpp:152
typedef Exception
Q_SCRIPTABLE CaptureState status()
KCALUTILS_EXPORT QStringList incidenceSecrecyList()
Returns a list of all available Secrecy types as a list of translated strings.
Definition: stringify.cpp:70
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...
Definition: stringify.cpp:245
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 6 2023 04:09:39 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.