libkcal

incidenceformatter.h
1/*
2 This file is part of libkcal.
3
4 Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (c) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 Copyright (c) 2009 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
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*/
23#ifndef KCAL_INCIDENCEFORMATTER_H
24#define KCAL_INCIDENCEFORMATTER_H
25
26#include "libkcal_export.h"
27
28#include <tqdatetime.h>
29#include <tqstring.h>
30#include <tqstringlist.h>
31
32namespace KCal {
33class Calendar;
34class Incidence;
35class IncidenceBase;
36
37class LIBKCAL_EXPORT InvitationFormatterHelper
38{
39 public:
40 virtual TQString generateLinkURL( const TQString &id ) { return id; }
41 virtual TQString makeLink( const TQString &id, const TQString &text );
42 virtual Calendar *calendar() const { return 0; }
43};
44
52class LIBKCAL_EXPORT IncidenceFormatter
53{
54 public:
55 static TQString TDE_DEPRECATED toolTipString( IncidenceBase *incidence, bool richText = true );
56 static TQString toolTipStr( Calendar *calendar,
57 IncidenceBase *incidence,
58 const TQDate &date=TQDate(),
59 bool richText = true );
60 static TQString mailBodyString( IncidenceBase *incidencebase );
61 static TQString TDE_DEPRECATED extensiveDisplayString( IncidenceBase *incidence );
62 static TQString extensiveDisplayStr( Calendar *calendar,
63 IncidenceBase *incidence,
64 const TQDate &date=TQDate() );
65
66 static TQString formatICalInvitation( TQString invitation, Calendar *mCalendar,
67 InvitationFormatterHelper *helper );
68 static TQString TDE_DEPRECATED formatICalInvitationNoHtml( TQString invitation,
69 Calendar *mCalendar,
70 InvitationFormatterHelper *helper );
71 static TQString formatICalInvitationNoHtml( TQString invitation,
72 Calendar *mCalendar,
73 InvitationFormatterHelper *helper,
74 const TQString &sender );
75
76 // Format a TNEF attachment to an HTML mail
77 static TQString formatTNEFInvitation( const TQByteArray& tnef,
78 Calendar *mCalendar,
79 InvitationFormatterHelper *helper );
80 // Transform a TNEF attachment to an iCal or vCard
81 static TQString msTNEFToVPart( const TQByteArray& tnef );
82
83 static TQString recurrenceString( Incidence *incidence );
84
85 /*
86 Returns a reminder string computed for the specified Incidence.
87 Each item of the returning TQStringList corresponds to a string
88 representation of an reminder belonging to this incidence.
89 @param incidence is a pointer to the Incidence.
90 @param shortfmt if false, a short version of each reminder is printed;
91 else a longer version of each reminder is printed.
92 */
93 static TQStringList reminderStringList( Incidence *incidence, bool shortfmt = true );
94
95 static TQString timeToString( const TQDateTime &date, bool shortfmt = true );
96
97 static TQString dateToString( const TQDateTime &date, bool shortfmt = true );
98
99 static TQString dateTimeToString( const TQDateTime &date,
100 bool dateOnly = false,
101 bool shortfmt = true );
107 static TQString resourceString( Calendar *calendar, Incidence *incidence );
108
114 static TQString durationString( Incidence *incidence );
115
116 private:
117 static TQString formatICalInvitationHelper( TQString invitation,
118 Calendar *mCalendar,
119 InvitationFormatterHelper *helper,
120 bool noHtmlMode,
121 const TQString &sender );
122 class EventViewerVisitor;
123 class ScheduleMessageVisitor;
124 class InvitationHeaderVisitor;
125 class InvitationBodyVisitor;
126 class IncidenceCompareVisitor;
127 class ToolTipVisitor;
128 class MailBodyVisitor;
129};
130
131}
132
133#endif
This is the main "calendar" object class.
Definition: calendar.h:171
This class provides the base class common to all calendar components.
Definition: incidencebase.h:46
This class is a helper class that provides several static methods to format an Incidence into differe...
This class provides the base class common to all calendar components.
Definition: incidence.h:48
Namespace KCal is for global classes, objects and/or functions in libkcal.
Definition: alarm.h:38