KCalUtils

incidenceformatter.h
Go to the documentation of this file.
1 /*
2  This file is part of the kcalutils library.
3 
4  Copyright (c) 2001-2003 Cornelius Schumacher <[email protected]>
5  Copyright (c) 2004 Reinhold Kainhofer <[email protected]>
6  Copyright (c) 2009-2010 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public
10  License as published by the Free Software Foundation; either
11  version 2 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU Library General Public License
19  along with this library; see the file COPYING.LIB. If not, write to
20  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  Boston, MA 02110-1301, USA.
22 */
32 #ifndef KCALUTILS_INCIDENCEFORMATTER_H
33 #define KCALUTILS_INCIDENCEFORMATTER_H
34 
35 #include "kcalutils_export.h"
36 
37 #include <KCalendarCore/Incidence>
38 #include <KCalendarCore/MemoryCalendar>
39 
40 #include <QDate>
41 class InvitationFormatterHelperPrivate;
42 
43 namespace KCalUtils {
47 class KCALUTILS_EXPORT InvitationFormatterHelper
48 {
49 public:
51  virtual ~InvitationFormatterHelper();
52  Q_REQUIRED_RESULT virtual QString generateLinkURL(const QString &id);
53  Q_REQUIRED_RESULT virtual QString makeLink(const QString &id, const QString &text);
54  Q_REQUIRED_RESULT virtual KCalendarCore::Calendar::Ptr calendar() const;
55 
56 private:
57  //@cond PRIVATE
58  Q_DISABLE_COPY(InvitationFormatterHelper)
59  InvitationFormatterHelperPrivate *const d;
60  //@endcond
61 };
62 
72 namespace IncidenceFormatter {
84 KCALUTILS_EXPORT QString toolTipStr(const QString &sourceName, const KCalendarCore::IncidenceBase::Ptr &incidence, QDate date = QDate(), bool richText = true);
85 
95 KCALUTILS_EXPORT QString extensiveDisplayStr(const KCalendarCore::Calendar::Ptr &calendar, const KCalendarCore::IncidenceBase::Ptr &incidence, QDate date = QDate());
96 
106 KCALUTILS_EXPORT QString extensiveDisplayStr(const QString &sourceName, const KCalendarCore::IncidenceBase::Ptr &incidence, QDate date = QDate());
107 
114 KCALUTILS_EXPORT QString mailBodyStr(const KCalendarCore::IncidenceBase::Ptr &incidence);
115 
127 KCALUTILS_EXPORT QString formatICalInvitation(
128  const QString &invitation, const KCalendarCore::MemoryCalendar::Ptr &calendar, InvitationFormatterHelper *helper);
129 
144 KCALUTILS_EXPORT QString formatICalInvitationNoHtml(
145  const QString &invitation, const KCalendarCore::MemoryCalendar::Ptr &calendar, InvitationFormatterHelper *helper, const QString &sender);
146 
152 KCALUTILS_EXPORT QString recurrenceString(const KCalendarCore::Incidence::Ptr &incidence);
153 
162 KCALUTILS_EXPORT QStringList reminderStringList(const KCalendarCore::Incidence::Ptr &incidence, bool shortfmt = true);
163 
170 KCALUTILS_EXPORT QString timeToString(const QTime &time, bool shortfmt = true);
171 
179 KCALUTILS_EXPORT QString dateToString(const QDate &date, bool shortfmt = true);
180 
181 KCALUTILS_EXPORT QString formatStartEnd(const QDateTime &start, const QDateTime &end, bool isAllDay);
182 
191 KCALUTILS_EXPORT QString dateTimeToString(const QDateTime &date, bool dateOnly = false, bool shortfmt = true);
192 
198 KCALUTILS_EXPORT QString resourceString(const KCalendarCore::Calendar::Ptr &calendar, const KCalendarCore::Incidence::Ptr &incidence);
199 
205 KCALUTILS_EXPORT QString durationString(const KCalendarCore::Incidence::Ptr &incidence);
206 
212 
216 KCALUTILS_EXPORT QString incidenceStatusStr(const KCalendarCore::Incidence::Ptr &incidence);
217 
218 class EventViewerVisitor;
219 template<typename T> class ScheduleMessageVisitor;
220 class InvitationHeaderVisitor;
221 class InvitationBodyVisitor;
222 class ToolTipVisitor;
223 class MailBodyVisitor;
224 }
225 }
226 
227 #endif
KCALUTILS_EXPORT QString formatICalInvitation(const QString &invitation, const KCalendarCore::MemoryCalendar::Ptr &calendar, InvitationFormatterHelper *helper)
Deliver an HTML formatted string displaying an invitation.
time_t date() const
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 May 24 2020 22:41:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.