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