| 1 |
. |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
#ifndef __WINDTFMT |
| 15 |
#define __WINDTFMT |
| 16 |
|
| 17 |
#include "unicode/utypes.h" |
| 18 |
|
| 19 |
#if U_PLATFORM_USES_ONLY_WIN32_API |
| 20 |
|
| 21 |
#if !UCONFIG_NO_FORMATTING |
| 22 |
|
| 23 |
#include "unicode/format.h" |
| 24 |
#include "unicode/datefmt.h" |
| 25 |
#include "unicode/calendar.h" |
| 26 |
#include "unicode/ustring.h" |
| 27 |
#include "unicode/locid.h" |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
U_CDECL_BEGIN |
| 35 |
|
| 36 |
typedef struct _SYSTEMTIME SYSTEMTIME; |
| 37 |
typedef struct _TIME_ZONE_INFORMATION TIME_ZONE_INFORMATION; |
| 38 |
U_CDECL_END |
| 39 |
|
| 40 |
U_NAMESPACE_BEGIN |
| 41 |
|
| 42 |
class Win32DateFormat : public DateFormat |
| 43 |
{ |
| 44 |
public: |
| 45 |
Win32DateFormat(DateFormat::EStyle timeStyle, DateFormat::EStyle dateStyle, const Locale &locale, UErrorCode &status); |
| 46 |
|
| 47 |
Win32DateFormat(const Win32DateFormat &other); |
| 48 |
|
| 49 |
virtual ~Win32DateFormat(); |
| 50 |
|
| 51 |
virtual Win32DateFormat *clone() const; |
| 52 |
|
| 53 |
Win32DateFormat &operator=(const Win32DateFormat &other); |
| 54 |
|
| 55 |
UnicodeString &format(Calendar &cal, UnicodeString &appendTo, FieldPosition &pos) const; |
| 56 |
|
| 57 |
using DateFormat::format; |
| 58 |
|
| 59 |
void parse(const UnicodeString& text, Calendar& cal, ParsePosition& pos) const; |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
virtual void adoptCalendar(Calendar* calendarToAdopt); |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
virtual void setCalendar(const Calendar& newCalendar); |
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
virtual void adoptTimeZone(TimeZone* zoneToAdopt); |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
virtual void setTimeZone(const TimeZone& zone); |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
U_I18N_API static UClassID U_EXPORT2 getStaticClassID(); |
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
virtual UClassID getDynamicClassID() const; |
| 115 |
|
| 116 |
private: |
| 117 |
void formatDate(const SYSTEMTIME *st, UnicodeString &appendTo) const; |
| 118 |
void formatTime(const SYSTEMTIME *st, UnicodeString &appendTo) const; |
| 119 |
|
| 120 |
UnicodeString setTimeZoneInfo(TIME_ZONE_INFORMATION *tzi, const TimeZone &zone) const; |
| 121 |
UnicodeString* getTimeDateFormat(const Calendar *cal, const Locale *locale, UErrorCode &status) const; |
| 122 |
|
| 123 |
UnicodeString *fDateTimeMsg; |
| 124 |
DateFormat::EStyle fTimeStyle; |
| 125 |
DateFormat::EStyle fDateStyle; |
| 126 |
Locale fLocale; |
| 127 |
UnicodeString fZoneID; |
| 128 |
TIME_ZONE_INFORMATION *fTZI; |
| 129 |
|
| 130 |
UnicodeString* fWindowsLocaleName; |
| 131 |
}; |
| 132 |
|
| 133 |
U_NAMESPACE_END |
| 134 |
|
| 135 |
#endif |
| 136 |
|
| 137 |
#endif |
| 138 |
|
| 139 |
#endif |