summaryrefslogtreecommitdiffabout
path: root/libkcal
authorzautrix <zautrix>2005-06-08 10:56:24 (UTC)
committer zautrix <zautrix>2005-06-08 10:56:24 (UTC)
commit2448916479b456ca7c880427a80e8e32e95b2fba (patch) (unidiff)
tree83be907f0eccb43ffc44a7f1bc07995c32760cb5 /libkcal
parent793d117812b4da36c9c11d90cccba347cbc6e208 (diff)
downloadkdepimpi-2448916479b456ca7c880427a80e8e32e95b2fba.zip
kdepimpi-2448916479b456ca7c880427a80e8e32e95b2fba.tar.gz
kdepimpi-2448916479b456ca7c880427a80e8e32e95b2fba.tar.bz2
more type API changes
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/alarm.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp
index 6de1566..0afa0a7 100644
--- a/libkcal/alarm.cpp
+++ b/libkcal/alarm.cpp
@@ -1,481 +1,481 @@
1/* 1/*
2 This file is part of libkcal. 2 This file is part of libkcal.
3 Copyright (c) 1998 Preston Brown 3 Copyright (c) 1998 Preston Brown
4 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This library is free software; you can redistribute it and/or 6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public 7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either 8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version. 9 version 2 of the License, or (at your option) any later version.
10 10
11 This library is distributed in the hope that it will be useful, 11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include <kdebug.h> 22#include <kdebug.h>
23#include <klocale.h> 23#include <klocale.h>
24 24
25#include "incidence.h" 25#include "incidence.h"
26#include "todo.h" 26#include "todo.h"
27 27
28#include "alarm.h" 28#include "alarm.h"
29 29
30using namespace KCal; 30using namespace KCal;
31#include <qwidget.h> 31#include <qwidget.h>
32Alarm::Alarm(Incidence *parent) 32Alarm::Alarm(Incidence *parent)
33 : mParent(parent), 33 : mParent(parent),
34 mType(Audio), 34 mType(Audio),
35 mDescription(""), // to make operator==() not fail 35 mDescription(""), // to make operator==() not fail
36 mFile(""), // to make operator==() not fail 36 mFile(""), // to make operator==() not fail
37 mMailSubject(""), // to make operator==() not fail 37 mMailSubject(""), // to make operator==() not fail
38 mAlarmSnoozeTime(5), 38 mAlarmSnoozeTime(5),
39 mAlarmRepeatCount(0), 39 mAlarmRepeatCount(0),
40 mEndOffset(false), 40 mEndOffset(false),
41 mHasTime(false), 41 mHasTime(false),
42 mAlarmEnabled(false) 42 mAlarmEnabled(false)
43{ 43{
44 44
45} 45}
46 46
47Alarm::~Alarm() 47Alarm::~Alarm()
48{ 48{
49} 49}
50 50
51bool Alarm::operator==( const Alarm& rhs ) const 51bool Alarm::operator==( const Alarm& rhs ) const
52{ 52{
53 53
54 if ( mType != rhs.mType || 54 if ( mType != rhs.mType ||
55 mAlarmSnoozeTime != rhs.mAlarmSnoozeTime || 55 mAlarmSnoozeTime != rhs.mAlarmSnoozeTime ||
56 mAlarmRepeatCount != rhs.mAlarmRepeatCount || 56 mAlarmRepeatCount != rhs.mAlarmRepeatCount ||
57 mAlarmEnabled != rhs.mAlarmEnabled || 57 mAlarmEnabled != rhs.mAlarmEnabled ||
58 mHasTime != rhs.mHasTime) 58 mHasTime != rhs.mHasTime)
59 return false; 59 return false;
60 60
61#if 0 61#if 0
62 if ( mType != rhs.mType ) { 62 if ( mType != rhs.mType ) {
63 63
64 qDebug("aaa1 "); 64 qDebug("aaa1 ");
65 return false; 65 return false;
66 } 66 }
67 67
68 if ( mAlarmSnoozeTime != rhs.mAlarmSnoozeTime ) { 68 if ( mAlarmSnoozeTime != rhs.mAlarmSnoozeTime ) {
69 69
70 qDebug("aaa2 "); 70 qDebug("aaa2 ");
71 return false; 71 return false;
72 } 72 }
73 73
74 74
75 if ( mAlarmRepeatCount != rhs.mAlarmRepeatCount ) { 75 if ( mAlarmRepeatCount != rhs.mAlarmRepeatCount ) {
76 76
77 qDebug("aaa3 "); 77 qDebug("aaa3 ");
78 return false; 78 return false;
79 } 79 }
80 80
81 if ( mAlarmEnabled != rhs.mAlarmEnabled ) { 81 if ( mAlarmEnabled != rhs.mAlarmEnabled ) {
82 82
83 qDebug("aaa4 "); 83 qDebug("aaa4 ");
84 return false; 84 return false;
85 } 85 }
86 86
87 if ( mHasTime != rhs.mHasTime ) { 87 if ( mHasTime != rhs.mHasTime ) {
88 88
89 qDebug("aaa5 "); 89 qDebug("aaa5 ");
90 return false; 90 return false;
91 } 91 }
92#endif 92#endif
93 93
94 94
95 if (mHasTime) { 95 if (mHasTime) {
96 if (mAlarmTime != rhs.mAlarmTime) 96 if (mAlarmTime != rhs.mAlarmTime)
97 return false; 97 return false;
98 } else { 98 } else {
99 if (mOffset != rhs.mOffset || 99 if (mOffset != rhs.mOffset ||
100 mEndOffset != rhs.mEndOffset) 100 mEndOffset != rhs.mEndOffset)
101 return false; 101 return false;
102 } 102 }
103 switch (mType) { 103 switch (mType) {
104 case Display: 104 case Display:
105 return mDescription == rhs.mDescription; 105 return mDescription == rhs.mDescription;
106 106
107 case Email: 107 case Email:
108 return mDescription == rhs.mDescription && 108 return mDescription == rhs.mDescription &&
109 mMailAttachFiles == rhs.mMailAttachFiles && 109 mMailAttachFiles == rhs.mMailAttachFiles &&
110 mMailAddresses == rhs.mMailAddresses && 110 mMailAddresses == rhs.mMailAddresses &&
111 mMailSubject == rhs.mMailSubject; 111 mMailSubject == rhs.mMailSubject;
112 112
113 case Procedure: 113 case Procedure:
114 return mFile == rhs.mFile && 114 return mFile == rhs.mFile &&
115 mDescription == rhs.mDescription; 115 mDescription == rhs.mDescription;
116 116
117 case Audio: 117 case Audio:
118 return mFile == rhs.mFile; 118 return mFile == rhs.mFile;
119 119
120 case Invalid: 120 case Invalid:
121 break; 121 break;
122 } 122 }
123 return false; 123 return false;
124} 124}
125 125
126void Alarm::setType(Alarm::Type type) 126void Alarm::setType(Alarm::Type type)
127{ 127{
128 if (type == mType) 128 if (type == mType)
129 return; 129 return;
130 130
131 switch (type) { 131 switch (type) {
132 case Display: 132 case Display:
133 mDescription = ""; 133 mDescription = "";
134 break; 134 break;
135 case Procedure: 135 case Procedure:
136 mFile = mDescription = ""; 136 mFile = mDescription = "";
137 break; 137 break;
138 case Audio: 138 case Audio:
139 mFile = ""; 139 mFile = "";
140 break; 140 break;
141 case Email: 141 case Email:
142 mMailSubject = mDescription = ""; 142 mMailSubject = mDescription = "";
143 mMailAddresses.clear(); 143 mMailAddresses.clear();
144 mMailAttachFiles.clear(); 144 mMailAttachFiles.clear();
145 break; 145 break;
146 case Invalid: 146 case Invalid:
147 break; 147 break;
148 default: 148 default:
149 return; 149 return;
150 } 150 }
151 mType = type; 151 mType = type;
152 mParent->updated(); 152 mParent->updated();
153} 153}
154 154
155Alarm::Type Alarm::type() const 155Alarm::Type Alarm::type() const
156{ 156{
157 return mType; 157 return mType;
158} 158}
159 159
160void Alarm::setAudioAlarm(const QString &audioFile) 160void Alarm::setAudioAlarm(const QString &audioFile)
161{ 161{
162 mType = Audio; 162 mType = Audio;
163 mFile = audioFile; 163 mFile = audioFile;
164 mParent->updated(); 164 mParent->updated();
165} 165}
166 166
167void Alarm::setAudioFile(const QString &audioFile) 167void Alarm::setAudioFile(const QString &audioFile)
168{ 168{
169 if (mType == Audio) { 169 if (mType == Audio) {
170 mFile = audioFile; 170 mFile = audioFile;
171 mParent->updated(); 171 mParent->updated();
172 } 172 }
173} 173}
174 174
175QString Alarm::audioFile() const 175QString Alarm::audioFile() const
176{ 176{
177 return (mType == Audio) ? mFile : QString::null; 177 return (mType == Audio) ? mFile : QString::null;
178} 178}
179 179
180void Alarm::setProcedureAlarm(const QString &programFile, const QString &arguments) 180void Alarm::setProcedureAlarm(const QString &programFile, const QString &arguments)
181{ 181{
182 mType = Procedure; 182 mType = Procedure;
183 mFile = programFile; 183 mFile = programFile;
184 mDescription = arguments; 184 mDescription = arguments;
185 mParent->updated(); 185 mParent->updated();
186} 186}
187 187
188void Alarm::setProgramFile(const QString &programFile) 188void Alarm::setProgramFile(const QString &programFile)
189{ 189{
190 if (mType == Procedure) { 190 if (mType == Procedure) {
191 mFile = programFile; 191 mFile = programFile;
192 mParent->updated(); 192 mParent->updated();
193 } 193 }
194} 194}
195 195
196QString Alarm::programFile() const 196QString Alarm::programFile() const
197{ 197{
198 return (mType == Procedure) ? mFile : QString::null; 198 return (mType == Procedure) ? mFile : QString::null;
199} 199}
200 200
201void Alarm::setProgramArguments(const QString &arguments) 201void Alarm::setProgramArguments(const QString &arguments)
202{ 202{
203 if (mType == Procedure) { 203 if (mType == Procedure) {
204 mDescription = arguments; 204 mDescription = arguments;
205 mParent->updated(); 205 mParent->updated();
206 } 206 }
207} 207}
208 208
209QString Alarm::programArguments() const 209QString Alarm::programArguments() const
210{ 210{
211 return (mType == Procedure) ? mDescription : QString::null; 211 return (mType == Procedure) ? mDescription : QString::null;
212} 212}
213 213
214void Alarm::setEmailAlarm(const QString &subject, const QString &text, 214void Alarm::setEmailAlarm(const QString &subject, const QString &text,
215 const QValueList<Person> &addressees, const QStringList &attachments) 215 const QValueList<Person> &addressees, const QStringList &attachments)
216{ 216{
217 mType = Email; 217 mType = Email;
218 mMailSubject = subject; 218 mMailSubject = subject;
219 mDescription = text; 219 mDescription = text;
220 mMailAddresses = addressees; 220 mMailAddresses = addressees;
221 mMailAttachFiles = attachments; 221 mMailAttachFiles = attachments;
222 mParent->updated(); 222 mParent->updated();
223} 223}
224 224
225void Alarm::setMailAddress(const Person &mailAddress) 225void Alarm::setMailAddress(const Person &mailAddress)
226{ 226{
227 if (mType == Email) { 227 if (mType == Email) {
228 mMailAddresses.clear(); 228 mMailAddresses.clear();
229 mMailAddresses += mailAddress; 229 mMailAddresses += mailAddress;
230 mParent->updated(); 230 mParent->updated();
231 } 231 }
232} 232}
233 233
234void Alarm::setMailAddresses(const QValueList<Person> &mailAddresses) 234void Alarm::setMailAddresses(const QValueList<Person> &mailAddresses)
235{ 235{
236 if (mType == Email) { 236 if (mType == Email) {
237 mMailAddresses = mailAddresses; 237 mMailAddresses = mailAddresses;
238 mParent->updated(); 238 mParent->updated();
239 } 239 }
240} 240}
241 241
242void Alarm::addMailAddress(const Person &mailAddress) 242void Alarm::addMailAddress(const Person &mailAddress)
243{ 243{
244 if (mType == Email) { 244 if (mType == Email) {
245 mMailAddresses += mailAddress; 245 mMailAddresses += mailAddress;
246 mParent->updated(); 246 mParent->updated();
247 } 247 }
248} 248}
249 249
250QValueList<Person> Alarm::mailAddresses() const 250QValueList<Person> Alarm::mailAddresses() const
251{ 251{
252 return (mType == Email) ? mMailAddresses : QValueList<Person>(); 252 return (mType == Email) ? mMailAddresses : QValueList<Person>();
253} 253}
254 254
255void Alarm::setMailSubject(const QString &mailAlarmSubject) 255void Alarm::setMailSubject(const QString &mailAlarmSubject)
256{ 256{
257 if (mType == Email) { 257 if (mType == Email) {
258 mMailSubject = mailAlarmSubject; 258 mMailSubject = mailAlarmSubject;
259 mParent->updated(); 259 mParent->updated();
260 } 260 }
261} 261}
262 262
263QString Alarm::mailSubject() const 263QString Alarm::mailSubject() const
264{ 264{
265 return (mType == Email) ? mMailSubject : QString::null; 265 return (mType == Email) ? mMailSubject : QString::null;
266} 266}
267 267
268void Alarm::setMailAttachment(const QString &mailAttachFile) 268void Alarm::setMailAttachment(const QString &mailAttachFile)
269{ 269{
270 if (mType == Email) { 270 if (mType == Email) {
271 mMailAttachFiles.clear(); 271 mMailAttachFiles.clear();
272 mMailAttachFiles += mailAttachFile; 272 mMailAttachFiles += mailAttachFile;
273 mParent->updated(); 273 mParent->updated();
274 } 274 }
275} 275}
276 276
277void Alarm::setMailAttachments(const QStringList &mailAttachFiles) 277void Alarm::setMailAttachments(const QStringList &mailAttachFiles)
278{ 278{
279 if (mType == Email) { 279 if (mType == Email) {
280 mMailAttachFiles = mailAttachFiles; 280 mMailAttachFiles = mailAttachFiles;
281 mParent->updated(); 281 mParent->updated();
282 } 282 }
283} 283}
284 284
285void Alarm::addMailAttachment(const QString &mailAttachFile) 285void Alarm::addMailAttachment(const QString &mailAttachFile)
286{ 286{
287 if (mType == Email) { 287 if (mType == Email) {
288 mMailAttachFiles += mailAttachFile; 288 mMailAttachFiles += mailAttachFile;
289 mParent->updated(); 289 mParent->updated();
290 } 290 }
291} 291}
292 292
293QStringList Alarm::mailAttachments() const 293QStringList Alarm::mailAttachments() const
294{ 294{
295 return (mType == Email) ? mMailAttachFiles : QStringList(); 295 return (mType == Email) ? mMailAttachFiles : QStringList();
296} 296}
297 297
298void Alarm::setMailText(const QString &text) 298void Alarm::setMailText(const QString &text)
299{ 299{
300 if (mType == Email) { 300 if (mType == Email) {
301 mDescription = text; 301 mDescription = text;
302 mParent->updated(); 302 mParent->updated();
303 } 303 }
304} 304}
305 305
306QString Alarm::mailText() const 306QString Alarm::mailText() const
307{ 307{
308 return (mType == Email) ? mDescription : QString::null; 308 return (mType == Email) ? mDescription : QString::null;
309} 309}
310 310
311void Alarm::setDisplayAlarm(const QString &text) 311void Alarm::setDisplayAlarm(const QString &text)
312{ 312{
313 mType = Display; 313 mType = Display;
314 mDescription = text; 314 mDescription = text;
315 mParent->updated(); 315 mParent->updated();
316} 316}
317 317
318void Alarm::setText(const QString &text) 318void Alarm::setText(const QString &text)
319{ 319{
320 if (mType == Display) { 320 if (mType == Display) {
321 mDescription = text; 321 mDescription = text;
322 mParent->updated(); 322 mParent->updated();
323 } 323 }
324} 324}
325 325
326QString Alarm::text() const 326QString Alarm::text() const
327{ 327{
328 return (mType == Display) ? mDescription : QString::null; 328 return (mType == Display) ? mDescription : QString::null;
329} 329}
330 330
331void Alarm::setTime(const QDateTime &alarmTime) 331void Alarm::setTime(const QDateTime &alarmTime)
332{ 332{
333 mAlarmTime = alarmTime; 333 mAlarmTime = alarmTime;
334 mHasTime = true; 334 mHasTime = true;
335 335
336 mParent->updated(); 336 mParent->updated();
337} 337}
338int Alarm::offset() 338int Alarm::offset()
339{ 339{
340 if ( hasTime() ) { 340 if ( hasTime() ) {
341 if (mParent->type()=="Todo") { 341 if (mParent->typeID() == todoID ) {
342 Todo *t = static_cast<Todo*>(mParent); 342 Todo *t = static_cast<Todo*>(mParent);
343 return t->dtDue().secsTo( mAlarmTime ) ; 343 return t->dtDue().secsTo( mAlarmTime ) ;
344 } else 344 } else
345 return mParent->dtStart().secsTo( mAlarmTime ) ; 345 return mParent->dtStart().secsTo( mAlarmTime ) ;
346 } 346 }
347 else 347 else
348 { 348 {
349 return mOffset.asSeconds(); 349 return mOffset.asSeconds();
350 } 350 }
351 351
352} 352}
353QString Alarm::offsetText() 353QString Alarm::offsetText()
354{ 354{
355 int min = -offset()/60; 355 int min = -offset()/60;
356 int hours = min /60; 356 int hours = min /60;
357 min = min % 60; 357 min = min % 60;
358 int days = hours /24; 358 int days = hours /24;
359 hours = hours % 24; 359 hours = hours % 24;
360 QString message; 360 QString message;
361 //qDebug("%d %d %d ", days, hours, min ); 361 //qDebug("%d %d %d ", days, hours, min );
362 if ( days > 0 ) 362 if ( days > 0 )
363 message += i18n("%1d").arg( days ); 363 message += i18n("%1d").arg( days );
364 if ( hours > 0 ) { 364 if ( hours > 0 ) {
365 if ( !message.isEmpty() ) message += "/"; 365 if ( !message.isEmpty() ) message += "/";
366 message += i18n("%1h").arg( hours ); 366 message += i18n("%1h").arg( hours );
367 } 367 }
368 if ( min > 0 ) { 368 if ( min > 0 ) {
369 if ( !message.isEmpty() ) message += "/"; 369 if ( !message.isEmpty() ) message += "/";
370 message += i18n("%1min").arg( min ); 370 message += i18n("%1min").arg( min );
371 } 371 }
372 if ( message.isEmpty() ) 372 if ( message.isEmpty() )
373 message = i18n("%1min").arg( 0 ); 373 message = i18n("%1min").arg( 0 );
374 return message; 374 return message;
375} 375}
376 376
377 377
378QDateTime Alarm::time() const 378QDateTime Alarm::time() const
379{ 379{
380 if ( hasTime() ) 380 if ( hasTime() )
381 return mAlarmTime; 381 return mAlarmTime;
382 else 382 else
383 { 383 {
384 if (mParent->type()=="Todo") { 384 if (mParent->typeID() == todoID ) {
385 Todo *t = static_cast<Todo*>(mParent); 385 Todo *t = static_cast<Todo*>(mParent);
386 return mOffset.end( t->dtDue() ); 386 return mOffset.end( t->dtDue() );
387 } else if (mEndOffset) { 387 } else if (mEndOffset) {
388 return mOffset.end( mParent->dtEnd() ); 388 return mOffset.end( mParent->dtEnd() );
389 } else { 389 } else {
390 return mOffset.end( mParent->dtStart() ); 390 return mOffset.end( mParent->dtStart() );
391 } 391 }
392 } 392 }
393} 393}
394 394
395bool Alarm::hasTime() const 395bool Alarm::hasTime() const
396{ 396{
397 return mHasTime; 397 return mHasTime;
398} 398}
399 399
400void Alarm::setSnoozeTime(int alarmSnoozeTime) 400void Alarm::setSnoozeTime(int alarmSnoozeTime)
401{ 401{
402 mAlarmSnoozeTime = alarmSnoozeTime; 402 mAlarmSnoozeTime = alarmSnoozeTime;
403 mParent->updated(); 403 mParent->updated();
404} 404}
405 405
406int Alarm::snoozeTime() const 406int Alarm::snoozeTime() const
407{ 407{
408 return mAlarmSnoozeTime; 408 return mAlarmSnoozeTime;
409} 409}
410 410
411void Alarm::setRepeatCount(int alarmRepeatCount) 411void Alarm::setRepeatCount(int alarmRepeatCount)
412{ 412{
413 kdDebug(5800) << "Alarm::setRepeatCount(): " << alarmRepeatCount << endl; 413 kdDebug(5800) << "Alarm::setRepeatCount(): " << alarmRepeatCount << endl;
414 414
415 mAlarmRepeatCount = alarmRepeatCount; 415 mAlarmRepeatCount = alarmRepeatCount;
416 mParent->updated(); 416 mParent->updated();
417} 417}
418 418
419int Alarm::repeatCount() const 419int Alarm::repeatCount() const
420{ 420{
421 kdDebug(5800) << "Alarm::repeatCount(): " << mAlarmRepeatCount << endl; 421 kdDebug(5800) << "Alarm::repeatCount(): " << mAlarmRepeatCount << endl;
422 return mAlarmRepeatCount; 422 return mAlarmRepeatCount;
423} 423}
424 424
425void Alarm::toggleAlarm() 425void Alarm::toggleAlarm()
426{ 426{
427 mAlarmEnabled = !mAlarmEnabled; 427 mAlarmEnabled = !mAlarmEnabled;
428 mParent->updated(); 428 mParent->updated();
429} 429}
430 430
431void Alarm::setEnabled(bool enable) 431void Alarm::setEnabled(bool enable)
432{ 432{
433 mAlarmEnabled = enable; 433 mAlarmEnabled = enable;
434 mParent->updated(); 434 mParent->updated();
435} 435}
436 436
437bool Alarm::enabled() const 437bool Alarm::enabled() const
438{ 438{
439 return mAlarmEnabled; 439 return mAlarmEnabled;
440} 440}
441 441
442void Alarm::setStartOffset( const Duration &offset ) 442void Alarm::setStartOffset( const Duration &offset )
443{ 443{
444 mOffset = offset; 444 mOffset = offset;
445 mEndOffset = false; 445 mEndOffset = false;
446 mHasTime = false; 446 mHasTime = false;
447 mParent->updated(); 447 mParent->updated();
448} 448}
449 449
450Duration Alarm::startOffset() const 450Duration Alarm::startOffset() const
451{ 451{
452 return (mHasTime || mEndOffset) ? 0 : mOffset; 452 return (mHasTime || mEndOffset) ? 0 : mOffset;
453} 453}
454 454
455bool Alarm::hasStartOffset() const 455bool Alarm::hasStartOffset() const
456{ 456{
457 return !mHasTime && !mEndOffset; 457 return !mHasTime && !mEndOffset;
458} 458}
459 459
460bool Alarm::hasEndOffset() const 460bool Alarm::hasEndOffset() const
461{ 461{
462 return !mHasTime && mEndOffset; 462 return !mHasTime && mEndOffset;
463} 463}
464 464
465void Alarm::setEndOffset( const Duration &offset ) 465void Alarm::setEndOffset( const Duration &offset )
466{ 466{
467 mOffset = offset; 467 mOffset = offset;
468 mEndOffset = true; 468 mEndOffset = true;
469 mHasTime = false; 469 mHasTime = false;
470 mParent->updated(); 470 mParent->updated();
471} 471}
472 472
473Duration Alarm::endOffset() const 473Duration Alarm::endOffset() const
474{ 474{
475 return (mHasTime || !mEndOffset) ? 0 : mOffset; 475 return (mHasTime || !mEndOffset) ? 0 : mOffset;
476} 476}
477 477
478void Alarm::setParent( Incidence *parent ) 478void Alarm::setParent( Incidence *parent )
479{ 479{
480 mParent = parent; 480 mParent = parent;
481} 481}