libkcal

event.h

Go to the documentation of this file.
00001 /*
00002     This file is part of libkcal.
00003 
00004     Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 #ifndef KCAL_EVENT_H
00022 #define KCAL_EVENT_H
00023 
00024 #include "incidence.h"
00025 #include <kdepimmacros.h>
00026 
00027 namespace KCal {
00028 
00032 class LIBKCAL_EXPORT Event : public Incidence
00033 {
00034   public:
00041     enum Transparency { Opaque, Transparent };
00042 
00043     typedef ListBase<Event> List;
00044 
00045     Event();
00046     Event( const Event & );
00047     ~Event();
00048     Event& operator=( const Event &e );
00049     bool operator==( const Event & ) const;
00050 
00051     QCString type() const { return "Event"; }
00052 
00056     Event *clone();
00057 
00061     void setDtEnd(const QDateTime &dtEnd);
00065     virtual QDateTime dtEnd() const;
00071     QDate dateEnd() const;
00076     QString dtEndTimeStr() const;
00084     QString dtEndDateStr( bool shortfmt = true ) const;
00089     QString dtEndStr() const;
00090 
00094     void setHasEndDate(bool);
00098     bool hasEndDate() const;
00099 
00103     bool isMultiDay() const;
00104 
00108     void setTransparency( Transparency transparency );
00112     Transparency transparency() const;
00113 
00117     void setDuration( int seconds );
00118 
00119   protected:
00121     virtual QDateTime endDateRecurrenceBase() const { return dtEnd(); }
00122   private:
00123     bool accept( Visitor &v ) { return v.visit( this ); }
00124 
00125     QDateTime mDtEnd;
00126     bool mHasEndDate;
00127     Transparency mTransparency;
00128 
00129     class Private;
00130     Private *d;
00131 };
00132 
00133 }
00134 
00135 #endif