• 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
372
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::ICalTimeZoneBackend
ICalTimeZoneBackend()
Implements ICalTimeZone::ICalTimeZone().
Definition icaltimezones.cpp:224
KCalCore::ICalTimeZoneBackend::virtual_hook
virtual void virtual_hook(int id, void *data)
Definition icaltimezones.cpp:261
KCalCore::ICalTimeZoneBackend::clone
virtual KTimeZoneBackend * clone() const
Creates a copy of this instance.
Definition icaltimezones.cpp:245
KCalCore::ICalTimeZoneBackend::type
virtual QByteArray type() const
Returns the class name of the data represented by this instance.
Definition icaltimezones.cpp:250
KCalCore::ICalTimeZoneBackend::hasTransitions
virtual bool hasTransitions(const KTimeZone *caller) const
Implements ICalTimeZone::hasTransitions().
Definition icaltimezones.cpp:255
KCalCore::ICalTimeZoneData
Parsed iCalendar VTIMEZONE data.
Definition icaltimezones.h:565
KCalCore::ICalTimeZoneData::ICalTimeZoneData
ICalTimeZoneData()
Default constructor.
Definition icaltimezones.cpp:390
KCalCore::ICalTimeZoneData::icalTimezone
icaltimezone * icalTimezone() const
Returns the ICal timezone structure which represents this time zone.
Definition icaltimezones.cpp:754
KCalCore::ICalTimeZoneData::clone
virtual KTimeZoneData * clone() const
Creates a new copy of this object.
Definition icaltimezones.cpp:727
KCalCore::ICalTimeZoneData::hasTransitions
virtual bool hasTransitions() const
Return whether daylight saving transitions are available for the time zone.
Definition icaltimezones.cpp:769
KCalCore::ICalTimeZoneData::url
QByteArray url() const
Returns the URL of the published VTIMEZONE definition, if any.
Definition icaltimezones.cpp:737
KCalCore::ICalTimeZoneData::vtimezone
QByteArray vtimezone() const
Returns the VTIMEZONE string which represents this time zone.
Definition icaltimezones.cpp:747
KCalCore::ICalTimeZoneData::virtual_hook
virtual void virtual_hook(int id, void *data)
Definition icaltimezones.cpp:774
KCalCore::ICalTimeZoneData::lastModified
QDateTime lastModified() const
Returns the LAST-MODIFIED time of the VTIMEZONE, if any.
Definition icaltimezones.cpp:742
KCalCore::ICalTimeZoneData::operator=
ICalTimeZoneData & operator=(const ICalTimeZoneData &rhs)
Assignment operator.
Definition icaltimezones.cpp:712
KCalCore::ICalTimeZoneData::city
QString city() const
Returns the name of the city for this time zone, if any.
Definition icaltimezones.cpp:732
KCalCore::ICalTimeZoneSource
A class which reads and parses iCalendar VTIMEZONE components, and accesses libical time zone data.
Definition icaltimezones.h:406
KCalCore::ICalTimeZoneSource::icalTzidPrefix
static QByteArray icalTzidPrefix()
Returns the prefix string used in the TZID field in built-in libical time zones.
Definition icaltimezones.cpp:1374
KCalCore::ICalTimeZoneSource::parse
ICalTimeZone parse(MSTimeZone *tz)
Creates an ICalTimeZone instance containing the detailed information contained in an MSTimeZone struc...
KCalCore::ICalTimeZoneSource::virtual_hook
virtual void virtual_hook(int id, void *data)
Definition icaltimezones.cpp:1391
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::ICalTimeZoneSource::standardZone
ICalTimeZone standardZone(const QString &zone, bool icalBuiltIn=false)
Creates an ICalTimeZone instance for a standard time zone.
Definition icaltimezones.cpp:1337
KCalCore::ICalTimeZoneSource::parse
ICalTimeZone parse(icalcomponent *vtimezone)
Creates an ICalTimeZone instance containing the detailed information parsed from an iCalendar VTIMEZO...
Definition icaltimezones.cpp:852
KCalCore::ICalTimeZoneSource::ICalTimeZoneSource
ICalTimeZoneSource()
Constructs an iCalendar time zone source.
Definition icaltimezones.cpp:799
KCalCore::ICalTimeZone
The ICalTimeZone class represents an iCalendar VTIMEZONE component.
Definition icaltimezones.h:178
KCalCore::ICalTimeZone::url
QByteArray url() const
Returns the URL of the published VTIMEZONE definition, if any.
Definition icaltimezones.cpp:305
KCalCore::ICalTimeZone::lastModified
QDateTime lastModified() const
Returns the LAST-MODIFIED time of the VTIMEZONE, if any.
Definition icaltimezones.cpp:311
KCalCore::ICalTimeZone::city
QString city() const
Returns the name of the city for this time zone, if any.
Definition icaltimezones.cpp:299
KCalCore::ICalTimeZone::ICalTimeZone
ICalTimeZone()
Constructs a null time zone.
Definition icaltimezones.cpp:269
KCalCore::ICalTimeZone::utc
static ICalTimeZone utc()
Returns a standard UTC time zone, with name "UTC".
Definition icaltimezones.cpp:340
KCalCore::ICalTimeZone::vtimezone
QByteArray vtimezone() const
Returns the VTIMEZONE string which represents this time zone.
Definition icaltimezones.cpp:317
KCalCore::ICalTimeZone::icalTimezone
icaltimezone * icalTimezone() const
Returns the ICal timezone structure which represents this time zone.
Definition icaltimezones.cpp:323
KCalCore::ICalTimeZone::virtual_hook
virtual void virtual_hook(int id, void *data)
Definition icaltimezones.cpp:350
KCalCore::ICalTimeZone::update
bool update(const ICalTimeZone &other)
Update the definition of the time zone to be identical to another ICalTimeZone instance.
Definition icaltimezones.cpp:329
KCalCore::ICalTimeZones
The ICalTimeZones class represents a time zone database which consists of a collection of individual ...
Definition icaltimezones.h:66
KCalCore::ICalTimeZones::add
bool add(const ICalTimeZone &zone)
Adds a time zone to the collection.
Definition icaltimezones.cpp:131
KCalCore::ICalTimeZones::zone
ICalTimeZone zone(const QString &name) const
Returns the time zone with the given name.
Definition icaltimezones.cpp:180
KCalCore::ICalTimeZones::clear
void clear()
Clears the collection.
Definition icaltimezones.cpp:170
KCalCore::ICalTimeZones::ICalTimeZones
ICalTimeZones()
Constructs an empty time zone collection.
Definition icaltimezones.cpp:100
KCalCore::ICalTimeZones::count
int count()
Returns the number of zones kept in memory.
Definition icaltimezones.cpp:175
KCalCore::ICalTimeZones::operator=
ICalTimeZones & operator=(const ICalTimeZones &rhs)
Assignment operator.
Definition icaltimezones.cpp:111
KCalCore::ICalTimeZones::remove
ICalTimeZone remove(const ICalTimeZone &zone)
Removes a time zone from the collection.
Definition icaltimezones.cpp:144
KCalCore::ICalTimeZones::zones
const ZoneMap zones() const
Returns all the time zones defined in this collection.
Definition icaltimezones.cpp:126
KCalCore
TODO: KDE5:
Definition alarm.h:47
KCalCore::MSSystemTime
struct KCalCore::_MSSystemTime MSSystemTime
Placeholhers for Microsoft and ActiveSync timezone data.
KCalCore::_MSSystemTime
Placeholhers for Microsoft and ActiveSync timezone data.
Definition icaltimezones.h:373
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 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