• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDECore

ksystemtimezone.h

Go to the documentation of this file.
00001 /*
00002    This file is part of the KDE libraries
00003    Copyright (c) 2005-2007 David Jarvie <djarvie@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018    Boston, MA 02110-1301, USA.
00019 */
00020 
00027 #ifndef _KSYSTEMTIMEZONE_H
00028 #define _KSYSTEMTIMEZONE_H
00029 
00030 #include <kdecore_export.h>
00031 #include "ktimezone.h"
00032 
00033 #include <QtCore/QObject>
00034 #include <QtCore/QDateTime>
00035 #include <QtCore/QList>
00036 #include <QtCore/QString>
00037 #include <QtCore/QByteArray>
00038 
00039 class KSystemTimeZoneSource;
00040 class KSystemTimeZonePrivate;
00041 class KSystemTimeZonesPrivate;
00042 class KSystemTimeZoneSourcePrivate;
00043 class KSystemTimeZoneDataPrivate;
00044 
00082 class KDECORE_EXPORT KSystemTimeZones : public QObject
00083 {
00084     Q_OBJECT
00085 public:
00086     ~KSystemTimeZones();
00087 
00094     static  KTimeZones *timeZones();
00095 
00101     static const KTimeZones::ZoneMap zones();
00102 
00114     static KTimeZone zone(const QString &name);
00115 
00126     static KTimeZone readZone(const QString &name);
00127 
00150     static KTimeZone local();
00151 
00157     static QString zoneinfoDir();
00158 
00159 private Q_SLOTS:
00160     // Connected to D-Bus signals
00161     void configChanged();
00162     void zonetabChanged(const QString &zonetab);
00163     void zoneDefinitionChanged(const QString &zone);
00164 
00165 private:
00166     KSystemTimeZones();
00167 
00168     KSystemTimeZonesPrivate * const d;
00169     friend class KSystemTimeZonesPrivate;
00170 };
00171 
00194 class KDECORE_EXPORT KSystemTimeZone : public KTimeZone  //krazy:exclude=dpointer (no d-pointer for KTimeZone derived classes)
00195 {
00196 public:
00197 
00208     KSystemTimeZone(KSystemTimeZoneSource *source, const QString &name,
00209         const QString &countryCode = QString(), float latitude = UNKNOWN, float longitude = UNKNOWN,
00210         const QString &comment = QString());
00211 
00212     ~KSystemTimeZone();
00213 
00214 private:
00215     // d-pointer is in KSystemTimeZoneBackend.
00216     // This is a requirement for classes inherited from KTimeZone.
00217 };
00218 
00219 
00233 class KDECORE_EXPORT KSystemTimeZoneBackend : public KTimeZoneBackend  //krazy:exclude=dpointer (non-const d-pointer for KTimeZoneBackend-derived classes)
00234 {
00235 public:
00237     KSystemTimeZoneBackend(KSystemTimeZoneSource *source, const QString &name,
00238         const QString &countryCode, float latitude, float longitude, const QString &comment);
00239 
00240     ~KSystemTimeZoneBackend();
00241 
00247     virtual KTimeZoneBackend *clone() const;
00248 
00254     virtual QByteArray type() const;
00255 
00276     virtual int offsetAtZoneTime(const KTimeZone *caller, const QDateTime &zoneDateTime, int *secondOffset) const;
00277 
00294     virtual int offsetAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const;
00295 
00309     virtual int offset(const KTimeZone *caller, time_t t) const;
00310 
00324     virtual bool isDstAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const;
00325 
00336     virtual bool isDst(const KTimeZone *caller, time_t t) const;
00337 
00338 private:
00339     KSystemTimeZonePrivate *d;   // non-const
00340 };
00341 
00342 
00353 class KDECORE_EXPORT KSystemTimeZoneSource : public KTimeZoneSource
00354 {
00355 public:
00359     KSystemTimeZoneSource();
00360     virtual ~KSystemTimeZoneSource();
00361 
00371     virtual KTimeZoneData *parse(const KTimeZone &zone) const;
00372 
00383     static void startParseBlock();
00384 
00388     static void endParseBlock();
00389 
00390 private:
00391     KSystemTimeZoneSourcePrivate * const d;
00392 };
00393 
00394 
00404 class KSystemTimeZoneData : public KTimeZoneData
00405 {
00406     friend class KSystemTimeZoneSource;
00407 
00408 public:
00409     KSystemTimeZoneData();
00411     KSystemTimeZoneData(const KSystemTimeZoneData &);
00412     virtual ~KSystemTimeZoneData();
00413 
00415     KSystemTimeZoneData &operator=(const KSystemTimeZoneData &);
00416 
00425     virtual KTimeZoneData *clone() const;
00426 
00432     virtual QList<QByteArray> abbreviations() const;
00433     virtual QByteArray abbreviation(const QDateTime &utcDateTime) const;
00434 
00442     virtual QList<int> utcOffsets() const;
00443 
00444 private:
00445     KSystemTimeZoneDataPrivate * const d;
00446 };
00447 
00448 #endif

KDECore

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal