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

KCalCore Library

  • kcalcore
incidence.h
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) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
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 */
31 #ifndef KCALCORE_INCIDENCE_H
32 #define KCALCORE_INCIDENCE_H
33 
34 #include "kcalcore_export.h"
35 #include "alarm.h"
36 #include "attachment.h"
37 #include "incidencebase.h"
38 #include "recurrence.h"
39 
40 #include <QtCore/QMetaType>
41 
42 //@cond PRIVATE
43 // Value used to signal invalid/unset latitude or longitude.
44 #define INVALID_LATLON 255.0
45 //@endcond
46 
47 namespace KCalCore {
48 
68 class KCALCORE_EXPORT Incidence
69  : public IncidenceBase, public Recurrence::RecurrenceObserver
70 {
71  public:
72 
77  enum Status {
78  StatusNone,
79  StatusTentative,
80  StatusConfirmed,
81  StatusCompleted,
82  StatusNeedsAction,
83  StatusCanceled,
84  StatusInProcess,
85  StatusDraft,
86  StatusFinal,
87  StatusX
88  };
89 
93  enum Secrecy {
94  SecrecyPublic,
95  SecrecyPrivate,
96  SecrecyConfidential
97  };
98 
103  enum RelType {
104  RelTypeParent,
105  RelTypeChild,
106  RelTypeSibling
107  };
108 
112  typedef QSharedPointer<Incidence> Ptr;
113 
117  typedef QVector<Ptr> List;
118 
122  Incidence();
123 
127  virtual ~Incidence();
128 
135  virtual Incidence *clone() const = 0;
136 
143  void setReadOnly( bool readonly );
144 
149  void setLastModified( const KDateTime &lm );
150 
159  void setLocalOnly( bool localonly );
160 
167  bool localOnly() const;
168 
173  void setAllDay( bool allDay );
174 
180  void recreate();
181 
188  void setCreated( const KDateTime &dt );
189 
194  KDateTime created() const;
195 
202  void setRevision( int rev );
203 
208  int revision() const;
209 
216  virtual void setDtStart( const KDateTime &dt );
217 
222  virtual void shiftTimes( const KDateTime::Spec &oldSpec,
223  const KDateTime::Spec &newSpec );
224 
232  void setDescription( const QString &description, bool isRich );
233 
241  void setDescription( const QString &description );
242 
248  QString description() const;
249 
255  QString richDescription() const;
256 
261  bool descriptionIsRich() const;
262 
270  void setSummary( const QString &summary, bool isRich );
271 
278  void setSummary( const QString &summary );
279 
285  QString summary() const;
286 
292  QString richSummary() const;
293 
298  bool summaryIsRich() const;
299 
307  void setLocation( const QString &location, bool isRich );
308 
316  void setLocation( const QString &location );
317 
323  QString location() const;
324 
330  QString richLocation() const;
331 
336  bool locationIsRich() const;
337 
344  void setCategories( const QStringList &categories );
345 
353  void setCategories( const QString &catStr );
354 
359  QStringList categories() const;
360 
365  QString categoriesStr() const;
366 
378  void setRelatedTo( const QString &uid, RelType relType = RelTypeParent );
379 
391  QString relatedTo( RelType relType = RelTypeParent ) const;
392 
393 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
394 // %%%%% Convenience wrappers for property handling
395 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
401  bool hasAltDescription() const;
409  void setAltDescription( const QString &altdescription );
410 
415  QString altDescription() const;
416 
417 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
418 // %%%%% Recurrence-related methods
419 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
420 
425  Recurrence *recurrence() const;
426 
430  void clearRecurrence();
431 
436  bool recurs() const;
437 
442  ushort recurrenceType() const;
443 
448  virtual bool recursOn( const QDate &date, const KDateTime::Spec &timeSpec ) const;
449 
454  bool recursAt( const KDateTime &dt ) const;
455 
467  virtual QList<KDateTime> startDateTimesForDate(
468  const QDate &date,
469  const KDateTime::Spec &timeSpec = KDateTime::LocalZone ) const;
470 
480  virtual QList<KDateTime> startDateTimesForDateTime(
481  const KDateTime &datetime ) const;
482 
492  virtual KDateTime endDateForStart( const KDateTime &startDt ) const;
493 
494 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
495 // %%%%% Attachment-related methods
496 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
497 
504  void addAttachment( const Attachment::Ptr &attachment );
505 
513  void deleteAttachment( const Attachment::Ptr &attachment );
514 
522  void deleteAttachments( const QString &mime );
523 
528  Attachment::List attachments() const;
529 
536  Attachment::List attachments( const QString &mime ) const;
537 
542  void clearAttachments();
543 
552  QString writeAttachmentToTempFile( const Attachment::Ptr &attachment ) const;
553 
558  void clearTempFiles();
559 
560 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
561 // %%%%% Secrecy and Status methods
562 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
563 
570  void setSecrecy( Secrecy secrecy );
571 
576  Secrecy secrecy() const;
577 
585  void setStatus( Status status );
586 
594  void setCustomStatus( const QString &status );
595 
600  QString customStatus() const;
601 
606  Status status() const;
607 
608 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
609 // %%%%% Other methods
610 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
611 
619  void setResources( const QStringList &resources );
620 
625  QStringList resources() const;
626 
635  void setPriority( int priority );
636 
641  int priority() const;
642 
647  bool hasGeo() const;
648 
654  void setHasGeo( bool hasGeo );
655 
661  void setGeoLatitude( float geolatitude );
662 
668  float geoLatitude() const;
669 
675  void setGeoLongitude( float geolongitude );
676 
682  float geoLongitude() const;
683 
688  bool hasRecurrenceId() const;
689 
695  void setRecurrenceId( const KDateTime &recurrenceId );
696 
702  KDateTime recurrenceId() const;
703 
704 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
705 // %%%%% Alarm-related methods
706 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
707 
711  Alarm::List alarms() const;
712 
716  Alarm::Ptr newAlarm();
717 
724  void addAlarm( const Alarm::Ptr &alarm );
725 
732  void removeAlarm( const Alarm::Ptr &alarm );
733 
738  void clearAlarms();
739 
743  bool hasEnabledAlarms() const;
744 
745 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
746 // %%%%% Other methods
747 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
748 
773  void setSchedulingID( const QString &sid,
774  const QString &uid = QString() );
775 
781  QString schedulingID() const;
782 
790  virtual void recurrenceUpdated( Recurrence *recurrence );
791 
799  virtual QLatin1String iconName( const KDateTime &recurrenceId = KDateTime() ) const = 0;
800  //TODO_KDE5: make pure virtual
805  /*virtual*/ bool supportsGroupwareCommunication() const/* = 0*/;
806 
807  protected:
808 
813  Incidence( const Incidence &other );
814 
820  virtual bool equals( const IncidenceBase &incidence ) const;
821 
826  virtual IncidenceBase &assign( const IncidenceBase &other );
827 
828  private:
835  Incidence &operator=( const Incidence &other );
836 
837  //@cond PRIVATE
838  class Private;
839  Private *const d;
840  //@endcond
841 };
842 
843 }
844 
845 //@cond PRIVATE
846 inline uint qHash( const QSharedPointer<KCalCore::Incidence> &key )
847 {
848  return qHash<KCalCore::Incidence>( key.data() );
849 }
850 //@endcond
851 
852 Q_DECLARE_TYPEINFO( KCalCore::Incidence::Ptr, Q_MOVABLE_TYPE );
853 Q_DECLARE_METATYPE( KCalCore::Incidence * )
854 
855 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:24:51 by doxygen 1.8.3.1 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