• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

KCalCore Library

  • kcalcore
todo.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the kcalcore library.
3 
4  Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
5  Copyright (C) 2009 Allen Winter <winter@kde.org>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
34 #include "todo.h"
35 #include "visitor.h"
36 
37 #include <KDebug>
38 
39 using namespace KCalCore;
40 
45 //@cond PRIVATE
46 class KCalCore::Todo::Private
47 {
48  public:
49  Private()
50  : mPercentComplete( 0 ),
51  mHasDueDate( false ),
52  mHasStartDate( false ),
53  mHasCompletedDate( false )
54  {}
55  Private( const KCalCore::Todo::Private &other )
56  { init( other ); }
57 
58  void init( const KCalCore::Todo::Private &other );
59 
60  KDateTime mDtDue; // to-do due date (if there is one)
61  // ALSO the first occurrence of a recurring to-do
62  KDateTime mDtRecurrence; // next occurrence (for recurring to-dos)
63  KDateTime mCompleted; // to-do completion date (if it has been completed)
64  int mPercentComplete; // to-do percent complete [0,100]
65  bool mHasDueDate; // true if the to-do has a due date
66  bool mHasStartDate; // true if the to-do has a starting date
67  bool mHasCompletedDate; // true if the to-do has a completion date
68 
72  bool recurTodo( Todo *todo );
73 };
74 
75 void KCalCore::Todo::Private::init( const KCalCore::Todo::Private &other )
76 {
77  mDtDue = other.mDtDue;
78  mDtRecurrence = other.mDtRecurrence;
79  mCompleted = other.mCompleted;
80  mPercentComplete = other.mPercentComplete;
81  mHasDueDate = other.mHasDueDate;
82  mHasStartDate = other.mHasStartDate;
83  mHasCompletedDate = other.mHasCompletedDate;
84 }
85 
86 //@endcond
87 
88 Todo::Todo()
89  : d( new KCalCore::Todo::Private )
90 {
91 }
92 
93 Todo::Todo( const Todo &other )
94  : Incidence( other ),
95  d( new KCalCore::Todo::Private( *other.d ) )
96 {
97 }
98 
99 Todo::~Todo()
100 {
101  delete d;
102 }
103 
104 Todo *Todo::clone() const
105 {
106  return new Todo( *this );
107 }
108 
109 IncidenceBase &Todo::assign( const IncidenceBase &other )
110 {
111  if ( &other != this ) {
112  Incidence::assign( other );
113  const Todo *t = static_cast<const Todo*>( &other );
114  d->init( *( t->d ) );
115  }
116  return *this;
117 }
118 
119 bool Todo::equals( const IncidenceBase &todo ) const
120 {
121  if ( !Incidence::equals( todo ) ) {
122  return false;
123  } else {
124  // If they weren't the same type IncidenceBase::equals would had returned false already
125  const Todo *t = static_cast<const Todo*>( &todo );
126  return ( ( dtDue() == t->dtDue() ) ||
127  ( !dtDue().isValid() && !t->dtDue().isValid() ) ) &&
128  hasDueDate() == t->hasDueDate() &&
129  hasStartDate() == t->hasStartDate() &&
130  ( ( completed() == t->completed() ) ||
131  ( !completed().isValid() && !t->completed().isValid() ) ) &&
132  hasCompletedDate() == t->hasCompletedDate() &&
133  percentComplete() == t->percentComplete();
134  }
135 }
136 
137 Incidence::IncidenceType Todo::type() const
138 {
139  return TypeTodo;
140 }
141 
142 QByteArray Todo::typeStr() const
143 {
144  return "Todo";
145 }
146 void Todo::setDtDue( const KDateTime &dtDue, bool first )
147 {
148  startUpdates();
149 
150  //int diffsecs = d->mDtDue.secsTo(dtDue);
151 
152  /*if (mReadOnly) return;
153  const Alarm::List& alarms = alarms();
154  for (Alarm *alarm = alarms.first(); alarm; alarm = alarms.next()) {
155  if (alarm->enabled()) {
156  alarm->setTime(alarm->time().addSecs(diffsecs));
157  }
158  }*/
159  d->mHasDueDate = dtDue.isValid();
160 
161  if ( recurs() && !first ) {
162  d->mDtRecurrence = dtDue;
163  } else {
164  d->mDtDue = dtDue;
165  // TODO: This doesn't seem right...
166  recurrence()->setStartDateTime( dtDue );
167  recurrence()->setAllDay( allDay() );
168  }
169 
170  if ( recurs() && dtDue < recurrence()->startDateTime() ) {
171  setDtStart( dtDue );
172  }
173 
174  /*const Alarm::List& alarms = alarms();
175  for (Alarm *alarm = alarms.first(); alarm; alarm = alarms.next())
176  alarm->setAlarmStart(d->mDtDue);*/
177  setFieldDirty( FieldDtDue );
178  endUpdates();
179 }
180 
181 KDateTime Todo::dtDue( bool first ) const
182 {
183  if ( !hasDueDate() ) {
184  return KDateTime();
185  }
186  if ( recurs() && !first && d->mDtRecurrence.isValid() ) {
187  return d->mDtRecurrence;
188  }
189 
190  return d->mDtDue;
191 }
192 
193 bool Todo::hasDueDate() const
194 {
195  return d->mHasDueDate;
196 }
197 
198 void Todo::setHasDueDate( bool f )
199 {
200  if ( mReadOnly ) {
201  return;
202  }
203  update();
204  d->mHasDueDate = f;
205  setFieldDirty( FieldDtDue );
206  updated();
207 }
208 
209 bool Todo::hasStartDate() const
210 {
211  return d->mHasStartDate;
212 }
213 
214 void Todo::setHasStartDate( bool f )
215 {
216  if ( mReadOnly ) {
217  return;
218  }
219 
220  update();
221  if ( recurs() && !f ) {
222  if ( !comments().filter( "NoStartDate" ).count() ) {
223  addComment( "NoStartDate" ); //TODO: --> custom flag?
224  }
225  } else {
226  QString s( "NoStartDate" );
227  removeComment( s );
228  }
229  d->mHasStartDate = f;
230  setFieldDirty( FieldDtStart );
231  updated();
232 }
233 
234 KDateTime Todo::dtStart() const
235 {
236  return dtStart( false );
237 }
238 
239 KDateTime Todo::dtStart( bool first ) const
240 {
241  if ( !hasStartDate() ) {
242  return KDateTime();
243  }
244  if ( recurs() && !first ) {
245  KDateTime dt = d->mDtRecurrence.addDays( dtDue( true ).daysTo( IncidenceBase::dtStart() ) );
246  dt.setTime( IncidenceBase::dtStart().time() );
247  return dt;
248  } else {
249  return IncidenceBase::dtStart();
250  }
251 }
252 
253 void Todo::setDtStart( const KDateTime &dtStart )
254 {
255  // TODO: This doesn't seem right (rfc 2445/6 says, recurrence is calculated from the dtstart...)
256 
257  d->mHasStartDate = dtStart.isValid();
258 
259  if ( recurs() ) {
260  recurrence()->setStartDateTime( d->mDtDue );
261  recurrence()->setAllDay( allDay() );
262  }
263  IncidenceBase::setDtStart( dtStart );
264 }
265 
266 bool Todo::isCompleted() const
267 {
268  return d->mPercentComplete == 100;
269 }
270 
271 void Todo::setCompleted( bool completed )
272 {
273  update();
274  if ( completed ) {
275  d->mPercentComplete = 100;
276  } else {
277  d->mPercentComplete = 0;
278  d->mHasCompletedDate = false;
279  d->mCompleted = KDateTime();
280  }
281  setFieldDirty( FieldCompleted );
282  updated();
283 }
284 
285 KDateTime Todo::completed() const
286 {
287  if ( hasCompletedDate() ) {
288  return d->mCompleted;
289  } else {
290  return KDateTime();
291  }
292 }
293 
294 void Todo::setCompleted( const KDateTime &completed )
295 {
296  update();
297  if ( !d->recurTodo( this ) ) {
298  d->mHasCompletedDate = true;
299  d->mPercentComplete = 100;
300  d->mCompleted = completed.toUtc();
301  setFieldDirty( FieldCompleted );
302  }
303  updated();
304 }
305 
306 bool Todo::hasCompletedDate() const
307 {
308  return d->mHasCompletedDate;
309 }
310 
311 int Todo::percentComplete() const
312 {
313  return d->mPercentComplete;
314 }
315 
316 void Todo::setPercentComplete( int percent )
317 {
318  if ( percent > 100 ) {
319  percent = 100;
320  } else if ( percent < 0 ) {
321  percent = 0;
322  }
323 
324  update();
325  d->mPercentComplete = percent;
326  if ( percent != 100 ) {
327  d->mHasCompletedDate = false;
328  }
329  setFieldDirty( FieldPercentComplete );
330  updated();
331 }
332 
333 bool Todo::isInProgress( bool first ) const
334 {
335  if ( isOverdue() ) {
336  return false;
337  }
338 
339  if ( d->mPercentComplete > 0 ) {
340  return true;
341  }
342 
343  if ( d->mHasStartDate && d->mHasDueDate ) {
344  if ( allDay() ) {
345  QDate currDate = QDate::currentDate();
346  if ( dtStart( first ).date() <= currDate && currDate < dtDue( first ).date() ) {
347  return true;
348  }
349  } else {
350  KDateTime currDate = KDateTime::currentUtcDateTime();
351  if ( dtStart( first ) <= currDate && currDate < dtDue( first ) ) {
352  return true;
353  }
354  }
355  }
356 
357  return false;
358 }
359 
360 bool Todo::isOpenEnded() const
361 {
362  if ( !d->mHasDueDate && !isCompleted() ) {
363  return true;
364  }
365  return false;
366 
367 }
368 
369 bool Todo::isNotStarted( bool first ) const
370 {
371  if ( d->mPercentComplete > 0 ) {
372  return false;
373  }
374 
375  if ( !d->mHasStartDate ) {
376  return false;
377  }
378 
379  if ( allDay() ) {
380  if ( dtStart( first ).date() >= QDate::currentDate() ) {
381  return false;
382  }
383  } else {
384  if ( dtStart( first ) >= KDateTime::currentUtcDateTime() ) {
385  return false;
386  }
387  }
388  return true;
389 }
390 
391 void Todo::shiftTimes( const KDateTime::Spec &oldSpec,
392  const KDateTime::Spec &newSpec )
393 {
394  Incidence::shiftTimes( oldSpec, newSpec );
395  d->mDtDue = d->mDtDue.toTimeSpec( oldSpec );
396  d->mDtDue.setTimeSpec( newSpec );
397  if ( recurs() ) {
398  d->mDtRecurrence = d->mDtRecurrence.toTimeSpec( oldSpec );
399  d->mDtRecurrence.setTimeSpec( newSpec );
400  }
401  if ( d->mHasCompletedDate ) {
402  d->mCompleted = d->mCompleted.toTimeSpec( oldSpec );
403  d->mCompleted.setTimeSpec( newSpec );
404  }
405 }
406 
407 void Todo::setDtRecurrence( const KDateTime &dt )
408 {
409  d->mDtRecurrence = dt;
410  setFieldDirty( FieldRecurrence );
411 }
412 
413 KDateTime Todo::dtRecurrence() const
414 {
415  return d->mDtRecurrence.isValid() ? d->mDtRecurrence : d->mDtDue;
416 }
417 
418 bool Todo::recursOn( const QDate &date, const KDateTime::Spec &timeSpec ) const
419 {
420  QDate today = QDate::currentDate();
421  return
422  Incidence::recursOn( date, timeSpec ) &&
423  !( date < today && d->mDtRecurrence.date() < today &&
424  d->mDtRecurrence > recurrence()->startDateTime() );
425 }
426 
427 bool Todo::isOverdue() const
428 {
429  if ( !dtDue().isValid() ) {
430  return false; // if it's never due, it can't be overdue
431  }
432 
433  const bool inPast = allDay() ?
434  dtDue().date() < QDate::currentDate() :
435  dtDue() < KDateTime::currentUtcDateTime();
436  return inPast && !isCompleted();
437 }
438 
439 void Todo::setAllDay( bool allday )
440 {
441  if ( allday != allDay() && !mReadOnly ) {
442  if ( hasDueDate() && dtDue().isValid() ) {
443  setFieldDirty( FieldDtDue );
444  }
445  Incidence::setAllDay( allday );
446  }
447 }
448 
449 //@cond PRIVATE
450 bool Todo::Private::recurTodo( Todo *todo )
451 {
452  if ( todo && todo->recurs() ) {
453  Recurrence *r = todo->recurrence();
454  const KDateTime recurrenceEndDateTime = r->endDateTime();
455  KDateTime nextOccurrenceDateTime = r->getNextDateTime( todo->dtDue() );
456 
457  if ( ( r->duration() == -1 ||
458  ( nextOccurrenceDateTime.isValid() && recurrenceEndDateTime.isValid() &&
459  nextOccurrenceDateTime <= recurrenceEndDateTime ) ) ) {
460  // We convert to the same timeSpec so we get the correct .date()
461  const KDateTime rightNow =
462  KDateTime::currentUtcDateTime().toTimeSpec( nextOccurrenceDateTime.timeSpec() );
463  const bool isDateOnly = todo->allDay();
464 
465  /* Now we search for the occurrence that's _after_ the currentUtcDateTime, or
466  * if it's dateOnly, the occurrrence that's _during or after today_.
467  * The reason we use "<" for date only, but "<=" for ocurrences with time is that
468  * if it's date only, the user can still complete that ocurrence today, so that's
469  * the current ocurrence that needs completing.
470  */
471  while ( !todo->recursAt( nextOccurrenceDateTime ) ||
472  ( !isDateOnly && nextOccurrenceDateTime <= rightNow ) ||
473  ( isDateOnly && nextOccurrenceDateTime.date() < rightNow.date() ) ) {
474 
475  if ( !nextOccurrenceDateTime.isValid() ||
476  ( nextOccurrenceDateTime > recurrenceEndDateTime && r->duration() != -1 ) ) {
477  return false;
478  }
479  nextOccurrenceDateTime = r->getNextDateTime( nextOccurrenceDateTime );
480  }
481 
482  todo->setDtDue( nextOccurrenceDateTime );
483  todo->setCompleted( false );
484  todo->setRevision( todo->revision() + 1 );
485 
486  return true;
487  }
488  }
489 
490  return false;
491 }
492 //@endcond
493 
494 bool Todo::accept( Visitor &v, IncidenceBase::Ptr incidence )
495 {
496  return v.visit( incidence.staticCast<Todo>() );
497 }
498 
499 KDateTime Todo::dateTime( DateTimeRole role ) const
500 {
501  switch ( role ) {
502  case RoleAlarmStartOffset:
503  return dtStart();
504  case RoleAlarmEndOffset:
505  return dtDue();
506  case RoleSort:
507  // Sorting to-dos first compares dtDue, then dtStart if
508  // dtDue doesn't exist
509  return hasDueDate() ? dtDue() : dtStart();
510  case RoleCalendarHashing:
511  return dtDue();
512  case RoleStartTimeZone:
513  return dtStart();
514  case RoleEndTimeZone:
515  return dtDue();
516  case RoleEndRecurrenceBase:
517  return dtDue();
518  case RoleDisplayStart:
519  case RoleDisplayEnd:
520  return dtDue();
521  case RoleAlarm:
522  if ( alarms().isEmpty() ) {
523  return KDateTime();
524  } else {
525  Alarm::Ptr alarm = alarms().first();
526  if ( alarm->hasStartOffset() && hasStartDate() ) {
527  return dtStart();
528  } else if ( alarm->hasEndOffset() && hasDueDate() ) {
529  return dtDue();
530  } else {
531  // The application shouldn't add alarms on to-dos without dates.
532  return KDateTime();
533  }
534  }
535  case RoleRecurrenceStart:
536  return dtDue();
537  break;
538  case RoleEnd:
539  // todos don't have dtEnd
540  default:
541  return KDateTime();
542  }
543 }
544 
545 void Todo::setDateTime( const KDateTime &dateTime, DateTimeRole role )
546 {
547  switch ( role ) {
548  case RoleDnD:
549  setDtDue( dateTime );
550  break;
551  default:
552  kDebug() << "Unhandled role" << role;
553  }
554 }
555 
556 void Todo::virtual_hook( int id, void *data )
557 {
558  Q_UNUSED( id );
559  Q_UNUSED( data );
560  Q_ASSERT( false );
561 }
562 
563 QLatin1String Todo::mimeType() const
564 {
565  return Todo::todoMimeType();
566 }
567 
568 QLatin1String Todo::todoMimeType()
569 {
570  return QLatin1String( "application/x-vnd.akonadi.calendar.todo" );
571 }
572 
573 QLatin1String Todo::iconName( const KDateTime &recurrenceId ) const
574 {
575  KDateTime occurrenceDT = recurrenceId;
576 
577  if ( recurs() && occurrenceDT.isDateOnly() ) {
578  occurrenceDT.setTime( QTime( 0, 0 ) );
579  }
580 
581  const bool usesCompletedTaskPixmap = isCompleted() ||
582  ( recurs() && occurrenceDT.isValid() &&
583  occurrenceDT < dtDue( false ) );
584 
585  if ( usesCompletedTaskPixmap ) {
586  return QLatin1String( "task-complete" );
587  } else {
588  return QLatin1String( "view-calendar-tasks" );
589  }
590 }
KCalCore::Incidence::equals
virtual bool equals(const IncidenceBase &incidence) const
Compares this with Incidence incidence for equality.
Definition: incidence.cpp:224
KCalCore::Todo::setAllDay
void setAllDay(bool allDay)
Definition: todo.cpp:439
KCalCore::Todo::type
IncidenceType type() const
KCalCore::Todo::dtStart
virtual KDateTime dtStart() const
Definition: todo.cpp:234
KCalCore::IncidenceBase::addComment
void addComment(const QString &comment)
Adds a comment to thieincidence.
Definition: incidencebase.cpp:334
KCalCore::Todo::setHasDueDate
void setHasDueDate(bool hasDueDate)
Sets if the todo has a due date.
Definition: todo.cpp:198
KCalCore::Todo::typeStr
QByteArray typeStr() const
KCalCore::IncidenceBase::RoleCalendarHashing
Role for looking up an incidence in a Calendar.
Definition: incidencebase.h:135
KCalCore::IncidenceBase::setDtStart
virtual void setDtStart(const KDateTime &dtStart)
Sets the incidence&#39;s starting date/time with a KDateTime.
Definition: incidencebase.cpp:290
KCalCore::Alarm::Ptr
QSharedPointer< Alarm > Ptr
A shared pointer to an Alarm object.
Definition: alarm.h:76
KCalCore::IncidenceBase::TypeTodo
Type is a to-do.
Definition: incidencebase.h:121
KCalCore::IncidenceBase::RoleAlarm
Role for determining the date/time of the first alarm.
Definition: incidencebase.h:143
KCalCore::Incidence::setAllDay
void setAllDay(bool allDay)
Definition: incidence.cpp:329
KCalCore::Visitor::visit
virtual bool visit(Event::Ptr event)
Reimplement this function in your concrete subclass of IncidenceBase::Visitor to perform actions on a...
Definition: visitor.cpp:42
KCalCore::Recurrence::setStartDateTime
void setStartDateTime(const KDateTime &start)
Set start of recurrence.
Definition: recurrence.cpp:581
KCalCore::Todo::setCompleted
void setCompleted(bool completed)
Sets completed state.
Definition: todo.cpp:271
KCalCore::IncidenceBase::FieldCompleted
Field representing the LOCATION component.
Definition: incidencebase.h:162
KCalCore::Todo::isInProgress
bool isInProgress(bool first) const
Returns true, if the to-do is in-progress (started, or &gt;0% completed); otherwise return false...
Definition: todo.cpp:333
KCalCore::IncidenceBase
An abstract class that provides a common base for all calendar incidence classes. ...
Definition: incidencebase.h:107
KCalCore::IncidenceBase::RoleEndTimeZone
Role for determining an incidence&#39;s ending timezone.
Definition: incidencebase.h:137
KCalCore::Todo::virtual_hook
virtual void virtual_hook(int id, void *data)
Definition: todo.cpp:556
KCalCore::Incidence::recurrence
Recurrence * recurrence() const
Returns the recurrence rule associated with this incidence.
Definition: incidence.cpp:535
KCalCore::Visitor
This class provides the interface for a visitor of calendar components.
Definition: visitor.h:43
KCalCore::IncidenceBase::update
void update()
Call this to notify the observers after the IncidenceBase object will be changed. ...
Definition: incidencebase.cpp:561
KCalCore::IncidenceBase::RoleEnd
Role for determining an incidence&#39;s dtEnd, will return an invalid KDateTime if the incidence does not...
Definition: incidencebase.h:139
KCalCore::Todo::dtRecurrence
KDateTime dtRecurrence() const
Returns the due date/time of the current occurrence if recurrent.
Definition: todo.cpp:413
KCalCore::IncidenceBase::IncidenceType
IncidenceType
The different types of incidences, per RFC2445.
Definition: incidencebase.h:119
KCalCore::Incidence::setRevision
void setRevision(int rev)
Sets the number of revisions this incidence has seen.
Definition: incidence.cpp:358
KCalCore::Todo::hasDueDate
bool hasDueDate() const
Returns true if the todo has a due date, otherwise return false.
Definition: todo.cpp:193
KCalCore::IncidenceBase::RoleDnD
Role for determining new start and end dates after a DnD.
Definition: incidencebase.h:152
KCalCore::IncidenceBase::FieldRecurrence
Field representing the RELATED-TO component.
Definition: incidencebase.h:167
KCalCore::IncidenceBase::RoleDisplayEnd
Role used for display purposes, represents the end boundary if an incidence supports dtEnd...
Definition: incidencebase.h:141
mHasDueDate
d mHasDueDate
Private class that helps to provide binary compatibility between releases.
Definition: todo.cpp:159
KCalCore::Todo::mimeType
QLatin1String mimeType() const
Definition: todo.cpp:563
KCalCore::Incidence::alarms
Alarm::List alarms() const
Returns a list of all incidence alarms.
Definition: incidence.cpp:860
KCalCore::IncidenceBase::updated
void updated()
Call this to notify the observers after the IncidenceBase object has changed.
Definition: incidencebase.cpp:572
KCalCore::Recurrence
This class represents a recurrence rule for a calendar incidence.
Definition: recurrence.h:87
KCalCore::IncidenceBase::removeComment
bool removeComment(const QString &comment)
Removes a comment from the incidence.
Definition: incidencebase.cpp:339
KCalCore::Todo::~Todo
~Todo()
Destroys a to-do.
KCalCore::Todo::equals
virtual bool equals(const IncidenceBase &todo) const
Compare this with todo for equality.
todo.h
This file is part of the API for handling calendar data and defines the Todo class.
KCalCore::IncidenceBase::Ptr
QSharedPointer< IncidenceBase > Ptr
A shared pointer to an IncidenceBase.
Definition: incidencebase.h:113
KCalCore::Todo::recursOn
virtual bool recursOn(const QDate &date, const KDateTime::Spec &timeSpec) const
Returns true if the date specified is one on which the to-do will recur.
Definition: todo.cpp:418
KCalCore::Todo::dateTime
KDateTime dateTime(DateTimeRole role) const
Definition: todo.cpp:499
KCalCore::Todo::Todo
Todo()
Constructs an empty to-do.
KCalCore::Todo::clone
Todo * clone() const
Returns an exact copy of this todo.
KCalCore::IncidenceBase::FieldPercentComplete
Field representing the COMPLETED component.
Definition: incidencebase.h:163
KCalCore::IncidenceBase::allDay
bool allDay() const
Returns true or false depending on whether the incidence is all-day.
Definition: incidencebase.cpp:305
KCalCore::IncidenceBase::setFieldDirty
void setFieldDirty(IncidenceBase::Field field)
Marks Field field as dirty.
Definition: incidencebase.cpp:625
KCalCore::Todo::iconName
QLatin1String iconName(const KDateTime &recurrenceId=KDateTime()) const
Definition: todo.cpp:573
KCalCore::IncidenceBase::RoleSort
Role for an incidence&#39;s date/time used when sorting.
Definition: incidencebase.h:134
KCalCore::IncidenceBase::endUpdates
void endUpdates()
Call this when a group of updates is complete, to notify observers that the instance has changed...
Definition: incidencebase.cpp:590
KCalCore::Incidence::shiftTimes
virtual void shiftTimes(const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec)
Definition: incidence.cpp:385
KCalCore::Recurrence::duration
int duration() const
Returns -1 if the event recurs infinitely, 0 if the end date is set, otherwise the total number of re...
Definition: recurrence.cpp:481
KCalCore::IncidenceBase::startUpdates
void startUpdates()
Call this when a group of updates is going to be made.
Definition: incidencebase.cpp:584
KCalCore::Todo::setDateTime
void setDateTime(const KDateTime &dateTime, DateTimeRole role)
Definition: todo.cpp:545
KCalCore::IncidenceBase::DateTimeRole
DateTimeRole
The different types of incidence date/times roles.
Definition: incidencebase.h:131
KCalCore::IncidenceBase::RoleAlarmEndOffset
Role for an incidence alarm&#39;s ending offset date/time.
Definition: incidencebase.h:133
KCalCore::Todo::setDtRecurrence
void setDtRecurrence(const KDateTime &dt)
Sets the due date/time of the current occurrence if recurrent.
Definition: todo.cpp:407
KCalCore::Incidence::assign
virtual IncidenceBase & assign(const IncidenceBase &other)
Definition: incidence.cpp:211
KCalCore::IncidenceBase::FieldDtDue
Field representing the PERCENT-COMPLETE component.
Definition: incidencebase.h:164
KCalCore::Incidence::revision
int revision() const
Returns the number of revisions this incidence has seen.
Definition: incidence.cpp:371
KCalCore::IncidenceBase::RoleStartTimeZone
Role for determining an incidence&#39;s starting timezone.
Definition: incidencebase.h:136
KCalCore::Todo::isOpenEnded
bool isOpenEnded() const
Returns true, if the to-do is open-ended (no due date); false otherwise.
Definition: todo.cpp:360
KCalCore::Todo::isOverdue
bool isOverdue() const
Returns true if this todo is overdue (e.g.
Definition: todo.cpp:427
KCalCore::Incidence::recursOn
virtual bool recursOn(const QDate &date, const KDateTime::Spec &timeSpec) const
Definition: incidence.cpp:572
KCalCore::Incidence::recurrenceId
KDateTime recurrenceId() const
Returns the incidence recurrenceId.
Definition: incidence.cpp:1023
KCalCore::Todo::setHasStartDate
void setHasStartDate(bool hasStartDate)
Sets if the todo has a start date.
Definition: todo.cpp:214
KCalCore::Todo::setDtDue
void setDtDue(const KDateTime &dtDue, bool first=false)
Sets due date and time.
KCalCore::Todo::setDtStart
void setDtStart(const KDateTime &dtStart)
Sets the start date of the todo.
Definition: todo.cpp:253
KCalCore::Todo::todoMimeType
static QLatin1String todoMimeType()
Returns the Akonadi specific sub MIME type of a KCalCore::Todo.
Definition: todo.cpp:568
KCalCore::Todo
Provides a To-do in the sense of RFC2445.
Definition: todo.h:44
KCalCore::Recurrence::getNextDateTime
KDateTime getNextDateTime(const KDateTime &preDateTime) const
Returns the date and time of the next recurrence, after the specified date/time.
Definition: recurrence.cpp:1018
KCalCore::IncidenceBase::comments
QStringList comments() const
Returns all incidence comments as a list of strings.
Definition: incidencebase.cpp:364
KCalCore::Recurrence::setAllDay
void setAllDay(bool allDay)
Sets whether the dtstart is a all-day (i.e.
Definition: recurrence.cpp:182
KCalCore::Todo::hasStartDate
bool hasStartDate() const
Returns true if the todo has a start date, otherwise return false.
Definition: todo.cpp:209
KCalCore::Incidence::recurs
bool recurs() const
Definition: incidence.cpp:563
KCalCore::Todo::completed
KDateTime completed() const
Returns date and time when todo was completed.
Definition: todo.cpp:285
KCalCore::IncidenceBase::mReadOnly
bool mReadOnly
Identifies a read-only incidence.
Definition: incidencebase.h:705
KCalCore::Todo::isCompleted
bool isCompleted() const
Returns true if the todo is 100% completed, otherwise return false.
Definition: todo.cpp:266
KCalCore::Todo::hasCompletedDate
bool hasCompletedDate() const
Returns true, if the to-do has a date associated with completion, otherwise return false...
Definition: todo.cpp:306
KCalCore::Todo::assign
virtual IncidenceBase & assign(const IncidenceBase &other)
KCalCore::Recurrence::startDateTime
KDateTime startDateTime() const
Return the start date/time of the recurrence (Time for all-day recurrences will be 0:00)...
Definition: recurrence.cpp:172
KCalCore::Todo::dtDue
KDateTime dtDue(bool first=false) const
Returns due date and time.
Definition: todo.cpp:181
KCalCore::Recurrence::endDateTime
KDateTime endDateTime() const
Returns the date/time of the last recurrence.
Definition: recurrence.cpp:428
KCalCore::IncidenceBase::RoleAlarmStartOffset
Role for an incidence alarm&#39;s starting offset date/time.
Definition: incidencebase.h:132
KCalCore::Incidence::recursAt
bool recursAt(const KDateTime &dt) const
Definition: incidence.cpp:578
KCalCore::Todo::percentComplete
int percentComplete() const
Returns what percentage of the to-do is completed.
Definition: todo.cpp:311
KCalCore::Todo::shiftTimes
virtual void shiftTimes(const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec)
Definition: todo.cpp:391
KCalCore::Todo::isNotStarted
bool isNotStarted(bool first) const
Returns true, if the to-do has yet to be started (no start date and 0% completed); otherwise return f...
Definition: todo.cpp:369
KCalCore::Incidence
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
Definition: incidence.h:68
KCalCore::IncidenceBase::dtStart
virtual KDateTime dtStart() const
Returns an incidence&#39;s starting date/time as a KDateTime.
Definition: incidencebase.cpp:300
KCalCore::IncidenceBase::RoleRecurrenceStart
Role for determining the start of the recurrence.
Definition: incidencebase.h:145
KCalCore::Todo::setPercentComplete
void setPercentComplete(int percent)
Sets what percentage of the to-do is completed.
Definition: todo.cpp:316
KCalCore::IncidenceBase::RoleDisplayStart
Role for display purposes, represents the start boundary of an incidence.
Definition: incidencebase.h:150
This file is part of the KDE documentation.
Documentation copyright © 1996-2015 The KDE developers.
Generated on Mon Sep 28 2015 03:07:59 by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCalCore Library

Skip menu "KCalCore Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal