KCalUtils::IncidenceFormatter
Functions | |
KCALUTILS_EXPORT QString | dateTimeToString (const QDateTime &date, bool dateOnly=false, bool shortfmt=true) |
KCALUTILS_EXPORT QString | dateToString (QDate date, bool shortfmt=true) |
KCALUTILS_EXPORT QString | durationString (const KCalendarCore::Incidence::Ptr &incidence) |
KCALUTILS_EXPORT QString | extensiveDisplayStr (const KCalendarCore::Calendar::Ptr &calendar, const KCalendarCore::IncidenceBase::Ptr &incidence, QDate date=QDate()) |
KCALUTILS_EXPORT QString | extensiveDisplayStr (const QString &sourceName, const KCalendarCore::IncidenceBase::Ptr &incidence, QDate date=QDate()) |
KCALUTILS_EXPORT QString | formatICalInvitation (const QString &invitation, const KCalendarCore::Calendar::Ptr &calendar, InvitationFormatterHelper *helper) |
KCALUTILS_EXPORT QString | formatICalInvitationNoHtml (const QString &invitation, const KCalendarCore::Calendar::Ptr &calendar, InvitationFormatterHelper *helper, const QString &sender) |
KCALUTILS_EXPORT QString | formatStartEnd (const QDateTime &start, const QDateTime &end, bool isAllDay) |
KCALUTILS_EXPORT QString | mailBodyStr (const KCalendarCore::IncidenceBase::Ptr &incidence) |
KCALUTILS_EXPORT QString | recurrenceString (const KCalendarCore::Incidence::Ptr &incidence) |
KCALUTILS_EXPORT QStringList | reminderStringList (const KCalendarCore::Incidence::Ptr &incidence, bool shortfmt=true) |
KCALUTILS_EXPORT QString | resourceString (const KCalendarCore::Calendar::Ptr &calendar, const KCalendarCore::Incidence::Ptr &incidence) |
KCALUTILS_EXPORT QString | timeToString (QTime time, bool shortfmt=true) |
KCALUTILS_EXPORT QString | toolTipStr (const QString &sourceName, const KCalendarCore::IncidenceBase::Ptr &incidence, QDate date=QDate(), 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
◆ dateTimeToString()
QString KCalUtils::IncidenceFormatter::dateTimeToString | ( | const QDateTime & | date, |
bool | dateOnly = false, | ||
bool | shortfmt = true ) |
Build a QString date/time representation of a QDateTime object.
All dates and times are converted to local time for display.
- Parameters
-
date The date to be formatted. dateOnly If true, don't print the time fields; print the date fields only. shortfmt If true, display info in short format.
- See also
- dateToString(), timeToString().
Definition at line 3304 of file incidenceformatter.cpp.
◆ dateToString()
Build a QString date representation of a QDate object.
All dates and times are converted to local time for display.
- Parameters
-
date The date to be formatted. shortfmt If true, display info in short format.
- See also
- dateToString(), dateTimeToString().
Definition at line 3299 of file incidenceformatter.cpp.
◆ durationString()
QString KCalUtils::IncidenceFormatter::durationString | ( | const KCalendarCore::Incidence::Ptr & | incidence | ) |
Returns a duration string computed for the specified Incidence.
Only makes sense for Events and Todos.
- Parameters
-
incidence is a pointer to the Incidence.
Definition at line 3342 of file incidenceformatter.cpp.
◆ extensiveDisplayStr() [1/2]
KCALUTILS_EXPORT QString KCalUtils::IncidenceFormatter::extensiveDisplayStr | ( | const KCalendarCore::Calendar::Ptr & | calendar, |
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 viewer widget.
All dates and times are converted to local time for display.
- Parameters
-
calendar is a pointer to the Calendar that owns the specified Incidence. incidence is a pointer to the Incidence to be formatted. date is the QDate for which the string representation should be computed; used mainly for recurring incidences.
◆ extensiveDisplayStr() [2/2]
KCALUTILS_EXPORT QString KCalUtils::IncidenceFormatter::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 viewer widget.
All dates and times are converted to local time for display.
- Parameters
-
sourceName where the incidence is from (e.g. resource name) incidence is a pointer to the Incidence to be formatted. date is the QDate for which the string representation should be computed; used mainly for recurring incidences.
◆ formatICalInvitation()
KCALUTILS_EXPORT QString KCalUtils::IncidenceFormatter::formatICalInvitation | ( | const QString & | invitation, |
const KCalendarCore::Calendar::Ptr & | calendar, | ||
InvitationFormatterHelper * | helper ) |
Deliver an HTML formatted string displaying an invitation.
Use the time zone from mCalendar.
- Parameters
-
invitation a QString containing a string representation of a calendar Incidence which will be interpreted as an invitation. calendar is a pointer to the Calendar that owns the invitation. helper is a pointer to an InvitationFormatterHelper.
- Since
- 5.23.0
◆ formatICalInvitationNoHtml()
KCALUTILS_EXPORT QString KCalUtils::IncidenceFormatter::formatICalInvitationNoHtml | ( | const QString & | invitation, |
const KCalendarCore::Calendar::Ptr & | 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
-
invitation a QString containing a string representation of a calendar Incidence which will be interpreted as an invitation. calendar is a pointer to the Calendar that owns the invitation. helper is a pointer to an InvitationFormatterHelper. sender is a QString containing the email address of the person sending the invitation.
- Since
- 5.23.0
◆ mailBodyStr()
QString KCalUtils::IncidenceFormatter::mailBodyStr | ( | const KCalendarCore::IncidenceBase::Ptr & | incidence | ) |
Create a QString representation of an Incidence in format suitable for including inside a mail message.
All dates and times are converted to local time for display.
- Parameters
-
incidence is a pointer to the Incidence to be formatted.
Definition at line 2900 of file incidenceformatter.cpp.
◆ recurrenceString()
QString KCalUtils::IncidenceFormatter::recurrenceString | ( | const KCalendarCore::Incidence::Ptr & | incidence | ) |
Build a pretty QString representation of an Incidence's recurrence info.
- Parameters
-
incidence is a pointer to the Incidence whose recurrence info is to be formatted.
Definition at line 2931 of file incidenceformatter.cpp.
◆ reminderStringList()
QStringList KCalUtils::IncidenceFormatter::reminderStringList | ( | const KCalendarCore::Incidence::Ptr & | 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
-
incidence is a pointer to the Incidence. shortfmt if false, a short version of each reminder is printed; else a longer version of each reminder is printed.
Definition at line 3371 of file incidenceformatter.cpp.
◆ resourceString()
QString KCalUtils::IncidenceFormatter::resourceString | ( | const KCalendarCore::Calendar::Ptr & | calendar, |
const KCalendarCore::Incidence::Ptr & | incidence ) |
Returns a Calendar Resource label name for the specified Incidence.
- Parameters
-
calendar is a pointer to the Calendar. incidence is a pointer to the Incidence.
Definition at line 3313 of file incidenceformatter.cpp.
◆ timeToString()
Build a QString time representation of a QTime object.
- Parameters
-
time The time to be formatted. shortfmt If true, display info in short format.
- See also
- dateToString(), dateTimeToString().
Definition at line 3294 of file incidenceformatter.cpp.
◆ toolTipStr()
QString KCalUtils::IncidenceFormatter::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.
EventViewerVisitor::~EventViewerVisitor() { }.
All dates and times are converted to local time for display.
- Parameters
-
sourceName where the incidence is from (e.g. resource name) incidence is a pointer to the Incidence to be formatted. date is the QDate for which the toolTip should be computed; used mainly for recurring incidences. Note: For to-dos, this a date between the start date and the due date (inclusive) of the occurrence. richText if yes, the QString will be created as RichText.
QString IncidenceFormatter::extensiveDisplayStr(const Calendar::Ptr &calendar, const IncidenceBase::Ptr &incidence, QDate date) { if (!incidence) { return QString(); }
EventViewerVisitor v; if (v.act(calendar, incidence, date)) { return v.result(); } else { return QString(); } }
QString IncidenceFormatter::extensiveDisplayStr(const QString &sourceName, const IncidenceBase::Ptr &incidence, QDate date) { if (!incidence) { return QString(); }
EventViewerVisitor v; if (v.act(sourceName, incidence, date)) { return v.result(); } else { return QString(); } }
/*********************************************************************** Helper functions for the body part formatter of kmail (Invitations) [[nodiscard]] static QVariantList invitationAttendeeList(const Incidence::Ptr &incidence) { if (!incidence) { return QVariantList(); }
QVariantList attendees; const Attendee::List lstAttendees = incidence->attendees(); for (const Attendee &a : lstAttendees) { if (iamAttendee(a)) { continue; }
QVariantHash attendee; attendee[QStringLiteral("name")] = a.name(); attendee[QStringLiteral("email")] = a.email(); attendee[QStringLiteral("delegator")] = a.delegator(); attendee[QStringLiteral("delegate")] = a.delegate(); attendee[QStringLiteral("isOrganizer")] = attendeeIsOrganizer(incidence, a); attendee[QStringLiteral("status")] = Stringify::attendeeStatus(a.status()); attendee[QStringLiteral("icon")] = rsvpStatusIconName(a.status());
attendees.push_back(attendee); }
return attendees; }
[[nodiscard]] static QVariantList invitationRsvpList(const Incidence::Ptr &incidence, const Attendee &sender) { if (!incidence) { return QVariantList(); }
QVariantList attendees; const Attendee::List lstAttendees = incidence->attendees(); for (const Attendee &a_ : lstAttendees) { Attendee a = a_; if (!attendeeIsOrganizer(incidence, a)) { continue; } QVariantHash attendee; attendee[QStringLiteral("status")] = Stringify::attendeeStatus(a.status()); if (!sender.isNull() && (a.email() == sender.email())) { use the attendee taken from the response incidence, rather than the attendee from the calendar incidence. if (a.status() != sender.status()) { attendee[QStringLiteral("status")] = i18n("%1 (<i>unrecorded</i>", Stringify::attendeeStatus(sender.status())); } a = sender; }
attendee[QStringLiteral("name")] = a.name(); attendee[QStringLiteral("email")] = a.email(); attendee[QStringLiteral("delegator")] = a.delegator(); attendee[QStringLiteral("delegate")] = a.delegate(); attendee[QStringLiteral("isOrganizer")] = attendeeIsOrganizer(incidence, a); attendee[QStringLiteral("isMyself")] = iamAttendee(a); attendee[QStringLiteral("icon")] = rsvpStatusIconName(a.status());
attendees.push_back(attendee); }
return attendees; }
[[nodiscard]] static QVariantList invitationAttachments(const Incidence::Ptr &incidence, InvitationFormatterHelper *helper) { if (!incidence) { return QVariantList(); }
if (incidence->type() == Incidence::TypeFreeBusy) { A FreeBusy does not have a valid attachment due to the static-cast from IncidenceBase return QVariantList(); }
QVariantList attachments; const Attachment::List lstAttachments = incidence->attachments(); for (const Attachment &a : lstAttachments) { QVariantHash attachment; QMimeDatabase mimeDb; auto mimeType = mimeDb.mimeTypeForName(a.mimeType()); attachment[QStringLiteral("icon")] = (mimeType.isValid() ? mimeType.iconName() : QStringLiteral("application-octet-stream")); attachment[QStringLiteral("name")] = a.label(); const QString attachementStr = helper->generateLinkURL(QStringLiteral("ATTACH:%1").arg(QString::fromLatin1(a.label().toUtf8().toBase64()))); attachment[QStringLiteral("uri")] = attachementStr; attachments.push_back(attachment); }
return attachments; }
class KCalUtils::InvitationFormatterHelperPrivate { };
InvitationFormatterHelper::InvitationFormatterHelper() : d(nullptr) { }
InvitationFormatterHelper::~InvitationFormatterHelper() { }
QString InvitationFormatterHelper::generateLinkURL(const QString &id) { return id; }
QString InvitationFormatterHelper::makeLink(const QString &id, const QString &text) { if (!id.startsWith(QLatin1StringView("ATTACH:"))) { const QString res = QStringLiteral("<a href=\"%1\"><font size=\"-1\"><b>%2</b></font></a>").arg(generateLinkURL(id), text); return res; } else { draw the attachment links in non-bold face const QString res = QStringLiteral("<a href=\"%1\">%2</a>").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(const Calendar::Ptr &calendar, const Incidence::Ptr &incidence) {
return true;
}
static QVariantHash inviteButton(const QString &id, const QString &text, const QString &iconName, InvitationFormatterHelper *helper) { QVariantHash button; button[QStringLiteral("uri")] = helper->generateLinkURL(id); button[QStringLiteral("icon")] = iconName; button[QStringLiteral("label")] = text; return button; }
static QVariantList responseButtons(const Incidence::Ptr &incidence, bool rsvpReq, bool rsvpRec, InvitationFormatterHelper *helper, const Incidence::Ptr &existingInc = Incidence::Ptr()) { bool hideAccept = false; bool hideTentative = false; bool hideDecline = false;
if (existingInc) { const Attendee ea = findMyAttendee(existingInc); if (!ea.isNull()) { If this is an update of an already accepted incidence to not show the buttons that confirm the status. hideAccept = ea.status() == Attendee::Accepted; hideDecline = ea.status() == Attendee::Declined; hideTentative = ea.status() == Attendee::Tentative; } }
QVariantList buttons; if (!rsvpReq && (incidence && incidence->revision() == 0)) { Record only buttons << inviteButton(QStringLiteral("record"), i18n("Record"), QStringLiteral("dialog-ok"), helper);
Move to trash buttons << inviteButton(QStringLiteral("delete"), i18n("Move to Trash"), QStringLiteral("edittrash"), helper); } else { Accept if (!hideAccept) { buttons << inviteButton(QStringLiteral("accept"), i18nc("accept invitation", "Accept"), QStringLiteral("dialog-ok-apply"), helper); }
Tentative if (!hideTentative) { buttons << inviteButton(QStringLiteral("accept_conditionally"), i18nc("Accept invitation conditionally", "Tentative"), QStringLiteral("dialog-ok"), helper); }
Decline if (!hideDecline) { buttons << inviteButton(QStringLiteral("decline"), i18nc("decline invitation", "Decline"), QStringLiteral("dialog-cancel"), helper); }
Counter proposal buttons << inviteButton(QStringLiteral("counter"), i18nc("invitation counter proposal", "Counter proposal ..."), QStringLiteral("edit-undo"), helper); }
if (!rsvpRec || (incidence && incidence->revision() > 0)) { Delegate buttons << inviteButton(QStringLiteral("delegate"), i18nc("delegate invitation to another", "Delegate ..."), QStringLiteral("mail-forward"), helper); } return buttons; }
[[nodiscard]] static QVariantList counterButtons(InvitationFormatterHelper *helper) { QVariantList buttons;
Accept proposal buttons << inviteButton(QStringLiteral("accept_counter"), i18n("Accept"), QStringLiteral("dialog-ok-apply"), helper);
Decline proposal buttons << inviteButton(QStringLiteral("decline_counter"), i18n("Decline"), QStringLiteral("dialog-cancel"), helper);
return buttons; }
[[nodiscard]] static QVariantList recordButtons(const Incidence::Ptr &incidence, InvitationFormatterHelper *helper) { QVariantList buttons; if (incidence) { buttons << inviteButton(QStringLiteral("reply"), incidence->type() == Incidence::TypeTodo ? i18n("Record invitation in my to-do list") : i18n("Record invitation in my calendar"), QStringLiteral("dialog-ok"), helper); } return buttons; }
[[nodiscard]] static QVariantList recordResponseButtons(const Incidence::Ptr &incidence, InvitationFormatterHelper *helper) { QVariantList buttons;
if (incidence) { buttons << inviteButton(QStringLiteral("reply"), incidence->type() == Incidence::TypeTodo ? i18n("Record response in my to-do list") : i18n("Record response in my calendar"), QStringLiteral("dialog-ok"), helper); } return buttons; }
[[nodiscard]] static QVariantList cancelButtons(const Incidence::Ptr &incidence, InvitationFormatterHelper *helper) { QVariantList buttons;
Remove invitation if (incidence) { buttons << inviteButton(QStringLiteral("cancel"), incidence->type() == Incidence::TypeTodo ? i18n("Remove invitation from my to-do list") : i18n("Remove invitation from my calendar"), QStringLiteral("dialog-cancel"), helper); }
return buttons; }
[[nodiscard]] static QVariantHash invitationStyle() { QVariantHash style; QPalette p; p.setCurrentColorGroup(QPalette::Normal); style[QStringLiteral("buttonBg")] = p.color(QPalette::Button).name(); style[QStringLiteral("buttonBorder")] = p.shadow().color().name(); style[QStringLiteral("buttonFg")] = p.color(QPalette::ButtonText).name(); return style; }
Calendar::Ptr InvitationFormatterHelper::calendar() const { return Calendar::Ptr(); }
static QString formatICalInvitationHelper(const QString &invitation, const Calendar::Ptr &mCalendar, InvitationFormatterHelper *helper, bool noHtmlMode, 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::Ptr msg = format.parseScheduleMessage(mCalendar, invitation);
if (!msg) { qCDebug(KCALUTILS_LOG) << "Failed to parse the scheduling message"; Q_ASSERT(format.exception()); qCDebug(KCALUTILS_LOG) << Stringify::errorMessage(*format.exception()); return QString(); }
IncidenceBase::Ptr incBase = msg->event();
incBase->shiftTimes(mCalendar->timeZone(), QTimeZone::systemTimeZone());
Determine if this incidence is in my calendar (and owned by me) Incidence::Ptr existingIncidence; if (incBase && helper->calendar()) { existingIncidence = helper->calendar()->incidence(incBase->uid(), incBase->recurrenceId());
if (!incidenceOwnedByMe(helper->calendar(), existingIncidence)) { existingIncidence.clear(); } 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) && (*it)->recurrenceId() == incBase->recurrenceId()) { existingIncidence = *it; break; } } } }
Incidence::Ptr inc = incBase.staticCast<Incidence>(); // the incidence in the invitation email
If the IncidenceBase is a FreeBusy, then we cannot access the revision number in the static-casted Incidence; so for sake of nothing better use 0 as the revision. int incRevision = 0; if (inc && inc->type() != Incidence::TypeFreeBusy) { incRevision = inc->revision(); }
IncidenceFormatter::InvitationHeaderVisitor headerVisitor; The InvitationHeaderVisitor returns false if the incidence is somehow invalid, or not handled if (!headerVisitor.act(inc, existingIncidence, msg, sender)) { return QString(); }
QVariantHash incidence;
use the Outlook 2007 Comparison Style IncidenceFormatter::InvitationBodyVisitor bodyVisitor(helper, noHtmlMode); bool bodyOk; if (msg->method() == iTIPRequest || msg->method() == iTIPReply || msg->method() == iTIPDeclineCounter) { if (inc && existingIncidence && incRevision < existingIncidence->revision()) { bodyOk = bodyVisitor.act(existingIncidence, inc, msg, sender); } else { bodyOk = bodyVisitor.act(inc, existingIncidence, msg, sender); } } else { bodyOk = bodyVisitor.act(inc, Incidence::Ptr(), msg, sender); } if (!bodyOk) { return QString(); }
incidence = bodyVisitor.result(); incidence[QStringLiteral("style")] = invitationStyle(); incidence[QStringLiteral("head")] = headerVisitor.result();
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; if (!myInc) { Incidence::Ptr rsvpIncidence = existingIncidence; if (!rsvpIncidence && inc && incRevision > 0) { rsvpIncidence = inc; } if (rsvpIncidence) { ea = findMyAttendee(rsvpIncidence); } if (!ea.isNull() && (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.isNull() && inc) { if (!inc->attendees().isEmpty()) { a = inc->attendees().at(0); } } if (!a.isNull()) { isDelegated = (a.status() == Attendee::Delegated); role = Stringify::attendeeRole(a.role()); }
determine if RSVP needed, not-needed, or response already recorded bool rsvpReq = rsvpRequested(inc); if (!rsvpReq && !a.isNull() && a.status() == Attendee::NeedsAction) { rsvpReq = true; }
QString eventInfo; if (!myInc && !a.isNull()) { if (rsvpRec && inc) { if (incRevision == 0) { eventInfo = i18n("Your <b>%1</b> response has been recorded.", Stringify::attendeeStatus(ea.status())); } else { eventInfo = i18n("Your status for this invitation is <b>%1</b>.", Stringify::attendeeStatus(ea.status())); } rsvpReq = false; } else if (msg->method() == iTIPCancel) { eventInfo = i18n("This invitation was canceled."); } else if (msg->method() == iTIPAdd) { eventInfo = i18n("This invitation was accepted."); } else if (msg->method() == iTIPDeclineCounter) { rsvpReq = true; eventInfo = rsvpRequestedStr(rsvpReq, role); } else { if (!isDelegated) { eventInfo = rsvpRequestedStr(rsvpReq, role); } else { eventInfo = i18n("Awaiting delegation response."); } } } incidence[QStringLiteral("eventInfo")] = eventInfo;
Print if the organizer gave you a preset status QString myStatus; if (!myInc) { if (inc && incRevision == 0) { myStatus = myStatusStr(inc); } } incidence[QStringLiteral("myStatus")] = myStatus;
Add groupware links QVariantList buttons; switch (msg->method()) { case iTIPPublish: case iTIPRequest: case iTIPRefresh: case iTIPAdd: if (inc && incRevision > 0 && (existingIncidence || !helper->calendar())) { buttons += recordButtons(inc, helper); }
if (!myInc) { if (!a.isNull()) { buttons += responseButtons(inc, rsvpReq, rsvpRec, helper); } else { buttons += responseButtons(inc, false, false, helper); } } break;
case iTIPCancel: buttons = cancelButtons(inc, helper); break;
case iTIPReply: { Record invitation response Attendee a; Attendee ea; if (inc) { First, determine if this reply is really a counter in disguise. if (replyMeansCounter(inc)) { buttons = counterButtons(helper); 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.isNull()) { if (a.status() != Attendee::Accepted || a.status() != Attendee::Tentative) { buttons = responseButtons(inc, rsvpReq, rsvpRec, helper); break; } }
Finally, simply allow a Record of the reply if (!inc->attendees().isEmpty()) { a = inc->attendees().at(0); } if (!a.isNull() && helper->calendar()) { ea = findAttendee(existingIncidence, a.email()); } } if (!ea.isNull() && (ea.status() != Attendee::NeedsAction) && (ea.status() == a.status())) { const QString tStr = i18n("The <b>%1</b> response has been recorded", Stringify::attendeeStatus(ea.status())); buttons << inviteButton(QString(), tStr, QString(), helper); } else { if (inc) { buttons = recordResponseButtons(inc, helper); } } break; }
case iTIPCounter: Counter proposal buttons = counterButtons(helper); break;
case iTIPDeclineCounter: buttons << responseButtons(inc, rsvpReq, rsvpRec, helper); break;
case iTIPNoMethod: break; }
incidence[QStringLiteral("buttons")] = buttons;
Add the attendee list if (inc->type() == Incidence::TypeTodo) { incidence[QStringLiteral("attendeesTitle")] = i18n("Assignees:"); } else { incidence[QStringLiteral("attendeesTitle")] = i18n("Participants:"); } if (myInc) { incidence[QStringLiteral("attendees")] = invitationRsvpList(existingIncidence, a); } else { incidence[QStringLiteral("attendees")] = invitationAttendeeList(inc); }
Add the attachment list incidence[QStringLiteral("attachments")] = invitationAttachments(inc, helper);
if (!inc->comments().isEmpty()) { incidence[QStringLiteral("comments")] = inc->comments(); }
QString templateName; switch (inc->type()) { case KCalendarCore::IncidenceBase::TypeEvent: templateName = QStringLiteral(":/org.kde.pim/kcalutils/itip_event.html"); break; case KCalendarCore::IncidenceBase::TypeTodo: templateName = QStringLiteral(":/org.kde.pim/kcalutils/itip_todo.html"); break; case KCalendarCore::IncidenceBase::TypeJournal: templateName = QStringLiteral(":/org.kde.pim/kcalutils/itip_journal.html"); break; case KCalendarCore::IncidenceBase::TypeFreeBusy: templateName = QStringLiteral(":/org.kde.pim/kcalutils/itip_freebusy.html"); break; case KCalendarCore::IncidenceBase::TypeUnknown: return QString(); }
return GrantleeTemplateManager::instance()->render(templateName, incidence); }
QString IncidenceFormatter::formatICalInvitation(const QString &invitation, const Calendar::Ptr &calendar, InvitationFormatterHelper *helper) { return formatICalInvitationHelper(invitation, calendar, helper, false, QString()); }
QString IncidenceFormatter::formatICalInvitationNoHtml(const QString &invitation, const Calendar::Ptr &calendar, InvitationFormatterHelper *helper, const QString &sender) { return formatICalInvitationHelper(invitation, calendar, helper, true, sender); }
/******************************************************************* Helper functions for the Incidence tooltips
Definition at line 2738 of file incidenceformatter.cpp.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:36:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.