PageRenderTime 31ms CodeModel.GetById 18ms app.highlight 12ms RepoModel.GetById 0ms app.codeStats 0ms

/packages/cocoaint/src/appkit/NSDatePickerCell.inc

https://github.com/slibre/freepascal
Pascal | 149 lines | 92 code | 20 blank | 37 comment | 0 complexity | acd60fae6357ac609f543953701e6d73 MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
  1{ Parsed from Appkit.framework NSDatePickerCell.h }
  2
  3{$ifdef TYPES}
  4{$ifndef NSDATEPICKERCELL_PAS_T}
  5{$define NSDATEPICKERCELL_PAS_T}
  6
  7{ Constants }
  8
  9const
 10  NSTextFieldAndStepperDatePickerStyle = 0;
 11  NSClockAndCalendarDatePickerStyle = 1;
 12  NSTextFieldDatePickerStyle = 2;
 13
 14const
 15  NSSingleDateMode = 0;
 16  NSRangeDateMode = 1;
 17
 18const
 19  NSHourMinuteDatePickerElementFlag = $000c;
 20  NSHourMinuteSecondDatePickerElementFlag = $000e;
 21  NSTimeZoneDatePickerElementFlag = $0010;
 22  NSYearMonthDatePickerElementFlag = $00c0;
 23  NSYearMonthDayDatePickerElementFlag = $00e0;
 24  NSEraDatePickerElementFlag = $0100;
 25
 26{ Types }
 27type
 28  NSDatePickerStyle = NSUInteger;
 29  NSDatePickerStylePtr = ^NSDatePickerStyle;
 30  NSDatePickerMode = NSUInteger;
 31  NSDatePickerModePtr = ^NSDatePickerMode;
 32  NSDatePickerElementFlags = NSUInteger;
 33  NSDatePickerElementFlagsPtr = ^NSDatePickerElementFlags;
 34
 35{$endif}
 36{$endif}
 37
 38{$ifdef RECORDS}
 39{$ifndef NSDATEPICKERCELL_PAS_R}
 40{$define NSDATEPICKERCELL_PAS_R}
 41
 42{$endif}
 43{$endif}
 44
 45{$ifdef FUNCTIONS}
 46{$ifndef NSDATEPICKERCELL_PAS_F}
 47{$define NSDATEPICKERCELL_PAS_F}
 48
 49{$endif}
 50{$endif}
 51
 52{$ifdef EXTERNAL_SYMBOLS}
 53{$ifndef NSDATEPICKERCELL_PAS_S}
 54{$define NSDATEPICKERCELL_PAS_S}
 55
 56{$endif}
 57{$endif}
 58
 59{$ifdef FORWARD}
 60  NSDatePickerCellDelegateProtocol = objcprotocol;
 61  NSDatePickerCell = objcclass;
 62  NSDatePickerCellPointer = ^NSDatePickerCell;
 63  NSDatePickerCellPtr = NSDatePickerCellPointer;
 64
 65{$endif}
 66
 67{$ifdef CLASSES}
 68{$ifndef NSDATEPICKERCELL_PAS_C}
 69{$define NSDATEPICKERCELL_PAS_C}
 70
 71{ NSDatePickerCell }
 72  NSDatePickerCell = objcclass external (NSActionCell)
 73  private
 74    _timeInterval: NSTimeInterval;
 75    _minDate: NSDate;
 76    _maxDate: NSDate;
 77    __dcFlags: record
 78      case byte of
 79       0: (_anonbitfield_NSDatePickerCell0: cuint);
 80       1: (data: bitpacked record
 81        elements: 0..((1 shl 16)-1);
 82        controlStyle: 0..((1 shl 3)-1);
 83        controlMode: 0..((1 shl 2)-1);
 84        trackingHand: 0..((1 shl 2)-1);
 85        reserved2: 0..((1 shl 4)-1);
 86        _drawsBackground: 0..1;
 87        digitsEntered: 0..((1 shl 2)-1);
 88        forcesLeadingZeroes: 0..1;
 89        wrapsDateComponentArithmetic: 0..1;
 90       end;
 91      );
 92      end;
 93    _delegate: id;
 94    _calendar: NSCalendar;
 95    _locale: NSLocale;
 96    _timeZone: NSTimeZone;
 97    _backgroundColor: NSColor;
 98    _textColor: NSColor;
 99    _indexOfSelectedSubfield: cint;
100    _reserved0: cint;
101    _reserved1: id;
102    _reserved2: id;
103    _reserved3: id;
104    _reserved4: id;
105    
106  public
107    function datePickerStyle: NSDatePickerStyle; message 'datePickerStyle';
108    procedure setDatePickerStyle(newStyle: NSDatePickerStyle); message 'setDatePickerStyle:';
109    function drawsBackground: Boolean; message 'drawsBackground';
110    procedure setDrawsBackground(flag: Boolean); message 'setDrawsBackground:';
111    function backgroundColor: NSColor; message 'backgroundColor';
112    procedure setBackgroundColor(color: NSColor); message 'setBackgroundColor:';
113    function textColor: NSColor; message 'textColor';
114    procedure setTextColor(color: NSColor); message 'setTextColor:';
115    function datePickerMode: NSDatePickerMode; message 'datePickerMode';
116    procedure setDatePickerMode(newMode: NSDatePickerMode); message 'setDatePickerMode:';
117    function datePickerElements: NSDatePickerElementFlags; message 'datePickerElements';
118    procedure setDatePickerElements(elementFlags: NSDatePickerElementFlags); message 'setDatePickerElements:';
119    function calendar: NSCalendar; message 'calendar';
120    procedure setCalendar(newCalendar: NSCalendar); message 'setCalendar:';
121    function locale: NSLocale; message 'locale';
122    procedure setLocale(newLocale: NSLocale); message 'setLocale:';
123    function timeZone: NSTimeZone; message 'timeZone';
124    procedure setTimeZone(newTimeZone: NSTimeZone); message 'setTimeZone:';
125    function dateValue: NSDate; message 'dateValue';
126    procedure setDateValue(newStartDate: NSDate); message 'setDateValue:';
127    function timeInterval: NSTimeInterval; message 'timeInterval';
128    procedure setTimeInterval(newTimeInterval: NSTimeInterval); message 'setTimeInterval:';
129    function minDate: NSDate; message 'minDate';
130    procedure setMinDate(date: NSDate); message 'setMinDate:';
131    function maxDate: NSDate; message 'maxDate';
132    procedure setMaxDate(date: NSDate); message 'setMaxDate:';
133    function delegate: NSDatePickerCellDelegateProtocol; message 'delegate';
134    procedure setDelegate(anObject: NSDatePickerCellDelegateProtocol); message 'setDelegate:';
135  end;
136
137{$endif}
138{$endif}
139{$ifdef PROTOCOLS}
140{$ifndef NSDATEPICKERCELL_PAS_P}
141{$define NSDATEPICKERCELL_PAS_P}
142  
143{ NSDatePickerCellDelegate Protocol }
144  NSDatePickerCellDelegateProtocol = objcprotocol external name 'NSDatePickerCellDelegate'
145  optional
146    procedure datePickerCell_validateProposedDateValue_timeInterval(aDatePickerCell: NSDatePickerCell; proposedDateValue: NSDatePointer; proposedTimeInterval: NSTimeIntervalPtr); message 'datePickerCell:validateProposedDateValue:timeInterval:';
147  end;
148{$endif}
149{$endif}