• Skip to content
  • Skip to link menu
KDE 4.3 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,2009 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 
00088 class KDECORE_EXPORT KSystemTimeZones : public QObject
00089 {
00090     Q_OBJECT
00091 public:
00092     ~KSystemTimeZones();
00093 
00100     static  KTimeZones *timeZones();
00101 
00107     static const KTimeZones::ZoneMap zones();
00108 
00120     static KTimeZone zone(const QString &name);
00121 
00132     static KTimeZone readZone(const QString &name);
00133 
00161     static KTimeZone local();
00162 
00180     static KTimeZone realLocalZone();
00181 
00200     static void setLocalZone(const KTimeZone& tz);
00201 
00221     static bool isSimulated();
00222 
00228     static QString zoneinfoDir();
00229 
00230 private Q_SLOTS:
00231     // Connected to D-Bus signals
00232     void configChanged();
00233     void zonetabChanged(const QString &zonetab);
00234     void zoneDefinitionChanged(const QString &zone);
00235 
00236 private:
00237     KSystemTimeZones();
00238 
00239     KSystemTimeZonesPrivate * const d;
00240     friend class KSystemTimeZonesPrivate;
00241 };
00242 
00265 class KDECORE_EXPORT KSystemTimeZone : public KTimeZone  //krazy:exclude=dpointer (no d-pointer for KTimeZone derived classes)
00266 {
00267 public:
00268 
00279     KSystemTimeZone(KSystemTimeZoneSource *source, const QString &name,
00280         const QString &countryCode = QString(), float latitude = UNKNOWN, float longitude = UNKNOWN,
00281         const QString &comment = QString());
00282 
00283     ~KSystemTimeZone();
00284 
00285 private:
00286     // d-pointer is in KSystemTimeZoneBackend.
00287     // This is a requirement for classes inherited from KTimeZone.
00288 };
00289 
00290 
00304 class KDECORE_EXPORT KSystemTimeZoneBackend : public KTimeZoneBackend  //krazy:exclude=dpointer (non-const d-pointer for KTimeZoneBackend-derived classes)
00305 {
00306 public:
00308     KSystemTimeZoneBackend(KSystemTimeZoneSource *source, const QString &name,
00309         const QString &countryCode, float latitude, float longitude, const QString &comment);
00310 
00311     ~KSystemTimeZoneBackend();
00312 
00318     virtual KTimeZoneBackend *clone() const;
00319 
00325     virtual QByteArray type() const;
00326 
00347     virtual int offsetAtZoneTime(const KTimeZone *caller, const QDateTime &zoneDateTime, int *secondOffset) const;
00348 
00365     virtual int offsetAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const;
00366 
00380     virtual int offset(const KTimeZone *caller, time_t t) const;
00381 
00395     virtual bool isDstAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const;
00396 
00407     virtual bool isDst(const KTimeZone *caller, time_t t) const;
00408 
00409 private:
00410     KSystemTimeZonePrivate *d;   // non-const
00411 };
00412 
00413 
00424 class KDECORE_EXPORT KSystemTimeZoneSource : public KTimeZoneSource
00425 {
00426 public:
00430     KSystemTimeZoneSource();
00431     virtual ~KSystemTimeZoneSource();
00432 
00442     virtual KTimeZoneData *parse(const KTimeZone &zone) const;
00443 
00454     static void startParseBlock();
00455 
00459     static void endParseBlock();
00460 
00461 private:
00462     KSystemTimeZoneSourcePrivate * const d;
00463 };
00464 
00465 
00475 class KSystemTimeZoneData : public KTimeZoneData
00476 {
00477     friend class KSystemTimeZoneSource;
00478 
00479 public:
00480     KSystemTimeZoneData();
00482     KSystemTimeZoneData(const KSystemTimeZoneData &);
00483     virtual ~KSystemTimeZoneData();
00484 
00486     KSystemTimeZoneData &operator=(const KSystemTimeZoneData &);
00487 
00496     virtual KTimeZoneData *clone() const;
00497 
00503     virtual QList<QByteArray> abbreviations() const;
00504     virtual QByteArray abbreviation(const QDateTime &utcDateTime) const;
00505 
00513     virtual QList<int> utcOffsets() const;
00514 
00515 private:
00516     KSystemTimeZoneDataPrivate * const d;
00517 };
00518 
00519 #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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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