OLD | NEW |
1 /* | 1 /* |
2 ******************************************************************************** | 2 ******************************************************************************** |
3 * Copyright (C) 1997-2014, International Business Machines | 3 * Copyright (C) 1997-2015, International Business Machines |
4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
5 ******************************************************************************** | 5 ******************************************************************************** |
6 * | 6 * |
7 * File DTFMTSYM.H | 7 * File DTFMTSYM.H |
8 * | 8 * |
9 * Modification History: | 9 * Modification History: |
10 * | 10 * |
11 * Date Name Description | 11 * Date Name Description |
12 * 02/19/97 aliu Converted from java. | 12 * 02/19/97 aliu Converted from java. |
13 * 07/21/98 stephen Added getZoneIndex() | 13 * 07/21/98 stephen Added getZoneIndex() |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 const UnicodeString* getAmPmStrings(int32_t& count) const; | 401 const UnicodeString* getAmPmStrings(int32_t& count) const; |
402 | 402 |
403 /** | 403 /** |
404 * Sets ampm strings. For example: "AM" and "PM". | 404 * Sets ampm strings. For example: "AM" and "PM". |
405 * @param ampms the new ampm strings. (not adopted; caller retains ow
nership) | 405 * @param ampms the new ampm strings. (not adopted; caller retains ow
nership) |
406 * @param count Filled in with length of the array. | 406 * @param count Filled in with length of the array. |
407 * @stable ICU 2.0 | 407 * @stable ICU 2.0 |
408 */ | 408 */ |
409 void setAmPmStrings(const UnicodeString* ampms, int32_t count); | 409 void setAmPmStrings(const UnicodeString* ampms, int32_t count); |
410 | 410 |
| 411 #ifndef U_HIDE_INTERNAL_API |
| 412 /** |
| 413 * This default time separator is used for formatting when the locale |
| 414 * doesn't specify any time separator, and always recognized when parsing. |
| 415 * @internal |
| 416 */ |
| 417 static const UChar DEFAULT_TIME_SEPARATOR = 0x003a; // ':' |
| 418 |
| 419 /** |
| 420 * This alternate time separator is always recognized when parsing. |
| 421 * @internal |
| 422 */ |
| 423 static const UChar ALTERNATE_TIME_SEPARATOR = 0x002e; // '.' |
| 424 #endif /* U_HIDE_INTERNAL_API */ |
| 425 |
411 #ifndef U_HIDE_DRAFT_API | 426 #ifndef U_HIDE_DRAFT_API |
412 /** | 427 /** |
| 428 * Gets the time separator string. For example: ":". |
| 429 * @param result Output param which will receive the time separator string. |
| 430 * @return A reference to 'result'. |
| 431 * @draft ICU 55 |
| 432 */ |
| 433 UnicodeString& getTimeSeparatorString(UnicodeString& result) const; |
| 434 |
| 435 /** |
| 436 * Sets the time separator string. For example: ":". |
| 437 * @param newTimeSeparator the new time separator string. |
| 438 * @draft ICU 55 |
| 439 */ |
| 440 void setTimeSeparatorString(const UnicodeString& newTimeSeparator); |
| 441 #endif /* U_HIDE_DRAFT_API */ |
| 442 |
| 443 /** |
413 * Gets cyclic year name strings if the calendar has them, by width and cont
ext. | 444 * Gets cyclic year name strings if the calendar has them, by width and cont
ext. |
414 * For example: "jia-zi", "yi-chou", etc. | 445 * For example: "jia-zi", "yi-chou", etc. |
415 * @param count Filled in with length of the array. | 446 * @param count Filled in with length of the array. |
416 * @param context The usage context: FORMAT, STANDALONE. | 447 * @param context The usage context: FORMAT, STANDALONE. |
417 * @param width The requested name width: WIDE, ABBREVIATED, NARROW. | 448 * @param width The requested name width: WIDE, ABBREVIATED, NARROW. |
418 * @return The year name strings (DateFormatSymbols retains ownersh
ip), | 449 * @return The year name strings (DateFormatSymbols retains ownersh
ip), |
419 * or null if they are not available for this calendar. | 450 * or null if they are not available for this calendar. |
420 * @draft ICU 54 | 451 * @stable ICU 54 |
421 */ | 452 */ |
422 const UnicodeString* getYearNames(int32_t& count, | 453 const UnicodeString* getYearNames(int32_t& count, |
423 DtContextType context, DtWidthType width) const; | 454 DtContextType context, DtWidthType width) const; |
424 | 455 |
425 /** | 456 /** |
426 * Sets cyclic year name strings by width and context. For example: "jia-zi"
, "yi-chou", etc. | 457 * Sets cyclic year name strings by width and context. For example: "jia-zi"
, "yi-chou", etc. |
427 * | 458 * |
428 * @param yearNames The new cyclic year name strings (not adopted; caller re
tains ownership). | 459 * @param yearNames The new cyclic year name strings (not adopted; caller re
tains ownership). |
429 * @param count The length of the array. | 460 * @param count The length of the array. |
430 * @param context The usage context: FORMAT, STANDALONE (currently only FO
RMAT is supported). | 461 * @param context The usage context: FORMAT, STANDALONE (currently only FO
RMAT is supported). |
431 * @param width The name width: WIDE, ABBREVIATED, NARROW (currently onl
y ABBREVIATED is supported). | 462 * @param width The name width: WIDE, ABBREVIATED, NARROW (currently onl
y ABBREVIATED is supported). |
432 * @draft ICU 54 | 463 * @stable ICU 54 |
433 */ | 464 */ |
434 void setYearNames(const UnicodeString* yearNames, int32_t count, | 465 void setYearNames(const UnicodeString* yearNames, int32_t count, |
435 DtContextType context, DtWidthType width); | 466 DtContextType context, DtWidthType width); |
436 | 467 |
437 /** | 468 /** |
438 * Gets calendar zodiac name strings if the calendar has them, by width and
context. | 469 * Gets calendar zodiac name strings if the calendar has them, by width and
context. |
439 * For example: "Rat", "Ox", "Tiger", etc. | 470 * For example: "Rat", "Ox", "Tiger", etc. |
440 * @param count Filled in with length of the array. | 471 * @param count Filled in with length of the array. |
441 * @param context The usage context: FORMAT, STANDALONE. | 472 * @param context The usage context: FORMAT, STANDALONE. |
442 * @param width The requested name width: WIDE, ABBREVIATED, NARROW. | 473 * @param width The requested name width: WIDE, ABBREVIATED, NARROW. |
443 * @return The zodiac name strings (DateFormatSymbols retains owner
ship), | 474 * @return The zodiac name strings (DateFormatSymbols retains owner
ship), |
444 * or null if they are not available for this calendar. | 475 * or null if they are not available for this calendar. |
445 * @draft ICU 54 | 476 * @stable ICU 54 |
446 */ | 477 */ |
447 const UnicodeString* getZodiacNames(int32_t& count, | 478 const UnicodeString* getZodiacNames(int32_t& count, |
448 DtContextType context, DtWidthType width) const; | 479 DtContextType context, DtWidthType width) const; |
449 | 480 |
450 /** | 481 /** |
451 * Sets calendar zodiac name strings by width and context. For example: "Rat
", "Ox", "Tiger", etc. | 482 * Sets calendar zodiac name strings by width and context. For example: "Rat
", "Ox", "Tiger", etc. |
452 * | 483 * |
453 * @param zodiacNames The new zodiac name strings (not adopted; caller retai
ns ownership). | 484 * @param zodiacNames The new zodiac name strings (not adopted; caller retai
ns ownership). |
454 * @param count The length of the array. | 485 * @param count The length of the array. |
455 * @param context The usage context: FORMAT, STANDALONE (currently only FO
RMAT is supported). | 486 * @param context The usage context: FORMAT, STANDALONE (currently only FO
RMAT is supported). |
456 * @param width The name width: WIDE, ABBREVIATED, NARROW (currently onl
y ABBREVIATED is supported). | 487 * @param width The name width: WIDE, ABBREVIATED, NARROW (currently onl
y ABBREVIATED is supported). |
457 * @draft ICU 54 | 488 * @stable ICU 54 |
458 */ | 489 */ |
459 void setZodiacNames(const UnicodeString* zodiacNames, int32_t count, | 490 void setZodiacNames(const UnicodeString* zodiacNames, int32_t count, |
460 DtContextType context, DtWidthType width); | 491 DtContextType context, DtWidthType width); |
461 | 492 |
462 #endif /* U_HIDE_DRAFT_API */ | |
463 | |
464 #ifndef U_HIDE_INTERNAL_API | 493 #ifndef U_HIDE_INTERNAL_API |
465 /** | 494 /** |
466 * Somewhat temporary constants for leap month pattern types, adequate for s
upporting | 495 * Somewhat temporary constants for leap month pattern types, adequate for s
upporting |
467 * just leap month patterns as needed for Chinese lunar calendar. | 496 * just leap month patterns as needed for Chinese lunar calendar. |
468 * Eventually we will add full support for different month pattern types (ne
eded for | 497 * Eventually we will add full support for different month pattern types (ne
eded for |
469 * other calendars such as Hindu) at which point this approach will be repla
ced by a | 498 * other calendars such as Hindu) at which point this approach will be repla
ced by a |
470 * more complete approach. | 499 * more complete approach. |
471 * @internal | 500 * @internal |
472 */ | 501 */ |
473 enum EMonthPatternType | 502 enum EMonthPatternType |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 UnicodeString* fStandaloneNarrowWeekdays; | 733 UnicodeString* fStandaloneNarrowWeekdays; |
705 int32_t fStandaloneNarrowWeekdaysCount; | 734 int32_t fStandaloneNarrowWeekdaysCount; |
706 | 735 |
707 /** | 736 /** |
708 * Ampm strings. For example: "AM" and "PM". | 737 * Ampm strings. For example: "AM" and "PM". |
709 */ | 738 */ |
710 UnicodeString* fAmPms; | 739 UnicodeString* fAmPms; |
711 int32_t fAmPmsCount; | 740 int32_t fAmPmsCount; |
712 | 741 |
713 /** | 742 /** |
| 743 * Narrow Ampm strings. For example: "a" and "p". |
| 744 */ |
| 745 UnicodeString* fNarrowAmPms; |
| 746 int32_t fNarrowAmPmsCount; |
| 747 |
| 748 /** |
| 749 * Time separator string. For example: ":". |
| 750 */ |
| 751 UnicodeString fTimeSeparator; |
| 752 |
| 753 /** |
714 * Quarter strings. For example: "1st quarter", "2nd quarter", etc. | 754 * Quarter strings. For example: "1st quarter", "2nd quarter", etc. |
715 */ | 755 */ |
716 UnicodeString *fQuarters; | 756 UnicodeString *fQuarters; |
717 int32_t fQuartersCount; | 757 int32_t fQuartersCount; |
718 | 758 |
719 /** | 759 /** |
720 * Short quarters. For example: "Q1", "Q2", etc. | 760 * Short quarters. For example: "Q1", "Q2", etc. |
721 */ | 761 */ |
722 UnicodeString *fShortQuarters; | 762 UnicodeString *fShortQuarters; |
723 int32_t fShortQuartersCount; | 763 int32_t fShortQuartersCount; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 | 935 |
896 /** | 936 /** |
897 * Returns TRUE if f (with its pattern character repeated count times) is a
numeric field. | 937 * Returns TRUE if f (with its pattern character repeated count times) is a
numeric field. |
898 */ | 938 */ |
899 static UBool U_EXPORT2 isNumericField(UDateFormatField f, int32_t count); | 939 static UBool U_EXPORT2 isNumericField(UDateFormatField f, int32_t count); |
900 | 940 |
901 /** | 941 /** |
902 * Returns TRUE if c (repeated count times) is the pattern character for a n
umeric field. | 942 * Returns TRUE if c (repeated count times) is the pattern character for a n
umeric field. |
903 */ | 943 */ |
904 static UBool U_EXPORT2 isNumericPatternChar(UChar c, int32_t count); | 944 static UBool U_EXPORT2 isNumericPatternChar(UChar c, int32_t count); |
| 945 public: |
| 946 #ifndef U_HIDE_INTERNAL_API |
| 947 /** |
| 948 * Gets a DateFormatSymbols by locale. |
| 949 * Unlike the constructors which always use gregorian calendar, this |
| 950 * method uses the calendar in the locale. If the locale contains no |
| 951 * explicit calendar, this method uses the default calendar for that |
| 952 * locale. |
| 953 * @param locale the locale. |
| 954 * @param status error returned here. |
| 955 * @return the new DateFormatSymbols which the caller owns. |
| 956 * @internal For ICU use only. |
| 957 */ |
| 958 static DateFormatSymbols * U_EXPORT2 createForLocale( |
| 959 const Locale &locale, UErrorCode &status); |
| 960 #endif /* U_HIDE_INTERNAL_API */ |
905 }; | 961 }; |
906 | 962 |
907 U_NAMESPACE_END | 963 U_NAMESPACE_END |
908 | 964 |
909 #endif /* #if !UCONFIG_NO_FORMATTING */ | 965 #endif /* #if !UCONFIG_NO_FORMATTING */ |
910 | 966 |
911 #endif // _DTFMTSYM | 967 #endif // _DTFMTSYM |
912 //eof | 968 //eof |
OLD | NEW |