KCalUtils

incidenceformatter.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 */
19 #ifndef KCALUTILS_INCIDENCEFORMATTER_H
20 #define KCALUTILS_INCIDENCEFORMATTER_H
21 
22 #include "kcalutils_export.h"
23 
24 #include <KCalendarCore/Incidence>
25 #include <KCalendarCore/MemoryCalendar>
26 
27 #include <QDate>
28 class InvitationFormatterHelperPrivate;
29 
30 namespace KCalUtils {
34 class KCALUTILS_EXPORT InvitationFormatterHelper
35 {
36 public:
38  virtual ~InvitationFormatterHelper();
39  Q_REQUIRED_RESULT virtual QString generateLinkURL(const QString &id);
40  Q_REQUIRED_RESULT virtual QString makeLink(const QString &id, const QString &text);
41  Q_REQUIRED_RESULT virtual KCalendarCore::Calendar::Ptr calendar() const;
42 
43 private:
44  //@cond PRIVATE
45  Q_DISABLE_COPY(InvitationFormatterHelper)
46  InvitationFormatterHelperPrivate *const d;
47  //@endcond
48 };
49 
59 namespace IncidenceFormatter {
71 KCALUTILS_EXPORT QString toolTipStr(const QString &sourceName, const KCalendarCore::IncidenceBase::Ptr &incidence, QDate date = QDate(), bool richText = true);
72 
82 KCALUTILS_EXPORT QString extensiveDisplayStr(const KCalendarCore::Calendar::Ptr &calendar, const KCalendarCore::IncidenceBase::Ptr &incidence, QDate date = QDate());
83 
93 KCALUTILS_EXPORT QString extensiveDisplayStr(const QString &sourceName, const KCalendarCore::IncidenceBase::Ptr &incidence, QDate date = QDate());
94 
101 KCALUTILS_EXPORT QString mailBodyStr(const KCalendarCore::IncidenceBase::Ptr &incidence);
102 
114 KCALUTILS_EXPORT QString formatICalInvitation(
115  const QString &invitation, const KCalendarCore::MemoryCalendar::Ptr &calendar, InvitationFormatterHelper *helper);
116 
131 KCALUTILS_EXPORT QString formatICalInvitationNoHtml(
132  const QString &invitation, const KCalendarCore::MemoryCalendar::Ptr &calendar, InvitationFormatterHelper *helper, const QString &sender);
133 
139 KCALUTILS_EXPORT QString recurrenceString(const KCalendarCore::Incidence::Ptr &incidence);
140 
149 KCALUTILS_EXPORT QStringList reminderStringList(const KCalendarCore::Incidence::Ptr &incidence, bool shortfmt = true);
150 
157 KCALUTILS_EXPORT QString timeToString(const QTime &time, bool shortfmt = true);
158 
166 KCALUTILS_EXPORT QString dateToString(const QDate &date, bool shortfmt = true);
167 
168 KCALUTILS_EXPORT QString formatStartEnd(const QDateTime &start, const QDateTime &end, bool isAllDay);
169 
178 KCALUTILS_EXPORT QString dateTimeToString(const QDateTime &date, bool dateOnly = false, bool shortfmt = true);
179 
185 KCALUTILS_EXPORT QString resourceString(const KCalendarCore::Calendar::Ptr &calendar, const KCalendarCore::Incidence::Ptr &incidence);
186 
192 KCALUTILS_EXPORT QString durationString(const KCalendarCore::Incidence::Ptr &incidence);
193 
199 
203 KCALUTILS_EXPORT QString incidenceStatusStr(const KCalendarCore::Incidence::Ptr &incidence);
204 
205 class EventViewerVisitor;
206 template<typename T> class ScheduleMessageVisitor;
207 class InvitationHeaderVisitor;
208 class InvitationBodyVisitor;
209 class ToolTipVisitor;
210 class MailBodyVisitor;
211 }
212 }
213 
214 #endif
KCALUTILS_EXPORT QString formatICalInvitation(const QString &invitation, const KCalendarCore::MemoryCalendar::Ptr &calendar, InvitationFormatterHelper *helper)
Deliver an HTML formatted string displaying an invitation.
KCALUTILS_EXPORT QString incidenceStatusName(KCalendarCore::Incidence::Status status)
Returns the translated string form of a specified #Status.
KCALUTILS_EXPORT QString extensiveDisplayStr(const QString &sourceName, const KCalendarCore::IncidenceBase::Ptr &incidence, QDate date=QDate())
Create a RichText QString representation of an Incidence in a nice format suitable for using in a vie...
KCALUTILS_EXPORT QString recurrenceString(const KCalendarCore::Incidence::Ptr &incidence)
Build a pretty QString representation of an Incidence&#39;s recurrence info.
KCALUTILS_EXPORT QString timeToString(const QTime &time, bool shortfmt=true)
Build a QString time representation of a QTime object.
KCALUTILS_EXPORT QString dateTimeToString(const QDateTime &date, bool dateOnly=false, bool shortfmt=true)
Build a QString date/time representation of a QDateTime object.
KCALUTILS_EXPORT QString formatICalInvitationNoHtml(const QString &invitation, const KCalendarCore::MemoryCalendar::Ptr &calendar, InvitationFormatterHelper *helper, const QString &sender)
Deliver an HTML formatted string displaying an invitation.
The InvitationFormatterHelper class.
KCALUTILS_EXPORT QString durationString(const KCalendarCore::Incidence::Ptr &incidence)
Returns a duration string computed for the specified Incidence.
KCALUTILS_EXPORT QString resourceString(const KCalendarCore::Calendar::Ptr &calendar, const KCalendarCore::Incidence::Ptr &incidence)
Returns a Calendar Resource label name for the specified Incidence.
KCALUTILS_EXPORT QString mailBodyStr(const KCalendarCore::IncidenceBase::Ptr &incidence)
Create a QString representation of an Incidence in format suitable for including inside a mail messag...
KCALUTILS_EXPORT QString toolTipStr(const QString &sourceName, const KCalendarCore::IncidenceBase::Ptr &incidence, QDate date=QDate(), bool richText=true)
Create a QString representation of an Incidence in a nice format suitable for using in a tooltip...
KCALUTILS_EXPORT QString dateToString(const QDate &date, bool shortfmt=true)
Build a QString date representation of a QDate object.
KCALUTILS_EXPORT QStringList reminderStringList(const KCalendarCore::Incidence::Ptr &incidence, bool shortfmt=true)
Returns a reminder string computed for the specified Incidence.
KCALUTILS_EXPORT QString incidenceStatusStr(const KCalendarCore::Incidence::Ptr &incidence)
Returns a translatedstatus string for this incidence.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Aug 2 2020 23:11:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.