1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 *******************************************************************************
5 * Copyright (C) 2011-2012, International Business Machines Corporation and *
6 * others. All Rights Reserved. *
7 *******************************************************************************
14 * \brief C API: Time zone generic names classe
17 #include "unicode/utypes.h"
19 #if !UCONFIG_NO_FORMATTING
21 #include "unicode/locid.h"
22 #include "unicode/unistr.h"
23 #include "unicode/tzfmt.h"
24 #include "unicode/tznames.h"
28 typedef enum UTimeZoneGenericNameType
{
29 UTZGNM_UNKNOWN
= 0x00,
30 UTZGNM_LOCATION
= 0x01,
33 } UTimeZoneGenericNameType
;
42 class U_I18N_API TimeZoneGenericNames
: public UMemory
{
44 virtual ~TimeZoneGenericNames();
46 static TimeZoneGenericNames
* createInstance(const Locale
& locale
, UErrorCode
& status
);
48 virtual UBool
operator==(const TimeZoneGenericNames
& other
) const;
49 virtual UBool
operator!=(const TimeZoneGenericNames
& other
) const {return !operator==(other
);}
50 virtual TimeZoneGenericNames
* clone() const;
52 UnicodeString
& getDisplayName(const TimeZone
& tz
, UTimeZoneGenericNameType type
,
53 UDate date
, UnicodeString
& name
) const;
55 UnicodeString
& getGenericLocationName(const UnicodeString
& tzCanonicalID
, UnicodeString
& name
) const;
57 int32_t findBestMatch(const UnicodeString
& text
, int32_t start
, uint32_t types
,
58 UnicodeString
& tzID
, UTimeZoneFormatTimeType
& timeType
, UErrorCode
& status
) const;
61 TimeZoneGenericNames();