2 * Copyright 2010-2011, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
5 #ifndef _B_TIME_UNIT_FORMAT_H_
6 #define _B_TIME_UNIT_FORMAT_H_
10 #include <SupportDefs.h>
15 #ifndef U_ICU_NAMESPACE
16 #define U_ICU_NAMESPACE icu
18 namespace U_ICU_NAMESPACE
{
23 enum time_unit_style
{
24 B_TIME_UNIT_ABBREVIATED
, // e.g. '5 hrs.'
25 B_TIME_UNIT_FULL
, // e.g. '5 hours'
29 enum time_unit_element
{
38 B_TIME_UNIT_LAST
= B_TIME_UNIT_SECOND
42 class BTimeUnitFormat
: public BFormat
{
43 typedef BFormat Inherited
;
46 BTimeUnitFormat(const time_unit_style style
=
48 BTimeUnitFormat(const BLanguage
& language
,
49 const BFormattingConventions
& conventions
,
50 const time_unit_style style
= B_TIME_UNIT_FULL
);
51 BTimeUnitFormat(const BTimeUnitFormat
& other
);
52 virtual ~BTimeUnitFormat();
54 status_t
Format(BString
& buffer
,
56 const time_unit_element unit
60 U_ICU_NAMESPACE::TimeUnitFormat
* fFormatter
;