KCalendarCore

incidencebase.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the kcalcore library.
3 
4  SPDX-FileCopyrightText: 2001,2004 Cornelius Schumacher <[email protected]>
5  SPDX-FileCopyrightText: 2003-2004 Reinhold Kainhofer <[email protected]>
6  SPDX-FileCopyrightText: 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
7  SPDX-FileContributor: Alvaro Manera <[email protected]>
8 
9  SPDX-License-Identifier: LGPL-2.0-or-later
10 */
11 /**
12  @file
13  This file is part of the API for handling calendar data and
14  defines the IncidenceBase class.
15 
16  @brief
17  An abstract base class that provides a common base for all calendar incidence
18  classes.
19 
20  @author Cornelius Schumacher <[email protected]>
21  @author Reinhold Kainhofer <[email protected]>
22 */
23 
24 #include "incidencebase.h"
25 #include "incidencebase_p.h"
26 #include "calformat.h"
27 #include "utils_p.h"
28 #include "visitor.h"
29 
30 #include "kcalendarcore_debug.h"
31 #include <QTime>
32 
33 #include <QStringList>
34 
35 #define KCALCORE_MAGIC_NUMBER 0xCA1C012E
36 #define KCALCORE_SERIALIZATION_VERSION 1
37 
38 using namespace KCalendarCore;
39 
40 //@cond PRIVATE
41 void IncidenceBasePrivate::init(const IncidenceBasePrivate &other)
42 {
43  mLastModified = other.mLastModified;
44  mDtStart = other.mDtStart;
45  mOrganizer = other.mOrganizer;
46  mUid = other.mUid;
47  mDuration = other.mDuration;
48  mAllDay = other.mAllDay;
49  mHasDuration = other.mHasDuration;
50 
51  mComments = other.mComments;
52  mContacts = other.mContacts;
53 
54  mAttendees = other.mAttendees;
55  mAttendees.reserve(other.mAttendees.count());
56  mUrl = other.mUrl;
57 }
58 
59 //@endcond
60 
61 #if KCALENDARCORE_BUILD_DEPRECATED_SINCE(5, 91)
63  : d_ptr(new KCalendarCore::IncidenceBasePrivate)
64 {
65  mReadOnly = false;
67 }
68 
70  : CustomProperties(i)
71  , d_ptr(new KCalendarCore::IncidenceBasePrivate(*i.d_ptr))
72 {
73  mReadOnly = i.mReadOnly;
74 }
75 #endif
76 
77 IncidenceBase::IncidenceBase(IncidenceBasePrivate *p)
78  : d_ptr(p)
79 {
80  mReadOnly = false;
82 }
83 
84 IncidenceBase::IncidenceBase(const IncidenceBase &i, IncidenceBasePrivate *p)
85  : CustomProperties(i)
86  , d_ptr(p)
87 {
88  mReadOnly = i.mReadOnly;
89 }
90 
92 {
93  delete d_ptr;
94 }
95 
97 {
98  Q_ASSERT(type() == other.type());
99 
100  startUpdates();
101 
102  // assign is virtual, will call the derived class's
103  IncidenceBase &ret = assign(other);
104  endUpdates();
105  return ret;
106 }
107 
109 {
111  d_ptr->init(*other.d_ptr);
112  mReadOnly = other.mReadOnly;
113  d_ptr->mDirtyFields.clear();
114  d_ptr->mDirtyFields.insert(FieldUnknown);
115  return *this;
116 }
117 
119 {
120  if (i2.type() != type()) {
121  return false;
122  } else {
123  // equals is virtual, so here we're calling the derived class method
124  return equals(i2);
125  }
126 }
127 
129 {
130  return !operator==(i2);
131 }
132 
133 bool IncidenceBase::equals(const IncidenceBase &other) const
134 {
135  if (attendees().count() != other.attendees().count()) {
136  // qCDebug(KCALCORE_LOG) << "Attendee count is different";
137  return false;
138  }
139 
140  // TODO Does the order of attendees in the list really matter?
141  // Please delete this comment if you know it's ok, kthx
142  const Attendee::List list = attendees();
143  const Attendee::List otherList = other.attendees();
144 
145  if (list.size() != otherList.size()) {
146  return false;
147  }
148 
149  auto [it1, it2] = std::mismatch(list.cbegin(), list.cend(), otherList.cbegin(), otherList.cend());
150 
151  // Checking the iterator from one list only, since we've already checked
152  // they are the same size
153  if (it1 != list.cend()) {
154  // qCDebug(KCALCORE_LOG) << "Attendees are different";
155  return false;
156  }
157 
158  if (!CustomProperties::operator==(other)) {
159  // qCDebug(KCALCORE_LOG) << "Properties are different";
160  return false;
161  }
162 
163  // Don't compare lastModified, otherwise the operator is not
164  // of much use. We are not comparing for identity, after all.
165  // no need to compare mObserver
166 
167  bool a = identical(dtStart(), other.dtStart());
168  bool b = organizer() == other.organizer();
169  bool c = uid() == other.uid();
170  bool d = allDay() == other.allDay();
171  bool e = duration() == other.duration();
172  bool f = hasDuration() == other.hasDuration();
173  bool g = url() == other.url();
174 
175  // qCDebug(KCALCORE_LOG) << a << b << c << d << e << f << g;
176  return a && b && c && d && e && f && g;
177 }
178 
180 {
181  Q_UNUSED(v);
182  Q_UNUSED(incidence);
183  return false;
184 }
185 
187 {
188  if (d_ptr->mUid != uid) {
189  update();
190  d_ptr->mUid = uid;
191  d_ptr->mDirtyFields.insert(FieldUid);
192  updated();
193  }
194 }
195 
196 QString IncidenceBase::uid() const
197 {
198  return d_ptr->mUid;
199 }
200 
202 {
203  // DON'T! updated() because we call this from
204  // Calendar::updateEvent().
205 
206  d_ptr->mDirtyFields.insert(FieldLastModified);
207 
208  // Convert to UTC and remove milliseconds part.
209  QDateTime current = lm.toUTC();
210  QTime t = current.time();
211  t.setHMS(t.hour(), t.minute(), t.second(), 0);
212  current.setTime(t);
213 
214  d_ptr->mLastModified = current;
215 }
216 
217 QDateTime IncidenceBase::lastModified() const
218 {
219  return d_ptr->mLastModified;
220 }
221 
222 void IncidenceBase::setOrganizer(const Person &organizer)
223 {
224  update();
225  // we don't check for readonly here, because it is
226  // possible that by setting the organizer we are changing
227  // the event's readonly status...
228  d_ptr->mOrganizer = organizer;
229 
230  d_ptr->mDirtyFields.insert(FieldOrganizer);
231 
232  updated();
233 }
234 
236 {
237  QString mail(o);
238  if (mail.startsWith(QLatin1String("MAILTO:"), Qt::CaseInsensitive)) {
239  mail.remove(0, 7);
240  }
241 
242  // split the string into full name plus email.
243  const Person organizer = Person::fromFullName(mail);
244  setOrganizer(organizer);
245 }
246 
247 Person IncidenceBase::organizer() const
248 {
249  return d_ptr->mOrganizer;
250 }
251 
252 void IncidenceBase::setReadOnly(bool readOnly)
253 {
254  mReadOnly = readOnly;
255 }
256 
258 {
259  return mReadOnly;
260 }
261 
263 {
264  // if ( mReadOnly ) return;
265 
266  if (!dtStart.isValid() && type() != IncidenceBase::TypeTodo) {
267  qCWarning(KCALCORE_LOG) << "Invalid dtStart";
268  }
269 
270  if (!identical(d_ptr->mDtStart, dtStart)) {
271  update();
272  d_ptr->mDtStart = dtStart;
273  d_ptr->mDirtyFields.insert(FieldDtStart);
274  updated();
275  }
276 }
277 
278 QDateTime IncidenceBase::dtStart() const
279 {
280  return d_ptr->mDtStart;
281 }
282 
283 bool IncidenceBase::allDay() const
284 {
285  return d_ptr->mAllDay;
286 }
287 
289 {
290  if (mReadOnly || f == d_ptr->mAllDay) {
291  return;
292  }
293  update();
294  d_ptr->mAllDay = f;
295  if (d_ptr->mDtStart.isValid()) {
296  d_ptr->mDirtyFields.insert(FieldDtStart);
297  }
298  updated();
299 }
300 
301 void IncidenceBase::shiftTimes(const QTimeZone &oldZone, const QTimeZone &newZone)
302 {
303  update();
304  d_ptr->mDtStart = d_ptr->mDtStart.toTimeZone(oldZone);
305  d_ptr->mDtStart.setTimeZone(newZone);
306  d_ptr->mDirtyFields.insert(FieldDtStart);
307  updated();
308 }
309 
310 void IncidenceBase::addComment(const QString &comment)
311 {
312  update();
313  d_ptr->mComments += comment;
314  d_ptr->mDirtyFields.insert(FieldComment);
315  updated();
316 }
317 
319 {
320  auto it = std::find(d_ptr->mComments.begin(), d_ptr->mComments.end(), comment);
321  bool found = it != d_ptr->mComments.end();
322  if (found) {
323  update();
324  d_ptr->mComments.erase(it);
325  d_ptr->mDirtyFields.insert(FieldComment);
326  updated();
327  }
328  return found;
329 }
330 
332 {
333  update();
334  d_ptr->mDirtyFields.insert(FieldComment);
335  d_ptr->mComments.clear();
336  updated();
337 }
338 
340 {
341  return d_ptr->mComments;
342 }
343 
344 void IncidenceBase::addContact(const QString &contact)
345 {
346  if (!contact.isEmpty()) {
347  update();
348  d_ptr->mContacts += contact;
349  d_ptr->mDirtyFields.insert(FieldContact);
350  updated();
351  }
352 }
353 
355 {
356  auto it = std::find(d_ptr->mContacts.begin(), d_ptr->mContacts.end(), contact);
357  bool found = it != d_ptr->mContacts.end();
358  if (found) {
359  update();
360  d_ptr->mContacts.erase(it);
361  d_ptr->mDirtyFields.insert(FieldContact);
362  updated();
363  }
364  return found;
365 }
366 
368 {
369  update();
370  d_ptr->mDirtyFields.insert(FieldContact);
371  d_ptr->mContacts.clear();
372  updated();
373 }
374 
376 {
377  return d_ptr->mContacts;
378 }
379 
380 void IncidenceBase::addAttendee(const Attendee &a, bool doupdate)
381 {
382  if (a.isNull() || mReadOnly) {
383  return;
384  }
385  Q_ASSERT(!a.uid().isEmpty());
386 
387  if (doupdate) {
388  update();
389  }
390 
391  d_ptr->mAttendees.append(a);
392  if (doupdate) {
393  d_ptr->mDirtyFields.insert(FieldAttendees);
394  updated();
395  }
396 }
397 
398 Attendee::List IncidenceBase::attendees() const
399 {
400  return d_ptr->mAttendees;
401 }
402 
404 {
405  return d_ptr->mAttendees.count();
406 }
407 
408 void IncidenceBase::setAttendees(const Attendee::List &attendees, bool doUpdate)
409 {
410  if (mReadOnly) {
411  return;
412  }
413 
414  // don't simply assign, we need the logic in addAttendee here too
415  clearAttendees();
416 
417  if (doUpdate) {
418  update();
419  }
420 
421  d_ptr->mAttendees.reserve(attendees.size());
422  for (const auto &a : attendees) {
423  addAttendee(a, false);
424  }
425 
426  if (doUpdate) {
427  d_ptr->mDirtyFields.insert(FieldAttendees);
428  updated();
429  }
430 }
431 
433 {
434  if (mReadOnly) {
435  return;
436  }
437  update();
438  d_ptr->mDirtyFields.insert(FieldAttendees);
439  d_ptr->mAttendees.clear();
440  updated();
441 }
442 
444 {
445  auto it = std::find_if(d_ptr->mAttendees.cbegin(), d_ptr->mAttendees.cend(), [&email](const Attendee &att) {
446  return att.email() == email;
447  });
448 
449  return it != d_ptr->mAttendees.cend() ? *it : Attendee{};
450 }
451 
452 Attendee IncidenceBase::attendeeByMails(const QStringList &emails, const QString &email) const
453 {
454  QStringList mails = emails;
455  if (!email.isEmpty()) {
456  mails.append(email);
457  }
458 
459  auto it = std::find_if(d_ptr->mAttendees.cbegin(), d_ptr->mAttendees.cend(), [&mails](const Attendee &a) {
460  return mails.contains(a.email());
461  });
462 
463  return it != d_ptr->mAttendees.cend() ? *it : Attendee{};
464 }
465 
467 {
468  auto it = std::find_if(d_ptr->mAttendees.cbegin(), d_ptr->mAttendees.cend(), [&uid](const Attendee &a) {
469  return a.uid() == uid;
470  });
471  return it != d_ptr->mAttendees.cend() ? *it : Attendee{};
472 }
473 
475 {
476  update();
477  d_ptr->mDuration = duration;
478  setHasDuration(true);
479  d_ptr->mDirtyFields.insert(FieldDuration);
480  updated();
481 }
482 
484 {
485  return d_ptr->mDuration;
486 }
487 
488 void IncidenceBase::setHasDuration(bool hasDuration)
489 {
490  d_ptr->mHasDuration = hasDuration;
491 }
492 
494 {
495  return d_ptr->mHasDuration;
496 }
497 
498 void IncidenceBase::setUrl(const QUrl &url)
499 {
500  update();
501  d_ptr->mDirtyFields.insert(FieldUrl);
502  d_ptr->mUrl = url;
503  updated();
504 }
505 
506 QUrl IncidenceBase::url() const
507 {
508  return d_ptr->mUrl;
509 }
510 
512 {
513  if (observer && !d_ptr->mObservers.contains(observer)) {
514  d_ptr->mObservers.append(observer);
515  }
516 }
517 
519 {
520  d_ptr->mObservers.removeAll(observer);
521 }
522 
524 {
525  if (!d_ptr->mUpdateGroupLevel) {
526  d_ptr->mUpdatedPending = true;
527  const auto rid = recurrenceId();
528  for (IncidenceObserver *o : std::as_const(d_ptr->mObservers)) {
529  o->incidenceUpdate(uid(), rid);
530  }
531  }
532 }
533 
535 {
536  if (d_ptr->mUpdateGroupLevel) {
537  d_ptr->mUpdatedPending = true;
538  } else {
539  const auto rid = recurrenceId();
540  for (IncidenceObserver *o : std::as_const(d_ptr->mObservers)) {
541  o->incidenceUpdated(uid(), rid);
542  }
543  }
544 }
545 
547 {
548  update();
549  ++d_ptr->mUpdateGroupLevel;
550 }
551 
553 {
554  if (d_ptr->mUpdateGroupLevel > 0) {
555  if (--d_ptr->mUpdateGroupLevel == 0 && d_ptr->mUpdatedPending) {
556  d_ptr->mUpdatedPending = false;
557  updated();
558  }
559  }
560 }
561 
563 {
564  update();
565 }
566 
568 {
569  updated();
570 }
571 
573 {
574  return QDateTime();
575 }
576 
578 {
579  d_ptr->mDirtyFields.clear();
580 }
581 
583 {
584  return d_ptr->mDirtyFields;
585 }
586 
588 {
589  d_ptr->mDirtyFields.insert(field);
590 }
591 
593 {
594  return QUrl(QStringLiteral("urn:x-ical:") + uid());
595 }
596 
598 {
599  d_ptr->mDirtyFields = dirtyFields;
600 }
601 
603 {
604  Q_UNUSED(out);
605 }
606 
608 {
609  Q_UNUSED(in);
610 }
611 
612 /** static */
614 {
615  return KCALCORE_MAGIC_NUMBER;
616 }
617 
619 {
620  return dt1 == dt2 && dt1.timeSpec() == dt2.timeSpec() && dt1.timeZone() == dt2.timeZone();
621 }
622 
624 {
625  if (!i) {
626  return out;
627  }
628 
629  out << static_cast<quint32>(KCALCORE_MAGIC_NUMBER); // Magic number to identify KCalendarCore data
630  out << static_cast<quint32>(KCALCORE_SERIALIZATION_VERSION);
631  out << static_cast<qint32>(i->type());
632 
633  out << *(static_cast<CustomProperties *>(i.data()));
634  serializeQDateTimeAsKDateTime(out, i->d_ptr->mLastModified);
635  serializeQDateTimeAsKDateTime(out, i->d_ptr->mDtStart);
636  out << i->organizer() << i->d_ptr->mUid << i->d_ptr->mDuration << i->d_ptr->mAllDay << i->d_ptr->mHasDuration << i->d_ptr->mComments << i->d_ptr->mContacts
637  << (qint32)i->d_ptr->mAttendees.count() << i->d_ptr->mUrl;
638 
639  for (const Attendee &attendee : std::as_const(i->d_ptr->mAttendees)) {
640  out << attendee;
641  }
642 
643  // Serialize the sub-class data.
644  i->serialize(out);
645 
646  return out;
647 }
648 
650 {
651  if (!i) {
652  return in;
653  }
654 
655  qint32 attendeeCount;
656  qint32 type;
657  quint32 magic;
658  quint32 version;
659 
660  in >> magic;
661 
662  if (magic != KCALCORE_MAGIC_NUMBER) {
663  qCWarning(KCALCORE_LOG) << "Invalid magic on serialized data";
664  return in;
665  }
666 
667  in >> version;
668 
669  if (version > KCALCORE_MAGIC_NUMBER) {
670  qCWarning(KCALCORE_LOG) << "Invalid version on serialized data";
671  return in;
672  }
673 
674  in >> type;
675 
676  in >> *(static_cast<CustomProperties *>(i.data()));
677  deserializeKDateTimeAsQDateTime(in, i->d_ptr->mLastModified);
678  deserializeKDateTimeAsQDateTime(in, i->d_ptr->mDtStart);
679  in >> i->d_ptr->mOrganizer >> i->d_ptr->mUid >> i->d_ptr->mDuration >> i->d_ptr->mAllDay >> i->d_ptr->mHasDuration >> i->d_ptr->mComments >> i->d_ptr->mContacts >> attendeeCount
680  >> i->d_ptr->mUrl;
681 
682  i->d_ptr->mAttendees.clear();
683  i->d_ptr->mAttendees.reserve(attendeeCount);
684  for (int it = 0; it < attendeeCount; it++) {
685  Attendee attendee;
686  in >> attendee;
687  i->d_ptr->mAttendees.append(attendee);
688  }
689 
690  // Deserialize the sub-class data.
691  i->deserialize(in);
692 
693  return in;
694 }
695 
697 {
698 }
699 
700 QVariantList IncidenceBase::attendeesVariant() const
701 {
702  QVariantList l;
703  l.reserve(d_ptr->mAttendees.size());
704  std::transform(d_ptr->mAttendees.begin(), d_ptr->mAttendees.end(), std::back_inserter(l), [](const Attendee &a) {
705  return QVariant::fromValue(a);
706  });
707  return l;
708 }
709 
710 #include "moc_incidencebase.cpp"
void append(const T &value)
T * data() const const
void addContact(const QString &contact)
Adds a contact to thieincidence.
@ FieldUrl
Field representing the URL component.
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
Alarm serializer.
Definition: alarm.cpp:820
Represents a span of time measured in seconds or days.
Definition: duration.h:43
virtual void deserialize(QDataStream &in)
Sub-type specific deserialization.
Represents information related to an attendee of an Calendar Incidence, typically a meeting or task (...
Definition: attendee.h:44
QTimeZone timeZone() const const
CaseInsensitive
void resetDirtyFields()
Resets dirty fields.
void clearAttendees()
Removes all attendees from the incidence.
QVector::const_iterator cend() const const
virtual void setDtStart(const QDateTime &dtStart)
Sets the incidence's starting date/time with a QDateTime.
Namespace for all KCalendarCore types.
Definition: alarm.h:36
int attendeeCount() const
Returns the number of incidence attendees.
QTime time() const const
@ FieldComment
Field representing the COMMENT component.
virtual QDateTime recurrenceId() const
Returns the incidence recurrenceId.
void update()
Call this to notify the observers after the IncidenceBase object will be changed.
void registerObserver(IncidenceObserver *observer)
Register observer.
QSet< IncidenceBase::Field > dirtyFields() const
Returns a QSet with all Fields that were changed since the incidence was created or resetDirtyFields(...
void addAttendee(const Attendee &attendee, bool doUpdate=true)
Add Attendee to this incidence.
KCALENDARCORE_EXPORT bool identical(QDateTime, QDateTime)
Compare two QDateTimes for extended equality.
virtual IncidenceBase & assign(const IncidenceBase &other)
Provides polymorfic assignment.
KCALENDARCORE_EXPORT QDataStream & operator>>(QDataStream &in, const KCalendarCore::Alarm::Ptr &)
Alarm deserializer.
Definition: alarm.cpp:833
void startUpdates()
Call this when a group of updates is going to be made.
@ TypeTodo
Type is a to-do.
QStringList comments() const
Returns all incidence comments as a list of strings.
IncidenceBase & operator=(const IncidenceBase &other)
Assignment operator.
void clearComments()
Deletes all incidence comments.
void setUid(const QString &uid)
Sets the unique id for the incidence to uid.
static quint32 magicSerializationIdentifier()
Constant that identifies KCalendarCore data in a binary stream.
void setOrganizer(const Person &organizer)
Sets the organizer for the incidence.
void setHasDuration(bool hasDuration)
Sets if the incidence has a duration.
bool hasDuration() const
Returns true if the incidence has a duration; false otherwise.
static Person fromFullName(const QString &fullName)
Constructs a person with name and email address taken from fullName.
Definition: person.cpp:362
bool isReadOnly() const
Returns true the object is read-only; false otherwise.
An abstract class that provides a common base for all calendar incidence classes.
Definition: incidencebase.h:98
~IncidenceBase() override
Destroys the IncidenceBase.
CustomProperties & operator=(const CustomProperties &other)
Assignment operator.
int size() const const
void customPropertyUpdated() override
bool removeComment(const QString &comment)
Removes a comment from the incidence.
virtual bool accept(Visitor &v, const IncidenceBase::Ptr &incidence)
Accept IncidenceVisitor.
QUrl uri() const
Returns the uri for the incidence, of form urn:x-ical:<uid>
void updated()
Call this to notify the observers after the IncidenceBase object has changed.
Field
The different types of incidence fields.
void setUrl(const QUrl &url)
Sets the incidences url.
@ FieldDuration
Field representing the DURATION component.
virtual void setDuration(const Duration &duration)
Sets the incidence duration.
QVector::const_iterator cbegin() const const
void addComment(const QString &comment)
Adds a comment to the incidence.
static QString createUniqueId()
Creates a unique id string.
Definition: calformat.cpp:95
bool isEmpty() const const
IncidenceBase()
Constructs an empty IncidenceBase.
virtual ~IncidenceObserver()
Destroys the IncidenceObserver.
bool setHMS(int h, int m, int s, int ms)
void clearContacts()
Deletes all incidence contacts.
bool removeContact(const QString &contact)
Removes a contact from the incidence.
QList::const_iterator cend() const const
@ FieldUid
Field representing the UID component.
void setAttendees(const Attendee::List &attendees, bool doUpdate=true)
Set the attendees of this incidence.
This class provides the interface for a visitor of calendar components.
Definition: visitor.h:30
virtual void setReadOnly(bool readOnly)
Sets readonly status.
@ FieldLastModified
Field representing the LAST-MODIFIED component.
int hour() const const
QDateTime toUTC() const const
virtual IncidenceType type() const =0
Returns the incidence type.
unsigned int version()
int second() const const
@ FieldAttendees
Field representing the ATTENDEE component.
Qt::TimeSpec timeSpec() const const
virtual void shiftTimes(const QTimeZone &oldZone, const QTimeZone &newZone)
Shift the times of the incidence so that they appear at the same clock time as before but in a new ti...
bool operator==(const IncidenceBase &ib) const
Compares this with IncidenceBase ib for equality.
QList::const_iterator cbegin() const const
@ FieldUnknown
Something changed. Always set when you use the assignment operator.
QStringList contacts() const
Returns all incidence contacts as a list of strings.
bool isValid() const const
Attendee attendeeByMails(const QStringList &emails, const QString &email=QString()) const
Returns the first incidence attendee with one of the specified email addresses.
virtual void serialize(QDataStream &out) const
Sub-type specific serialization.
void unRegisterObserver(IncidenceObserver *observer)
Unregister observer.
int size() const const
virtual bool equals(const IncidenceBase &incidenceBase) const
Provides polymorfic comparison for equality.
@ FieldOrganizer
Field representing the ORGANIZER component.
Represents a person, by name and email address.
Definition: person.h:37
void setDirtyFields(const QSet< IncidenceBase::Field > &)
Sets which fields are dirty.
void endUpdates()
Call this when a group of updates is complete, to notify observers that the instance has changed.
@ FieldContact
Field representing the CONTACT component.
bool mReadOnly
Identifies a read-only incidence.
void setFieldDirty(IncidenceBase::Field field)
Marks Field field as dirty.
bool operator!=(const IncidenceBase &ib) const
Compares this with IncidenceBase ib for inequality.
A class to manage custom calendar properties.
Attendee attendeeByUid(const QString &uid) const
Returns the incidence attendee with the specified attendee UID.
int minute() const const
Duration duration() const
Returns the length of the incidence duration.
void setTime(const QTime &time)
void customPropertyUpdate() override
Attendee attendeeByMail(const QString &email) const
Returns the attendee with the specified email address.
virtual void setAllDay(bool allDay)
Sets whether the incidence is all-day, i.e.
virtual void setLastModified(const QDateTime &lm)
Sets the time the incidence was last modified to lm.
@ FieldDtStart
Field representing the DTSTART component.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 28 2023 03:53:12 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.