NSCollectionView.inc 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. { Parsed from AppKit.framework NSCollectionView.h }
  2. {$ifdef TYPES}
  3. type
  4. NSCollectionViewItemPtr = ^NSCollectionViewItem;
  5. NSCollectionViewPtr = ^NSCollectionView;
  6. NSCollectionViewDelegateProtocolPtr = ^NSCollectionViewDelegateProtocol;
  7. {$endif}
  8. {$ifdef CLASSES}
  9. type
  10. NSCollectionViewItem = objcclass external (NSViewController, NSCopyingProtocol)
  11. private
  12. _collectionView: NSCollectionView;
  13. _cviFlags: bitpacked record
  14. case byte of
  15. 0: (_anonBitField__cviFlags0: cuint);
  16. 1: (
  17. isSelected: 0..1;
  18. suppressSelectionChangedNotification: 0..1;
  19. connectionsCopied: 0..1;
  20. reserved: 0..((1 shl 29)-1);
  21. );
  22. end;
  23. _cachedArchive: NSData;
  24. _reserved2: pointer;
  25. public
  26. function collectionView: NSCollectionView; message 'collectionView';
  27. procedure setSelected(newValue: ObjCBOOL); message 'setSelected:';
  28. function isSelected: ObjCBOOL; message 'isSelected';
  29. procedure setImageView(newValue: NSImageView); message 'setImageView:';
  30. function imageView: NSImageView; message 'imageView';
  31. procedure setTextField(newValue: NSTextField); message 'setTextField:';
  32. function textField: NSTextField; message 'textField';
  33. function draggingImageComponents: NSArray; message 'draggingImageComponents';
  34. { Adopted protocols }
  35. function copyWithZone (zone: NSZonePtr): id; message 'copyWithZone:';
  36. end;
  37. {$endif}
  38. {$ifdef TYPES}
  39. type
  40. NSCollectionViewDropOperation = NSInteger;
  41. NSCollectionViewDropOperationPtr = ^NSCollectionViewDropOperation;
  42. const
  43. NSCollectionViewDropOn = 0;
  44. NSCollectionViewDropBefore = 1;
  45. {$endif}
  46. {$ifdef CLASSES}
  47. type
  48. NSCollectionView = objcclass external (NSView, NSDraggingSourceProtocol, NSDraggingDestinationProtocol)
  49. private
  50. _content: NSArray;
  51. _selectionIndexes: NSMutableIndexSet;
  52. _itemPrototype: NSCollectionViewItem;
  53. _minItemSize: NSSize;
  54. _maxItemSize: NSSize;
  55. _maxGridRows: NSUInteger;
  56. _maxGridColumns: NSUInteger;
  57. _backgroundColors: NSArray;
  58. _displayedItems: NSMutableArray;
  59. _animationDuration: NSTimeInterval;
  60. _cvFlags: bitpacked record
  61. case byte of
  62. 0: (_anonBitField__cvFlags0: cuint);
  63. 1: (
  64. isFirstResponder: 0..1;
  65. invalidateItemViews: 0..1;
  66. selectable: 0..1;
  67. allowsMultipleSelection: 0..1;
  68. avoidsEmptySelection: 0..1;
  69. superviewIsClipView: 0..1;
  70. needsUpdateGrid: 0..1;
  71. needsUpdateBackground: 0..1;
  72. gridSettingsNeedUpdate: 0..1;
  73. guardSetFrameSize: 0..1;
  74. canDisplayItems: 0..1;
  75. animateForDrag: 0..1;
  76. unarchiving: 0..1;
  77. observingScroll: 0..1;
  78. reserved: 0..((1 shl 18)-1);
  79. );
  80. end;
  81. _delegate: id;
  82. _backgroundLayers: NSMutableArray;
  83. _storedFrameSize: NSSize;
  84. _cachedNib: NSNib;
  85. _animTimerCancel: pObjCBOOL;
  86. _removedItems: NSArray;
  87. _addedItems: NSArray;
  88. _addedItemIndexes: NSIndexSet;
  89. _resizeTimerCancel: pObjCBOOL;
  90. _draggedIndexes: NSIndexSet;
  91. _draggingSourceOperationMaskForLocal: NSDragOperation;
  92. _draggingSourceOperationMaskForNonLocal: NSDragOperation;
  93. _currentDropIndex: NSInteger;
  94. _currentDropSpaceIndex: NSInteger;
  95. _shiftRow: NSInteger;
  96. _currentDragOperation: NSDragOperation;
  97. _currentDropOperation: NSCollectionViewDropOperation;
  98. _draggingInfo: id;
  99. _dragTimerCancel: pObjCBOOL;
  100. _private: id;
  101. _reserved:array[0..12] of pointer;
  102. public
  103. procedure setDelegate(newValue: NSCollectionViewDelegateProtocol); message 'setDelegate:';
  104. function delegate: NSCollectionViewDelegateProtocol; message 'delegate';
  105. function isFirstResponder: ObjCBOOL; message 'isFirstResponder';
  106. procedure setContent(newValue: NSArray); message 'setContent:';
  107. function content: NSArray; message 'content';
  108. procedure setSelectable(newValue: ObjCBOOL); message 'setSelectable:';
  109. function isSelectable: ObjCBOOL; message 'isSelectable';
  110. procedure setAllowsMultipleSelection(newValue: ObjCBOOL); message 'setAllowsMultipleSelection:';
  111. function allowsMultipleSelection: ObjCBOOL; message 'allowsMultipleSelection';
  112. procedure setSelectionIndexes(newValue: NSIndexSet); message 'setSelectionIndexes:';
  113. function selectionIndexes: NSIndexSet; message 'selectionIndexes';
  114. function newItemForRepresentedObject (object_: id): NSCollectionViewItem; message 'newItemForRepresentedObject:';
  115. procedure setItemPrototype(newValue: NSCollectionViewItem); message 'setItemPrototype:';
  116. function itemPrototype: NSCollectionViewItem; message 'itemPrototype';
  117. procedure setMaxNumberOfRows(newValue: NSUInteger); message 'setMaxNumberOfRows:';
  118. function maxNumberOfRows: NSUInteger; message 'maxNumberOfRows';
  119. procedure setMaxNumberOfColumns(newValue: NSUInteger); message 'setMaxNumberOfColumns:';
  120. function maxNumberOfColumns: NSUInteger; message 'maxNumberOfColumns';
  121. procedure setMinItemSize(newValue: NSSize); message 'setMinItemSize:';
  122. function minItemSize: NSSize; message 'minItemSize';
  123. procedure setMaxItemSize(newValue: NSSize); message 'setMaxItemSize:';
  124. function maxItemSize: NSSize; message 'maxItemSize';
  125. procedure setBackgroundColors(newValue: NSArray); message 'setBackgroundColors:';
  126. function backgroundColors: NSArray; message 'backgroundColors';
  127. function itemAtIndex (index: NSUInteger): NSCollectionViewItem; message 'itemAtIndex:'; { available in 10_6 }
  128. function frameForItemAtIndex (index: NSUInteger): NSRect; message 'frameForItemAtIndex:'; { available in 10_6 }
  129. function frameForItemAtIndex_withNumberOfItems (index: NSUInteger; numberOfItems: NSUInteger): NSRect; message 'frameForItemAtIndex:withNumberOfItems:'; { available in 10_7 }
  130. procedure setDraggingSourceOperationMask_forLocal (dragOperationMask: NSDragOperation; localDestination: ObjCBOOL); message 'setDraggingSourceOperationMask:forLocal:'; { available in 10_6 }
  131. function draggingImageForItemsAtIndexes_withEvent_offset (indexes: NSIndexSet; event: NSEvent; dragImageOffset: NSPointPointer): NSImage; message 'draggingImageForItemsAtIndexes:withEvent:offset:'; { available in 10_6 }
  132. { Adopted protocols }
  133. procedure draggingSession_endedAtPoint_operation (session: NSDraggingSession; screenPoint: NSPoint; operation: NSDragOperation); message 'draggingSession:endedAtPoint:operation:';
  134. procedure draggingSession_movedToPoint (session: NSDraggingSession; screenPoint: NSPoint); message 'draggingSession:movedToPoint:';
  135. function draggingSession_sourceOperationMaskForDraggingContext (session: NSDraggingSession; context: NSDraggingContext): NSDragOperation; message 'draggingSession:sourceOperationMaskForDraggingContext:';
  136. procedure draggingSession_willBeginAtPoint (session: NSDraggingSession; screenPoint: NSPoint); message 'draggingSession:willBeginAtPoint:';
  137. function ignoreModifierKeysForDraggingSession (session: NSDraggingSession): ObjCBOOL; message 'ignoreModifierKeysForDraggingSession:';
  138. end;
  139. {$endif}
  140. {$ifdef PROTOCOLS}
  141. type
  142. NSCollectionViewDelegateProtocol = objcprotocol external name 'NSCollectionViewDelegate' (NSObjectProtocol)
  143. optional
  144. function collectionView_canDragItemsAtIndexes_withEvent (collectionView: NSCollectionView; indexes: NSIndexSet; event: NSEvent): ObjCBOOL; message 'collectionView:canDragItemsAtIndexes:withEvent:'; { available in 10_6 }
  145. function collectionView_writeItemsAtIndexes_toPasteboard (collectionView: NSCollectionView; indexes: NSIndexSet; pasteboard: NSPasteboard): ObjCBOOL; message 'collectionView:writeItemsAtIndexes:toPasteboard:'; { available in 10_6 }
  146. function collectionView_namesOfPromisedFilesDroppedAtDestination_forDraggedItemsAtIndexes (collectionView: NSCollectionView; dropURL: NSURL; indexes: NSIndexSet): NSArray; message 'collectionView:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAtIndexes:'; { available in 10_6 }
  147. function collectionView_draggingImageForItemsAtIndexes_withEvent_offset (collectionView: NSCollectionView; indexes: NSIndexSet; event: NSEvent; dragImageOffset: NSPointPointer): NSImage; message 'collectionView:draggingImageForItemsAtIndexes:withEvent:offset:'; { available in 10_6 }
  148. function collectionView_validateDrop_proposedIndex_dropOperation (collectionView: NSCollectionView; draggingInfo: NSDraggingInfoProtocol; proposedDropIndex: NSIntegerPtr; proposedDropOperation: NSCollectionViewDropOperationPtr): NSDragOperation; message 'collectionView:validateDrop:proposedIndex:dropOperation:'; { available in 10_6 }
  149. function collectionView_acceptDrop_index_dropOperation (collectionView: NSCollectionView; draggingInfo: NSDraggingInfoProtocol; index: NSInteger; dropOperation: NSCollectionViewDropOperation): ObjCBOOL; message 'collectionView:acceptDrop:index:dropOperation:'; { available in 10_6 }
  150. function collectionView_pasteboardWriterForItemAtIndex (collectionView: NSCollectionView; index: NSUInteger): NSPasteboardWritingProtocol; message 'collectionView:pasteboardWriterForItemAtIndex:';
  151. procedure collectionView_draggingSession_willBeginAtPoint_forItemsAtIndexes (collectionView: NSCollectionView; session: NSDraggingSession; screenPoint: NSPoint; indexes: NSIndexSet); message 'collectionView:draggingSession:willBeginAtPoint:forItemsAtIndexes:';
  152. procedure collectionView_draggingSession_endedAtPoint_dragOperation (collectionView: NSCollectionView; session: NSDraggingSession; screenPoint: NSPoint; operation: NSDragOperation); message 'collectionView:draggingSession:endedAtPoint:dragOperation:';
  153. procedure collectionView_updateDraggingItemsForDrag (collectionView: NSCollectionView; draggingInfo: NSDraggingInfoProtocol); message 'collectionView:updateDraggingItemsForDrag:';
  154. end;
  155. {$endif}