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

KCalCore Library

  • sources
  • kde-4.12
  • kdepimlibs
  • kcalcore
icaltimezones.h
1 /*
2  This file is part of the kcalcore library.
3 
4  Copyright (c) 2005-2007 David Jarvie <djarvie@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 #ifndef KCALCORE_ICALTIMEZONES_H
22 #define KCALCORE_ICALTIMEZONES_H
23 
24 #include "kcalcore_export.h"
25 
26 #include <KDE/KTimeZone>
27 
28 #include <QtCore/QMap>
29 
30 #ifndef ICALCOMPONENT_H
31 typedef struct icalcomponent_impl icalcomponent;
32 #endif
33 #ifndef ICALTIMEZONE_DEFINED
34 #define ICALTIMEZONE_DEFINED
35 typedef struct _icaltimezone icaltimezone;
36 #endif
37 
38 namespace KCalCore {
39 
40 class ICalTimeZone;
41 class ICalTimeZoneSource;
42 class ICalTimeZoneData;
43 class ICalTimeZonesPrivate;
44 class ICalTimeZonePrivate;
45 class ICalTimeZoneSourcePrivate;
46 class ICalTimeZoneDataPrivate;
47 
65 class KCALCORE_EXPORT ICalTimeZones
66 {
67 public:
71  ICalTimeZones();
72 
77  ICalTimeZones(const ICalTimeZones &rhs);
78 
83  ICalTimeZones &operator=(const ICalTimeZones &rhs);
84 
88  ~ICalTimeZones();
89 
98  ICalTimeZone zone(const QString &name) const;
99 
112  ICalTimeZone zone(const ICalTimeZone &zone) const;
113 
114  typedef QMap<QString, ICalTimeZone> ZoneMap;
115 
121  const ZoneMap zones() const;
122 
131  bool add(const ICalTimeZone &zone);
132 
139  ICalTimeZone remove(const ICalTimeZone &zone);
140 
147  ICalTimeZone remove(const QString &name);
148 
152  void clear();
153 
159  int count();
160 
161 private:
162  //@cond PRIVATE
163  ICalTimeZonesPrivate *const d;
164  //@endcond
165 };
166 
176 class KCALCORE_EXPORT ICalTimeZone : public KTimeZone //krazy:exclude=dpointer
177  //(no d-pointer for KTimeZone derived classes)
178 {
179 public:
185  ICalTimeZone();
186 
195  ICalTimeZone(ICalTimeZoneSource *source, const QString &name, ICalTimeZoneData *data);
196 
203  explicit ICalTimeZone(const KTimeZone &tz, const QDate &earliest = QDate());
204 
208  virtual ~ICalTimeZone();
209 
216  QString city() const;
217 
223  QByteArray url() const;
224 
230  QDateTime lastModified() const;
231 
237  QByteArray vtimezone() const;
238 
246  icaltimezone *icalTimezone() const;
247 
260  bool update(const ICalTimeZone &other);
261 
272  static ICalTimeZone utc();
273 
274 protected:
279  virtual void virtual_hook(int id, void *data);
280 
281 private:
282  // d-pointer is in ICalTimeZoneBackend.
283  // This is a requirement for classes inherited from KTimeZone.
284 };
285 
299 class KCALCORE_EXPORT ICalTimeZoneBackend : public KTimeZoneBackend
300 {
301 public:
303  ICalTimeZoneBackend();
314  ICalTimeZoneBackend(ICalTimeZoneSource *source, const QString &name,
315  const QString &countryCode = QString(),
316  float latitude = KTimeZone::UNKNOWN,
317  float longitude = KTimeZone::UNKNOWN,
318  const QString &comment = QString());
319 
325  ICalTimeZoneBackend(const KTimeZone &tz, const QDate &earliest);
326 
327  virtual ~ICalTimeZoneBackend();
328 
334  virtual KTimeZoneBackend *clone() const;
335 
341  virtual QByteArray type() const;
342 
351  virtual bool hasTransitions(const KTimeZone *caller) const;
352 
353 protected:
358  virtual void virtual_hook(int id, void *data);
359 
360 private:
361  //@cond PRIVATE
362  ICalTimeZonePrivate *d; //krazy:exclude=dpointer
363  //(non-const d-pointer for KTimeZoneBackend-derived classes)
364  //@endcond
365 };
366 
373 typedef struct _MSSystemTime {
374  qint16 wYear;
375  qint16 wMonth;
376  qint16 wDayOfWeek;
377  qint16 wDay;
378  qint16 wHour;
379  qint16 wMinute;
380  qint16 wSecond;
381  qint16 wMilliseconds;
382 } MSSystemTime;
383 
384 typedef struct _MSTimeZone {
385  long Bias;
386  QString StandardName;
387  MSSystemTime StandardDate;
388  long StandardBias;
389  QString DaylightName;
390  MSSystemTime DaylightDate;
391  long DaylightBias;
392 } MSTimeZone;
393 
405 class KCALCORE_EXPORT ICalTimeZoneSource : public KTimeZoneSource
406 {
407 public:
411  ICalTimeZoneSource();
412 
416  virtual ~ICalTimeZoneSource();
417 
425  ICalTimeZone parse(icalcomponent *vtimezone);
426 
441  bool parse(icalcomponent *calendar, ICalTimeZones &zones);
442 
450  ICalTimeZone parse(MSTimeZone *tz);
451 
461  ICalTimeZone parse(MSTimeZone *tz, ICalTimeZones &zones);
462 
475  ICalTimeZone parse(const QString &name, const QStringList &tzList, ICalTimeZones &zones);
476 
485  ICalTimeZone parse(const QString &name, const QStringList &tzList);
486 
500  bool parse(const QString &fileName, ICalTimeZones &zones);
501 
514  ICalTimeZone parse(icaltimezone *tz);
515 
527  ICalTimeZone standardZone(const QString &zone, bool icalBuiltIn = false);
528 
537  static QByteArray icalTzidPrefix();
538 
539  using KTimeZoneSource::parse; // prevent warning about hidden virtual method
540 
541 protected:
546  virtual void virtual_hook(int id, void *data);
547 
548 private:
549  //@cond PRIVATE
550  ICalTimeZoneSourcePrivate *const d;
551  //@endcond
552 };
553 
564 class KCALCORE_EXPORT ICalTimeZoneData : public KTimeZoneData
565 {
566  friend class ICalTimeZoneSource;
567 
568 public:
572  ICalTimeZoneData();
573 
579  ICalTimeZoneData(const ICalTimeZoneData &rhs);
580 
592  ICalTimeZoneData(const KTimeZoneData &rhs, const KTimeZone &tz, const QDate &earliest);
593 
597  virtual ~ICalTimeZoneData();
598 
605  ICalTimeZoneData &operator=(const ICalTimeZoneData &rhs);
606 
613  virtual KTimeZoneData *clone() const;
614 
621  QString city() const;
622 
628  QByteArray url() const;
629 
635  QDateTime lastModified() const;
636 
642  QByteArray vtimezone() const;
643 
651  icaltimezone *icalTimezone() const;
652 
658  virtual bool hasTransitions() const;
659 
660 protected:
665  virtual void virtual_hook(int id, void *data);
666 
667 private:
668  //@cond PRIVATE
669  ICalTimeZoneDataPrivate *const d;
670  //@endcond
671 };
672 
673 }
674 
675 #endif
KCalCore::ICalTimeZoneSource
A class which reads and parses iCalendar VTIMEZONE components, and accesses libical time zone data...
Definition: icaltimezones.h:405
KCalCore::MSSystemTime
struct KCalCore::_MSSystemTime MSSystemTime
Placeholhers for Microsoft and ActiveSync timezone data.
KCalCore::ICalTimeZoneData
Parsed iCalendar VTIMEZONE data.
Definition: icaltimezones.h:564
KCalCore::ICalTimeZoneBackend
Backend class for KICalTimeZone class.
Definition: icaltimezones.h:299
KCalCore::ICalTimeZones
The ICalTimeZones class represents a time zone database which consists of a collection of individual ...
Definition: icaltimezones.h:65
KCalCore::ICalTimeZone
The ICalTimeZone class represents an iCalendar VTIMEZONE component.
Definition: icaltimezones.h:176
KCalCore::_MSSystemTime
Placeholhers for Microsoft and ActiveSync timezone data.
Definition: icaltimezones.h:373
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:59:57 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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