Fix FreeBSD build.
[haiku.git] / headers / os / locale / TimeUnitFormat.h
blob632cdcb03e6eea464c2e17c4fef344bf9c9eda5d
1 /*
2 * Copyright 2010-2011, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _B_TIME_UNIT_FORMAT_H_
6 #define _B_TIME_UNIT_FORMAT_H_
9 #include <Format.h>
10 #include <SupportDefs.h>
13 class BString;
15 #ifndef U_ICU_NAMESPACE
16 #define U_ICU_NAMESPACE icu
17 #endif
18 namespace U_ICU_NAMESPACE {
19 class TimeUnitFormat;
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 {
30 B_TIME_UNIT_YEAR,
31 B_TIME_UNIT_MONTH,
32 B_TIME_UNIT_WEEK,
33 B_TIME_UNIT_DAY,
34 B_TIME_UNIT_HOUR,
35 B_TIME_UNIT_MINUTE,
36 B_TIME_UNIT_SECOND,
38 B_TIME_UNIT_LAST = B_TIME_UNIT_SECOND
42 class BTimeUnitFormat : public BFormat {
43 typedef BFormat Inherited;
45 public:
46 BTimeUnitFormat(const time_unit_style style =
47 B_TIME_UNIT_FULL);
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,
55 const int32 value,
56 const time_unit_element unit
57 ) const;
59 private:
60 U_ICU_NAMESPACE::TimeUnitFormat* fFormatter;
64 #endif