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

KCalCore Library

icaltimezones.h
00001 /*
00002   This file is part of the kcalcore 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 #ifndef KCALCORE_ICALTIMEZONES_H
00022 #define KCALCORE_ICALTIMEZONES_H
00023 
00024 #include "kcalcore_export.h"
00025 
00026 #include <KDE/KTimeZone>
00027 
00028 #include <QtCore/QMap>
00029 
00030 #ifndef ICALCOMPONENT_H
00031 typedef struct icalcomponent_impl icalcomponent;
00032 #endif
00033 #ifndef ICALTIMEZONE_DEFINED
00034 #define ICALTIMEZONE_DEFINED
00035 typedef struct _icaltimezone  icaltimezone;
00036 #endif
00037 
00038 namespace KCalCore {
00039 
00040 class ICalTimeZone;
00041 class ICalTimeZoneSource;
00042 class ICalTimeZoneData;
00043 class ICalTimeZonesPrivate;
00044 class ICalTimeZonePrivate;
00045 class ICalTimeZoneSourcePrivate;
00046 class ICalTimeZoneDataPrivate;
00047 
00065 class KCALCORE_EXPORT ICalTimeZones
00066 {
00067   public:
00071     ICalTimeZones();
00072 
00077     ICalTimeZones( const ICalTimeZones &rhs );
00078 
00083     ICalTimeZones &operator=( const ICalTimeZones &rhs );
00084 
00088     ~ICalTimeZones();
00089 
00098     ICalTimeZone zone( const QString &name ) const;
00099 
00112     ICalTimeZone zone( const ICalTimeZone &zone ) const;
00113 
00114     typedef QMap<QString, ICalTimeZone> ZoneMap;
00115 
00121     const ZoneMap zones() const;
00122 
00131     bool add( const ICalTimeZone &zone );
00132 
00139     ICalTimeZone remove( const ICalTimeZone &zone );
00140 
00147     ICalTimeZone remove( const QString &name );
00148 
00152     void clear();
00153 
00159     int count();
00160 
00161   private:
00162     //@cond PRIVATE
00163     ICalTimeZonesPrivate *const d;
00164     //@endcond
00165 };
00166 
00176 class KCALCORE_EXPORT ICalTimeZone : public KTimeZone //krazy:exclude=dpointer
00177                                                       //(no d-pointer for KTimeZone derived classes)
00178 {
00179   public:
00185     ICalTimeZone();
00186 
00195     ICalTimeZone( ICalTimeZoneSource *source, const QString &name, ICalTimeZoneData *data );
00196 
00203     explicit ICalTimeZone( const KTimeZone &tz, const QDate &earliest = QDate() );
00204 
00208     virtual ~ICalTimeZone();
00209 
00216     QString city() const;
00217 
00223     QByteArray url() const;
00224 
00230     QDateTime lastModified() const;
00231 
00237     QByteArray vtimezone() const;
00238 
00246     icaltimezone *icalTimezone() const;
00247 
00260     bool update( const ICalTimeZone &other );
00261 
00272     static ICalTimeZone utc();
00273 
00274   protected:
00279     virtual void virtual_hook( int id, void *data );
00280 
00281   private:
00282     // d-pointer is in ICalTimeZoneBackend.
00283     // This is a requirement for classes inherited from KTimeZone.
00284 };
00285 
00299 class KCALCORE_EXPORT ICalTimeZoneBackend : public KTimeZoneBackend
00300 {
00301   public:
00303     ICalTimeZoneBackend();
00314     ICalTimeZoneBackend( ICalTimeZoneSource *source, const QString &name,
00315                          const QString &countryCode = QString(),
00316                          float latitude = KTimeZone::UNKNOWN,
00317                          float longitude = KTimeZone::UNKNOWN,
00318                          const QString &comment = QString() );
00319 
00325     ICalTimeZoneBackend( const KTimeZone &tz, const QDate &earliest );
00326 
00327     virtual ~ICalTimeZoneBackend();
00328 
00334     virtual KTimeZoneBackend *clone() const;
00335 
00341     virtual QByteArray type() const;
00342 
00351     virtual bool hasTransitions( const KTimeZone *caller ) const;
00352 
00353   protected:
00358     virtual void virtual_hook( int id, void *data );
00359 
00360   private:
00361     //@cond PRIVATE
00362     ICalTimeZonePrivate *d; //krazy:exclude=dpointer
00363                             //(non-const d-pointer for KTimeZoneBackend-derived classes)
00364     //@endcond
00365 };
00366 
00373 typedef struct _MSSystemTime {
00374   qint16 wYear;
00375   qint16 wMonth;
00376   qint16 wDayOfWeek;
00377   qint16 wDay;
00378   qint16 wHour;
00379   qint16 wMinute;
00380   qint16 wSecond;
00381   qint16 wMilliseconds;
00382 } MSSystemTime;
00383 
00384 typedef struct _MSTimeZone {
00385   long         Bias;
00386   QString      StandardName;
00387   MSSystemTime StandardDate;
00388   long         StandardBias;
00389   QString      DaylightName;
00390   MSSystemTime DaylightDate;
00391   long         DaylightBias;
00392 } MSTimeZone;
00393 
00405 class KCALCORE_EXPORT ICalTimeZoneSource : public KTimeZoneSource
00406 {
00407   public:
00411     ICalTimeZoneSource();
00412 
00416     virtual ~ICalTimeZoneSource();
00417 
00425     ICalTimeZone parse( icalcomponent *vtimezone );
00426 
00441     bool parse( icalcomponent *calendar, ICalTimeZones &zones );
00442 
00450     ICalTimeZone parse( MSTimeZone *tz );
00451 
00461     ICalTimeZone parse( MSTimeZone *tz, ICalTimeZones &zones );
00462 
00475     ICalTimeZone parse( const QString &name, const QStringList &tzList, ICalTimeZones &zones );
00476 
00485     ICalTimeZone parse( const QString &name, const QStringList &tzList );
00486 
00500     bool parse( const QString &fileName, ICalTimeZones &zones );
00501 
00514     ICalTimeZone parse( icaltimezone *tz );
00515 
00527     ICalTimeZone standardZone( const QString &zone, bool icalBuiltIn = false );
00528 
00537     static QByteArray icalTzidPrefix();
00538 
00539     using KTimeZoneSource::parse; // prevent warning about hidden virtual method
00540 
00541   protected:
00546     virtual void virtual_hook( int id, void *data );
00547 
00548   private:
00549     //@cond PRIVATE
00550     ICalTimeZoneSourcePrivate *const d;
00551     //@endcond
00552 };
00553 
00564 class KCALCORE_EXPORT ICalTimeZoneData : public KTimeZoneData
00565 {
00566   friend class ICalTimeZoneSource;
00567 
00568   public:
00572     ICalTimeZoneData();
00573 
00579     ICalTimeZoneData( const ICalTimeZoneData &rhs );
00580 
00592     ICalTimeZoneData( const KTimeZoneData &rhs, const KTimeZone &tz, const QDate &earliest );
00593 
00597     virtual ~ICalTimeZoneData();
00598 
00605     ICalTimeZoneData &operator=( const ICalTimeZoneData &rhs );
00606 
00613     virtual KTimeZoneData *clone() const;
00614 
00621     QString city() const;
00622 
00628     QByteArray url() const;
00629 
00635     QDateTime lastModified() const;
00636 
00642     QByteArray vtimezone() const;
00643 
00651     icaltimezone *icalTimezone() const;
00652 
00658     virtual bool hasTransitions() const;
00659 
00660   protected:
00665     virtual void virtual_hook( int id, void *data );
00666 
00667   private:
00668     //@cond PRIVATE
00669     ICalTimeZoneDataPrivate *const d;
00670     //@endcond
00671 };
00672 
00673 }
00674 
00675 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:24:12 by doxygen 1.7.5 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.8.5 API Reference

Skip menu "kdepimlibs-4.8.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • 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