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