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
00111 void setDtEnd( const KDateTime &dtEnd );
00112
00120 virtual KDateTime dtEnd() const;
00121
00127 QDate dateEnd() const;
00128
00133 void setHasEndDate( bool b );
00134
00138 bool hasEndDate() const;
00139
00150 bool isMultiDay( const KDateTime::Spec &spec = KDateTime::Spec() ) const;
00151
00156 virtual void shiftTimes( const KDateTime::Spec &oldSpec,
00157 const KDateTime::Spec &newSpec );
00158
00163 void setTransparency( Transparency transparency );
00164
00168 Transparency transparency() const;
00169
00174 void setDuration( const Duration &duration );
00175
00180 void setAllDay( bool allDay );
00181
00186 KDateTime dateTime( DateTimeRole role ) const;
00187
00192 void setDateTime( const KDateTime &dateTime, DateTimeRole role );
00193
00198 QLatin1String mimeType() const;
00199
00204 QLatin1String iconName( const KDateTime &recurrenceId = KDateTime() ) const;
00205
00209 static QLatin1String eventMimeType();
00210
00211 protected:
00216 virtual bool equals( const IncidenceBase &event ) const;
00217
00222 virtual IncidenceBase &assign( const IncidenceBase &other );
00223
00228 virtual void virtual_hook( int id, void *data );
00229
00230 private:
00235 bool accept( Visitor &v, IncidenceBase::Ptr incidence );
00236
00243 Event &operator=( const Event &other );
00244
00245
00246 class Private;
00247 Private *const d;
00248
00249 };
00250
00251 }
00252
00253 Q_DECLARE_TYPEINFO( KCalCore::Event::Ptr, Q_MOVABLE_TYPE );
00254
00255
00256 namespace KPIMUtils
00257 {
00258
00259 template <> struct SuperClass<KCalCore::Event> : public SuperClassTrait<KCalCore::Incidence>{};
00260 }
00261
00262
00263 #endif