1 /* 2 * Copyright 2010-2011, Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _TIME_ZONE_H 6 #define _TIME_ZONE_H 7 8 9 #include <String.h> 10 11 12 #ifndef U_ICU_NAMESPACE 13 #define U_ICU_NAMESPACE icu 14 #endif 15 namespace U_ICU_NAMESPACE { 16 class Locale; 17 class TimeZone; 18 } 19 class BLanguage; 20 21 22 class BTimeZone { 23 public: 24 BTimeZone(const char* zoneID = NULL, 25 const BLanguage* language = NULL); 26 BTimeZone(const BTimeZone& other); 27 ~BTimeZone(); 28 29 BTimeZone& operator=(const BTimeZone& source); 30 31 const BString& ID() const; 32 const BString& Name() const; 33 const BString& DaylightSavingName() const; 34 const BString& ShortName() const; 35 const BString& ShortDaylightSavingName() const; 36 int OffsetFromGMT() const; 37 bool SupportsDaylightSaving() const; 38 39 status_t InitCheck() const; 40 41 status_t SetTo(const char* zoneID, 42 const BLanguage* language = NULL); 43 44 status_t SetLanguage(const BLanguage* language); 45 46 static const char* kNameOfGmtZone; 47 48 class Private; 49 private: 50 friend class Private; 51 52 U_ICU_NAMESPACE::TimeZone* fICUTimeZone; 53 U_ICU_NAMESPACE::Locale* fICULocale; 54 status_t fInitStatus; 55 56 mutable uint32 fInitializedFields; 57 mutable BString fZoneID; 58 mutable BString fName; 59 mutable BString fDaylightSavingName; 60 mutable BString fShortName; 61 mutable BString fShortDaylightSavingName; 62 mutable int fOffsetFromGMT; 63 mutable bool fSupportsDaylightSaving; 64 }; 65 66 67 #endif // _TIME_ZONE_H 68