]> git.saurik.com Git - apple/icu.git/blame - icuSources/i18n/tzgnames.h
ICU-511.32.tar.gz
[apple/icu.git] / icuSources / i18n / tzgnames.h
CommitLineData
4388f060
A
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
24U_CDECL_BEGIN
25
26typedef enum UTimeZoneGenericNameType {
27 UTZGNM_UNKNOWN = 0x00,
28 UTZGNM_LOCATION = 0x01,
29 UTZGNM_LONG = 0x02,
30 UTZGNM_SHORT = 0x04
31} UTimeZoneGenericNameType;
32
33U_CDECL_END
34
35U_NAMESPACE_BEGIN
36
37class TimeZone;
38struct TZGNCoreRef;
39
40class U_I18N_API TimeZoneGenericNames : public UMemory {
41public:
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
58private:
59 TimeZoneGenericNames();
60 TZGNCoreRef* fRef;
61};
62
63U_NAMESPACE_END
64#endif
65#endif