Commit b87231b7 authored by David Jarvie's avatar David Jarvie
Browse files

Refactor MessageWin -> MessageWindow

This will allow implementation of a new option to use system
notifications instead of windows for displaying alarms.
parent 2a7e6ae9
Pipeline #32400 failed with stage
in 11 minutes and 42 seconds
......@@ -94,7 +94,9 @@ set(kalarm_bin_SRCS ${libkalarm_SRCS} ${resources_SRCS}
kalarmapp.cpp
mainwindowbase.cpp
mainwindow.cpp
messagewin.cpp
messagedisplay.cpp
messagedisplayhelper.cpp
messagewindow.cpp
preferences.cpp
prefdlg.cpp
traywindow.cpp
......
......@@ -858,7 +858,7 @@ void EditAlarmDlg::showEvent(QShowEvent* se)
* Called when the window is first shown, to ensure that it initially becomes
* the active window.
* This is only required on Ubuntu's Unity desktop, which doesn't transfer
* keyboard focus properly between Edit Alarm Dialog windows and MessageWin
* keyboard focus properly between Edit Alarm Dialog windows and MessageWindow
* windows.
*/
void EditAlarmDlg::focusFixTimer()
......@@ -873,9 +873,9 @@ void EditAlarmDlg::focusFixTimer()
/******************************************************************************
* Called to detect when the mouse is pressed anywhere inside the window.
* Activates this window if a MessageWin window is also active.
* Activates this window if a MessageWindow window is also active.
* This is only required on Ubuntu's Unity desktop, which doesn't transfer
* keyboard focus properly between Edit Alarm Dialog windows and MessageWin
* keyboard focus properly between Edit Alarm Dialog windows and MessageWindow
* windows.
*/
bool EditAlarmDlg::eventFilter(QObject*, QEvent* e)
......
......@@ -16,7 +16,7 @@
#include "kamail.h"
#include "latecancel.h"
#include "mainwindow.h"
#include "messagewin.h"
#include "messagewindow.h"
#include "pickfileradio.h"
#include "preferences.h"
#include "reminder.h"
......@@ -1506,7 +1506,7 @@ EditAudioAlarmDlg::EditAudioAlarmDlg(bool Template, const KAEvent* event, bool n
{
qCDebug(KALARM_LOG) << "EditAudioAlarmDlg: Event.id()";
init(event);
mTryButton->setEnabled(!MessageWin::isAudioPlaying());
mTryButton->setEnabled(!MessageDisplay::isAudioPlaying());
connect(theApp(), &KAlarmApp::audioPlaying, this, &EditAudioAlarmDlg::slotAudioPlaying);
}
......@@ -1670,12 +1670,12 @@ bool EditAudioAlarmDlg::checkText(QString& result, bool showErrorMessage) const
*/
void EditAudioAlarmDlg::slotTry()
{
if (!MessageWin::isAudioPlaying())
if (!MessageDisplay::isAudioPlaying())
EditAlarmDlg::slotTry(); // play the audio file
else if (mMessageWin)
else if (mMessageWindow)
{
mMessageWin->stopAudio();
mMessageWin = nullptr;
MessageDisplay::stopAudio();
mMessageWindow = nullptr;
}
}
......@@ -1684,11 +1684,11 @@ void EditAudioAlarmDlg::slotTry()
*/
void EditAudioAlarmDlg::type_executedTry(const QString&, void* result)
{
mMessageWin = (MessageWin*)result; // note which MessageWin controls the audio playback
if (mMessageWin)
mMessageWindow = (MessageWindow*)result; // note which MessageWindow controls the audio playback
if (mMessageWindow)
{
slotAudioPlaying(true);
connect(mMessageWin, &MessageWin::destroyed, this, &EditAudioAlarmDlg::audioWinDestroyed);
connect(mMessageWindow, &MessageWindow::destroyed, this, &EditAudioAlarmDlg::audioWinDestroyed);
}
}
......@@ -1704,9 +1704,9 @@ void EditAudioAlarmDlg::slotAudioPlaying(bool playing)
mTryButton->setEnabled(true);
mTryButton->setCheckable(false);
mTryButton->setChecked(false);
mMessageWin = nullptr;
mMessageWindow = nullptr;
}
else if (mMessageWin)
else if (mMessageWindow)
{
// The test sound file is playing, so enable the Try button and depress it
mTryButton->setEnabled(true);
......
......@@ -33,7 +33,7 @@ class CommandEdit;
class LineEdit;
class TextEdit;
class SoundWidget;
class MessageWin;
class MessageWindow;
class PickLogFileRadio;
class EditDisplayAlarmDlg : public EditAlarmDlg
......@@ -282,7 +282,7 @@ class EditAudioAlarmDlg : public EditAlarmDlg
void slotAudioPlaying(bool playing);
private:
MessageWin* mMessageWin {nullptr}; // MessageWin controlling test audio playback
MessageWindow* mMessageWindow {nullptr}; // MessageWindow controlling test audio playback
// Audio alarm options
SoundWidget* mSoundConfig;
......
......@@ -15,7 +15,7 @@
#include "kalarmapp.h"
#include "kamail.h"
#include "mainwindow.h"
#include "messagewin.h"
#include "messagewindow.h"
#include "preferences.h"
#include "resourcescalendar.h"
#include "templatelistview.h"
......@@ -200,7 +200,7 @@ KToggleAction* createAlarmEnableAction(QObject* parent)
QAction* createStopPlayAction(QObject* parent)
{
QAction* action = new QAction(QIcon::fromTheme(QStringLiteral("media-playback-stop")), i18nc("@action", "Stop Play"), parent);
action->setEnabled(MessageWin::isAudioPlaying());
action->setEnabled(MessageDisplay::isAudioPlaying());
QObject::connect(action, &QAction::triggered, theApp(), &KAlarmApp::stopAudio);
// The following line ensures that all instances are kept in the same state
QObject::connect(theApp(), &KAlarmApp::audioPlaying, action, &QAction::setEnabled);
......@@ -727,10 +727,10 @@ UpdateResult enableEvents(QVector<KAEvent>& events, bool enable, QWidget* msgPar
resourceIds.insert(event->resourceId());
ResourcesCalendar::disabledChanged(newev);
// If we're disabling a display alarm, close any message window
// If we're disabling a display alarm, close any message display
if (!enable && (event->actionTypes() & KAEvent::ACT_DISPLAY))
{
MessageWin* win = MessageWin::findEvent(EventId(*event));
MessageDisplay* win = MessageDisplay::findEvent(EventId(*event));
delete win;
}
}
......@@ -1611,13 +1611,13 @@ void refreshAlarmsIfQueued()
for (Resource& resource : resources)
resource.reload();
// Close any message windows for alarms which are now disabled
// Close any message displays for alarms which are now disabled
const QVector<KAEvent> events = ResourcesCalendar::events(CalEvent::ACTIVE);
for (const KAEvent& event : events)
{
if (!event.enabled() && (event.actionTypes() & KAEvent::ACT_DISPLAY))
{
MessageWin* win = MessageWin::findEvent(EventId(event));
MessageDisplay* win = MessageDisplay::findEvent(EventId(event));
delete win;
}
}
......
......@@ -16,7 +16,7 @@
#include "functions.h"
#include "kamail.h"
#include "mainwindow.h"
#include "messagewin.h"
#include "messagewindow.h"
#include "migratekde4files.h"
#include "preferences.h"
#include "prefdlg.h"
......@@ -273,9 +273,9 @@ bool KAlarmApp::restoreSession()
else
win->show();
}
else if (type == QLatin1String("MessageWin"))
else if (type == QLatin1String("MessageWindow"))
{
MessageWin* win = new MessageWin;
MessageWindow* win = new MessageWindow;
win->restore(i, false);
if (win->isValid())
{
......@@ -680,7 +680,7 @@ bool KAlarmApp::quitIf(int exitCode, bool force)
MainWindow::closeAll();
mQuitting = false;
displayTrayIcon(false);
if (MessageWin::instanceCount(true)) // ignore always-hidden windows (e.g. audio alarms)
if (MessageDisplay::instanceCount(true)) // ignore always-hidden displays (e.g. audio alarms)
return false;
}
else if (mQuitting)
......@@ -689,7 +689,7 @@ bool KAlarmApp::quitIf(int exitCode, bool force)
{
// Quit only if there are no more "instances" running
mPendingQuit = false;
if (mActiveCount > 0 || MessageWin::instanceCount(true)) // ignore always-hidden windows (e.g. audio alarms)
if (mActiveCount > 0 || MessageDisplay::instanceCount(true)) // ignore always-hidden displays (e.g. audio alarms)
return false;
const int mwcount = MainWindow::count();
MainWindow* mw = mwcount ? MainWindow::firstWindow() : nullptr;
......@@ -718,7 +718,7 @@ bool KAlarmApp::quitIf(int exitCode, bool force)
// be initialised in the initialiseTimerResources() method, in case
// KAlarm is started again before application exit completes!
qCDebug(KALARM_LOG) << "KAlarmApp::quitIf:" << exitCode << ": quitting";
MessageWin::stopAudio(true);
MessageDisplay::stopAudio(true);
if (mCancelRtcWake)
{
KAlarm::setRtcWakeTime(0, nullptr);
......@@ -1300,7 +1300,7 @@ void KAlarmApp::slotResourcesCreated()
if (mRedisplayAlarms)
{
mRedisplayAlarms = false;
MessageWin::redisplayAlarms();
MessageDisplay::redisplayAlarms();
}
checkWritableCalendar();
checkArchivedCalendar();
......@@ -1386,7 +1386,7 @@ void KAlarmApp::slotEditAlarmById()
if (mEditingCmdLineAlarm & 0x10)
{
mRedisplayAlarms = false;
MessageWin::redisplayAlarms();
MessageDisplay::redisplayAlarms();
}
mEditingCmdLineAlarm = 2; // indicate edit completion
QTimer::singleShot(0, this, &KAlarmApp::processQueue);
......@@ -1540,7 +1540,7 @@ void KAlarmApp::setAlarmsEnabled(bool enabled)
*/
void KAlarmApp::spreadWindows(bool spread)
{
spread = MessageWin::spread(spread);
spread = MessageWindow::spread(spread);
Q_EMIT spreadWindowsToggled(spread);
}
......@@ -1556,7 +1556,7 @@ void KAlarmApp::setSpreadWindowsState(bool spread)
/******************************************************************************
* Check whether the window manager's handling of keyboard focus transfer
* between application windows is broken. This is true for Ubuntu's Unity
* desktop, where MessageWin windows steal keyboard focus from EditAlarmDlg
* desktop, where MessageWindow windows steal keyboard focus from EditAlarmDlg
* windows.
*/
bool KAlarmApp::windowFocusBroken() const
......@@ -1567,11 +1567,11 @@ bool KAlarmApp::windowFocusBroken() const
/******************************************************************************
* Check whether window/keyboard focus currently needs to be fixed manually due
* to the window manager not handling it correctly. This will occur if there are
* both EditAlarmDlg and MessageWin windows currently active.
* both EditAlarmDlg and MessageWindow windows currently active.
*/
bool KAlarmApp::needWindowFocusFix() const
{
return mWindowFocusBroken && MessageWin::instanceCount(true) && EditAlarmDlg::instanceCount();
return mWindowFocusBroken && MessageWindow::windowCount(true) && EditAlarmDlg::instanceCount();
}
/******************************************************************************
......@@ -2089,7 +2089,7 @@ bool KAlarmApp::cancelReminderAndDeferral(KAEvent& event)
/******************************************************************************
* Execute an alarm by displaying its message or file, or executing its command.
* Reply = ShellProcess instance if a command alarm
* = MessageWin if an audio alarm
* = MessageWindow if an audio alarm
* != 0 if successful
* = -1 if execution has not completed
* = 0 if the alarm is disabled, or if an error message was output.
......@@ -2126,13 +2126,13 @@ void* KAlarmApp::execAlarm(KAEvent& event, const KAAlarm& alarm, bool reschedule
{
// Display a message, file or command output, provided that the same event
// isn't already being displayed
MessageWin* win = MessageWin::findEvent(EventId(event));
MessageDisplay* disp = MessageDisplay::findEvent(EventId(event));
// Find if we're changing a reminder message to the real message
const bool reminder = (alarm.type() & KAAlarm::REMINDER_ALARM);
const bool replaceReminder = !reminder && win && (win->alarmType() & KAAlarm::REMINDER_ALARM);
const bool replaceReminder = !reminder && disp && (disp->alarmType() & KAAlarm::REMINDER_ALARM);
if (!reminder
&& (!event.deferred() || (event.extraActionOptions() & KAEvent::ExecPreActOnDeferral))
&& (replaceReminder || !win) && !noPreAction
&& (replaceReminder || !disp) && !noPreAction
&& !event.preAction().isEmpty())
{
// It's not a reminder alarm, and it's not a deferred alarm unless the
......@@ -2174,33 +2174,33 @@ void* KAlarmApp::execAlarm(KAEvent& event, const KAAlarm& alarm, bool reschedule
// Display the message even though it failed
}
if (!win)
if (!disp)
{
// There isn't already a message for this event
const int flags = (reschedule ? 0 : MessageWin::NO_RESCHEDULE) | (allowDefer ? 0 : MessageWin::NO_DEFER);
(new MessageWin(&event, alarm, flags))->show();
const int flags = (reschedule ? 0 : MessageDisplay::NO_RESCHEDULE) | (allowDefer ? 0 : MessageDisplay::NO_DEFER);
(new MessageWindow(&event, alarm, flags))->show();
}
else if (replaceReminder)
{
// The caption needs to be changed from "Reminder" to "Message"
win->cancelReminder(event, alarm);
disp->cancelReminder(event, alarm);
}
else if (!win->hasDefer() && !alarm.repeatAtLogin())
else if (!disp->hasDefer() && !alarm.repeatAtLogin())
{
// It's a repeat-at-login message with no Defer button,
// which has now reached its final trigger time and needs
// to be replaced with a new message.
win->showDefer();
win->showDateTime(event, alarm);
disp->showDefer();
disp->showDateTime(event, alarm);
}
else
{
// Use the existing message window
}
if (win)
if (disp)
{
// Raise the existing message window and replay any sound
win->repeat(alarm); // N.B. this reschedules the alarm
disp->repeat(alarm); // N.B. this reschedules the alarm
}
break;
}
......@@ -2231,19 +2231,19 @@ void* KAlarmApp::execAlarm(KAEvent& event, const KAAlarm& alarm, bool reschedule
{
// Play the sound, provided that the same event
// isn't already playing
MessageWin* win = MessageWin::findEvent(EventId(event));
if (!win)
MessageDisplay* disp = MessageDisplay::findEvent(EventId(event));
if (!disp)
{
// There isn't already a message for this event.
const int flags = (reschedule ? 0 : MessageWin::NO_RESCHEDULE) | MessageWin::ALWAYS_HIDE;
win = new MessageWin(&event, alarm, flags);
const int flags = (reschedule ? 0 : MessageDisplay::NO_RESCHEDULE) | MessageDisplay::ALWAYS_HIDE;
disp = new MessageWindow(&event, alarm, flags);
}
else
{
// There's an existing message window: replay the sound
win->repeat(alarm); // N.B. this reschedules the alarm
disp->repeat(alarm); // N.B. this reschedules the alarm
}
return win;
return disp;
}
default:
return nullptr;
......@@ -2261,7 +2261,7 @@ void KAlarmApp::emailSent(KAMail::JobData& data, const QStringList& errmsgs, boo
// Some error occurred, although the email may have been sent successfully
if (errmsgs.count() > 1)
qCDebug(KALARM_LOG) << "KAlarmApp::emailSent:" << (copyerr ? "Copy error:" : "Failed:") << errmsgs[1];
MessageWin::showError(data.event, data.alarm.dateTime(), errmsgs);
MessageWindow::showError(data.event, data.alarm.dateTime(), errmsgs);
}
else if (data.queued)
Q_EMIT execAlarmSuccess();
......@@ -2473,7 +2473,7 @@ QString KAlarmApp::createTempScriptFile(const QString& command, bool insertShell
}
const QStringList errmsgs(i18nc("@info", "Error creating temporary script file"));
MessageWin::showError(event, alarm.dateTime(), errmsgs, QStringLiteral("Script"));
MessageWindow::showError(event, alarm.dateTime(), errmsgs, QStringLiteral("Script"));
return QString();
}
......@@ -2592,7 +2592,7 @@ void KAlarmApp::commandErrorMsg(const ShellProcess* proc, const KAEvent& event,
errmsgs += proc->command();
dontShowAgain += QString::number(proc->status());
}
MessageWin::showError(event, (alarm ? alarm->dateTime() : DateTime()), errmsgs, dontShowAgain);
MessageWindow::showError(event, (alarm ? alarm->dateTime() : DateTime()), errmsgs, dontShowAgain);
}
}
......@@ -2626,8 +2626,8 @@ bool KAlarmApp::initCheck(bool calendarOnly)
{
/* Need to open the display calendar now, since otherwise if display
* alarms are immediately due, they will often be processed while
* MessageWin::redisplayAlarms() is executing open() (but before open()
* completes), which causes problems!!
* MessageDisplay::redisplayAlarms() is executing open() (but before
* open() completes), which causes problems!!
*/
DisplayCalendar::open();
}
......@@ -2657,7 +2657,7 @@ void KAlarmApp::notifyAudioPlaying(bool playing)
*/
void KAlarmApp::stopAudio()
{
MessageWin::stopAudio();
MessageDisplay::stopAudio();
}
/******************************************************************************
......
......@@ -1513,7 +1513,7 @@ MainWindow* MainWindow::toggleWindow(MainWindow* win)
* Called when the Edit button is clicked in an alarm message window.
* This controls the alarm edit dialog created by the alarm window, and allows
* it to remain unaffected by the alarm window closing.
* See MessageWin::slotEdit() for more information.
* See MessageWindow::slotEdit() for more information.
*/
void MainWindow::editAlarm(EditAlarmDlg* dlg, const KAEvent& event)
{
......
......@@ -21,7 +21,7 @@ MainWindowBase::MainWindowBase(QWidget* parent, Qt::WindowFlags f)
* Called when the mouse cursor enters the window.
* Activates this window if an Edit Alarm Dialog has activated itself.
* This is only required on Ubuntu's Unity desktop, which doesn't transfer
* keyboard focus properly between Edit Alarm Dialog windows and MessageWin
* keyboard focus properly between Edit Alarm Dialog windows and MessageWindow
* windows.
*/
void MainWindowBase::enterEvent(QEvent* e)
......
/*
* messagedisplay.cpp - base class to display an alarm or error message
* Program: kalarm
* SPDX-FileCopyrightText: 2001-2020 David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "messagedisplayhelper.h"
#include "messagewindow.h"
//#include "messagenotification.h"
#include "displaycalendar.h"
#include "kalarmapp.h"
#include "resourcescalendar.h"
#include "resources/resources.h"
using namespace KAlarmCal;
using namespace KCalendarCore;
bool MessageDisplay::mRedisplayed = false;
MessageDisplay::MessageDisplay(const QString& displayType)
: mDisplayType(displayType)
, mHelper(new MessageDisplayHelper(this))
{
}
MessageDisplay::MessageDisplay(const QString& displayType, const KAEvent* event, const KAAlarm& alarm, int flags)
: mDisplayType(displayType)
, mHelper(new MessageDisplayHelper(this, event, alarm, flags))
{
}
MessageDisplay::MessageDisplay(const QString& displayType, const KAEvent* event,
const DateTime& alarmDateTime,
const QStringList& errmsgs, const QString& dontShowAgain)
: mDisplayType(displayType)
, mHelper(new MessageDisplayHelper(this, event, alarmDateTime, errmsgs, dontShowAgain))
{
}
MessageDisplay::~MessageDisplay()
{
delete mHelper;
if (!instanceCount(true))
theApp()->quitIf(); // no visible displays remain - check whether to quit
}
/******************************************************************************
* Redisplay alarms which were being shown when the program last exited.
* Normally, these alarms will have been displayed by session restoration, but
* if the program crashed or was killed, we can redisplay them here so that
* they won't be lost.
*/
void MessageDisplay::redisplayAlarms()
{
if (mRedisplayed)
return;
qCDebug(KALARM_LOG) << "MessageDisplay::redisplayAlarms";
mRedisplayed = true;
if (DisplayCalendar::isOpen())
{
KAEvent event;
Resource resource;
const Event::List kcalEvents = DisplayCalendar::kcalEvents();
for (const Event::Ptr& kcalEvent : kcalEvents)
{
bool showDefer, showEdit;
reinstateFromDisplaying(kcalEvent, event, resource, showEdit, showDefer);
const EventId eventId(event);
if (findEvent(eventId))
qCDebug(KALARM_LOG) << "MessageDisplay::redisplayAlarms: Message display already exists:" << eventId;
else
{
// This event should be displayed, but currently isn't being
const KAAlarm alarm = event.convertDisplayingAlarm();
if (alarm.type() == KAAlarm::INVALID_ALARM)
{
qCCritical(KALARM_LOG) << "MessageDisplay::redisplayAlarms: Invalid alarm: id=" << eventId;
continue;
}
qCDebug(KALARM_LOG) << "MessageDisplay::redisplayAlarms:" << eventId;
const bool login = alarm.repeatAtLogin();
const int flags = NO_RESCHEDULE | (login ? NO_DEFER : 0) | NO_INIT_VIEW;
MessageDisplay* d = new MessageWindow(&event, alarm, flags);
MessageDisplayHelper* h = d->mHelper;
h->mResource = resource;
const bool rw = resource.isWritable(event.category());
h->mShowEdit = rw ? showEdit : false;
h->mNoDefer = (rw && !login) ? !showDefer : true;
d->setUpDisplay();
d->showDisplay();
}
}
}
}
/******************************************************************************
* Retrieves the event with the current ID from the displaying calendar file,
* or if not found there, from the archive calendar. 'resource' is set to the
* resource which originally contained the event, or invalid if not known.
*/
bool MessageDisplay::retrieveEvent(KAEvent& event, Resource& resource, bool& showEdit, bool& showDefer)
{
const QString eventId = mHelper->mEventId.eventId();
const Event::Ptr kcalEvent = DisplayCalendar::kcalEvent(CalEvent::uid(eventId, CalEvent::DISPLAYING));
if (!reinstateFromDisplaying(kcalEvent, event, resource, showEdit, showDefer))
{
// The event isn't in the displaying calendar.
// Try to retrieve it from the archive calendar.
KAEvent ev;
Resource archiveRes = Resources::getStandard(CalEvent::ARCHIVED);
if (archiveRes.isValid())
ev = ResourcesCalendar::event(EventId(archiveRes.id(), CalEvent::uid(eventId, CalEvent::ARCHIVED)));
if (!ev.isValid())
return false;
event = ev;
event.setArchive(); // ensure that it gets re-archived if it's saved
event.setCategory(CalEvent::ACTIVE);
if (eventId != event.id())
qCCritical(KALARM_LOG) << "MessageDisplay::retrieveEvent: Wrong event ID";
event.setEventId(eventId);
resource = Resource();
showEdit = false;
showDefer = false;
qCDebug(KALARM_LOG) << "MessageDisplay::retrieveEvent:" << event.id() << ": success";
}
return true;
}
/******************************************************************************
* Retrieves the displayed event from the calendar file, or if not found there,
* from the displaying calendar. 'resource' is set to the resource which
* originally contained the event.
*/
bool MessageDisplay::reinstateFromDisplaying(const Event::Ptr& kcalEvent, KAEvent& event, Resource& resource, bool& showEdit, bool& showDefer)
{
if (!kcalEvent)
return false;
ResourceId resourceId;
event.reinstateFromDisplaying(kcalEvent, resourceId, showEdit, showDefer);
event.setResourceId(resourceId);
resource = Resources::resource(resourceId);
qCDebug(KALARM_LOG) << "MessageDisplay::reinstateFromDisplaying:" << EventId(event) << ": success";
return true;
}
// vim: et sw=4:
/*
* messagedisplay.h - base class to display an alarm or error message
* Program: kalarm
* SPDX-FileCopyrightText: 2001-2020 David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef MESSAGEDISPLAY_H
#define MESSAGEDISPLAY_H
#include "messagedisplayhelper.h"
#include <KAlarmCal/KAEvent>
#include <QObject>
class KConfigGroup;
class EventId;
class MessageDisplayHelper;
using namespace KAlarmCal;
/**
* Abstract base class for alarm message display.
*/
class MessageDisplay
{
public:
enum { // flags for constructor
NO_RESCHEDULE = 0x01, // don't reschedule the event once it has displayed
NO_DEFER = 0x02, // don't display an option to defer
ALWAYS_HIDE = 0x04, // never show the window (e.g. for audio-only alarms)
NO_INIT_VIEW = 0x08 // for internal MessageDisplayHelper use only
};
virtual ~MessageDisplay();
bool isValid() const { return mHelper->isValid(); }
KAAlarm::Type alarmType() const { return mHelper->mAlarmType; }
/** Raise the alarm display, re-output any required audio notification, and
* reschedule the alarm in the calendar file.
*/
virtual void repeat(const KAAlarm&) = 0;
virtual bool hasDefer() const { return false; }
virtual void showDefer() {}
virtual void showDateTime(const KAEvent&, const KAAlarm&) {}
/** Convert a reminder display into a normal alarm display. */
virtual void cancelReminder(const KAEvent& event, const KAAlarm& alarm)
{
mHelper->cancelReminder(event, alarm);
}
/** Returns the existing message display (if any) which is showing the event with