1 2 /* Definition of class NSDateIntervalFormatter 3 Copyright (C) 2019 Free Software Foundation, Inc. 4 5 By: heron 6 Date: Wed Oct 9 16:23:55 EDT 2019 7 8 This file is part of the GNUstep Library. 9 10 This library is free software; you can redistribute it and/or 11 modify it under the terms of the GNU Lesser General Public 12 License as published by the Free Software Foundation; either 13 version 2 of the License, or (at your option) any later version. 14 15 This library is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 Lesser General Public License for more details. 19 20 You should have received a copy of the GNU Lesser General Public 21 License along with this library; if not, write to the Free 22 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 23 Boston, MA 02110 USA. 24 */ 25 26 #ifndef _NSDateIntervalFormatter_h_GNUSTEP_BASE_INCLUDE 27 #define _NSDateIntervalFormatter_h_GNUSTEP_BASE_INCLUDE 28 29 #include <Foundation/NSFormatter.h> 30 31 #if defined(__cplusplus) 32 extern "C" { 33 #endif 34 35 #if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST) 36 37 enum { 38 NSDateIntervalFormatterNoStyle = 0, 39 NSDateIntervalFormatterShortStyle = 1, 40 NSDateIntervalFormatterMediumStyle = 2, 41 NSDateIntervalFormatterLongStyle = 3, 42 NSDateIntervalFormatterFullStyle = 4 43 }; 44 typedef NSUInteger NSDateIntervalFormatterStyle; 45 46 @class NSCalendar, NSLocale, NSDateInterval; 47 48 @interface NSDateIntervalFormatter : NSFormatter 49 { 50 NSLocale *_locale; 51 NSCalendar *_calendar; 52 NSTimeZone *_timeZone; 53 NSString *_dateTemplate; 54 NSDateIntervalFormatterStyle _dateStyle; 55 NSDateIntervalFormatterStyle _timeStyle; 56 } 57 58 // Properties 59 - (NSLocale *) locale; 60 - (void) setLocale: (NSLocale *)locale; 61 62 - (NSCalendar *) calendar; 63 - (void) setCalendar: (NSCalendar *)calendar; 64 65 - (NSTimeZone *) timeZone; 66 - (void) setTimeZone: (NSTimeZone *)timeZone; 67 68 - (NSString *) dateTemplate; 69 - (void) setDateTemplate: (NSString *)dateTemplate; 70 71 - (NSDateIntervalFormatterStyle) dateStyle; 72 - (void) setDateStyle: (NSDateIntervalFormatterStyle)dateStyle; 73 74 - (NSDateIntervalFormatterStyle) timeStyle; 75 - (void) setTimeStyle: (NSDateIntervalFormatterStyle)timeStyle; 76 77 // Create strings 78 - (NSString *)stringFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate; 79 80 - (NSString *)stringFromDateInterval:(NSDateInterval *)dateInterval; 81 82 @end 83 84 #if defined(__cplusplus) 85 } 86 #endif 87 88 #endif /* GS_API_MACOSX */ 89 90 #endif /* _NSDateIntervalFormatter_h_GNUSTEP_BASE_INCLUDE */ 91 92