NSDateComponentsFormatter.inc 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. { Parsed from Foundation.framework NSDateComponentsFormatter.h }
  2. {$ifdef TYPES}
  3. type
  4. NSDateComponentsFormatterPtr = ^NSDateComponentsFormatter;
  5. {$endif}
  6. {$ifdef TYPES}
  7. type
  8. NSDateComponentsFormatterUnitsStyle = NSInteger;
  9. NSDateComponentsFormatterUnitsStylePtr = ^NSDateComponentsFormatterUnitsStyle;
  10. const
  11. NSDateComponentsFormatterUnitsStylePositional = 0;
  12. NSDateComponentsFormatterUnitsStyleAbbreviated = 1;
  13. NSDateComponentsFormatterUnitsStyleShort = 2;
  14. NSDateComponentsFormatterUnitsStyleFull = 3;
  15. NSDateComponentsFormatterUnitsStyleSpellOut = 4;
  16. type
  17. NSDateComponentsFormatterZeroFormattingBehavior = NSUInteger;
  18. NSDateComponentsFormatterZeroFormattingBehaviorPtr = ^NSDateComponentsFormatterZeroFormattingBehavior;
  19. const
  20. NSDateComponentsFormatterZeroFormattingBehaviorNone = 0;
  21. NSDateComponentsFormatterZeroFormattingBehaviorDefault = 1 shl 0;
  22. NSDateComponentsFormatterZeroFormattingBehaviorDropLeading = 1 shl 1;
  23. NSDateComponentsFormatterZeroFormattingBehaviorDropMiddle = 1 shl 2;
  24. NSDateComponentsFormatterZeroFormattingBehaviorDropTrailing = 1 shl 3;
  25. NSDateComponentsFormatterZeroFormattingBehaviorDropAll = NSDateComponentsFormatterZeroFormattingBehaviorDropLeading + NSDateComponentsFormatterZeroFormattingBehaviorDropMiddle + NSDateComponentsFormatterZeroFormattingBehaviorDropTrailing;
  26. NSDateComponentsFormatterZeroFormattingBehaviorPad = 1 shl 16;
  27. {$endif}
  28. {$ifdef CLASSES}
  29. type
  30. NSDateComponentsFormatter = objcclass external (NSFormatter)
  31. private
  32. _lock: pthread_mutex_t;
  33. _fmt: pointer;
  34. _unused: pointer;
  35. _fmtLocaleIdent: NSString;
  36. _calendar: NSCalendar;
  37. _referenceDate: NSDate;
  38. _unitFormatter: NSNumberFormatter;
  39. _allowedUnits: NSCalendarUnit;
  40. _formattingContext: NSFormattingContext;
  41. _unitsStyle: NSDateComponentsFormatterUnitsStyle;
  42. _zeroFormattingBehavior: NSDateComponentsFormatterZeroFormattingBehavior;
  43. _maximumUnitCount: NSInteger;
  44. _allowsFractionalUnits: ObjCBOOL;
  45. _collapsesLargestUnit: ObjCBOOL;
  46. _includesApproximationPhrase: ObjCBOOL;
  47. _includesTimeRemainingPhrase: ObjCBOOL;
  48. _reserved: pointer;
  49. public
  50. function stringForObjectValue (obj: id): NSString; message 'stringForObjectValue:';
  51. function stringFromDateComponents (components: NSDateComponents): NSString; message 'stringFromDateComponents:';
  52. function stringFromDate_toDate (startDate: NSDate; endDate: NSDate): NSString; message 'stringFromDate:toDate:';
  53. function stringFromTimeInterval (ti: NSTimeInterval): NSString; message 'stringFromTimeInterval:';
  54. class function localizedStringFromDateComponents_unitsStyle (components: NSDateComponents; unitsStyle: NSDateComponentsFormatterUnitsStyle): NSString; message 'localizedStringFromDateComponents:unitsStyle:';
  55. procedure setUnitsStyle(newValue: NSDateComponentsFormatterUnitsStyle); message 'setUnitsStyle:';
  56. function unitsStyle: NSDateComponentsFormatterUnitsStyle; message 'unitsStyle';
  57. procedure setAllowedUnits(newValue: NSCalendarUnit); message 'setAllowedUnits:';
  58. function allowedUnits: NSCalendarUnit; message 'allowedUnits';
  59. procedure setZeroFormattingBehavior(newValue: NSDateComponentsFormatterZeroFormattingBehavior); message 'setZeroFormattingBehavior:';
  60. function zeroFormattingBehavior: NSDateComponentsFormatterZeroFormattingBehavior; message 'zeroFormattingBehavior';
  61. procedure setCalendar(newValue: NSCalendar); message 'setCalendar:';
  62. function calendar: NSCalendar; message 'calendar';
  63. procedure setAllowsFractionalUnits(newValue: ObjCBOOL); message 'setAllowsFractionalUnits:';
  64. function allowsFractionalUnits: ObjCBOOL; message 'allowsFractionalUnits';
  65. procedure setMaximumUnitCount(newValue: NSInteger); message 'setMaximumUnitCount:';
  66. function maximumUnitCount: NSInteger; message 'maximumUnitCount';
  67. procedure setCollapsesLargestUnit(newValue: ObjCBOOL); message 'setCollapsesLargestUnit:';
  68. function collapsesLargestUnit: ObjCBOOL; message 'collapsesLargestUnit';
  69. procedure setIncludesApproximationPhrase(newValue: ObjCBOOL); message 'setIncludesApproximationPhrase:';
  70. function includesApproximationPhrase: ObjCBOOL; message 'includesApproximationPhrase';
  71. procedure setIncludesTimeRemainingPhrase(newValue: ObjCBOOL); message 'setIncludesTimeRemainingPhrase:';
  72. function includesTimeRemainingPhrase: ObjCBOOL; message 'includesTimeRemainingPhrase';
  73. procedure setFormattingContext(newValue: NSFormattingContext); message 'setFormattingContext:';
  74. function formattingContext: NSFormattingContext; message 'formattingContext';
  75. function getObjectValue_forString_errorDescription (obj: idPtr; string_: NSString; error: NSStringPtr): ObjCBOOL; message 'getObjectValue:forString:errorDescription:';
  76. end;
  77. {$endif}