|
1 |
|
2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
3 * |
|
4 * This Source Code Form is subject to the terms of the Mozilla Public |
|
5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
7 #ifndef nsDateTimeFormatMac_h__ |
|
8 #define nsDateTimeFormatMac_h__ |
|
9 |
|
10 |
|
11 #include "nsCOMPtr.h" |
|
12 #include "nsIDateTimeFormat.h" |
|
13 |
|
14 |
|
15 class nsDateTimeFormatMac : public nsIDateTimeFormat { |
|
16 |
|
17 public: |
|
18 NS_DECL_THREADSAFE_ISUPPORTS |
|
19 |
|
20 // performs a locale sensitive date formatting operation on the time_t parameter |
|
21 NS_IMETHOD FormatTime(nsILocale* locale, |
|
22 const nsDateFormatSelector dateFormatSelector, |
|
23 const nsTimeFormatSelector timeFormatSelector, |
|
24 const time_t timetTime, |
|
25 nsAString& stringOut); |
|
26 |
|
27 // performs a locale sensitive date formatting operation on the struct tm parameter |
|
28 NS_IMETHOD FormatTMTime(nsILocale* locale, |
|
29 const nsDateFormatSelector dateFormatSelector, |
|
30 const nsTimeFormatSelector timeFormatSelector, |
|
31 const struct tm* tmTime, |
|
32 nsAString& stringOut); |
|
33 // performs a locale sensitive date formatting operation on the PRTime parameter |
|
34 NS_IMETHOD FormatPRTime(nsILocale* locale, |
|
35 const nsDateFormatSelector dateFormatSelector, |
|
36 const nsTimeFormatSelector timeFormatSelector, |
|
37 const PRTime prTime, |
|
38 nsAString& stringOut); |
|
39 |
|
40 // performs a locale sensitive date formatting operation on the PRExplodedTime parameter |
|
41 NS_IMETHOD FormatPRExplodedTime(nsILocale* locale, |
|
42 const nsDateFormatSelector dateFormatSelector, |
|
43 const nsTimeFormatSelector timeFormatSelector, |
|
44 const PRExplodedTime* explodedTime, |
|
45 nsAString& stringOut); |
|
46 |
|
47 nsDateTimeFormatMac() {} |
|
48 |
|
49 virtual ~nsDateTimeFormatMac() {} |
|
50 |
|
51 private: |
|
52 // init this interface to a specified locale |
|
53 NS_IMETHOD Initialize(nsILocale* locale); |
|
54 |
|
55 nsString mLocale; |
|
56 nsString mAppLocale; |
|
57 bool mUseDefaultLocale; |
|
58 }; |
|
59 |
|
60 #endif /* nsDateTimeFormatMac_h__ */ |