• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

KCal Library

  • KCal
  • IncidenceFormatter
Functions
KCal::IncidenceFormatter Namespace Reference

Functions

KCAL_DEPRECATED_EXPORT QString dateTimeToString (const KDateTime &date, bool dateOnly=false, bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec())
 
KCAL_DEPRECATED_EXPORT QString dateToString (const KDateTime &date, bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec())
 
KCAL_DEPRECATED_EXPORT QString durationString (Incidence *incidence)
 
KCAL_DEPRECATED_EXPORT QString extensiveDisplayStr (Calendar *calendar, IncidenceBase *incidence, const QDate &date=QDate(), KDateTime::Spec spec=KDateTime::Spec())
 
KCAL_DEPRECATED_EXPORT QString extensiveDisplayStr (const QString &sourceName, IncidenceBase *incidence, const QDate &date=QDate(), KDateTime::Spec spec=KDateTime::Spec())
 
KCAL_DEPRECATED_EXPORT QString extensiveDisplayStr (IncidenceBase *incidence, KDateTime::Spec spec=KDateTime::Spec())
 
KCAL_DEPRECATED_EXPORT QString extensiveDisplayString (IncidenceBase *incidence)
 
KCAL_DEPRECATED_EXPORT QString formatICalInvitation (QString invitation, Calendar *calendar, InvitationFormatterHelper *helper)
 
KCAL_DEPRECATED_EXPORT QString formatICalInvitationNoHtml (QString invitation, Calendar *calendar, InvitationFormatterHelper *helper)
 
KCAL_DEPRECATED_EXPORT QString formatICalInvitationNoHtml (const QString &invitation, Calendar *calendar, InvitationFormatterHelper *helper, const QString &sender)
 
KCAL_DEPRECATED_EXPORT QString formatTNEFInvitation (const QByteArray &tnef, Calendar *mCalendar, InvitationFormatterHelper *helper)
 
KCAL_DEPRECATED_EXPORT QString mailBodyStr (IncidenceBase *incidence, KDateTime::Spec spec=KDateTime::Spec())
 
KCAL_DEPRECATED_EXPORT QString mailBodyString (IncidenceBase *incidence)
 
KCAL_DEPRECATED_EXPORT QString msTNEFToVPart (const QByteArray &tnef)
 
KCAL_DEPRECATED_EXPORT QString recurrenceString (Incidence *incidence)
 
KCAL_DEPRECATED_EXPORT QStringList reminderStringList (Incidence *incidence, bool shortfmt=true)
 
KCAL_DEPRECATED_EXPORT QString resourceString (Calendar *calendar, Incidence *incidence)
 
KCAL_DEPRECATED_EXPORT QString timeToString (const KDateTime &date, bool shortfmt=true, const KDateTime::Spec &spec=KDateTime::Spec())
 
KCAL_DEPRECATED_EXPORT QString toolTipStr (Calendar *calendar, IncidenceBase *incidence, const QDate &date=QDate(), bool richText=true, KDateTime::Spec spec=KDateTime::Spec())
 
KCAL_DEPRECATED_EXPORT QString toolTipStr (const QString &sourceName, IncidenceBase *incidence, const QDate &date=QDate(), bool richText=true, KDateTime::Spec spec=KDateTime::Spec())
 
KCAL_DEPRECATED_EXPORT QString toolTipStr (IncidenceBase *incidence, bool richText=true, KDateTime::Spec spec=KDateTime::Spec())
 
KCAL_DEPRECATED_EXPORT QString toolTipString (IncidenceBase *incidence, bool richText=true)
 

Detailed Description

Provides methods to format Incidences in various ways for display purposes.

Helpers that provides several static methods to format an Incidence in different ways: like an HTML representation for KMail, a representation for tool tips, or a representation for a viewer widget.

Function Documentation

QString KCal::IncidenceFormatter::dateTimeToString ( const KDateTime &  date,
bool  dateOnly = false,
bool  shortfmt = true,
const KDateTime::Spec &  spec = KDateTime::Spec() 
)

Build a QString date/time representation of a KDateTime object.

Parameters
dateThe date to be formatted.
dateOnlyIf true, don't print the time fields; print the date fields only.
shortfmtIf true, display info in short format.
specTime spec to use.
See also
dateToString(), timeToString().
Since
4.3

Definition at line 3759 of file incidenceformatter.cpp.

QString KCal::IncidenceFormatter::dateToString ( const KDateTime &  date,
bool  shortfmt = true,
const KDateTime::Spec &  spec = KDateTime::Spec() 
)

Build a QString date representation of a KDateTime object.

Parameters
dateThe date to be formatted.
shortfmtIf true, display info in short format.
specTime spec to use.
See also
dateToString(), dateTimeToString().
Since
4.3

Definition at line 3737 of file incidenceformatter.cpp.

QString KCal::IncidenceFormatter::durationString ( Incidence *  incidence)

Returns a duration string computed for the specified Incidence.

Only makes sense for Events and Todos.

Parameters
incidenceis a pointer to the Incidence.
Since
4.5

Definition at line 3834 of file incidenceformatter.cpp.

QString KCal::IncidenceFormatter::extensiveDisplayStr ( Calendar *  calendar,
IncidenceBase *  incidence,
const QDate &  date = QDate(),
KDateTime::Spec  spec = KDateTime::Spec() 
)

Create a RichText QString representation of an Incidence in a nice format suitable for using in a viewer widget.

Parameters
calendaris a pointer to the Calendar that owns the specified Incidence.
incidenceis a pointer to the Incidence to be formatted.
dateis the QDate for which the string representation should be computed; used mainly for recurring incidences.
specis an optional time specification which, when specified, will shift the Incidence times to different timezones.
Since
4.4

Definition at line 991 of file incidenceformatter.cpp.

QString KCal::IncidenceFormatter::extensiveDisplayStr ( const QString &  sourceName,
IncidenceBase *  incidence,
const QDate &  date = QDate(),
KDateTime::Spec  spec = KDateTime::Spec() 
)

Create a RichText QString representation of an Incidence in a nice format suitable for using in a viewer widget.

Parameters
sourceNamewhere the incidence is from (e.g. resource name)
incidenceis a pointer to the Incidence to be formatted.
dateis the QDate for which the string representation should be computed; used mainly for recurring incidences.
specis an optional time specification which, when specified, will shift the Incidence times to different timezones.
Since
4.5

Definition at line 1008 of file incidenceformatter.cpp.

QString KCal::IncidenceFormatter::extensiveDisplayStr ( IncidenceBase *  incidence,
KDateTime::Spec  spec = KDateTime::Spec() 
)

Create a RichText QString representation of an Incidence in a nice format suitable for using in a viewer widget.

Parameters
incidenceis a pointer to the Incidence to be formatted.
specis an optional time specification which, when specified, will shift the Incidence times to different timezones.
Since
4.2
Deprecated:
use extensiveDisplayStr( Calendar *, IncidenceBase *, KDateTime::Spec )

Definition at line 976 of file incidenceformatter.cpp.

QString KCal::IncidenceFormatter::extensiveDisplayString ( IncidenceBase *  incidence)

Create a RichText QString representation of an Incidence in a nice format suitable for using in a viewer widget.

Parameters
incidenceis a pointer to the Incidence to be formatted.
Deprecated:
use extensiveDisplayStr( Calendar *, IncidenceBase *, KDateTime::Spec )

Definition at line 971 of file incidenceformatter.cpp.

KCAL_DEPRECATED_EXPORT QString KCal::IncidenceFormatter::formatICalInvitation ( QString  invitation,
Calendar *  calendar,
InvitationFormatterHelper *  helper 
)

Deliver an HTML formatted string displaying an invitation.

Use the time zone from mCalendar.

Parameters
invitationa QString containing a string representation of a calendar Event which will be intrepreted as an invitation.
calendaris a pointer to the Calendar that owns the invitation.
helperis a pointer to an InvitationFormatterHelper.
KCAL_DEPRECATED_EXPORT QString KCal::IncidenceFormatter::formatICalInvitationNoHtml ( QString  invitation,
Calendar *  calendar,
InvitationFormatterHelper *  helper 
)

Deliver an HTML formatted string displaying an invitation.

Differs from formatICalInvitation() in that invitation details (summary, location, etc) have HTML formatting cleaned. Use the time zone from calendar.

Parameters
invitationa QString containing a string representation of a calendar Event which will be intrepreted as an invitation.
calendaris a pointer to the Calendar that owns the invitation.
helperis a pointer to an InvitationFormatterHelper.
Deprecated:
use formatICalInvitationNoHtml(const QString &,Calendar *, InvitationFormatterHelper *,const QString &) instead.
KCAL_DEPRECATED_EXPORT QString KCal::IncidenceFormatter::formatICalInvitationNoHtml ( const QString &  invitation,
Calendar *  calendar,
InvitationFormatterHelper *  helper,
const QString &  sender 
)

Deliver an HTML formatted string displaying an invitation.

Differs from formatICalInvitation() in that invitation details (summary, location, etc) have HTML formatting cleaned. Use the time zone from calendar.

Parameters
invitationa QString containing a string representation of a calendar Event which will be intrepreted as an invitation.
calendaris a pointer to the Calendar that owns the invitation.
helperis a pointer to an InvitationFormatterHelper.
senderis a QString containing the email address of the person sending the invitation.
Since
4.5
KCAL_DEPRECATED_EXPORT QString KCal::IncidenceFormatter::formatTNEFInvitation ( const QByteArray &  tnef,
Calendar *  mCalendar,
InvitationFormatterHelper *  helper 
)

Format a TNEF attachment to an HTML mail.

Since
4.1
QString KCal::IncidenceFormatter::mailBodyStr ( IncidenceBase *  incidence,
KDateTime::Spec  spec = KDateTime::Spec() 
)

Create a QString representation of an Incidence in format suitable for including inside a mail message.

Parameters
incidenceis a pointer to the Incidence to be formatted.
specis an optional time specification which, when specified, will shift the Incidence times to different timezones.
Since
4.2

Definition at line 3378 of file incidenceformatter.cpp.

QString KCal::IncidenceFormatter::mailBodyString ( IncidenceBase *  incidence)

Create a QString representation of an Incidence in format suitable for including inside a mail message.

Parameters
incidenceis a pointer to the Incidence to be formatted.
Deprecated:
use mailBodyStr( IncidenceBase *, KDateTime::Spec )

Definition at line 3373 of file incidenceformatter.cpp.

KCAL_DEPRECATED_EXPORT QString KCal::IncidenceFormatter::msTNEFToVPart ( const QByteArray &  tnef)

Transform a TNEF attachment to an iCal or vCard.

Since
4.1
QString KCal::IncidenceFormatter::recurrenceString ( Incidence *  incidence)

Build a pretty QString representation of an Incidence's recurrence info.

Parameters
incidenceis a pointer to the Incidence whose recurrence info is to be formatted.
Since
4.1

Definition at line 3409 of file incidenceformatter.cpp.

QStringList KCal::IncidenceFormatter::reminderStringList ( Incidence *  incidence,
bool  shortfmt = true 
)

Returns a reminder string computed for the specified Incidence.

Each item of the returning QStringList corresponds to a string representation of an reminder belonging to this incidence.

Parameters
incidenceis a pointer to the Incidence.
shortfmtif false, a short version of each reminder is printed; else a longer version of each reminder is printed.
Since
4.5

Definition at line 3865 of file incidenceformatter.cpp.

QString KCal::IncidenceFormatter::resourceString ( Calendar *  calendar,
Incidence *  incidence 
)

Returns a Calendar Resource label name for the specified Incidence.

Parameters
calendaris a pointer to the Calendar.
incidenceis a pointer to the Incidence.
Since
4.4

Definition at line 3784 of file incidenceformatter.cpp.

QString KCal::IncidenceFormatter::timeToString ( const KDateTime &  date,
bool  shortfmt = true,
const KDateTime::Spec &  spec = KDateTime::Spec() 
)

Build a QString time representation of a KDateTime object.

Parameters
dateThe date to be formatted.
shortfmtIf true, display info in short format.
specTime spec to use.
See also
dateToString(), dateTimeToString().
Since
4.3

Definition at line 3720 of file incidenceformatter.cpp.

QString KCal::IncidenceFormatter::toolTipStr ( Calendar *  calendar,
IncidenceBase *  incidence,
const QDate &  date = QDate(),
bool  richText = true,
KDateTime::Spec  spec = KDateTime::Spec() 
)

Create a QString representation of an Incidence in a nice format suitable for using in a tooltip.

Parameters
incidenceis a pointer to the Incidence to be formatted.
dateis the QDate for which the toolTip should be computed; used mainly for recurring incidences.
richTextif yes, the QString will be created as RichText.
specis an optional time specification which, when specified, will shift the Incidence times to different timezones.
Since
4.4

Definition at line 3198 of file incidenceformatter.cpp.

QString KCal::IncidenceFormatter::toolTipStr ( const QString &  sourceName,
IncidenceBase *  incidence,
const QDate &  date = QDate(),
bool  richText = true,
KDateTime::Spec  spec = KDateTime::Spec() 
)

Create a QString representation of an Incidence in a nice format suitable for using in a tooltip.

Parameters
sourceNamewhere the incidence is from (e.g. resource name)
incidenceis a pointer to the Incidence to be formatted.
dateis the QDate for which the toolTip should be computed; used mainly for recurring incidences.
richTextif yes, the QString will be created as RichText.
specis an optional time specification which, when specified, will shift the Incidence times to different timezones.
Since
4.5

Definition at line 3211 of file incidenceformatter.cpp.

QString KCal::IncidenceFormatter::toolTipStr ( IncidenceBase *  incidence,
bool  richText = true,
KDateTime::Spec  spec = KDateTime::Spec() 
)

Create a QString representation of an Incidence in a nice format suitable for using in a tooltip.

Parameters
incidenceis a pointer to the Incidence to be formatted.
richTextif yes, the QString will be created as RichText.
specis an optional time specification which, when specified, will shift the Incidence times to different timezones.
Since
4.2
Deprecated:
use toolTipStr( Calendar *, IncidenceBase *, bool, KDateTime::Spec)

Definition at line 3187 of file incidenceformatter.cpp.

QString KCal::IncidenceFormatter::toolTipString ( IncidenceBase *  incidence,
bool  richText = true 
)

Create a QString representation of an Incidence in a nice format suitable for using in a tooltip.

static QString invitationAttendees( Incidence *incidence ) { QString tmpStr; if ( !incidence ) { return tmpStr; }

Parameters
incidenceis a pointer to the Incidence to be formatted.
richTextif yes, the QString will be created as RichText.
Deprecated:
use toolTipStr( Calendar *, IncidenceBase *, bool, KDateTime::Spec)

tmpStr += i18n( "Invitation List" );

int count=0; Attendee::List attendees = incidence->attendees(); if ( !attendees.isEmpty() ) {

Attendee::List::ConstIterator it; for ( it = attendees.constBegin(); it != attendees.constEnd(); ++it ) { Attendee *a = *it; if ( !iamAttendee( a ) ) { count++; if ( count == 1 ) { tmpStr += "<table border=\"1" cellpadding="1" cellspacing="0">"; } tmpStr += "<tr>"; tmpStr += "<td>"; tmpStr += invitationPerson( a->email(), a->name(), QString() ); if ( !a->delegator().isEmpty() ) { tmpStr += i18n( " (delegated by %1)", a->delegator() ); } if ( !a->delegate().isEmpty() ) { tmpStr += i18n( " (delegated to %1)", a->delegate() ); } tmpStr += "</td>"; tmpStr += "<td>" + a->statusStr() + "</td>"; tmpStr += "</tr>"; } } } if ( count ) { tmpStr += "</table>"; } else { tmpStr += "<i> " + i18nc( "no attendees", "None" ) + "</i>"; }

return tmpStr; }

static QString invitationAttachments( InvitationFormatterHelper *helper, Incidence *incidence ) { QString tmpStr; if ( !incidence ) { return tmpStr; }

Attachment::List attachments = incidence->attachments(); if ( !attachments.isEmpty() ) { tmpStr += i18n( "Attached Documents:" ) + "<ol>";

Attachment::List::ConstIterator it; for ( it = attachments.constBegin(); it != attachments.constEnd(); ++it ) { Attachment *a = *it; tmpStr += "<li>"; Attachment icon KMimeType::Ptr mimeType = KMimeType::mimeType( a->mimeType() ); const QString iconStr = ( mimeType ? mimeType->iconName( a->uri() ) : QString( "application-octet-stream" ) ); const QString iconPath = KIconLoader::global()->iconPath( iconStr, KIconLoader::Small ); if ( !iconPath.isEmpty() ) { tmpStr += "<img valign=\"top" src="" + iconPath + "">"; } tmpStr += helper->makeLink( "ATTACH:" + a->label(), a->label() ); tmpStr += "</li>"; } tmpStr += "</ol>"; }

return tmpStr; }

QString InvitationFormatterHelper::generateLinkURL( const QString &id ) { return id; }

QString InvitationFormatterHelper::makeLink( const QString &id, const QString &text ) { if ( !id.startsWith( QLatin1String( "ATTACH:" ) ) ) { QString res = QString( "<a href=\"%1">%2" ). arg( generateLinkURL( id ), text ); return res; } else { draw the attachment links in non-bold face QString res = QString( "<a href=\"%1">%2" ). arg( generateLinkURL( id ), text ); return res; } }

Check if the given incidence is likely one that we own instead one from a shared calendar (Kolab-specific) static bool incidenceOwnedByMe( Calendar <em>calendar, Incidence *incidence ) {

CalendarResources *cal = dynamic_cast<CalendarResources>( calendar ); if ( !cal || !incidence ) { return true; } ResourceCalendar *res = cal->resource( incidence ); if ( !res ) { return true; } const QString subRes = res->subresourceIdentifier( incidence ); if ( !subRes.contains( "/.INBOX.directory/" ) ) { return false; }

return true; }

The open & close table cell tags for the invitation buttons static QString tdOpen = "<td style=\"border-width:2px;border-style:outset">"; static QString tdClose = "";

static QString responseButtons( Incidence *inc, bool rsvpReq, bool rsvpRec, InvitationFormatterHelper *helper ) { QString html; if ( !helper ) { return html; }

if ( !rsvpReq && ( inc && inc->revision() == 0 ) ) { Record only html += tdOpen; html += helper->makeLink( "record", i18n( "[Record]" ) ); html += tdClose;

Move to trash html += tdOpen; html += helper->makeLink( "delete", i18n( "[Move to Trash]" ) ); html += tdClose;

} else {

Accept html += tdOpen; html += helper->makeLink( "accept", i18nc( "accept invitation", "Accept" ) ); html += tdClose;

Tentative html += tdOpen; html += helper->makeLink( "accept_conditionally", i18nc( "Accept invitation conditionally", "Accept cond." ) ); html += tdClose;

Counter proposal html += tdOpen; html += helper->makeLink( "counter", i18nc( "invitation counter proposal", "Counter proposal" ) ); html += tdClose;

Decline html += tdOpen; html += helper->makeLink( "decline", i18nc( "decline invitation", "Decline" ) ); html += tdClose; }

if ( !rsvpRec || ( inc && inc->revision() > 0 ) ) { Delegate html += tdOpen; html += helper->makeLink( "delegate", i18nc( "delegate inviation to another", "Delegate" ) ); html += tdClose;

Forward html += tdOpen; html += helper->makeLink( "forward", i18nc( "forward request to another", "Forward" ) ); html += tdClose;

Check calendar if ( inc && inc->type() == "Event" ) { html += tdOpen; html += helper->makeLink( "check_calendar", i18nc( "look for scheduling conflicts", "Check my calendar" ) ); html += tdClose; } } return html; }

static QString counterButtons( Incidence *incidence, InvitationFormatterHelper *helper ) { QString html; if ( !helper ) { return html; }

Accept proposal html += tdOpen; html += helper->makeLink( "accept_counter", i18n( "[Accept]" ) ); html += tdClose;

Decline proposal html += tdOpen; html += helper->makeLink( "decline_counter", i18n( "[Decline]" ) ); html += tdClose;

Check calendar if ( incidence && incidence->type() == "Event" ) { html += tdOpen; html += helper->makeLink( "check_calendar", i18n( "[Check my calendar] " ) ); html += tdClose; } return html; }

Calendar *InvitationFormatterHelper::calendar() const { return 0; }

static QString formatICalInvitationHelper( QString invitation, Calendar *mCalendar, InvitationFormatterHelper *helper, bool noHtmlMode, KDateTime::Spec spec, const QString &sender ) { if ( invitation.isEmpty() ) { return QString(); }

ICalFormat format; parseScheduleMessage takes the tz from the calendar, no need to set it manually here for the format! ScheduleMessage *msg = format.parseScheduleMessage( mCalendar, invitation );

if( !msg ) { kDebug() << "Failed to parse the scheduling message"; Q_ASSERT( format.exception() ); kDebug() << format.exception()->message(); return QString(); }

IncidenceBase *incBase = msg->event(); incBase->shiftTimes( mCalendar->timeSpec(), KDateTime::Spec::LocalZone() );

Determine if this incidence is in my calendar (and owned by me) Incidence *existingIncidence = 0; if ( incBase && helper->calendar() ) { existingIncidence = helper->calendar()->incidence( incBase->uid() ); if ( !incidenceOwnedByMe( helper->calendar(), existingIncidence ) ) { existingIncidence = 0; } if ( !existingIncidence ) { const Incidence::List list = helper->calendar()->incidences(); for ( Incidence::List::ConstIterator it = list.begin(), end = list.end(); it != end; ++it ) { if ( (*it)->schedulingID() == incBase->uid() && incidenceOwnedByMe( helper->calendar(), *it ) ) { existingIncidence = *it; break; } } } }

First make the text of the message QString html; html += "<div align=\"center" style="border:solid 1px;">";

IncidenceFormatter::InvitationHeaderVisitor headerVisitor; The InvitationHeaderVisitor returns false if the incidence is somehow invalid, or not handled if ( !headerVisitor.act( incBase, existingIncidence, msg, sender ) ) { return QString(); } html += htmlAddTag( "h3", headerVisitor.result() );

IncidenceFormatter::InvitationBodyVisitor bodyVisitor( noHtmlMode, spec ); if ( !bodyVisitor.act( incBase, existingIncidence, msg, sender ) ) { return QString(); } html += bodyVisitor.result();

if ( msg->method() == iTIPRequest ) { IncidenceFormatter::IncidenceCompareVisitor compareVisitor; if ( compareVisitor.act( incBase, existingIncidence, msg->method() ) ) { html += "<p align=\"left">"; html += i18n( "The following changes have been made by the organizer:" ); html += "

"; html += compareVisitor.result(); } } if ( msg->method() == iTIPReply ) { IncidenceCompareVisitor compareVisitor; if ( compareVisitor.act( incBase, existingIncidence, msg->method() ) ) { html += "<p align=\"left">"; if ( !sender.isEmpty() ) { html += i18n( "The following changes have been made by %1:", sender ); } else { html += i18n( "The following changes have been made by an attendee:" ); } html += "</p>"; html += compareVisitor.result(); } }

Incidence inc = dynamic_cast<Incidence>( incBase );

determine if I am the organizer for this invitation bool myInc = iamOrganizer( inc );

determine if the invitation response has already been recorded bool rsvpRec = false; Attendee *ea = 0; if ( !myInc ) { Incidence *rsvpIncidence = existingIncidence; if ( !rsvpIncidence && inc && inc->revision() > 0 ) { rsvpIncidence = inc; } if ( rsvpIncidence ) { ea = findMyAttendee( rsvpIncidence ); } if ( ea && ( ea->status() == Attendee::Accepted || ea->status() == Attendee::Declined || ea->status() == Attendee::Tentative ) ) { rsvpRec = true; } }

determine invitation role QString role; bool isDelegated = false; Attendee *a = findMyAttendee( inc ); if ( !a && inc ) { if ( !inc->attendees().isEmpty() ) { a = inc->attendees().first(); } } if ( a ) { isDelegated = ( a->status() == Attendee::Delegated ); role = Attendee::roleName( a->role() ); }

Print if RSVP needed, not-needed, or response already recorded bool rsvpReq = rsvpRequested( inc ); if ( !myInc && a ) { html += "<br/>"; html += "<i><u>"; if ( rsvpRec && inc ) { if ( inc->revision() == 0 ) { html += i18n( "Your <b>%1</b> response has already been recorded", ea->statusStr() ); } else { html += i18n( "Your status for this invitation is <b>%1</b>", ea->statusStr() ); } rsvpReq = false; } else if ( msg->method() == iTIPCancel ) { html += i18n( "This invitation was declined" ); } else if ( msg->method() == iTIPAdd ) { html += i18n( "This invitation was accepted" ); } else { if ( !isDelegated ) { html += rsvpRequestedStr( rsvpReq, role ); } else { html += i18n( "Awaiting delegation response" ); } } html += "</u></i>"; }

Print if the organizer gave you a preset status if ( !myInc ) { if ( inc && inc->revision() == 0 ) { QString statStr = myStatusStr( inc ); if ( !statStr.isEmpty() ) { html += "<br/>"; html += "<i>"; html += statStr; html += "</i>"; } } }

Add groupware links

html += "<p>"; html += "<table border=\"0" align="center" cellspacing="4">

";

switch ( msg->method() ) { case iTIPPublish: case iTIPRequest: case iTIPRefresh: case iTIPAdd: { if ( inc && inc->revision() > 0 && ( existingIncidence || !helper->calendar() ) ) { if ( inc->type() == "Todo" ) { html += helper->makeLink( "reply", i18n( "[Record invitation in my to-do list]" ) ); } else { html += helper->makeLink( "reply", i18n( "[Record invitation in my calendar]" ) ); } }

if ( !myInc && a ) { html += responseButtons( inc, rsvpReq, rsvpRec, helper ); } break; }

case iTIPCancel: Remove invitation if ( inc ) { html += tdOpen; if ( inc->type() == "Todo" ) { html += helper->makeLink( "cancel", i18n( "Remove invitation from my to-do list" ) ); } else { html += helper->makeLink( "cancel", i18n( "Remove invitation from my calendar" ) ); } html += tdClose; } break;

case iTIPReply: { Record invitation response Attendee *a = 0; Attendee *ea = 0; if ( inc ) { First, determine if this reply is really a counter in disguise. if ( replyMeansCounter( inc ) ) { html += "<tr>" + counterButtons( inc, helper ) + "</tr>"; break; }

Next, maybe this is a declined reply that was delegated from me? find first attendee who is delegated-from me look a their PARTSTAT response, if the response is declined, then we need to start over which means putting all the action buttons and NOT putting on the [Record response..] button a = findDelegatedFromMyAttendee( inc ); if ( a ) { if ( a->status() != Attendee::Accepted || a->status() != Attendee::Tentative ) { html += responseButtons( inc, rsvpReq, rsvpRec, helper ); break; } }

Finally, simply allow a Record of the reply if ( !inc->attendees().isEmpty() ) { a = inc->attendees().first(); } if ( a && helper->calendar() ) { ea = findAttendee( existingIncidence, a->email() ); } } if ( ea && ( ea->status() != Attendee::NeedsAction ) && ( ea->status() == a->status() ) ) { html += tdOpen; html += htmlAddTag( "i", i18n( "The response has already been recorded" ) ); html += tdClose; } else { if ( inc ) { if ( inc->type() == "Todo" ) { html += helper->makeLink( "reply", i18n( "[Record response in my to-do list]" ) ); } else { html += helper->makeLink( "reply", i18n( "[Record response in my calendar]" ) ); } } } break; }

case iTIPCounter: Counter proposal html += counterButtons( inc, helper ); break;

case iTIPDeclineCounter: case iTIPNoMethod: break; }

close the groupware table html += "</tr></table>";

Add the attendee list if I am the organizer if ( myInc && helper->calendar() ) { html += invitationAttendees( helper->calendar()->incidence( inc->uid() ) ); }

close the top-level html += "</div>";

Add the attachment list html += invitationAttachments( helper, inc );

return html; }

QString IncidenceFormatter::formatICalInvitation( QString invitation, Calendar *calendar, InvitationFormatterHelper *helper ) { return formatICalInvitationHelper( invitation, calendar, helper, false, KSystemTimeZones::local(), QString() ); }

QString IncidenceFormatter::formatICalInvitationNoHtml( QString invitation, Calendar *calendar, InvitationFormatterHelper *helper ) { return formatICalInvitationHelper( invitation, calendar, helper, true, KSystemTimeZones::local(), QString() ); }

QString IncidenceFormatter::formatICalInvitationNoHtml( const QString &invitation, Calendar *calendar, InvitationFormatterHelper *helper, const QString &sender ) { return formatICalInvitationHelper( invitation, calendar, helper, true, KSystemTimeZones::local(), sender ); }

/******************************************************************* Helper functions for the Incidence tooltips

Definition at line 3181 of file incidenceformatter.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCal Library

Skip menu "KCal Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal