KDECore
ktimezone_win.cpp
Go to the documentation of this file.
147 typedef BOOL (WINAPI *PtrTzSpecificLocalTimeToSystemTime )(LPTIME_ZONE_INFORMATION lpTimeZoneInformation,
202 static const TCHAR timeZonesKey[] = TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones");
233 pTzSpecificLocalTimeToSystemTime = (PtrTzSpecificLocalTimeToSystemTime)kernelLib.resolve("TzSpecificLocalTimeToSystemTime");
284 static bool get_binary_value( HKEY key, const TCHAR * value, void * data, DWORD numData, DWORD * outNumData=0 ) {
297 static bool get_string_value( HKEY key, const TCHAR * value, TCHAR * dest, DWORD destSizeInBytes ) {
360 return QDateTime( find_nth_weekday_in_month_of_year( st.wDay, win_dayofweek_to_qt_dayofweek( st.wDayOfWeek ), st.wMonth, year ),
400 if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE, timeZonesKey, 0, KEY_READ, &timeZones ) == ERROR_SUCCESS )
412 if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE, keypath.c_str(), 0, KEY_READ, &key ) != ERROR_SUCCESS ) {
442 if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE, timeZonesKey, 0, KEY_READ, &timeZones ) == ERROR_SUCCESS )
451 if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE, keypath.c_str(), 0, KEY_READ, &key ) != ERROR_SUCCESS ) {
491 int offsetAtZoneTime(const KTimeZone *caller, const QDateTime &zoneDateTime, int *secondOffset) const;
557 return transitions( static_cast<const KSystemTimeZoneDataWindows*>( caller->data(true) )->tzi( year ), year );
574 const TIME_ZONE_INFORMATION & tzi = static_cast<const KSystemTimeZoneDataWindows*>( caller->data(true) )->tzi( year );
592 const TIME_ZONE_INFORMATION & tz = static_cast<const KSystemTimeZoneDataWindows*>( caller->data(true) )->tzi( year );
602 static int offset_at_zone_time( const KTimeZone * caller, const SYSTEMTIME & zone, int * secondOffset ) {
606 const KSystemTimeZoneDataWindows * const data = static_cast<const KSystemTimeZoneDataWindows*>( caller->data(true) );
609 if ( !TzSpecificLocalTimeToSystemTime_Portable( const_cast<LPTIME_ZONE_INFORMATION>( &tz ), const_cast<LPSYSTEMTIME>( &zone ), &utc ) )
616 const SYSTEMTIME utcplus1 = qdatetime_to_systemtime( systemtime_to_qdatetime( utc ).addSecs( OneHour ) );
617 const SYSTEMTIME utcminus1 = qdatetime_to_systemtime( systemtime_to_qdatetime( utc ).addSecs( -OneHour ) );
619 if ( !SystemTimeToTzSpecificLocalTime( const_cast<LPTIME_ZONE_INFORMATION>( &tz ), const_cast<LPSYSTEMTIME>( &utcplus1 ), &zoneplus1 ) ||
620 !SystemTimeToTzSpecificLocalTime( const_cast<LPTIME_ZONE_INFORMATION>( &tz ), const_cast<LPSYSTEMTIME>( &utcminus1 ), &zoneminus1 ) )
646 int KSystemTimeZoneBackendWindows::offsetAtZoneTime(const KTimeZone *caller, const QDateTime &zoneDateTime, int *secondOffset) const
656 int KSystemTimeZoneBackendWindows::offsetAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const
672 bool KSystemTimeZoneBackendWindows::isDstAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const
int minute() const
static int effective_offset(const TIME_ZONE_INFORMATION &tz, bool isDst)
Definition: ktimezone_win.cpp:578
KSystemTimeZoneWindows(KTimeZoneSource *source, const QString &name)
Creates a time zone.
Definition: ktimezone_win.cpp:683
static QDateTime fromTime_t(time_t t)
Converts a UTC time, measured in seconds since 00:00:00 UTC 1st January 1970 (as returned by time(2))...
Definition: ktimezone.cpp:917
static bool check_local(const KTimeZone *caller, const QDateTime &dt)
Definition: ktimezone_win.cpp:320
virtual QByteArray type() const
Returns the class name of the data represented by this instance.
Definition: ktimezone.cpp:457
void push_back(const T &value)
Base class for the parsed data returned by a KTimeZoneSource class.
Definition: ktimezone.h:1302
Transitions transitions(const TIME_ZONE_INFORMATION &tz, int year)
Definition: ktimezone_win.cpp:368
virtual int offsetAtZoneTime(const KTimeZone *caller, const QDateTime &zoneDateTime, int *secondOffset) const
Implements KTimeZone::offsetAtZoneTime().
Definition: ktimezone.cpp:467
static QStringList listTimeZones()
Static helper method that lists all availalbe timezones on the system as per the information in the W...
Definition: ktimezone_win.cpp:687
#define COPY(name)
static PtrTzSpecificLocalTimeToSystemTime pTzSpecificLocalTimeToSystemTime
Definition: ktimezone_win.cpp:151
QTime time() const
static QDateTime systemtime_to_qdatetime(const SYSTEMTIME &st)
Definition: ktimezone_win.cpp:203
int month() const
static bool has_transition(const TIME_ZONE_INFORMATION &tz)
Definition: ktimezone_win.cpp:328
int second() const
int dayOfWeek() const
static bool check_utc(const KTimeZone *caller, const QDateTime &dt)
Definition: ktimezone_win.cpp:324
static bool get_string_value(HKEY key, const TCHAR *value, TCHAR *dest, DWORD destSizeInBytes)
Definition: ktimezone_win.cpp:297
QString fromLocal8Bit(const char *str, int size)
const KTimeZoneData * data(bool create=false) const
Returns the detailed parsed data for the time zone.
Definition: ktimezone.cpp:754
QString fromUtf16(const ushort *unicode, int size)
static int difference(const SYSTEMTIME &st1, const SYSTEMTIME &st2)
Definition: ktimezone_win.cpp:598
static int qt_dayofweek_to_win_dayofweek(int qdow)
Definition: ktimezone_win.cpp:337
static bool check_prereq(const KTimeZone *caller, const QDateTime &dt, Qt::TimeSpec spec)
Definition: ktimezone_win.cpp:316
virtual KTimeZoneBackend * clone() const
Creates a copy of this instance.
Definition: ktimezone.cpp:462
static bool get_binary_value(HKEY key, const TCHAR *value, void *data, DWORD numData, DWORD *outNumData=0)
Definition: ktimezone_win.cpp:284
int day() const
const char * constData() const
static std::basic_string< TCHAR > qstring_to_tcharstring(const QString &str)
Definition: ktimezone_win.cpp:196
static std::basic_string< TCHAR > pathFromZoneName(const KTimeZone &zone)
Definition: ktimezone_win.cpp:431
virtual bool isDst(const KTimeZone *caller, time_t t) const
Implements KTimeZone::isDst().
Definition: ktimezone.cpp:577
static int offset_at_utc(const KTimeZone *caller, const QDateTime &utc)
Definition: ktimezone_win.cpp:588
int year() const
static const TCHAR * qstring_to_tchar(const QString &str)
Definition: ktimezone_win.cpp:192
int hour() const
QByteArray toLocal8Bit() const
int msec() const
Qt::TimeSpec timeSpec() const
static int win_dayofweek_to_qt_dayofweek(int wdow)
Definition: ktimezone_win.cpp:332
bool isValid() const
typedef BOOL(WINAPI *PtrTzSpecificLocalTimeToSystemTime)(LPTIME_ZONE_INFORMATION lpTimeZoneInformation
static int offset_at_zone_time(const KTimeZone *caller, const SYSTEMTIME &zone, int *secondOffset)
Definition: ktimezone_win.cpp:602
const ushort * utf16() const
QDate date() const
void * resolve(const char *symbol)
int secsTo(const QDateTime &other) const
static QDate find_nth_weekday_in_month_of_year(int nth, int dayOfWeek, int month, int year)
Definition: ktimezone_win.cpp:342
static QDateTime transition(const SYSTEMTIME &st, int year)
Definition: ktimezone_win.cpp:357
static SYSTEMTIME qdatetime_to_systemtime(const QDateTime &dt)
Definition: ktimezone_win.cpp:208
virtual int offsetAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const
Implements KTimeZone::offsetAtUtc().
Definition: ktimezone.cpp:530
static bool TzSpecificLocalTimeToSystemTime_Portable(TIME_ZONE_INFORMATION *tz, SYSTEMTIME *i_stLocal, SYSTEMTIME *o_stUniversal)
Definition: ktimezone_win.cpp:224
KTimeZoneData * parse(const KTimeZone &zone) const
Retrieves and parses the Windows registry information to extract detailed information for one time zo...
Definition: ktimezone_win.cpp:517
QDate addDays(int ndays) const
virtual int offset(const KTimeZone *caller, time_t t) const
Implements KTimeZone::offset().
Definition: ktimezone.cpp:562
Base class representing a source of time zone information.
Definition: ktimezone.h:1230
virtual bool isDstAtUtc(const KTimeZone *caller, const QDateTime &utcDateTime) const
Implements KTimeZone::isDstAtUtc().
Definition: ktimezone.cpp:567
static bool is_dst(const TIME_ZONE_INFORMATION &tzi, const QDateTime &utc, int year)
Definition: ktimezone_win.cpp:560
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.