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

KCalCore Library

  • 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
31typedef struct icalcomponent_impl icalcomponent;
32#endif
33#ifndef ICALTIMEZONE_DEFINED
34#define ICALTIMEZONE_DEFINED
35typedef struct _icaltimezone icaltimezone;
36#endif
37
38namespace KCalCore {
39
40class ICalTimeZone;
41class ICalTimeZoneSource;
42class ICalTimeZoneData;
43class ICalTimeZonesPrivate;
44class ICalTimeZonePrivate;
45class ICalTimeZoneSourcePrivate;
46class ICalTimeZoneDataPrivate;
47
65class KCALCORE_EXPORT ICalTimeZones
66{
67public:
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
161private:
162 //@cond PRIVATE
163 ICalTimeZonesPrivate *const d;
164 //@endcond
165};
166
176class KCALCORE_EXPORT ICalTimeZone : public KTimeZone //krazy:exclude=dpointer
177 //(no d-pointer for KTimeZone derived classes)
178{
179public:
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
274protected:
279 virtual void virtual_hook(int id, void *data);
280
281private:
282 // d-pointer is in ICalTimeZoneBackend.
283 // This is a requirement for classes inherited from KTimeZone.
284};
285
299class KCALCORE_EXPORT ICalTimeZoneBackend : public KTimeZoneBackend
300{
301public:
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
353protected:
358 virtual void virtual_hook(int id, void *data);
359
360private:
361 //@cond PRIVATE
362 ICalTimeZonePrivate *d; //krazy:exclude=dpointer
363 //(non-const d-pointer for KTimeZoneBackend-derived classes)
364 //@endcond
365};
366
373typedef 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
384typedef 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
405class KCALCORE_EXPORT ICalTimeZoneSource : public KTimeZoneSource
406{
407public:
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
541protected:
546 virtual void virtual_hook(int id, void *data);
547
548private:
549 //@cond PRIVATE
550 ICalTimeZoneSourcePrivate *const d;
551 //@endcond
552};
553
564class KCALCORE_EXPORT ICalTimeZoneData : public KTimeZoneData
565{
566 friend class ICalTimeZoneSource;
567
568public:
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
660protected:
665 virtual void virtual_hook(int id, void *data);
666
667private:
668 //@cond PRIVATE
669 ICalTimeZoneDataPrivate *const d;
670 //@endcond
671};
672
673}
674
675#endif
KCalCore::ICalTimeZoneBackend
Backend class for KICalTimeZone class.
Definition icaltimezones.h:300
KCalCore::ICalTimeZoneData
Parsed iCalendar VTIMEZONE data.
Definition icaltimezones.h:565
KCalCore::ICalTimeZoneSource
A class which reads and parses iCalendar VTIMEZONE components, and accesses libical time zone data.
Definition icaltimezones.h:406
KCalCore::ICalTimeZoneSource::parse
ICalTimeZone parse(MSTimeZone *tz)
Creates an ICalTimeZone instance containing the detailed information contained in an MSTimeZone struc...
KCalCore::ICalTimeZoneSource::parse
ICalTimeZone parse(MSTimeZone *tz, ICalTimeZones &zones)
Creates an ICalTimeZone instance and adds it to a ICalTimeZones collection or returns an existing ins...
KCalCore::ICalTimeZone
The ICalTimeZone class represents an iCalendar VTIMEZONE component.
Definition icaltimezones.h:178
KCalCore::ICalTimeZones
The ICalTimeZones class represents a time zone database which consists of a collection of individual ...
Definition icaltimezones.h:66
KCalCore
TODO: KDE5:
Definition alarm.h:47
KCalCore::MSSystemTime
struct KCalCore::_MSSystemTime MSSystemTime
Placeholhers for Microsoft and ActiveSync timezone data.
qHash
static uint qHash(const KDateTime &dt)
Private class that helps to provide binary compatibility between releases.
Definition occurrenceiterator.cpp:157
KCalCore::_MSSystemTime
Placeholhers for Microsoft and ActiveSync timezone data.
Definition icaltimezones.h:373
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 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.14.10 API Reference

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