32 #include <kalarmcal/kaevent.h>
35 #include <akonadi/collection.h>
36 #include <akonadi/item.h>
56 using namespace KAlarmCal;
73 MessageWin(
const KAEvent*,
const KAAlarm&,
int flags);
75 void repeat(
const KAAlarm&);
77 const DateTime&
dateTime() {
return mDateTime; }
78 KAAlarm::Type
alarmType()
const {
return mAlarmType; }
79 bool hasDefer()
const;
81 void cancelReminder(
const KAEvent&,
const KAAlarm&);
82 void showDateTime(
const KAEvent&,
const KAAlarm&);
83 bool isValid()
const {
return !mInvalid; }
86 virtual QSize sizeHint()
const;
87 static int instanceCount(
bool excludeAlwaysHidden =
false);
91 static MessageWin* findEvent(
const QString& eventId);
93 static void redisplayAlarms();
94 static void stopAudio(
bool wait =
false);
95 static bool isAudioPlaying();
96 static void showError(
const KAEvent&,
const DateTime& alarmDateTime,
const QStringList& errmsgs,
97 const QString& dontShowAgain = QString());
98 static bool spread(
bool scatter);
101 virtual void showEvent(QShowEvent*);
102 virtual void moveEvent(QMoveEvent*);
103 virtual void resizeEvent(QResizeEvent*);
104 virtual void closeEvent(QCloseEvent*);
105 virtual void saveProperties(KConfigGroup&);
106 virtual void readProperties(
const KConfigGroup&);
113 void editCloseCancel();
114 void activeWindowChanged(WId);
115 void checkDeferralLimit();
116 void displayMainWindow();
117 #ifdef KMAIL_SUPPORTED
118 void slotShowKMailMessage();
121 void audioTerminating();
125 void enableButtons();
126 void setRemainingTextDay();
127 void setRemainingTextMinute();
132 MessageWin(
const KAEvent*,
const DateTime& alarmDateTime,
const QStringList& errmsgs,
133 const QString& dontShowAgain);
135 QString dateTimeToDisplay();
136 void displayComplete();
137 void setButtonsReadOnly(
bool);
138 bool getWorkAreaAndModal();
140 void setDeferralLimit(
const KAEvent&);
141 void alarmShowing(KAEvent&);
143 bool retrieveEvent(KAEvent&, Akonadi::Collection&,
bool& showEdit,
bool& showDefer);
145 bool retrieveEvent(KAEvent&, AlarmResource*&,
bool& showEdit,
bool& showDefer);
147 bool haveErrorMessage(
unsigned msg)
const;
148 void clearErrorMessage(
unsigned msg)
const;
150 static bool reinstateFromDisplaying(
const KCalCore::Event::Ptr&, KAEvent&, Akonadi::Collection&,
bool& showEdit,
bool& showDefer);
152 static bool reinstateFromDisplaying(
const KCal::Event*, KAEvent&, AlarmResource*&,
bool& showEdit,
bool& showDefer);
154 static bool isSpread(
const QPoint& topLeft);
158 static QMap<EventId, unsigned> mErrorMessages;
160 static QMap<QString, unsigned> mErrorMessages;
167 QColor mBgColour, mFgColour;
169 QDateTime mCloseTime;
171 Akonadi::Item::Id mEventItemId;
180 int mDefaultDeferMinutes;
181 KAAlarm::Type mAlarmType;
182 KAEvent::SubAction mAction;
183 unsigned long mKMailSerialNumber;
184 KAEvent::CmdErrType mCommandError;
185 QStringList mErrorMsgs;
186 QString mDontShowAgain;
188 int mAudioRepeatPause;
195 KAEvent mOriginalEvent;
197 Akonadi::Collection mCollection;
199 AlarmResource* mResource;
209 MessageText* mCommandText;
213 QDateTime mDeferLimit;
223 bool mRescheduleEvent;
226 bool mNoCloseConfirm;
227 bool mDisableDeferral;
230 #endif // MESSAGEWIN_H
The MainWindowBase class is a base class for KAlarm's main window and message window.
MessageWin: A window to display an alarm or error message.
const DateTime & dateTime()
KAAlarm::Type alarmType() const
Unique event identifier for Akonadi.
bool alwaysHidden() const