intl/locale/src/windows/nsDateTimeFormatWin.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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 nsDateTimeFormatWin_h__
     8 #define nsDateTimeFormatWin_h__
    11 #include "nsIDateTimeFormat.h"
    12 #include <windows.h>
    15 // Locale sensitive date and time format interface
    16 // 
    17 class nsDateTimeFormatWin : public nsIDateTimeFormat {
    19 public: 
    20   NS_DECL_THREADSAFE_ISUPPORTS 
    22   // performs a locale sensitive date formatting operation on the time_t parameter
    23   NS_IMETHOD FormatTime(nsILocale* locale, 
    24                         const nsDateFormatSelector  dateFormatSelector, 
    25                         const nsTimeFormatSelector timeFormatSelector, 
    26                         const time_t  timetTime, 
    27                         nsAString& stringOut); 
    29   // performs a locale sensitive date formatting operation on the struct tm parameter
    30   NS_IMETHOD FormatTMTime(nsILocale* locale, 
    31                           const nsDateFormatSelector  dateFormatSelector, 
    32                           const nsTimeFormatSelector timeFormatSelector, 
    33                           const struct tm*  tmTime, 
    34                           nsAString& stringOut); 
    36   // performs a locale sensitive date formatting operation on the PRTime parameter
    37   NS_IMETHOD FormatPRTime(nsILocale* locale, 
    38                           const nsDateFormatSelector  dateFormatSelector, 
    39                           const nsTimeFormatSelector timeFormatSelector, 
    40                           const PRTime  prTime, 
    41                           nsAString& stringOut);
    43   // performs a locale sensitive date formatting operation on the PRExplodedTime parameter
    44   NS_IMETHOD FormatPRExplodedTime(nsILocale* locale, 
    45                                   const nsDateFormatSelector  dateFormatSelector, 
    46                                   const nsTimeFormatSelector timeFormatSelector, 
    47                                   const PRExplodedTime*  explodedTime, 
    48                                   nsAString& stringOut); 
    50   nsDateTimeFormatWin() {mLocale.SetLength(0);mAppLocale.SetLength(0);}
    53   virtual ~nsDateTimeFormatWin() {}
    55 private:
    56   // init this interface to a specified locale
    57   NS_IMETHOD Initialize(nsILocale* locale);
    59   // call GetTimeFormatW or TimeFormatA
    60   int nsGetTimeFormatW(DWORD dwFlags, const SYSTEMTIME *lpTime,
    61                     const char* format, char16_t *timeStr, int cchTime);
    63   // call GetDateFormatW or GetDateFormatA
    64   int nsGetDateFormatW(DWORD dwFlags, const SYSTEMTIME *lpDate,
    65                        const char* format, char16_t *dateStr, int cchDate);
    67   nsString    mLocale;
    68   nsString    mAppLocale;
    69   uint32_t    mLCID;             // Windows platform locale ID
    70 };
    72 #endif  /* nsDateTimeFormatWin_h__ */

mercurial