libkcal

incidenceformatter.h

00001 /*
00002     This file is part of libkcal.
00003 
00004     Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
00005     Copyright (c) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00006     Copyright (c) 2009 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
00007 
00008     This library is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU Library General Public
00010     License as published by the Free Software Foundation; either
00011     version 2 of the License, or (at your option) any later version.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Library General Public License for more details.
00017 
00018     You should have received a copy of the GNU Library General Public License
00019     along with this library; see the file COPYING.LIB.  If not, write to
00020     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021     Boston, MA 02110-1301, USA.
00022 */
00023 #ifndef KCAL_INCIDENCEFORMATTER_H
00024 #define KCAL_INCIDENCEFORMATTER_H
00025 
00026 #include "libkcal_export.h"
00027 
00028 #include <qdatetime.h>
00029 #include <qstring.h>
00030 
00031 namespace KCal {
00032 class Calendar;
00033 class Incidence;
00034 class IncidenceBase;
00035 
00036 class LIBKCAL_EXPORT InvitationFormatterHelper
00037 {
00038   public:
00039     virtual QString generateLinkURL( const QString &id ) { return id; }
00040     virtual QString makeLink( const QString &id, const QString &text );
00041     virtual Calendar* calendar() const { return 0; }
00042 };
00043 
00051 class LIBKCAL_EXPORT IncidenceFormatter
00052 {
00053   public:
00054     static QString KDE_DEPRECATED toolTipString( IncidenceBase *incidence, bool richText = true );
00055     static QString toolTipStr( Calendar *calendar,
00056                                IncidenceBase *incidence,
00057                                const QDate &date=QDate(),
00058                                bool richText = true );
00059     static QString mailBodyString( IncidenceBase *incidencebase );
00060     static QString KDE_DEPRECATED extensiveDisplayString( IncidenceBase *incidence );
00061     static QString extensiveDisplayStr( Calendar *calendar,
00062                                         IncidenceBase *incidence,
00063                                         const QDate &date=QDate() );
00064 
00065     static QString formatICalInvitation( QString invitation, Calendar *mCalendar,
00066                                          InvitationFormatterHelper *helper );
00067     // Format a TNEF attachment to an HTML mail
00068     static QString formatTNEFInvitation( const QByteArray& tnef,
00069                                          Calendar *mCalendar,
00070                                          InvitationFormatterHelper *helper );
00071     // Transform a TNEF attachment to an iCal or vCard
00072     static QString msTNEFToVPart( const QByteArray& tnef );
00073 
00074     static QString recurrenceString( Incidence *incidence );
00075 
00076     static QString timeToString( const QDateTime &date, bool shortfmt = true );
00077 
00078     static QString dateToString( const QDateTime &date, bool shortfmt = true );
00079 
00080     static QString dateTimeToString( const QDateTime &date,
00081                                      bool dateOnly = false,
00082                                      bool shortfmt = true );
00088     static QString resourceString( Calendar *calendar, Incidence *incidence );
00089 
00090   private:
00091     class EventViewerVisitor;
00092     class ScheduleMessageVisitor;
00093     class InvitationHeaderVisitor;
00094     class InvitationBodyVisitor;
00095     class IncidenceCompareVisitor;
00096     class ToolTipVisitor;
00097     class MailBodyVisitor;
00098 };
00099 
00100 }
00101 
00102 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys