KCal Library
icaltimezones.h
00001 /* 00002 This file is part of the kcal library. 00003 00004 Copyright (c) 2005-2007 David Jarvie <djarvie@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 00022 #ifndef KCAL_ICALTIMEZONES_H 00023 #define KCAL_ICALTIMEZONES_H 00024 00025 #include <ktimezone.h> 00026 00027 #include "kcal_export.h" 00028 00029 #ifndef ICALCOMPONENT_H 00030 typedef struct icalcomponent_impl icalcomponent; 00031 #endif 00032 #ifndef ICALTIMEZONE_DEFINED 00033 #define ICALTIMEZONE_DEFINED 00034 typedef struct _icaltimezone icaltimezone; 00035 #endif 00036 00037 namespace KCal { 00038 00039 class ICalTimeZone; 00040 class ICalTimeZoneSource; 00041 class ICalTimeZoneData; 00042 class ICalTimeZonesPrivate; 00043 class ICalTimeZonePrivate; 00044 class ICalTimeZoneSourcePrivate; 00045 class ICalTimeZoneDataPrivate; 00046 00064 class KCAL_EXPORT_DEPRECATED ICalTimeZones 00065 { 00066 public: 00070 ICalTimeZones(); 00074 ~ICalTimeZones(); 00075 00084 ICalTimeZone zone( const QString &name ) const; 00085 00086 typedef QMap<QString, ICalTimeZone> ZoneMap; 00087 00093 const ZoneMap zones() const; 00094 00103 bool add( const ICalTimeZone &zone ); 00104 00111 ICalTimeZone remove( const ICalTimeZone &zone ); 00112 00119 ICalTimeZone remove( const QString &name ); 00120 00124 void clear(); 00125 00126 private: 00127 ICalTimeZones( const ICalTimeZones & ); // prohibit copying 00128 ICalTimeZones &operator=( const ICalTimeZones & ); // prohibit copying 00129 00130 ICalTimeZonesPrivate *const d; 00131 }; 00132 00142 class KCAL_EXPORT_DEPRECATED ICalTimeZone : public KTimeZone //krazy:exclude=dpointer 00143 //(no d-pointer for KTimeZone derived classes) 00144 { 00145 public: 00151 ICalTimeZone(); 00152 00161 ICalTimeZone( ICalTimeZoneSource *source, const QString &name, ICalTimeZoneData *data ); 00162 00169 explicit ICalTimeZone( const KTimeZone &tz, const QDate &earliest = QDate() ); 00170 00174 virtual ~ICalTimeZone(); 00175 00182 QString city() const; 00183 00189 QByteArray url() const; 00190 00196 QDateTime lastModified() const; 00197 00203 QByteArray vtimezone() const; 00204 00212 icaltimezone *icalTimezone() const; 00213 00226 bool update( const ICalTimeZone &other ); 00227 00238 static ICalTimeZone utc(); 00239 00240 private: 00241 // d-pointer is in ICalTimeZoneBackend. 00242 // This is a requirement for classes inherited from KTimeZone. 00243 }; 00244 00258 class KCAL_EXPORT_DEPRECATED ICalTimeZoneBackend : public KTimeZoneBackend 00259 { 00260 public: 00262 ICalTimeZoneBackend(); 00273 ICalTimeZoneBackend( ICalTimeZoneSource *source, const QString &name, 00274 const QString &countryCode = QString(), 00275 float latitude = KTimeZone::UNKNOWN, 00276 float longitude = KTimeZone::UNKNOWN, 00277 const QString &comment = QString() ); 00278 00284 ICalTimeZoneBackend( const KTimeZone &tz, const QDate &earliest ); 00285 00286 virtual ~ICalTimeZoneBackend(); 00287 00293 virtual KTimeZoneBackend *clone() const; 00294 00300 virtual QByteArray type() const; 00301 00310 virtual bool hasTransitions( const KTimeZone *caller ) const; 00311 00312 private: 00313 ICalTimeZonePrivate *d; //krazy:exclude=dpointer 00314 //(non-const d-pointer for KTimeZoneBackend-derived classes) 00315 }; 00316 00328 class KCAL_EXPORT_DEPRECATED ICalTimeZoneSource : public KTimeZoneSource 00329 { 00330 public: 00334 ICalTimeZoneSource(); 00335 00339 virtual ~ICalTimeZoneSource(); 00340 00348 ICalTimeZone parse( icalcomponent *vtimezone ); 00349 00364 bool parse( icalcomponent *calendar, ICalTimeZones &zones ); 00365 00379 bool parse( const QString &fileName, ICalTimeZones &zones ); 00380 00393 ICalTimeZone parse( icaltimezone *tz ); 00394 00406 ICalTimeZone standardZone( const QString &zone, bool icalBuiltIn = false ); 00407 00416 static QByteArray icalTzidPrefix(); 00417 00418 using KTimeZoneSource::parse; // prevent warning about hidden virtual method 00419 00420 private: 00421 ICalTimeZoneSourcePrivate *const d; 00422 }; 00423 00434 class KCAL_EXPORT_DEPRECATED ICalTimeZoneData : public KTimeZoneData 00435 { 00436 friend class ICalTimeZoneSource; 00437 00438 public: 00442 ICalTimeZoneData(); 00443 00449 ICalTimeZoneData( const ICalTimeZoneData &rhs ); 00450 00462 ICalTimeZoneData( const KTimeZoneData &rhs, const KTimeZone &tz, const QDate &earliest ); 00463 00467 virtual ~ICalTimeZoneData(); 00468 00475 ICalTimeZoneData &operator=( const ICalTimeZoneData &rhs ); 00476 00483 virtual KTimeZoneData *clone() const; 00484 00491 QString city() const; 00492 00498 QByteArray url() const; 00499 00505 QDateTime lastModified() const; 00506 00512 QByteArray vtimezone() const; 00513 00521 icaltimezone *icalTimezone() const; 00522 00528 virtual bool hasTransitions() const; 00529 00530 private: 00531 ICalTimeZoneDataPrivate *const d; 00532 }; 00533 00534 } 00535 00536 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:25:53 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:25:53 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.