xref: /haiku/headers/os/locale/TimeZone.h (revision 362efe0c9f36d3dd38b22d2c24ac02e54b189d7c)
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 namespace icu {
13 	class Locale;
14 	class TimeZone;
15 }
16 class BLanguage;
17 
18 
19 class BTimeZone {
20 public:
21 								BTimeZone(const char* zoneID = NULL,
22 									const BLanguage* language = NULL);
23 								BTimeZone(const BTimeZone& other);
24 								~BTimeZone();
25 
26 			BTimeZone&			operator=(const BTimeZone& source);
27 
28 			const BString&		ID() const;
29 			const BString&		Name() const;
30 			const BString&		DaylightSavingName() const;
31 			const BString&		ShortName() const;
32 			const BString&		ShortDaylightSavingName() const;
33 			int					OffsetFromGMT() const;
34 			bool				SupportsDaylightSaving() const;
35 
36 			status_t			InitCheck() const;
37 
38 			status_t			SetTo(const char* zoneID,
39 									const BLanguage* language = NULL);
40 
41 			status_t			SetLanguage(const BLanguage* language);
42 
43 	static  const char*			kNameOfGmtZone;
44 
45 			class Private;
46 private:
47 	friend	class Private;
48 
49 			icu::TimeZone*		fICUTimeZone;
50 			icu::Locale*		fICULocale;
51 			status_t			fInitStatus;
52 
53 	mutable uint32				fInitializedFields;
54 	mutable BString				fZoneID;
55 	mutable BString				fName;
56 	mutable BString				fDaylightSavingName;
57 	mutable BString				fShortName;
58 	mutable BString				fShortDaylightSavingName;
59 	mutable int					fOffsetFromGMT;
60 	mutable bool				fSupportsDaylightSaving;
61 };
62 
63 
64 #endif	// _TIME_ZONE_H
65