• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • date
ksystemtimezone.h
Go to the documentation of this file.
1/*
2 This file is part of the KDE libraries
3 Copyright (c) 2005-2007,2009-2012 David Jarvie <djarvie@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
27#ifndef _KSYSTEMTIMEZONE_H
28#define _KSYSTEMTIMEZONE_H
29
30#include <kdecore_export.h>
31#include "ktimezone.h"
32
33#include <QtCore/QObject>
34#include <QtCore/QDateTime>
35#include <QtCore/QList>
36#include <QtCore/QString>
37#include <QtCore/QByteArray>
38
39class KSystemTimeZoneSource;
40class KSystemTimeZonePrivate;
41class KSystemTimeZonesPrivate;
42class KSystemTimeZoneSourcePrivate;
43class KSystemTimeZoneDataPrivate;
44
94class KDECORE_EXPORT KSystemTimeZones : public QObject
95{
96 Q_OBJECT
97public:
98 ~KSystemTimeZones();
99
106 static KTimeZones *timeZones();
107
113 static const KTimeZones::ZoneMap zones();
114
126 static KTimeZone zone(const QString &name);
127
138 static KTimeZone readZone(const QString &name);
139
167 static KTimeZone local();
168
187 static KTimeZone realLocalZone();
188
208 static void setLocalZone(const KTimeZone& tz);
209
230 static bool isSimulated();
231
237 static QString zoneinfoDir();
238
245 static bool isTimeZoneDaemonAvailable();
246
247private Q_SLOTS:
248 // Connected to D-Bus signals
249 void configChanged();
250 void zonetabChanged(const QString &zonetab);
251 void zoneDefinitionChanged(const QString &zone);
252
253private:
254 KSystemTimeZones();
255
256 KSystemTimeZonesPrivate * const d;
257 friend class KSystemTimeZonesPrivate;
258};
259
282class KDECORE_EXPORT KSystemTimeZone : public KTimeZone //krazy:exclude=dpointer (no d-pointer for KTimeZone derived classes)
283{
284public:
285
296 KSystemTimeZone(KSystemTimeZoneSource *source, const QString &name,
297 const QString &countryCode = QString(), float latitude = UNKNOWN, float longitude = UNKNOWN,
298 const QString &comment = QString());
299
300 ~KSystemTimeZone();
301
302private:
303 // d-pointer is in KSystemTimeZoneBackend.
304 // This is a requirement for classes inherited from KTimeZone.
305};
306
307
321class KDECORE_EXPORT KSystemTimeZoneBackend : public KTimeZoneBackend //krazy:exclude=dpointer (non-const d-pointer for KTimeZoneBackend-derived classes)
322{
323public:
325 KSystemTimeZoneBackend(KSystemTimeZoneSource *source, const QString &name,
326 const QString &countryCode, float latitude, float longitude, const QString &comment);
327
328 ~KSystemTimeZoneBackend();
329
335 virtual KTimeZoneBackend *clone() const;
336
342 virtual QByteArray type() const;
343
364 virtual int offsetAtZoneTime(const KTimeZone *caller, const QDateTime &zoneDateTime, int *secondOffset) const;
365
382 virtual int offsetAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const;
383
397 virtual int offset(const KTimeZone *caller, time_t t) const;
398
412 virtual bool isDstAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const;
413
424 virtual bool isDst(const KTimeZone *caller, time_t t) const;
425
426private:
427 KSystemTimeZonePrivate *d; // non-const
428};
429
430
441class KDECORE_EXPORT KSystemTimeZoneSource : public KTimeZoneSource
442{
443public:
447 KSystemTimeZoneSource();
448 virtual ~KSystemTimeZoneSource();
449
459 virtual KTimeZoneData *parse(const KTimeZone &zone) const;
460
471 static void startParseBlock();
472
476 static void endParseBlock();
477
478private:
479 KSystemTimeZoneSourcePrivate * const d;
480};
481
482
492class KSystemTimeZoneData : public KTimeZoneData
493{
494 friend class KSystemTimeZoneSource;
495
496public:
497 KSystemTimeZoneData();
499 KSystemTimeZoneData(const KSystemTimeZoneData &);
500 virtual ~KSystemTimeZoneData();
501
503 KSystemTimeZoneData &operator=(const KSystemTimeZoneData &);
504
513 virtual KTimeZoneData *clone() const;
514
520 virtual QList<QByteArray> abbreviations() const;
521 virtual QByteArray abbreviation(const QDateTime &utcDateTime) const;
522
530 virtual QList<int> utcOffsets() const;
531
532private:
533 KSystemTimeZoneDataPrivate * const d;
534};
535
536#endif
KSystemTimeZoneBackend
Backend class for KSystemTimeZone class.
Definition: ksystemtimezone.h:322
KSystemTimeZoneData
Parsed system time zone data.
Definition: ksystemtimezone.h:493
KSystemTimeZoneData::operator=
KSystemTimeZoneData & operator=(const KSystemTimeZoneData &)
Assignment; no special ownership assumed.
Definition: ksystemtimezone.cpp:835
KSystemTimeZoneData::clone
virtual KTimeZoneData * clone() const
Creates a new copy of this object.
Definition: ksystemtimezone.cpp:842
KSystemTimeZoneData::abbreviations
virtual QList< QByteArray > abbreviations() const
Returns the complete list of time zone abbreviations.
Definition: ksystemtimezone.cpp:847
KSystemTimeZoneData::KSystemTimeZoneData
KSystemTimeZoneData()
Definition: ksystemtimezone.cpp:819
KSystemTimeZoneData::utcOffsets
virtual QList< int > utcOffsets() const
Returns the complete list of UTC offsets for the time zone.
Definition: ksystemtimezone.cpp:888
KSystemTimeZoneData::~KSystemTimeZoneData
virtual ~KSystemTimeZoneData()
Definition: ksystemtimezone.cpp:830
KSystemTimeZoneData::abbreviation
virtual QByteArray abbreviation(const QDateTime &utcDateTime) const
Returns the time zone abbreviation current at a specified time.
Definition: ksystemtimezone.cpp:852
KSystemTimeZoneSource
A class to read and parse system time zone data.
Definition: ksystemtimezone.h:442
KSystemTimeZone
The KSystemTimeZone class represents a time zone in the system database.
Definition: ksystemtimezone.h:283
KSystemTimeZones
The KSystemTimeZones class represents the system time zone database, consisting of a collection of in...
Definition: ksystemtimezone.h:95
KTimeZoneBackend
Base backend class for KTimeZone classes.
Definition: ktimezone.h:1121
KTimeZoneData
Base class for the parsed data returned by a KTimeZoneSource class.
Definition: ktimezone.h:1303
KTimeZoneSource
Base class representing a source of time zone information.
Definition: ktimezone.h:1231
KTimeZone
Base class representing a time zone.
Definition: ktimezone.h:417
KTimeZones
The KTimeZones class represents a time zone database which consists of a collection of individual tim...
Definition: ktimezone.h:309
KTimeZones::ZoneMap
QMap< QString, KTimeZone > ZoneMap
Map of KTimeZone instances, indexed by time zone name.
Definition: ktimezone.h:323
QDateTime
QList
Definition: kaboutdata.h:33
QObject
QString
kdecore_export.h
ktimezone.h
Time zone functions.
parse
QList< Action > parse(QSettings &ini)
Definition: policy-gen.cpp:54
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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