2 * Copyright 2010-2011, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
5 #ifndef _B_DURATION_FORMAT_H_
6 #define _B_DURATION_FORMAT_H_
12 #include <TimeUnitFormat.h>
17 #ifndef U_ICU_NAMESPACE
18 #define U_ICU_NAMESPACE icu
20 namespace U_ICU_NAMESPACE
{
21 class GregorianCalendar
;
25 class BDurationFormat
: public BFormat
{
26 typedef BFormat Inherited
;
29 BDurationFormat(const BLanguage
& language
,
30 const BFormattingConventions
& conventions
,
31 const BString
& separator
= ", ",
32 const time_unit_style style
= B_TIME_UNIT_FULL
);
33 BDurationFormat(const BString
& separator
= ", ",
34 const time_unit_style style
= B_TIME_UNIT_FULL
);
35 BDurationFormat(const BDurationFormat
& other
);
36 virtual ~BDurationFormat();
38 void SetSeparator(const BString
& separator
);
39 status_t
SetTimeZone(const BTimeZone
* timeZone
);
41 status_t
Format(BString
& buffer
,
42 const bigtime_t startValue
,
43 const bigtime_t stopValue
) const;
47 BTimeUnitFormat fTimeUnitFormat
;
48 U_ICU_NAMESPACE::GregorianCalendar
* fCalendar
;