KCalCore Library
event.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00028 #ifndef KCALCORE_EVENT_H
00029 #define KCALCORE_EVENT_H
00030
00031 #include "kcalcore_export.h"
00032 #include "incidence.h"
00033 #include "supertrait.h"
00034
00035 namespace KCalCore {
00036
00041 class KCALCORE_EXPORT Event : public Incidence
00042 {
00043 public:
00047 enum Transparency {
00048 Opaque,
00049 Transparent
00050 };
00051
00055 typedef QSharedPointer<Event> Ptr;
00056
00060 typedef QVector<Ptr> List;
00061
00065 Event();
00066
00071 Event( const Event &other );
00072
00076 ~Event();
00077
00082 IncidenceType type() const;
00083
00088 QByteArray typeStr() const;
00089
00093 Event *clone() const;
00094
00101 virtual void setDtStart( const KDateTime &dt );
00102
00108 void setDtEnd( const KDateTime &dtEnd );
00109
00114 virtual KDateTime dtEnd() const;
00115
00121 QDate dateEnd() const;
00122
00127 void setHasEndDate( bool b );
00128
00132 bool hasEndDate() const;
00133
00140 bool isMultiDay( const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00141
00146 virtual void shiftTimes( const KDateTime::Spec &oldSpec,
00147 const KDateTime::Spec &newSpec );
00148
00153 void setTransparency( Transparency transparency );
00154
00158 Transparency transparency() const;
00159
00164 void setDuration( const Duration &duration );
00165
00170 void setAllDay( bool allDay );
00171
00176 KDateTime dateTime( DateTimeRole role ) const;
00177
00182 void setDateTime( const KDateTime &dateTime, DateTimeRole role );
00183
00188 QLatin1String mimeType() const;
00189
00194 QLatin1String iconName( const KDateTime &recurrenceId = KDateTime() ) const;
00195
00199 static QLatin1String eventMimeType();
00200
00201 protected:
00206 virtual bool equals( const IncidenceBase &event ) const;
00207
00212 virtual IncidenceBase &assign( const IncidenceBase &other );
00213
00218 virtual void virtual_hook( int id, void *data );
00219
00220 private:
00225 bool accept( Visitor &v, IncidenceBase::Ptr incidence );
00226
00233 Event &operator=( const Event &other );
00234
00235
00236 class Private;
00237 Private *const d;
00238
00239 };
00240
00241 }
00242
00243 Q_DECLARE_TYPEINFO( KCalCore::Event::Ptr, Q_MOVABLE_TYPE );
00244
00245
00246 namespace KPIMUtils
00247 {
00248
00249 template <> struct SuperClass<KCalCore::Event> : public SuperClassTrait<KCalCore::Incidence>{};
00250 }
00251
00252
00253 #endif