|
1 /* |
|
2 ******************************************************************************* |
|
3 * Copyright (C) 2011-2012, International Business Machines Corporation and * |
|
4 * others. All Rights Reserved. * |
|
5 ******************************************************************************* |
|
6 */ |
|
7 #ifndef __TZGNAMES_H |
|
8 #define __TZGNAMES_H |
|
9 |
|
10 /** |
|
11 * \file |
|
12 * \brief C API: Time zone generic names classe |
|
13 */ |
|
14 |
|
15 #include "unicode/utypes.h" |
|
16 |
|
17 #if !UCONFIG_NO_FORMATTING |
|
18 |
|
19 #include "unicode/locid.h" |
|
20 #include "unicode/unistr.h" |
|
21 #include "unicode/tzfmt.h" |
|
22 #include "unicode/tznames.h" |
|
23 |
|
24 U_CDECL_BEGIN |
|
25 |
|
26 typedef enum UTimeZoneGenericNameType { |
|
27 UTZGNM_UNKNOWN = 0x00, |
|
28 UTZGNM_LOCATION = 0x01, |
|
29 UTZGNM_LONG = 0x02, |
|
30 UTZGNM_SHORT = 0x04 |
|
31 } UTimeZoneGenericNameType; |
|
32 |
|
33 U_CDECL_END |
|
34 |
|
35 U_NAMESPACE_BEGIN |
|
36 |
|
37 class TimeZone; |
|
38 struct TZGNCoreRef; |
|
39 |
|
40 class U_I18N_API TimeZoneGenericNames : public UMemory { |
|
41 public: |
|
42 virtual ~TimeZoneGenericNames(); |
|
43 |
|
44 static TimeZoneGenericNames* createInstance(const Locale& locale, UErrorCode& status); |
|
45 |
|
46 virtual UBool operator==(const TimeZoneGenericNames& other) const; |
|
47 virtual UBool operator!=(const TimeZoneGenericNames& other) const {return !operator==(other);}; |
|
48 virtual TimeZoneGenericNames* clone() const; |
|
49 |
|
50 UnicodeString& getDisplayName(const TimeZone& tz, UTimeZoneGenericNameType type, |
|
51 UDate date, UnicodeString& name) const; |
|
52 |
|
53 UnicodeString& getGenericLocationName(const UnicodeString& tzCanonicalID, UnicodeString& name) const; |
|
54 |
|
55 int32_t findBestMatch(const UnicodeString& text, int32_t start, uint32_t types, |
|
56 UnicodeString& tzID, UTimeZoneFormatTimeType& timeType, UErrorCode& status) const; |
|
57 |
|
58 private: |
|
59 TimeZoneGenericNames(); |
|
60 TZGNCoreRef* fRef; |
|
61 }; |
|
62 |
|
63 U_NAMESPACE_END |
|
64 #endif |
|
65 #endif |