intl/locale/src/unix/nsDateTimeFormatUnix.h

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

michael@0 1
michael@0 2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
michael@0 3 *
michael@0 4 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 5 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 7 #ifndef nsDateTimeFormatUnix_h__
michael@0 8 #define nsDateTimeFormatUnix_h__
michael@0 9
michael@0 10
michael@0 11 #include "nsICharsetConverterManager.h"
michael@0 12 #include "nsCOMPtr.h"
michael@0 13 #include "nsIDateTimeFormat.h"
michael@0 14
michael@0 15 #define kPlatformLocaleLength 64
michael@0 16
michael@0 17 class nsDateTimeFormatUnix : public nsIDateTimeFormat {
michael@0 18
michael@0 19 public:
michael@0 20 NS_DECL_THREADSAFE_ISUPPORTS
michael@0 21
michael@0 22 // performs a locale sensitive date formatting operation on the time_t parameter
michael@0 23 NS_IMETHOD FormatTime(nsILocale* locale,
michael@0 24 const nsDateFormatSelector dateFormatSelector,
michael@0 25 const nsTimeFormatSelector timeFormatSelector,
michael@0 26 const time_t timetTime,
michael@0 27 nsAString& stringOut);
michael@0 28
michael@0 29 // performs a locale sensitive date formatting operation on the struct tm parameter
michael@0 30 NS_IMETHOD FormatTMTime(nsILocale* locale,
michael@0 31 const nsDateFormatSelector dateFormatSelector,
michael@0 32 const nsTimeFormatSelector timeFormatSelector,
michael@0 33 const struct tm* tmTime,
michael@0 34 nsAString& stringOut);
michael@0 35
michael@0 36 // performs a locale sensitive date formatting operation on the PRTime parameter
michael@0 37 NS_IMETHOD FormatPRTime(nsILocale* locale,
michael@0 38 const nsDateFormatSelector dateFormatSelector,
michael@0 39 const nsTimeFormatSelector timeFormatSelector,
michael@0 40 const PRTime prTime,
michael@0 41 nsAString& stringOut);
michael@0 42
michael@0 43 // performs a locale sensitive date formatting operation on the PRExplodedTime parameter
michael@0 44 NS_IMETHOD FormatPRExplodedTime(nsILocale* locale,
michael@0 45 const nsDateFormatSelector dateFormatSelector,
michael@0 46 const nsTimeFormatSelector timeFormatSelector,
michael@0 47 const PRExplodedTime* explodedTime,
michael@0 48 nsAString& stringOut);
michael@0 49
michael@0 50
michael@0 51 nsDateTimeFormatUnix() {mLocale.Truncate();mAppLocale.Truncate();}
michael@0 52
michael@0 53 virtual ~nsDateTimeFormatUnix() {}
michael@0 54
michael@0 55 private:
michael@0 56 // init this interface to a specified locale
michael@0 57 NS_IMETHOD Initialize(nsILocale* locale);
michael@0 58
michael@0 59 void LocalePreferred24hour();
michael@0 60
michael@0 61 nsString mLocale;
michael@0 62 nsString mAppLocale;
michael@0 63 nsCString mCharset; // in order to convert API result to unicode
michael@0 64 nsCString mPlatformLocale; // for setlocale
michael@0 65 bool mLocalePreferred24hour; // true if 24 hour format is preferred by current locale
michael@0 66 bool mLocaleAMPMfirst; // true if AM/PM string is preferred before the time
michael@0 67 nsCOMPtr <nsIUnicodeDecoder> mDecoder;
michael@0 68 };
michael@0 69
michael@0 70 #endif /* nsDateTimeFormatUnix_h__ */

mercurial