xref: /haiku/headers/os/locale/RelativeDateTimeFormat.h (revision 4bd0c1066b227cec4b79883bdef697c7a27f2e90)
1 /*
2  * Copyright 2017, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Akshay Agarwal <agarwal.akshay.akshay8@gmail.com>
7  */
8 #ifndef _B_RELATIVE_DATE_TIME_FORMAT_H_
9 #define _B_RELATIVE_DATE_TIME_FORMAT_H_
10 
11 
12 #include <Format.h>
13 #include <SupportDefs.h>
14 
15 
16 class BString;
17 
18 #ifndef U_ICU_NAMESPACE
19   #define U_ICU_NAMESPACE icu
20 #endif
21 namespace U_ICU_NAMESPACE {
22 	class GregorianCalendar;
23 	class RelativeDateTimeFormatter;
24 }
25 
26 
27 class BRelativeDateTimeFormat: public BFormat {
28 	typedef BFormat				Inherited;
29 public:
30 								BRelativeDateTimeFormat();
31 								BRelativeDateTimeFormat(const BLanguage& language,
32 									const BFormattingConventions& conventions);
33 								BRelativeDateTimeFormat(const BRelativeDateTimeFormat& other);
34 			virtual				~BRelativeDateTimeFormat();
35 
36 			status_t			Format(BString& string, const time_t timeValue) const;
37 
38 private:
39 			U_ICU_NAMESPACE::RelativeDateTimeFormatter*	fFormatter;
40 			U_ICU_NAMESPACE::GregorianCalendar*	fCalendar;
41 };
42 
43 
44 #endif	// _B_RELATIVE_DATE_TIME_FORMAT_H_
45