1a33f8fbdSAdrien Destugues/* 2820dca4dSJohn Scipione * Copyright 2011 Haiku, Inc. All rights reserved. 3820dca4dSJohn Scipione * Distributed under the terms of the MIT License. 4a33f8fbdSAdrien Destugues * 5820dca4dSJohn Scipione * Authors: 6820dca4dSJohn Scipione * Adrien Destugues, pulkomandy@pulkomandy.ath.cx 7820dca4dSJohn Scipione * John Scipione, jscipione@gmail.com 8820dca4dSJohn Scipione * Oliver Tappe, zooey@hirschkaefer.de 9820dca4dSJohn Scipione * 10a33f8fbdSAdrien Destugues * Corresponds to: 11820dca4dSJohn Scipione * headers/os/locale/TimeZone.h rev 42274 12820dca4dSJohn Scipione * src/kits/locale/TimeZone.cpp rev 42274 13a33f8fbdSAdrien Destugues */ 14a33f8fbdSAdrien Destugues 15a33f8fbdSAdrien Destugues 16a33f8fbdSAdrien Destugues/*! 17a33f8fbdSAdrien Destugues \file TimeZone.h 18820dca4dSJohn Scipione \ingroup locale 19820dca4dSJohn Scipione \ingroup libbe 20820dca4dSJohn Scipione \brief Provides the BTimeZone class. 21a33f8fbdSAdrien Destugues*/ 22a33f8fbdSAdrien Destugues 23a33f8fbdSAdrien Destugues 24a33f8fbdSAdrien Destugues/*! 25a33f8fbdSAdrien Destugues \class BTimeZone 26a33f8fbdSAdrien Destugues \ingroup locale 27820dca4dSJohn Scipione \ingroup libbe 28a33f8fbdSAdrien Destugues \brief Provides information about time zones. 29*edc845a3SJohn Scipione 30*edc845a3SJohn Scipione \since Haiku R1 31a33f8fbdSAdrien Destugues*/ 32a33f8fbdSAdrien Destugues 33a33f8fbdSAdrien Destugues 34a33f8fbdSAdrien Destugues/*! 35a33f8fbdSAdrien Destugues \fn BTimeZone::BTimeZone(const char* zoneID, const BLanguage* language) 36a33f8fbdSAdrien Destugues \brief Construct a timezone from its \a zoneID and \a language. 37a33f8fbdSAdrien Destugues 38a33f8fbdSAdrien Destugues The constructor only allows you to construct a timezone if you already 39a33f8fbdSAdrien Destugues know its code. If you don't know the code, you can instead go through the 40a33f8fbdSAdrien Destugues BCountry class which can enumerate all timezones in a country, or use the 41a33f8fbdSAdrien Destugues BLocaleRoster, which knows the timezone selected by the user. 42*edc845a3SJohn Scipione 43*edc845a3SJohn Scipione \since Haiku R1 44a33f8fbdSAdrien Destugues*/ 45a33f8fbdSAdrien Destugues 46a33f8fbdSAdrien Destugues 47a33f8fbdSAdrien Destugues/*! 48a33f8fbdSAdrien Destugues \fn BTimeZone::BTimeZone(const BTimeZone& other) 49*edc845a3SJohn Scipione 50*edc845a3SJohn Scipione \since Haiku R1 51a33f8fbdSAdrien Destugues*/ 52a33f8fbdSAdrien Destugues 53a33f8fbdSAdrien Destugues 54a33f8fbdSAdrien Destugues/*! 55a33f8fbdSAdrien Destugues \fn BTimeZone& BTimeZone::operator=(const BTimeZone& source) 56*edc845a3SJohn Scipione 57*edc845a3SJohn Scipione \since Haiku R1 58a33f8fbdSAdrien Destugues*/ 59a33f8fbdSAdrien Destugues 60a33f8fbdSAdrien Destugues 61a33f8fbdSAdrien Destugues/*! 62a33f8fbdSAdrien Destugues \fn const BString& BTimeZone::ID() const 63a33f8fbdSAdrien Destugues \brief Returns the ID of the time zone. 64*edc845a3SJohn Scipione 65*edc845a3SJohn Scipione \since Haiku R1 66a33f8fbdSAdrien Destugues*/ 67a33f8fbdSAdrien Destugues 68a33f8fbdSAdrien Destugues 69a33f8fbdSAdrien Destugues/*! 70a33f8fbdSAdrien Destugues \fn const BString& BTimeZone::Name() const 71a33f8fbdSAdrien Destugues \brief Returns the localized name of the time zone. 72a33f8fbdSAdrien Destugues 73a33f8fbdSAdrien Destugues Use this method to display the time zone's name to the user. 74*edc845a3SJohn Scipione 75*edc845a3SJohn Scipione \since Haiku R1 76a33f8fbdSAdrien Destugues*/ 77a33f8fbdSAdrien Destugues 78a33f8fbdSAdrien Destugues 79a33f8fbdSAdrien Destugues/*! 80a33f8fbdSAdrien Destugues \fn const BString& BTimeZone::DaylightSavingName() const 81a33f8fbdSAdrien Destugues \brief Returns the name of the daylight savings rules used in this timezone. 82*edc845a3SJohn Scipione 83*edc845a3SJohn Scipione \since Haiku R1 84a33f8fbdSAdrien Destugues*/ 85a33f8fbdSAdrien Destugues 86a33f8fbdSAdrien Destugues 87a33f8fbdSAdrien Destugues/*! 88a33f8fbdSAdrien Destugues \fn const BString& BTimeZone::ShortName() const 89a33f8fbdSAdrien Destugues \brief Returns the short name of the timezone, in the user's locale. 90*edc845a3SJohn Scipione 91*edc845a3SJohn Scipione \since Haiku R1 92a33f8fbdSAdrien Destugues*/ 93a33f8fbdSAdrien Destugues 94a33f8fbdSAdrien Destugues 95a33f8fbdSAdrien Destugues/*! 96a33f8fbdSAdrien Destugues \fn const BString& BTimeZone::ShortDaylightSavingName() const 97a33f8fbdSAdrien Destugues \brief Returns the short name of the daylight savings rules used in this 98a33f8fbdSAdrien Destugues timezone. 99*edc845a3SJohn Scipione 100*edc845a3SJohn Scipione \since Haiku R1 101a33f8fbdSAdrien Destugues*/ 102a33f8fbdSAdrien Destugues 103a33f8fbdSAdrien Destugues 104a33f8fbdSAdrien Destugues/*! 105a33f8fbdSAdrien Destugues \fn int BTimeZone::OffsetFromGMT() const 106a33f8fbdSAdrien Destugues \brief Return the offset from GMT. 107a33f8fbdSAdrien Destugues 108a33f8fbdSAdrien Destugues The offset is a number of seconds, positive or negative. 109*edc845a3SJohn Scipione 110*edc845a3SJohn Scipione \since Haiku R1 111a33f8fbdSAdrien Destugues*/ 112a33f8fbdSAdrien Destugues 113a33f8fbdSAdrien Destugues 114a33f8fbdSAdrien Destugues/*! 115a33f8fbdSAdrien Destugues \fn bool BTimeZone::SupportsDaylightSaving() const 116a33f8fbdSAdrien Destugues \brief Return true if the time zone has daylight saving rules 117*edc845a3SJohn Scipione 118*edc845a3SJohn Scipione \since Haiku R1 119a33f8fbdSAdrien Destugues*/ 120a33f8fbdSAdrien Destugues 121a33f8fbdSAdrien Destugues 122a33f8fbdSAdrien Destugues/*! 123a33f8fbdSAdrien Destugues \fn status_t BTimeZone::InitCheck() const 124a33f8fbdSAdrien Destugues \brief Return \c false if there was an error creating the timezone 125*edc845a3SJohn Scipione for instance if you called the constructor or SetTo() with an 126*edc845a3SJohn Scipione invalid timezone code. 127*edc845a3SJohn Scipione 128*edc845a3SJohn Scipione \since Haiku R1 129a33f8fbdSAdrien Destugues*/ 130a33f8fbdSAdrien Destugues 131a33f8fbdSAdrien Destugues 132a33f8fbdSAdrien Destugues/*! 1336ec9625aSAdrien Destugues \fn status_t BTimeZone::SetTo(const char* zoneCode, 1346ec9625aSAdrien Destugues const BLanguage* language = NULL) 135a33f8fbdSAdrien Destugues \brief Set the timezone to another code. 136a33f8fbdSAdrien Destugues 137a33f8fbdSAdrien Destugues \returns \c false if there was an error (likely due to an invalid 138a33f8fbdSAdrien Destugues timezone code.) 139*edc845a3SJohn Scipione 140*edc845a3SJohn Scipione \since Haiku R1 141a33f8fbdSAdrien Destugues*/ 142