1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/locale/public/nsIDateTimeFormat.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,64 @@ 1.4 + 1.5 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.6 + * 1.7 + * This Source Code Form is subject to the terms of the Mozilla Public 1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.10 +#ifndef nsIDateTimeFormat_h__ 1.11 +#define nsIDateTimeFormat_h__ 1.12 + 1.13 + 1.14 +#include "nsISupports.h" 1.15 +#include "nscore.h" 1.16 +#include "nsStringGlue.h" 1.17 +#include "nsILocale.h" 1.18 +#include "nsIScriptableDateFormat.h" 1.19 +#include "prtime.h" 1.20 +#include <time.h> 1.21 + 1.22 + 1.23 +// {2BBAA0B0-A591-11d2-9119-006008A6EDF6} 1.24 +#define NS_IDATETIMEFORMAT_IID \ 1.25 +{ 0x2bbaa0b0, 0xa591, 0x11d2, \ 1.26 +{ 0x91, 0x19, 0x0, 0x60, 0x8, 0xa6, 0xed, 0xf6 } } 1.27 + 1.28 + 1.29 +// Locale sensitive date and time format interface 1.30 +// 1.31 +class nsIDateTimeFormat : public nsISupports { 1.32 + 1.33 +public: 1.34 + NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDATETIMEFORMAT_IID) 1.35 + 1.36 + // performs a locale sensitive date formatting operation on the time_t parameter 1.37 + NS_IMETHOD FormatTime(nsILocale* locale, 1.38 + const nsDateFormatSelector dateFormatSelector, 1.39 + const nsTimeFormatSelector timeFormatSelector, 1.40 + const time_t timetTime, 1.41 + nsAString& stringOut) = 0; 1.42 + 1.43 + // performs a locale sensitive date formatting operation on the struct tm parameter 1.44 + NS_IMETHOD FormatTMTime(nsILocale* locale, 1.45 + const nsDateFormatSelector dateFormatSelector, 1.46 + const nsTimeFormatSelector timeFormatSelector, 1.47 + const struct tm* tmTime, 1.48 + nsAString& stringOut) = 0; 1.49 + 1.50 + // performs a locale sensitive date formatting operation on the PRTime parameter 1.51 + NS_IMETHOD FormatPRTime(nsILocale* locale, 1.52 + const nsDateFormatSelector dateFormatSelector, 1.53 + const nsTimeFormatSelector timeFormatSelector, 1.54 + const PRTime prTime, 1.55 + nsAString& stringOut) = 0; 1.56 + 1.57 + // performs a locale sensitive date formatting operation on the PRExplodedTime parameter 1.58 + NS_IMETHOD FormatPRExplodedTime(nsILocale* locale, 1.59 + const nsDateFormatSelector dateFormatSelector, 1.60 + const nsTimeFormatSelector timeFormatSelector, 1.61 + const PRExplodedTime* explodedTime, 1.62 + nsAString& stringOut) = 0; 1.63 +}; 1.64 + 1.65 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIDateTimeFormat, NS_IDATETIMEFORMAT_IID) 1.66 + 1.67 +#endif /* nsIDateTimeFormat_h__ */