xref: /haiku/headers/os/locale/TimeUnitFormat.h (revision e7d5c75dce28921de0dc981ed840205a67a0c0e5)
1 /*
2  * Copyright 2010, 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_
7 
8 
9 #include <DateTimeFormat.h>
10 #include <SupportDefs.h>
11 
12 
13 class BString;
14 
15 
16 enum time_unit_style {
17 	B_TIME_UNIT_ABBREVIATED,	// e.g. '5 hrs.'
18 	B_TIME_UNIT_FULL,			// e.g. '5 hours'
19 };
20 
21 
22 enum time_unit_element {
23 	B_TIME_UNIT_YEAR,
24 	B_TIME_UNIT_MONTH,
25 	B_TIME_UNIT_WEEK,
26 	B_TIME_UNIT_DAY,
27 	B_TIME_UNIT_HOUR,
28 	B_TIME_UNIT_MINUTE,
29 	B_TIME_UNIT_SECOND,
30 
31 	B_TIME_UNIT_LAST = B_TIME_UNIT_SECOND
32 };
33 
34 
35 class BTimeUnitFormat : public BFormat {
36 public:
37 			status_t			Format(int32 value, time_unit_element unit,
38 									BString* buffer,
39 									time_unit_style style = B_TIME_UNIT_FULL
40 									) const;
41 };
42 
43 
44 #endif
45