summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qtimezoneprivate_p.h
diff options
context:
space:
mode:
authorJohn Layt <jlayt@kde.org>2013-02-04 20:54:29 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-23 01:13:49 +0200
commit7ed7d66b5a420f70d056a95a63c9be5de1af3191 (patch)
tree13faf2a34f89ecc71a0fac0b629e88fc244fb00e /src/corelib/tools/qtimezoneprivate_p.h
parent8dfaf910388fc0dd3c53c382e9ff85dd78a9a3ef (diff)
QTimeZone - Add Mac backend
Add Mac backend support Change-Id: Iafa2dbd925e18431f571e3eac62983015f8bc977 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qtimezoneprivate_p.h')
-rw-r--r--src/corelib/tools/qtimezoneprivate_p.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/corelib/tools/qtimezoneprivate_p.h b/src/corelib/tools/qtimezoneprivate_p.h
index 9120be49d1..bc28e627a9 100644
--- a/src/corelib/tools/qtimezoneprivate_p.h
+++ b/src/corelib/tools/qtimezoneprivate_p.h
@@ -61,6 +61,14 @@
#include <unicode/ucal.h>
#endif // QT_USE_ICU
+#ifdef Q_OS_MAC
+#ifdef __OBJC__
+@class NSTimeZone;
+#else
+class NSTimeZone;
+#endif // __OBJC__
+#endif // Q_OS_MAC
+
QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QTimeZonePrivate : public QSharedData
@@ -306,6 +314,49 @@ private:
};
#endif // Q_OS_UNIX
+#ifdef Q_OS_MAC
+class Q_AUTOTEST_EXPORT QMacTimeZonePrivate Q_DECL_FINAL : public QTimeZonePrivate
+{
+public:
+ // Create default time zone
+ QMacTimeZonePrivate();
+ // Create named time zone
+ QMacTimeZonePrivate(const QByteArray &olsenId);
+ QMacTimeZonePrivate(const QMacTimeZonePrivate &other);
+ ~QMacTimeZonePrivate();
+
+ QTimeZonePrivate *clone();
+
+ QString comment() const Q_DECL_OVERRIDE;
+
+ QString displayName(QTimeZone::TimeType timeType, QTimeZone::NameType nameType,
+ const QLocale &locale) const Q_DECL_OVERRIDE;
+ QString abbreviation(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+
+ int offsetFromUtc(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ int standardTimeOffset(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ int daylightTimeOffset(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+
+ bool hasDaylightTime() const Q_DECL_OVERRIDE;
+ bool isDaylightTime(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+
+ Data data(qint64 forMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+
+ bool hasTransitions() const Q_DECL_OVERRIDE;
+ Data nextTransition(qint64 afterMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ Data previousTransition(qint64 beforeMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+
+ QByteArray systemTimeZoneId() const Q_DECL_OVERRIDE;
+
+ QSet<QByteArray> availableTimeZoneIds() const Q_DECL_OVERRIDE;
+
+private:
+ void init(const QByteArray &zoneId);
+
+ NSTimeZone *m_nstz;
+};
+#endif // Q_OS_MAC
+
QT_END_NAMESPACE
#endif // QTIMEZONEPRIVATE_P_H