intl/locale/public/nsIDateTimeFormat.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     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 nsIDateTimeFormat_h__
     8 #define nsIDateTimeFormat_h__
    11 #include "nsISupports.h"
    12 #include "nscore.h"
    13 #include "nsStringGlue.h"
    14 #include "nsILocale.h"
    15 #include "nsIScriptableDateFormat.h"
    16 #include "prtime.h"
    17 #include <time.h>
    20 // {2BBAA0B0-A591-11d2-9119-006008A6EDF6}
    21 #define NS_IDATETIMEFORMAT_IID \
    22 { 0x2bbaa0b0, 0xa591, 0x11d2, \
    23 { 0x91, 0x19, 0x0, 0x60, 0x8, 0xa6, 0xed, 0xf6 } }
    26 // Locale sensitive date and time format interface
    27 // 
    28 class nsIDateTimeFormat : public nsISupports {
    30 public: 
    31   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDATETIMEFORMAT_IID)
    33   // performs a locale sensitive date formatting operation on the time_t parameter
    34   NS_IMETHOD FormatTime(nsILocale* locale, 
    35                         const nsDateFormatSelector  dateFormatSelector, 
    36                         const nsTimeFormatSelector timeFormatSelector, 
    37                         const time_t  timetTime,
    38                         nsAString& stringOut) = 0; 
    40   // performs a locale sensitive date formatting operation on the struct tm parameter
    41   NS_IMETHOD FormatTMTime(nsILocale* locale, 
    42                           const nsDateFormatSelector  dateFormatSelector, 
    43                           const nsTimeFormatSelector timeFormatSelector, 
    44                           const struct tm*  tmTime, 
    45                           nsAString& stringOut) = 0; 
    47   // performs a locale sensitive date formatting operation on the PRTime parameter
    48   NS_IMETHOD FormatPRTime(nsILocale* locale, 
    49                           const nsDateFormatSelector  dateFormatSelector, 
    50                           const nsTimeFormatSelector timeFormatSelector, 
    51                           const PRTime  prTime, 
    52                           nsAString& stringOut) = 0;
    54   // performs a locale sensitive date formatting operation on the PRExplodedTime parameter
    55   NS_IMETHOD FormatPRExplodedTime(nsILocale* locale, 
    56                                   const nsDateFormatSelector  dateFormatSelector, 
    57                                   const nsTimeFormatSelector timeFormatSelector, 
    58                                   const PRExplodedTime*  explodedTime, 
    59                                   nsAString& stringOut) = 0; 
    60 };
    62 NS_DEFINE_STATIC_IID_ACCESSOR(nsIDateTimeFormat, NS_IDATETIMEFORMAT_IID)
    64 #endif  /* nsIDateTimeFormat_h__ */

mercurial