chore(macos): vendor system-sdk dependency
This commit is contained in:
		
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -0,0 +1,273 @@
 | 
			
		||||
/*
 | 
			
		||||
	AppKit.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
 | 
			
		||||
	This file is included by all AppKit application source files for easy building.  Using this file is preferred over importing individual files because it will use a precompiled version.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <AppKit/AppKitErrors.h>
 | 
			
		||||
#import <AppKit/NSGraphicsContext.h>
 | 
			
		||||
#import <AppKit/NSAccessibility.h>
 | 
			
		||||
#import <AppKit/NSActionCell.h>
 | 
			
		||||
#import <AppKit/NSAlert.h>
 | 
			
		||||
#import <AppKit/NSAnimationContext.h>
 | 
			
		||||
#import <AppKit/NSAppearance.h>
 | 
			
		||||
#import <AppKit/NSAppleScriptExtensions.h>
 | 
			
		||||
#import <AppKit/NSApplication.h>
 | 
			
		||||
#import <AppKit/NSBox.h>
 | 
			
		||||
#import <AppKit/NSButton.h>
 | 
			
		||||
#import <AppKit/NSButtonCell.h>
 | 
			
		||||
#import <AppKit/NSCandidateListTouchBarItem.h>
 | 
			
		||||
#import <AppKit/NSCell.h>
 | 
			
		||||
#import <AppKit/NSClipView.h>
 | 
			
		||||
#import <AppKit/NSCollectionView.h>
 | 
			
		||||
#import <AppKit/NSCollectionViewLayout.h>
 | 
			
		||||
#import <AppKit/NSCollectionViewCompositionalLayout.h>
 | 
			
		||||
#import <AppKit/NSCollectionViewFlowLayout.h>
 | 
			
		||||
#import <AppKit/NSCollectionViewGridLayout.h>
 | 
			
		||||
#import <AppKit/NSCollectionViewTransitionLayout.h>
 | 
			
		||||
#import <AppKit/NSColorSampler.h>
 | 
			
		||||
#import <AppKit/NSControl.h>
 | 
			
		||||
#import <AppKit/NSDiffableDataSource.h>
 | 
			
		||||
#import <AppKit/NSDockTile.h>
 | 
			
		||||
#import <AppKit/NSFont.h>
 | 
			
		||||
#import <AppKit/NSFontAssetRequest.h>
 | 
			
		||||
#import <AppKit/NSFontCollection.h>
 | 
			
		||||
#import <AppKit/NSFontDescriptor.h>
 | 
			
		||||
#import <AppKit/NSFontManager.h>
 | 
			
		||||
#import <AppKit/NSFontPanel.h>
 | 
			
		||||
#import <AppKit/NSForm.h>
 | 
			
		||||
#import <AppKit/NSFormCell.h>
 | 
			
		||||
#import <AppKit/NSMatrix.h>
 | 
			
		||||
#import <AppKit/NSMenu.h>
 | 
			
		||||
#import <AppKit/NSMenuItem.h>
 | 
			
		||||
#import <AppKit/NSColor.h>
 | 
			
		||||
#import <AppKit/NSColorSpace.h>
 | 
			
		||||
#import <AppKit/NSBitmapImageRep.h>
 | 
			
		||||
#import <AppKit/NSBrowser.h>
 | 
			
		||||
#import <AppKit/NSBrowserCell.h>
 | 
			
		||||
#import <AppKit/NSCachedImageRep.h>
 | 
			
		||||
#import <AppKit/NSCIImageRep.h>
 | 
			
		||||
#import <AppKit/NSColorList.h>
 | 
			
		||||
#import <AppKit/NSColorPanel.h>
 | 
			
		||||
#import <AppKit/NSColorPicking.h>
 | 
			
		||||
#import <AppKit/NSColorPicker.h>
 | 
			
		||||
#import <AppKit/NSColorPickerTouchBarItem.h>
 | 
			
		||||
#import <AppKit/NSColorWell.h>
 | 
			
		||||
#import <AppKit/NSUserInterfaceCompression.h>
 | 
			
		||||
#import <AppKit/NSCursor.h>
 | 
			
		||||
#import <AppKit/NSCustomImageRep.h>
 | 
			
		||||
#import <AppKit/NSCustomTouchBarItem.h>
 | 
			
		||||
#import <AppKit/NSDocument.h>
 | 
			
		||||
#import <AppKit/NSDocumentController.h>
 | 
			
		||||
#import <AppKit/NSDragging.h>
 | 
			
		||||
#import <AppKit/NSDraggingItem.h>
 | 
			
		||||
#import <AppKit/NSDraggingSession.h>
 | 
			
		||||
#import <AppKit/NSFilePromiseProvider.h>
 | 
			
		||||
#import <AppKit/NSFilePromiseReceiver.h>
 | 
			
		||||
#import <AppKit/NSEPSImageRep.h>
 | 
			
		||||
#import <AppKit/NSErrors.h>
 | 
			
		||||
#import <AppKit/NSEvent.h>
 | 
			
		||||
#import <AppKit/NSFileWrapperExtensions.h>
 | 
			
		||||
#import <AppKit/NSHelpManager.h>
 | 
			
		||||
#import <AppKit/NSGradient.h>
 | 
			
		||||
#import <AppKit/NSGraphics.h>
 | 
			
		||||
#import <AppKit/NSGroupTouchBarItem.h>
 | 
			
		||||
#import <AppKit/NSGestureRecognizer.h>
 | 
			
		||||
#import <AppKit/NSClickGestureRecognizer.h>
 | 
			
		||||
#import <AppKit/NSPanGestureRecognizer.h>
 | 
			
		||||
#import <AppKit/NSPressGestureRecognizer.h>
 | 
			
		||||
#import <AppKit/NSMagnificationGestureRecognizer.h>
 | 
			
		||||
#import <AppKit/NSRotationGestureRecognizer.h>
 | 
			
		||||
#import <AppKit/NSLayoutConstraint.h>
 | 
			
		||||
#import <AppKit/NSLayoutGuide.h>
 | 
			
		||||
#import <AppKit/NSLayoutAnchor.h>
 | 
			
		||||
#import <AppKit/NSImage.h>
 | 
			
		||||
#import <AppKit/NSImageCell.h>
 | 
			
		||||
#import <AppKit/NSImageRep.h>
 | 
			
		||||
#import <AppKit/NSImageView.h>
 | 
			
		||||
#import <AppKit/NSNib.h>
 | 
			
		||||
#import <AppKit/NSNibLoading.h>
 | 
			
		||||
#import <AppKit/NSPrinter.h>
 | 
			
		||||
#import <AppKit/NSScrubber.h>
 | 
			
		||||
#import <AppKit/NSScrubberItemView.h>
 | 
			
		||||
#import <AppKit/NSScrubberLayout.h>
 | 
			
		||||
#import <AppKit/NSSharingServicePickerTouchBarItem.h>
 | 
			
		||||
#import <AppKit/NSSliderAccessory.h>
 | 
			
		||||
#import <AppKit/NSSliderTouchBarItem.h>
 | 
			
		||||
#import <AppKit/NSSpeechRecognizer.h>
 | 
			
		||||
#import <AppKit/NSSpeechSynthesizer.h>
 | 
			
		||||
#import <AppKit/NSSpellChecker.h>
 | 
			
		||||
#import <AppKit/NSSplitView.h>
 | 
			
		||||
#import <AppKit/NSSplitViewController.h>
 | 
			
		||||
#import <AppKit/NSOpenPanel.h>
 | 
			
		||||
#import <AppKit/NSPageLayout.h>
 | 
			
		||||
#import <AppKit/NSPanel.h>
 | 
			
		||||
#import <AppKit/NSPasteboard.h>
 | 
			
		||||
#import <AppKit/NSPasteboardItem.h>
 | 
			
		||||
#import <AppKit/NSPopoverTouchBarItem.h>
 | 
			
		||||
#import <AppKit/NSPopUpButton.h>
 | 
			
		||||
#import <AppKit/NSPrintInfo.h>
 | 
			
		||||
#import <AppKit/NSPrintOperation.h>
 | 
			
		||||
#import <AppKit/NSPrintPanel.h>
 | 
			
		||||
#import <AppKit/NSPDFInfo.h>
 | 
			
		||||
#import <AppKit/NSPDFPanel.h>
 | 
			
		||||
#import <AppKit/NSResponder.h>
 | 
			
		||||
#import <AppKit/NSSavePanel.h>
 | 
			
		||||
#import <AppKit/NSMediaLibraryBrowserController.h>
 | 
			
		||||
#import <AppKit/NSScreen.h>
 | 
			
		||||
#import <AppKit/NSScrollView.h>
 | 
			
		||||
#import <AppKit/NSScroller.h>
 | 
			
		||||
#import <AppKit/NSSegmentedControl.h>
 | 
			
		||||
#import <AppKit/NSSegmentedCell.h>
 | 
			
		||||
#import <AppKit/NSSharingService.h>
 | 
			
		||||
#import <AppKit/NSSlider.h>
 | 
			
		||||
#import <AppKit/NSSliderCell.h>
 | 
			
		||||
#import <AppKit/NSSpellProtocol.h>
 | 
			
		||||
#import <AppKit/NSStackView.h>
 | 
			
		||||
#import <AppKit/NSSwitch.h>
 | 
			
		||||
#import <AppKit/NSGridView.h>
 | 
			
		||||
#import <AppKit/NSText.h>
 | 
			
		||||
#import <AppKit/NSTextCheckingClient.h>
 | 
			
		||||
#import <AppKit/NSTextCheckingController.h>
 | 
			
		||||
#import <AppKit/NSTextField.h>
 | 
			
		||||
#import <AppKit/NSTextFieldCell.h>
 | 
			
		||||
#import <AppKit/NSText.h>
 | 
			
		||||
#import <AppKit/NSTokenField.h>
 | 
			
		||||
#import <AppKit/NSTokenFieldCell.h>
 | 
			
		||||
#import <AppKit/NSTouchBar.h>
 | 
			
		||||
#import <AppKit/NSTouchBarItem.h>
 | 
			
		||||
#import <AppKit/NSTrackingArea.h>
 | 
			
		||||
#import <AppKit/NSTrackingSeparatorToolbarItem.h>
 | 
			
		||||
#import <AppKit/NSUserActivity.h>
 | 
			
		||||
#import <AppKit/NSView.h>
 | 
			
		||||
#import <AppKit/NSViewController.h>
 | 
			
		||||
#import <AppKit/NSWindow.h>
 | 
			
		||||
#import <AppKit/NSWindowTab.h>
 | 
			
		||||
#import <AppKit/NSWindowTabGroup.h>
 | 
			
		||||
#import <AppKit/NSWindowController.h>
 | 
			
		||||
#import <AppKit/NSWorkspace.h>
 | 
			
		||||
#import <AppKit/NSRunningApplication.h>
 | 
			
		||||
#import <AppKit/NSComboBox.h>
 | 
			
		||||
#import <AppKit/NSComboBoxCell.h>
 | 
			
		||||
#import <AppKit/NSTableCellView.h>
 | 
			
		||||
#import <AppKit/NSTableColumn.h>
 | 
			
		||||
#import <AppKit/NSTableHeaderCell.h>
 | 
			
		||||
#import <AppKit/NSTableHeaderView.h>
 | 
			
		||||
#import <AppKit/NSTableRowView.h>
 | 
			
		||||
#import <AppKit/NSTableView.h>
 | 
			
		||||
#import <AppKit/NSTableViewDiffableDataSource.h>
 | 
			
		||||
#import <AppKit/NSTableViewRowAction.h>
 | 
			
		||||
#import <AppKit/NSOutlineView.h>
 | 
			
		||||
#import <AppKit/NSAttributedString.h>
 | 
			
		||||
#import <AppKit/NSLayoutManager.h>
 | 
			
		||||
#import <AppKit/NSParagraphStyle.h>
 | 
			
		||||
#import <AppKit/NSTextStorage.h>
 | 
			
		||||
#import <AppKit/NSTextView.h>
 | 
			
		||||
#import <AppKit/NSTextContainer.h>
 | 
			
		||||
#import <AppKit/NSTextAttachment.h>
 | 
			
		||||
#import <AppKit/NSInputManager.h>
 | 
			
		||||
#import <AppKit/NSInputServer.h>
 | 
			
		||||
#import <AppKit/NSStringDrawing.h>
 | 
			
		||||
#import <AppKit/NSRulerMarker.h>
 | 
			
		||||
#import <AppKit/NSRulerView.h>
 | 
			
		||||
#import <AppKit/NSSecureTextField.h>
 | 
			
		||||
#import <AppKit/NSInterfaceStyle.h>
 | 
			
		||||
#import <AppKit/NSNibDeclarations.h>
 | 
			
		||||
#import <AppKit/NSProgressIndicator.h>
 | 
			
		||||
#import <AppKit/NSTabView.h>
 | 
			
		||||
#import <AppKit/NSTabViewController.h>
 | 
			
		||||
#import <AppKit/NSTabViewItem.h>
 | 
			
		||||
#import <AppKit/NSMenuItemCell.h>
 | 
			
		||||
#import <AppKit/NSPopUpButtonCell.h>
 | 
			
		||||
#import <AppKit/NSAffineTransform.h>
 | 
			
		||||
#import <AppKit/NSBezierPath.h>
 | 
			
		||||
#import <AppKit/NSPICTImageRep.h>
 | 
			
		||||
#import <AppKit/NSStatusBar.h>
 | 
			
		||||
#import <AppKit/NSStatusBarButton.h>
 | 
			
		||||
#import <AppKit/NSStatusItem.h>
 | 
			
		||||
#import <AppKit/NSSound.h>
 | 
			
		||||
#import <AppKit/NSMovie.h>
 | 
			
		||||
#import <AppKit/NSPDFImageRep.h>
 | 
			
		||||
#import <AppKit/NSDrawer.h>
 | 
			
		||||
#import <AppKit/NSOpenGL.h>
 | 
			
		||||
#import <AppKit/NSOpenGLLayer.h>
 | 
			
		||||
#import <AppKit/NSOpenGLView.h>
 | 
			
		||||
#import <AppKit/NSApplicationScripting.h>
 | 
			
		||||
#import <AppKit/NSDocumentScripting.h>
 | 
			
		||||
#import <AppKit/NSTextStorageScripting.h>
 | 
			
		||||
#import <AppKit/NSToolbar.h>
 | 
			
		||||
#import <AppKit/NSToolbarItem.h>
 | 
			
		||||
#import <AppKit/NSToolbarItemGroup.h>
 | 
			
		||||
#import <AppKit/NSMenuToolbarItem.h>
 | 
			
		||||
#import <AppKit/NSSharingServicePickerToolbarItem.h>
 | 
			
		||||
#import <AppKit/NSWindowScripting.h>
 | 
			
		||||
#import <AppKit/NSStepper.h>
 | 
			
		||||
#import <AppKit/NSStepperCell.h>
 | 
			
		||||
#import <AppKit/NSGlyphInfo.h>
 | 
			
		||||
#import <AppKit/NSShadow.h>
 | 
			
		||||
#import <AppKit/NSATSTypesetter.h>
 | 
			
		||||
#import <AppKit/NSGlyphGenerator.h>
 | 
			
		||||
#import <AppKit/NSSearchField.h>
 | 
			
		||||
#import <AppKit/NSSearchFieldCell.h>
 | 
			
		||||
#import <AppKit/NSController.h>
 | 
			
		||||
#import <AppKit/NSObjectController.h>
 | 
			
		||||
#import <AppKit/NSArrayController.h>
 | 
			
		||||
#import <AppKit/NSDictionaryController.h>
 | 
			
		||||
#import <AppKit/NSTreeNode.h>
 | 
			
		||||
#import <AppKit/NSTreeController.h>
 | 
			
		||||
#import <AppKit/NSUserDefaultsController.h>
 | 
			
		||||
#import <AppKit/NSKeyValueBinding.h>
 | 
			
		||||
#import <AppKit/NSTextList.h>
 | 
			
		||||
#import <AppKit/NSTextTable.h>
 | 
			
		||||
#import <AppKit/NSDatePickerCell.h>
 | 
			
		||||
#import <AppKit/NSDatePicker.h>
 | 
			
		||||
#import <AppKit/NSLevelIndicatorCell.h>
 | 
			
		||||
#import <AppKit/NSLevelIndicator.h>
 | 
			
		||||
#import <AppKit/NSAnimation.h>
 | 
			
		||||
#import <AppKit/NSPersistentDocument.h>
 | 
			
		||||
#import <AppKit/NSRuleEditor.h>
 | 
			
		||||
#import <AppKit/NSPredicateEditor.h>
 | 
			
		||||
#import <AppKit/NSPredicateEditorRowTemplate.h>
 | 
			
		||||
#import <AppKit/NSPathCell.h>
 | 
			
		||||
#import <AppKit/NSPathControl.h>
 | 
			
		||||
#import <AppKit/NSPathComponentCell.h>
 | 
			
		||||
#import <AppKit/NSPathControlItem.h>
 | 
			
		||||
#import <AppKit/NSPageController.h>
 | 
			
		||||
#import <AppKit/NSPopover.h>
 | 
			
		||||
#import <AppKit/NSTextInputClient.h>
 | 
			
		||||
#import <AppKit/NSTextInputContext.h>
 | 
			
		||||
#import <AppKit/NSUserInterfaceItemSearching.h>
 | 
			
		||||
#import <AppKit/NSUserInterfaceLayout.h>
 | 
			
		||||
#import <AppKit/NSTouch.h>
 | 
			
		||||
#import <AppKit/NSWindowRestoration.h>
 | 
			
		||||
#import <AppKit/NSTextAlternatives.h>
 | 
			
		||||
#import <AppKit/NSStoryboard.h>
 | 
			
		||||
#import <AppKit/NSStoryboardSegue.h>
 | 
			
		||||
#import <AppKit/NSVisualEffectView.h>
 | 
			
		||||
#import <AppKit/NSItemProvider.h>
 | 
			
		||||
#import <AppKit/NSTitlebarAccessoryViewController.h>
 | 
			
		||||
#import <AppKit/NSDataAsset.h>
 | 
			
		||||
#import <AppKit/NSAlignmentFeedbackFilter.h>
 | 
			
		||||
#import <AppKit/NSHapticFeedback.h>
 | 
			
		||||
#import <AppKit/NSPressureConfiguration.h>
 | 
			
		||||
#import <AppKit/NSButtonTouchBarItem.h>
 | 
			
		||||
#import <AppKit/NSPickerTouchBarItem.h>
 | 
			
		||||
#import <AppKit/NSStepperTouchBarItem.h>
 | 
			
		||||
#import <AppKit/NSTintConfiguration.h>
 | 
			
		||||
#import <AppKit/NSSearchToolbarItem.h>
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSTextRange.h>
 | 
			
		||||
#import <AppKit/NSTextSelection.h>
 | 
			
		||||
#import <AppKit/NSTextSelectionNavigation.h>
 | 
			
		||||
#import <AppKit/NSTextContentManager.h>
 | 
			
		||||
#import <AppKit/NSTextElement.h>
 | 
			
		||||
#import <AppKit/NSTextLayoutFragment.h>
 | 
			
		||||
#import <AppKit/NSTextLayoutManager.h>
 | 
			
		||||
#import <AppKit/NSTextLineFragment.h>
 | 
			
		||||
#import <AppKit/NSTextViewportLayoutController.h>
 | 
			
		||||
#import <AppKit/NSTextAttachmentCell.h>
 | 
			
		||||
@@ -0,0 +1,52 @@
 | 
			
		||||
/*
 | 
			
		||||
	AppKitDefines.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1995-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
#ifndef _APPKITDEFINES_H
 | 
			
		||||
#define _APPKITDEFINES_H
 | 
			
		||||
 | 
			
		||||
#import <AvailabilityMacros.h>
 | 
			
		||||
#import <Foundation/NSObjCRuntime.h>
 | 
			
		||||
 | 
			
		||||
#ifndef AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_0
 | 
			
		||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_0 DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER
 | 
			
		||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER
 | 
			
		||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER
 | 
			
		||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER
 | 
			
		||||
#define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER
 | 
			
		||||
#define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER
 | 
			
		||||
#define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6 DEPRECATED_IN_MAC_OS_X_VERSION_10_6_AND_LATER
 | 
			
		||||
#define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
#define APPKIT_EXTERN		extern "C"
 | 
			
		||||
#define APPKIT_PRIVATE_EXTERN	__attribute__((visibility("hidden"))) extern "C"
 | 
			
		||||
#define APPKIT_PRIVATE          __attribute__((visibility("hidden")))
 | 
			
		||||
#else
 | 
			
		||||
#define APPKIT_EXTERN		extern
 | 
			
		||||
#define APPKIT_PRIVATE_EXTERN	__attribute__((visibility("hidden"))) extern
 | 
			
		||||
#define APPKIT_PRIVATE          __attribute__((visibility("hidden")))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef NS_SWIFT_BRIDGED_TYPEDEF
 | 
			
		||||
#if __has_attribute(swift_bridged_typedef)
 | 
			
		||||
#define NS_SWIFT_BRIDGED_TYPEDEF __attribute__((swift_bridged_typedef))
 | 
			
		||||
#else
 | 
			
		||||
#define NS_SWIFT_BRIDGED_TYPEDEF
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* These macros are for AppKit's own use. They may be modified or removed in a future release. */
 | 
			
		||||
#ifndef APPKIT_IVAR
 | 
			
		||||
#define APPKIT_IVAR DEPRECATED_MSG_ATTRIBUTE("AppKit instance variables are private, and the ability to access them will be removed in a future release.")
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST API_UNAVAILABLE_BEGIN(ios)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif // _APPKITDEFINES_H
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,55 @@
 | 
			
		||||
/*
 | 
			
		||||
	AppKitErrors.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2004-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
/* NSError codes for AppKit added errors in NSCocoaErrorDomain.  Foundation error codes can be found in <Foundation/FoundationErrors.h>; CoreData error codes in <CoreData/CoreDataErrors.h>.
 | 
			
		||||
*/
 | 
			
		||||
enum {
 | 
			
		||||
    NSTextReadInapplicableDocumentTypeError = 65806,		// NSAttributedString parsing error
 | 
			
		||||
    NSTextWriteInapplicableDocumentTypeError = 66062,		// NSAttributedString generating error
 | 
			
		||||
 | 
			
		||||
    // Inclusive error range definitions, for checking future error codes
 | 
			
		||||
    NSTextReadWriteErrorMinimum = 65792,
 | 
			
		||||
    NSTextReadWriteErrorMaximum = 66303,
 | 
			
		||||
 | 
			
		||||
    // Font error codes
 | 
			
		||||
    NSFontAssetDownloadError API_AVAILABLE(macos(10.13)) = 66304,  // Generic code when font asset download error occurs.
 | 
			
		||||
    NSFontErrorMinimum API_AVAILABLE(macos(10.13)) = 66304,
 | 
			
		||||
    NSFontErrorMaximum API_AVAILABLE(macos(10.13)) = 66335,
 | 
			
		||||
    
 | 
			
		||||
    // Service error codes
 | 
			
		||||
    NSServiceApplicationNotFoundError = 66560,			// The service provider could not be found.
 | 
			
		||||
    NSServiceApplicationLaunchFailedError = 66561,		// The service providing application could not be launched.  This will typically contain an underlying error with an LS error code (check MacErrors.h for their meanings).
 | 
			
		||||
    NSServiceRequestTimedOutError = 66562,			// The service providing application did not open its service listening port in time, or the app didn't respond to the request in time; see the Console log to figure out which (the errors are typically reported the same way to the user).
 | 
			
		||||
    NSServiceInvalidPasteboardDataError = 66563,		// The service providing app did not return a pasteboard with any of the promised types, or we couldn't write the data from the pasteboard to the object receiving the returned data.
 | 
			
		||||
    NSServiceMalformedServiceDictionaryError = 66564,		// The service dictionary did not contain the necessary keys.  Messages will typically be logged to the console giving more details.
 | 
			
		||||
    NSServiceMiscellaneousError = 66800,			// Other errors, representing programmatic mistakes in the service consuming application.  These show a generic error message to the user.
 | 
			
		||||
    
 | 
			
		||||
    // Inclusive service error range, for checking future error codes
 | 
			
		||||
    NSServiceErrorMinimum = 66560,
 | 
			
		||||
    NSServiceErrorMaximum = 66817,
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    // Sharing Service Error    
 | 
			
		||||
    NSSharingServiceNotConfiguredError = 67072,                // The service is not configured in the Preferences
 | 
			
		||||
    
 | 
			
		||||
    // Inclusive service error range, for checking future error codes
 | 
			
		||||
    NSSharingServiceErrorMinimum = 67072,
 | 
			
		||||
    NSSharingServiceErrorMaximum = 67327,
 | 
			
		||||
 | 
			
		||||
    // NSWorkspaceAuthorization
 | 
			
		||||
    NSWorkspaceAuthorizationInvalidError API_AVAILABLE(macos(10.14)) = 67328,
 | 
			
		||||
    NSWorkspaceErrorMinimum API_AVAILABLE(macos(10.14)) = 67328,
 | 
			
		||||
    NSWorkspaceErrorMaximum API_AVAILABLE(macos(10.14)) = 67455,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,102 @@
 | 
			
		||||
#if !__has_include(<UIFoundation/NSATSTypesetter.h>)
 | 
			
		||||
/*
 | 
			
		||||
        NSATSTypesetter.h
 | 
			
		||||
        Application Kit
 | 
			
		||||
        Copyright (c) 2002-2021, Apple Inc.
 | 
			
		||||
        All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSTypesetter.h>
 | 
			
		||||
#import <AppKit/NSParagraphStyle.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
 | 
			
		||||
NS_AUTOMATED_REFCOUNT_WEAK_UNAVAILABLE
 | 
			
		||||
@interface NSATSTypesetter : NSTypesetter
 | 
			
		||||
 | 
			
		||||
// Factory methods
 | 
			
		||||
@property (class, readonly, strong) NSATSTypesetter *sharedTypesetter;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSATSTypesetter (NSPantherCompatibility)
 | 
			
		||||
// Use -getLineFragmentRect:usedRect:forStartingGlyphAtIndex:proposedRect:lineSpacing:paragraphSpacingBefore:paragraphSpacingAfter:remainingRect: instead
 | 
			
		||||
- (NSRect)lineFragmentRectForProposedRect:(NSRect)proposedRect remainingRect:(null_unspecified NSRectPointer)remainingRect API_DEPRECATED("", macos(10.3,10.4));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
// The following interfaces are moved to the abstract NSTypesetter class
 | 
			
		||||
 | 
			
		||||
@interface NSATSTypesetter (NSPrimitiveInterface)
 | 
			
		||||
/* Privmitive typesetting methods */
 | 
			
		||||
// NSLayoutManager attributes
 | 
			
		||||
@property BOOL usesFontLeading;
 | 
			
		||||
@property NSTypesetterBehavior typesetterBehavior;
 | 
			
		||||
@property float hyphenationFactor;
 | 
			
		||||
 | 
			
		||||
// NSTextContainer attributes
 | 
			
		||||
@property CGFloat lineFragmentPadding;
 | 
			
		||||
 | 
			
		||||
// Screen/printer font mapping
 | 
			
		||||
- (NSFont *)substituteFontForFont:(NSFont *)originalFont;
 | 
			
		||||
 | 
			
		||||
// Tab stops
 | 
			
		||||
- (nullable NSTextTab *)textTabForGlyphLocation:(CGFloat)glyphLocation writingDirection:(NSWritingDirection)direction maxLocation:(CGFloat)maxLocation;
 | 
			
		||||
 | 
			
		||||
// Bidi control
 | 
			
		||||
@property BOOL bidiProcessingEnabled; // Controls whether to perform bi-directional processing.  You can disable the layout stage if you know the parapgraph does not need this stage (i.e. the backing-store is in the display order) in -fillAttributesForGlyphsInRange:andParagraphSeparatorRange:.
 | 
			
		||||
 | 
			
		||||
// Accessors for required paragraph typesetting ivars (attributedString, paragraphGlyphRange, paragraphSeparatorGlyphRange
 | 
			
		||||
@property (nullable, assign) NSAttributedString *attributedString; // Note this method does not retain attrString
 | 
			
		||||
- (void)setParagraphGlyphRange:(NSRange)paragraphRange separatorGlyphRange:(NSRange)paragraphSeparatorRange;
 | 
			
		||||
@property (readonly) NSRange paragraphGlyphRange;
 | 
			
		||||
@property (readonly) NSRange paragraphSeparatorGlyphRange;
 | 
			
		||||
 | 
			
		||||
// layout primitive
 | 
			
		||||
- (NSUInteger)layoutParagraphAtPoint:(NSPoint *)lineFragmentOrigin; // lineFragmentOrigin specifies the upper-left corner of line fragment rect.  On return, set to the next origin. The method returns the next glyph index. Usually the index right after paragraph separator but can be inside the paragraph range (i.e. text container exhaustion)
 | 
			
		||||
 | 
			
		||||
// Line/paragraph spacing
 | 
			
		||||
- (CGFloat)lineSpacingAfterGlyphAtIndex:(NSUInteger)glyphIndex withProposedLineFragmentRect:(NSRect)rect;
 | 
			
		||||
- (CGFloat)paragraphSpacingBeforeGlyphAtIndex:(NSUInteger)glyphIndex withProposedLineFragmentRect:(NSRect)rect;
 | 
			
		||||
- (CGFloat)paragraphSpacingAfterGlyphAtIndex:(NSUInteger)glyphIndex withProposedLineFragmentRect:(NSRect)rect;
 | 
			
		||||
 | 
			
		||||
/* Cocoa Text System interface methods */
 | 
			
		||||
 | 
			
		||||
// Friend classes
 | 
			
		||||
@property (nullable, readonly, assign) NSLayoutManager *layoutManager;
 | 
			
		||||
@property (nullable, readonly, assign) NSTextContainer *currentTextContainer;
 | 
			
		||||
 | 
			
		||||
// Forces NSLayoutManager to invalidate glyph cache in range when invalidating layout
 | 
			
		||||
- (void)setHardInvalidation:(BOOL)flag forGlyphRange:(NSRange)glyphRange;
 | 
			
		||||
 | 
			
		||||
// This method calculates the line fragment rect/line fragment used rect for blank lines
 | 
			
		||||
// theParagraphSeparatorGlyphRange with length == 0 indicates extra line fragment
 | 
			
		||||
- (void)getLineFragmentRect:(NSRect *)lineFragmentRect usedRect:(NSRect *)lineFragmentUsedRect forParagraphSeparatorGlyphRange:(NSRange)paragraphSeparatorGlyphRange atProposedOrigin:(NSPoint)lineOrigin;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* NSLayoutPhaseInterface declares various subclass override points that are invoked if implemented */
 | 
			
		||||
@interface NSATSTypesetter (NSLayoutPhaseInterface)
 | 
			
		||||
// Called right before setLineFragmentRect:forGlyphRange:usedRect:
 | 
			
		||||
- (void)willSetLineFragmentRect:(NSRect *)lineRect forGlyphRange:(NSRange)glyphRange usedRect:(NSRect *)usedRect baselineOffset:(CGFloat *)baselineOffset;
 | 
			
		||||
 | 
			
		||||
- (BOOL)shouldBreakLineByWordBeforeCharacterAtIndex:(NSUInteger)charIndex;
 | 
			
		||||
- (BOOL)shouldBreakLineByHyphenatingBeforeCharacterAtIndex:(NSUInteger)charIndex;
 | 
			
		||||
 | 
			
		||||
- (float)hyphenationFactorForGlyphAtIndex:(NSUInteger)glyphIndex;
 | 
			
		||||
- (UTF32Char)hyphenCharacterForGlyphAtIndex:(NSUInteger)glyphIndex;
 | 
			
		||||
 | 
			
		||||
- (NSRect)boundingBoxForControlGlyphAtIndex:(NSUInteger)glyphIndex forTextContainer:(NSTextContainer *)textContainer proposedLineFragment:(NSRect)proposedRect glyphPosition:(NSPoint)glyphPosition characterIndex:(NSUInteger)charIndex;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* NSGlyphStorageInterface declares all primitives interfacing to the glyph storage (usually NSLayoutManager). By overriding all the methods, you can implement an NSATSTypesetter subclass that interacts with custom glyph storage. */
 | 
			
		||||
@interface NSATSTypesetter (NSGlyphStorageInterface)
 | 
			
		||||
// Glyph data
 | 
			
		||||
- (NSUInteger)getGlyphsInRange:(NSRange)glyphsRange glyphs:(null_unspecified NSGlyph *)glyphBuffer characterIndexes:(null_unspecified NSUInteger *)charIndexBuffer glyphInscriptions:(null_unspecified NSGlyphInscription *)inscribeBuffer elasticBits:(null_unspecified BOOL *)elasticBuffer API_DEPRECATED("", macos(10.3,10.13));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif // !TARGET_OS_IPHONE
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
#else
 | 
			
		||||
#import <UIFoundation/NSATSTypesetter.h>
 | 
			
		||||
#endif
 | 
			
		||||
@@ -0,0 +1,194 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSAccessibility.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2001-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <AppKit/NSErrors.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <AppKit/NSAccessibilityConstants.h>
 | 
			
		||||
#import <AppKit/NSAccessibilityProtocols.h>
 | 
			
		||||
#import <AppKit/NSAccessibilityElement.h>
 | 
			
		||||
#import <AppKit/NSAccessibilityCustomRotor.h>
 | 
			
		||||
// #import <AppKit/NSAccessibilityColor.h> - this caused a build failure (60459719), and needs to be disabled until 60467092 is addressed
 | 
			
		||||
#import <AppKit/NSWorkspace.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSString, NSArray, NSView;
 | 
			
		||||
 | 
			
		||||
/*** Accessibility Informal Protocol ***/
 | 
			
		||||
 | 
			
		||||
@interface NSObject (NSAccessibility)
 | 
			
		||||
 | 
			
		||||
/* Attribute methods
 | 
			
		||||
*/
 | 
			
		||||
- (NSArray<NSAccessibilityAttributeName> *)accessibilityAttributeNames API_DEPRECATED("Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)", macos(10.1,10.10));
 | 
			
		||||
- (nullable id)accessibilityAttributeValue:(NSAccessibilityAttributeName)attribute API_DEPRECATED("Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)", macos(10.1,10.10));
 | 
			
		||||
- (BOOL)accessibilityIsAttributeSettable:(NSAccessibilityAttributeName)attribute API_DEPRECATED("Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)", macos(10.1,10.10));
 | 
			
		||||
- (void)accessibilitySetValue:(nullable id)value forAttribute:(NSAccessibilityAttributeName)attribute API_DEPRECATED("Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)", macos(10.1,10.10));
 | 
			
		||||
 | 
			
		||||
/* Parameterized Attribute methods
 | 
			
		||||
*/
 | 
			
		||||
- (NSArray<NSAccessibilityParameterizedAttributeName> *)accessibilityParameterizedAttributeNames API_DEPRECATED("Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)", macos(10.1,10.10));
 | 
			
		||||
- (nullable id)accessibilityAttributeValue:(NSAccessibilityParameterizedAttributeName)attribute forParameter:(nullable id)parameter API_DEPRECATED("Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)", macos(10.1,10.10));
 | 
			
		||||
 | 
			
		||||
/* Accessibility action methods
 | 
			
		||||
*/
 | 
			
		||||
- (NSArray<NSAccessibilityActionName> *)accessibilityActionNames API_DEPRECATED("Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)", macos(10.1,10.10));
 | 
			
		||||
- (nullable NSString *)accessibilityActionDescription:(NSAccessibilityActionName)action API_DEPRECATED("Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)", macos(10.1,10.10));
 | 
			
		||||
- (void)accessibilityPerformAction:(NSAccessibilityActionName)action API_DEPRECATED("Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)", macos(10.1,10.10));
 | 
			
		||||
 | 
			
		||||
/* Return YES if the UIElement doesn't show up to the outside world - i.e. its parent should return the UIElement's children as its own - cutting the UIElement out. E.g. NSControls are ignored when they are single-celled.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)accessibilityIsIgnored API_DEPRECATED("Use isAccessibilityElement instead", macos(10.1,10.10));
 | 
			
		||||
 | 
			
		||||
/* Returns the deepest descendant of the UIElement hierarchy that contains the point. You can assume the point has already been determined to lie within the receiver. Override this method to do deeper hit testing within a UIElement - e.g. a NSMatrix would test its cells. The point is bottom-left relative screen coordinates.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable id)accessibilityHitTest:(NSPoint)point;
 | 
			
		||||
 | 
			
		||||
/* Returns the UI Element that has the focus. You can assume that the search for the focus has already been narrowed down to the receiver. Override this method to do a deeper search with a UIElement - e.g. a NSMatrix would determine if one of its cells has the focus.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, strong) id accessibilityFocusedUIElement;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* The following are optional methods to improve performance of accessible objects with large numbers of children or large numbers of UI Elements returned from attributes that return an array (selected children, or visible children, for instance).  The default implementation for these operations will call -accessibilityAttributeValue: to retrieve the entire array of values, and then perform the appropriate operation.  If these methods are implemented, they will be used instead.  For accessibility objects with many children, the results to these methods can sometimes be calculated without generating the entire array of children which can improve performance.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* Given an accessibility child of an object, return the index of that child in the parent.  If the provided object is not a child of the receiver, this method should return NSNotFound.
 | 
			
		||||
*/
 | 
			
		||||
- (NSUInteger)accessibilityIndexOfChild:(id)child;
 | 
			
		||||
 | 
			
		||||
/* Return the count of an accessibility array attribute.
 | 
			
		||||
*/
 | 
			
		||||
- (NSUInteger)accessibilityArrayAttributeCount:(NSAccessibilityAttributeName)attribute;
 | 
			
		||||
 | 
			
		||||
/* Return a subarray of values of an accessibility array attribute.  Note this method does not take a range.  The max count is the maximum desired number of items requested by an accessibility client.  This number may be beyond the bounds of your array.
 | 
			
		||||
*/
 | 
			
		||||
- (NSArray *)accessibilityArrayAttributeValues:(NSAccessibilityAttributeName)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Prior to OS X 10.9, the only accessible objects that could post accessibility notifications were those that inherited from NSView, NSWindow, or NSCell. An application's custom accessible object, subclassed from NSObject, could not post notifications.
 | 
			
		||||
 
 | 
			
		||||
 In 10.9 and later, an application's custom accessible object may post accessibility notifications if it follows the following guidelines:
 | 
			
		||||
 
 | 
			
		||||
 - the lifetime of the NSObject must match the lifetime of the corresponding element in the application's visual interface. It is common for a custom accessible object that acts as a proxy for an onscreen UI element to be autoreleased and deallocated very quickly, immediately after the application responds to a single accessibility request. This is not sufficient to support posting notifications, because any notification observers that are registered on the object will be removed as soon as the object is deallocated. Instead, the application must arrange for an accessible object that refers to a specific UI element to remain allocated as long as that UI element is visible.
 | 
			
		||||
 
 | 
			
		||||
 - the object must post the NSAccessibilityUIElementDestroyed notification at appropriate times, typically when the corresponding UI element in the application's visual interface is removed from the screen, and certainly when the accessible object is deallocated.
 | 
			
		||||
 
 | 
			
		||||
 - the object must implement -accessibilityNotifiesWhenDestroyed to return YES.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) BOOL accessibilityNotifiesWhenDestroyed API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSWorkspace (NSWorkspaceAccessibilityDisplay)
 | 
			
		||||
 | 
			
		||||
/* Get the current accessibility display option for high-contrast UI. If this is true, UI should be presented with high contrast such as utilizing a less subtle color palette or bolder lines. You may listen for NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification to be notified when this changes. */
 | 
			
		||||
@property (readonly) BOOL accessibilityDisplayShouldIncreaseContrast API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
/* Get the current accessibility display option for differentiate without color. If this is true, UI should not convey information using color alone and instead should use shapes or glyphs to convey information. You may listen for NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification to be notified when this changes. */
 | 
			
		||||
@property (readonly) BOOL accessibilityDisplayShouldDifferentiateWithoutColor API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
/* Get the current accessibility display option for reduce transparency. If this property's value is true, UI (mainly window) backgrounds should not be semi-transparent; they should be opaque. You may listen for NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification to be notified when this changes. */
 | 
			
		||||
@property (readonly) BOOL accessibilityDisplayShouldReduceTransparency API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
/* Get the current accessibility display option for reduce motion. If this property's value is true, UI should avoid large animations, especially those that simulate the third dimension. You may listen for NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification to be notified when this changes. */
 | 
			
		||||
@property (readonly) BOOL accessibilityDisplayShouldReduceMotion API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/* Get the current accessibility display option for invert colors. If this property's value is true then the display will be inverted. In these cases it may be needed for UI drawing to be adjusted to in order to display optimally when inverted.  You may listen for NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification to be notified when this changes. */
 | 
			
		||||
@property (readonly) BOOL accessibilityDisplayShouldInvertColors API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSWorkspace (NSWorkspaceAccessibility)
 | 
			
		||||
 | 
			
		||||
/* Indicates if VoiceOver is currently running. This is observable through KVO. */
 | 
			
		||||
@property (readonly, getter=isVoiceOverEnabled) BOOL voiceOverEnabled API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
/* Indicates if Switch Control is currently running. This is observable through KVO. */
 | 
			
		||||
@property (readonly, getter=isSwitchControlEnabled) BOOL switchControlEnabled API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* Notification posted to the NSWorkspace notification center when accessibility display options have changed. */
 | 
			
		||||
APPKIT_EXTERN NSNotificationName const NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
/*** Accessibility Related Methods ***/
 | 
			
		||||
 | 
			
		||||
@interface NSObject (NSAccessibilityAdditions)
 | 
			
		||||
 | 
			
		||||
/* For changing the set of attributes on an instance - as an alternative to sub-classing.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)accessibilitySetOverrideValue:(nullable id)value forAttribute:(NSAccessibilityAttributeName)attribute API_DEPRECATED("Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)", macos(10.1,10.10));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
// With a NSView and a relative frame, return the frame in screen coordinates for accessibility
 | 
			
		||||
APPKIT_EXTERN NSRect NSAccessibilityFrameInView(NSView *parentView, NSRect frame) API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// With a NSView and a relative point, return the frame in screen coordinates for accessibility
 | 
			
		||||
APPKIT_EXTERN NSPoint NSAccessibilityPointInView(NSView *parentView, NSPoint point) API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Setting whether the application may have protected content. Protected content is identified by a value of TRUE for the accessibility attribute NSAccessibilityContainsProtectedContentAttribute. If NSAccessibilityMayContainProtectedContent returns NO, then NSAccessibilityContainsProtectedContentAttribute is completely ignored.
 | 
			
		||||
 | 
			
		||||
    A return value of TRUE indicates success.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN BOOL NSAccessibilitySetMayContainProtectedContent(BOOL flag);
 | 
			
		||||
 | 
			
		||||
/* Getting descriptions for standard roles and actions.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN NSString * _Nullable NSAccessibilityRoleDescription(NSAccessibilityRole role, NSAccessibilitySubrole _Nullable subrole);
 | 
			
		||||
APPKIT_EXTERN NSString * _Nullable NSAccessibilityRoleDescriptionForUIElement(id element);
 | 
			
		||||
APPKIT_EXTERN NSString * _Nullable NSAccessibilityActionDescription(NSAccessibilityActionName action);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Error signaling for bad setter value or bad parameter.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN void NSAccessibilityRaiseBadArgumentException(_Null_unspecified id element, NSAccessibilityAttributeName _Null_unspecified attribute, _Null_unspecified id value) API_DEPRECATED("Exceptions are no longer appropriate for indicating errors in accessibility API. Unexpected values should be handled through appropriate type checking.", macos(10.1,10.11));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*** Ignored UIElements Utilities ***/
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN _Nullable id NSAccessibilityUnignoredAncestor(id element);
 | 
			
		||||
APPKIT_EXTERN _Nullable id NSAccessibilityUnignoredDescendant(id element);
 | 
			
		||||
APPKIT_EXTERN NSArray *NSAccessibilityUnignoredChildren(NSArray *originalChildren);
 | 
			
		||||
APPKIT_EXTERN NSArray *NSAccessibilityUnignoredChildrenForOnlyChild(id originalChild);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*** Posting Notifications ***/
 | 
			
		||||
 | 
			
		||||
/* Posts a notification to accessibility client observers.  Note that accessibility notifications are not NSNotifications and do not use the NSNotificationCenter mechanism.  These notifications are received by client processes using the AX API defined in <HIServices/Accessibility.h> including AXUIElement.h.
 | 
			
		||||
 | 
			
		||||
For all notifications, the observer receives the provided notification string and the AX API representation of the provided element. 
 | 
			
		||||
 | 
			
		||||
For most notifications, the provided element is checked for observers of the provided notification.
 | 
			
		||||
 | 
			
		||||
For some notifications, the accessibility parent of the provided element is checked for observers instead.  An example is NSAccessibilityCreatedNotification.  It is impossible for a client to register to observe this notification on a new element, since the element does not exist yet.  So, the function would be called passing in the new element, and the accessibility parent of the element is automatically checked for registered observers.
 | 
			
		||||
 | 
			
		||||
The following notifications check the accessibility parent of the provided element for observers: NSAccessibilityCreatedNotification, NSAccessibilityWindowCreatedNotification, NSAccessibilityDrawerCreatedNotification, NSAccessibilitySheetCreatedNotification, NSAccessibilityHelpTagCreatedNotification, NSAccessibilityRowExpandedNotification, NSAccessibilityRowCollapsedNotification.
 | 
			
		||||
 | 
			
		||||
For another set of notifications, the NSApp instance is always the observed element.  An example is NSAccessibilityFocusedUIElementChangedNotification.  The provided element would be the element that now has focus, and the function will automatically check NSApp for registered observers.
 | 
			
		||||
 | 
			
		||||
The following notifications always check for accessibility observers of NSApp: NSAccessibilityFocusedUIElementChangedNotification, NSAccessibilityFocusedWindowChangedNotification, NSAccessibilityMainWindowChangedNotification.
 | 
			
		||||
 | 
			
		||||
The rule of thumb is that the affected element should be passed into the function (the newly created element, the newly focused element, the row that was expanded, etc.), and the function will check for observer registrations on the correct element.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN void NSAccessibilityPostNotification(id element, NSAccessibilityNotificationName notification);
 | 
			
		||||
 | 
			
		||||
#ifdef __swift__
 | 
			
		||||
// This struct is not available in Objective-C. Its only purpose is to create a namespace for accessibility symbols in Swift.
 | 
			
		||||
typedef struct NSAccessibility { void *_reserved; } NSAccessibility;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,25 @@
 | 
			
		||||
/*
 | 
			
		||||
        NSAccessibilityColor.h
 | 
			
		||||
        Application Kit
 | 
			
		||||
        Copyright (c) 2020-2021, Apple Inc.
 | 
			
		||||
        All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
#import <AppKit/NSColor.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
API_AVAILABLE(macos(11.0)) @protocol NSAccessibilityColor
 | 
			
		||||
@required
 | 
			
		||||
/*!
 | 
			
		||||
 @brief Returns a localized description of the color for use in accessibility attributes.
 | 
			
		||||
*/
 | 
			
		||||
@property(readonly) NSString *accessibilityName;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSColor (NSAccessibilityColorConformance) <NSAccessibilityColor>
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,594 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSAccessibilityConstants.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2001-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
/*** Exception Constants ***/
 | 
			
		||||
 | 
			
		||||
// name for accessibility exception - declared in NSErrors.h
 | 
			
		||||
// APPKIT_EXTERN NSExceptionName NSAccessibilityException;
 | 
			
		||||
 | 
			
		||||
/* userInfo key for error codes in accessibility exceptions
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSString *const NSAccessibilityErrorCodeExceptionInfo;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*** Accessibility Constants ***/
 | 
			
		||||
 | 
			
		||||
/* Standard attributes
 | 
			
		||||
 */
 | 
			
		||||
typedef NSString * NSAccessibilityAttributeName NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityRoleAttribute;		//(NSAccessibilityRole) - type, non-localized (e.g. radioButton)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityRoleDescriptionAttribute;	//(NSString *) - user readable role (e.g. "radio button")
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySubroleAttribute;		//(NSAccessibilitySubrole) - type, non-localized (e.g. closeButton)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityHelpAttribute;		//(NSString *) - instance description (e.g. a tool tip)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityValueAttribute;		//(id)         - element's value
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityMinValueAttribute;		//(id)         - element's min value
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityMaxValueAttribute;		//(id)         - element's max value
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityEnabledAttribute;		//(NSNumber *) - (boolValue) responds to user?
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityFocusedAttribute;		//(NSNumber *) - (boolValue) has keyboard focus?
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityParentAttribute;		//(id)         - element containing you
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityChildrenAttribute;		//(NSArray *)  - elements you contain
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityWindowAttribute;		//(id)         - UIElement for the containing window
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityTopLevelUIElementAttribute;	//(id)         - UIElement for the containing top level element
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySelectedChildrenAttribute;	//(NSArray *)  - child elements which are selected
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityVisibleChildrenAttribute;	//(NSArray *)  - child elements which are visible
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityPositionAttribute;		//(NSValue *)  - (pointValue) position in screen coords
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySizeAttribute;		//(NSValue *)  - (sizeValue) size
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityContentsAttribute;		//(NSArray *)  - main elements
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityTitleAttribute;		//(NSString *) - visible text (e.g. of a push button)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityDescriptionAttribute;	//(NSString *) - instance description
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityShownMenuAttribute;		//(id)         - menu being displayed
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityValueDescriptionAttribute	//(NSString *)  - text description of value
 | 
			
		||||
API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySharedFocusElementsAttribute API_AVAILABLE(macos(10.10));  //(NSArray *)  - elements that share focus
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Misc attributes
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityPreviousContentsAttribute;	//(NSArray *)  - main elements
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityNextContentsAttribute;	//(NSArray *)  - main elements
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityHeaderAttribute;		//(id)         - UIElement for header.
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityEditedAttribute;		//(NSNumber *) - (boolValue) is it dirty?
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityTabsAttribute;		//(NSArray *)  - UIElements for tabs
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityHorizontalScrollBarAttribute;//(id)       - UIElement for the horizontal scroller
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityVerticalScrollBarAttribute;//(id)         - UIElement for the vertical scroller
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityOverflowButtonAttribute;	//(id)         - UIElement for overflow
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityIncrementButtonAttribute;	//(id)         - UIElement for increment
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityDecrementButtonAttribute;	//(id)         - UIElement for decrement
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityFilenameAttribute;		//(NSString *) - filename
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityExpandedAttribute;		//(NSNumber *) - (boolValue) is expanded?
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySelectedAttribute;		//(NSNumber *) - (boolValue) is selected?
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySplittersAttribute;	//(NSArray *)  - UIElements for splitters
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityDocumentAttribute;		//(NSString *) - url as string - for open document
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityActivationPointAttribute;           //(NSValue *)  - (pointValue)
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityURLAttribute;		//(NSURL *)    - url
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityIndexAttribute;		//(NSNumber *)  - (intValue)
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityRowCountAttribute		//(NSNumber *)  - (intValue) number of rows
 | 
			
		||||
API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityColumnCountAttribute	//(NSNumber *)  - (intValue) number of columns
 | 
			
		||||
API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityOrderedByRowAttribute	//(NSNumber *)  - (boolValue) is ordered by row?
 | 
			
		||||
API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityWarningValueAttribute	//(id)  - warning value of a level indicator, typically a number
 | 
			
		||||
API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityCriticalValueAttribute	//(id)  - critical value of a level indicator, typically a number
 | 
			
		||||
API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityPlaceholderValueAttribute	//(NSString *)  - placeholder value of a control such as a text field
 | 
			
		||||
API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityContainsProtectedContentAttribute API_AVAILABLE(macos(10.9));   // (NSNumber *) - (boolValue) contains protected content?
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityAlternateUIVisibleAttribute API_AVAILABLE(macos(10.10));  //(NSNumber *) - (boolValue)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityRequiredAttribute API_AVAILABLE(macos(10.12));  //(NSNumber *) - (boolValue) whether a form field is required to have content for successful submission of the form
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Linkage attributes
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityTitleUIElementAttribute;		//(id)	      - UIElement for the title
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityServesAsTitleForUIElementsAttribute; //(NSArray *) - UIElements this titles
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityLinkedUIElementsAttribute;		//(NSArray *) - corresponding UIElements
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Text-specific attributes
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySelectedTextAttribute;		//(NSString *) - selected text
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySelectedTextRangeAttribute;	//(NSValue *)  - (rangeValue) range of selected text
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityNumberOfCharactersAttribute;	//(NSNumber *) - number of characters
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityVisibleCharacterRangeAttribute;	//(NSValue *)  - (rangeValue) range of visible text
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySharedTextUIElementsAttribute;	//(NSArray *)  - text views sharing text
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySharedCharacterRangeAttribute;	//(NSValue *)  - (rangeValue) part of shared text in this view
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityInsertionPointLineNumberAttribute;	//(NSNumber *) - line# containing caret
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySelectedTextRangesAttribute	//(NSArray<NSValue *> *) - array of NSValue (rangeValue) ranges of selected text
 | 
			
		||||
API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Parameterized text-specific attributes
 | 
			
		||||
 */
 | 
			
		||||
typedef NSString * NSAccessibilityParameterizedAttributeName NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityParameterizedAttributeName const NSAccessibilityLineForIndexParameterizedAttribute;		//(NSNumber *) - line# for char index; param:(NSNumber *)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityParameterizedAttributeName const NSAccessibilityRangeForLineParameterizedAttribute;		//(NSValue *)  - (rangeValue) range of line; param:(NSNumber *)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityParameterizedAttributeName const NSAccessibilityStringForRangeParameterizedAttribute;	//(NSString *) - substring; param:(NSValue * - rangeValue)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityParameterizedAttributeName const NSAccessibilityRangeForPositionParameterizedAttribute;	//(NSValue *)  - (rangeValue) composed char range; param:(NSValue * - pointValue)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityParameterizedAttributeName const NSAccessibilityRangeForIndexParameterizedAttribute;	//(NSValue *)  - (rangeValue) composed char range; param:(NSNumber *)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityParameterizedAttributeName const NSAccessibilityBoundsForRangeParameterizedAttribute;	//(NSValue *)  - (rectValue) bounds of text; param:(NSValue * - rangeValue)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityParameterizedAttributeName const NSAccessibilityRTFForRangeParameterizedAttribute;		//(NSData *)   - rtf for text; param:(NSValue * - rangeValue)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityParameterizedAttributeName const NSAccessibilityStyleRangeForIndexParameterizedAttribute;	//(NSValue *)  - (rangeValue) extent of style run; param:(NSNumber *)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityParameterizedAttributeName const NSAccessibilityAttributedStringForRangeParameterizedAttribute; //(NSAttributedString *) - does _not_ use attributes from Appkit/AttributedString.h
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Text attributed string attributes and constants
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityFontTextAttribute;			//(NSDictionary<NSAccessibilityFontAttributeKey, id> *)
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityForegroundColorTextAttribute;	//CGColorRef
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityBackgroundColorTextAttribute;	//CGColorRef
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityUnderlineColorTextAttribute;	//CGColorRef
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityStrikethroughColorTextAttribute;	//CGColorRef
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityUnderlineTextAttribute;		//(NSNumber *)	    - underline style
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilitySuperscriptTextAttribute;		//(NSNumber *)	    - superscript>0, subscript<0
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityStrikethroughTextAttribute;		//(NSNumber *)	    - (boolValue)
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityShadowTextAttribute;		//(NSNumber *)	    - (boolValue)
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityAttachmentTextAttribute;		//id - corresponding element
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityLinkTextAttribute;			//id - corresponding element
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityAutocorrectedTextAttribute API_AVAILABLE(macos(10.7));		//(NSNumber *)	    - (boolValue)
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityTextAlignmentAttribute API_AVAILABLE(macos(10.12));		//(NSNumber *) - (NSTextAlignment)
 | 
			
		||||
 | 
			
		||||
/* Textual list attributes and constants. Examples: unordered or ordered lists in a document.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityListItemPrefixTextAttribute    API_AVAILABLE(macos(10.11));    // NSAttributedString, the prepended string of the list item. If the string is a common unicode character (e.g. a bullet •), return that unicode character. For lists with images before the text, return a reasonable label of the image.
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityListItemIndexTextAttribute     API_AVAILABLE(macos(10.11));    // NSNumber, integerValue of the line index. Each list item increments the index, even for unordered lists. The first item should have index 0.
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityListItemLevelTextAttribute     API_AVAILABLE(macos(10.11));    // NSNumber, integerValue of the indent level. Each sublist increments the level. The first item should have level 0.
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 About MisspelledText attributes for attribute strings:
 | 
			
		||||
 
 | 
			
		||||
 NSAccessibilityMisspelledTextAttribute was the original attribute to indicate misspelled text. In OS X 10.4, the Cocoa text system added support for NSAccessibilityMarkedMisspelledTextAttribute, which was used to indicate a word that was visibly marked as misspelled (for example, with a red squiggle underneath); the original MisspelledText attribute could also be used on text that was not visibly marked as mispelled (for example, a misspelled word that was currently being edited by the user).
 | 
			
		||||
 
 | 
			
		||||
 Typically, a screen reader only wants to vocalize what a sighted user could see, and so the MarkedMisspelledText attribute was adopted by VoiceOver to provide feedback to the user about misspelled text. In OS X 10.9, VoiceOver has entirely stopped using the original MisspelledText attribute, and now only checks for MarkedMisspelledText.
 | 
			
		||||
 
 | 
			
		||||
 When implementing accessibility for a custom text-editing engine, you should generally provide the MarkedMisspelledText attribute in order to support VoiceOver, especially in OS X 10.9 and later. You may optionally also support the MisspelledText attribute for compatibility with other accessibility clients.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityMisspelledTextAttribute;		//(NSNumber *)	    - (boolValue)
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityMarkedMisspelledTextAttribute API_AVAILABLE(macos(10.4));	//(NSNumber *) - (boolValue)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityLanguageTextAttribute API_AVAILABLE(macos(10.13)); //(NSString *) - BCP-47 langugage code to identify the language of a segment of string
 | 
			
		||||
 | 
			
		||||
// This key in attributed string allows developers to return an array of localized strings to describe custom text attributes
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityCustomTextAttribute API_AVAILABLE(macos(10.13));   //(NSArray *) - NSString per custom text attribute
 | 
			
		||||
/*
 | 
			
		||||
 NSAccessibilityAnnotationTextAttribute allows annotation information to be conveyed.  It returns an array to allow overlapping annotations.  Each annotation attribute dictionary can describe itself via the set of NSAccessibilityAnnotationAttributeKeys.
 | 
			
		||||
    NSAccessibilityAnnotationLabel: Describe the annotation
 | 
			
		||||
    NSAccessibilityAnnotationElement: Annotation UIElement.  Should return this if the element is interactive.
 | 
			
		||||
    NSAccessibilityAnnotationLocation: The position where the annotation applies.  Generally, this is the entire range.  But in the case where the annotation, like a comment arrow, points to a position between two characters, the range is zero.  Since NSAttributedString requires adding an attribute to string of length greater than zero, the string nearest the annotation with at least length of one needs to be returned.  So NSAccessibilityAnnotationLocation is a way to indicate exactly which end of that range the annotation is intended.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSAccessibilityAnnotationTextAttribute API_AVAILABLE(macos(10.13));   //(NSArray *) - (NSDictionary<NSAccessibilityAnnotationAttributeKey, id> *)
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSAccessibilityAnnotationAttributeKey NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAnnotationAttributeKey const NSAccessibilityAnnotationLabel API_AVAILABLE(macos(10.13)); // required (NSString *)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAnnotationAttributeKey const NSAccessibilityAnnotationElement API_AVAILABLE(macos(10.13)); // optional (id) - UIElement for the annotation object
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAnnotationAttributeKey const NSAccessibilityAnnotationLocation API_AVAILABLE(macos(10.13)); // optional (NSNumber *) - (NSAccessibilityAnnotationPosition)
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSAccessibilityAnnotationPosition) {
 | 
			
		||||
    NSAccessibilityAnnotationPositionFullRange,
 | 
			
		||||
    NSAccessibilityAnnotationPositionStart,
 | 
			
		||||
    NSAccessibilityAnnotationPositionEnd,
 | 
			
		||||
} API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSAccessibilityFontAttributeKey NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityFontAttributeKey const NSAccessibilityFontNameKey;	// required
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityFontAttributeKey const NSAccessibilityFontFamilyKey;	// optional
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityFontAttributeKey const NSAccessibilityVisibleNameKey;	// optional
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityFontAttributeKey const NSAccessibilityFontSizeKey;	// required
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Window-specific attributes
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityMainAttribute;		//(NSNumber *) - (boolValue) is it the main window?
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityMinimizedAttribute;	//(NSNumber *) - (boolValue) is window minimized?
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityCloseButtonAttribute;	//(id) - UIElement for close box (or nil)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityZoomButtonAttribute;	//(id) - UIElement for zoom box (or nil)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityMinimizeButtonAttribute;	//(id) - UIElement for miniaturize box (or nil)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityToolbarButtonAttribute;	//(id) - UIElement for toolbar box (or nil)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityProxyAttribute;		//(id) - UIElement for title's icon (or nil)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityGrowAreaAttribute;		//(id) - UIElement for grow box (or nil)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityModalAttribute;		//(NSNumber *) - (boolValue) is the window modal
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityDefaultButtonAttribute;	//(id) - UIElement for default button
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityCancelButtonAttribute;	//(id) - UIElement for cancel button
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityFullScreenButtonAttribute API_AVAILABLE(macos(10.7)); //(id) - UIElement for full screen button (or nil)
 | 
			
		||||
 | 
			
		||||
/* Application-specific attributes
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityMenuBarAttribute;		//(id)         - UIElement for the menu bar
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityWindowsAttribute;		//(NSArray *)  - UIElements for the windows
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityFrontmostAttribute;	//(NSNumber *) - (boolValue) is the app active?
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityHiddenAttribute;		//(NSNumber *) - (boolValue) is the app hidden?
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityMainWindowAttribute;	//(id)         - UIElement for the main window.
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityFocusedWindowAttribute;	//(id)         - UIElement for the key window.
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityFocusedUIElementAttribute;	//(id)         - Currently focused UIElement.
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityExtrasMenuBarAttribute API_AVAILABLE(macos(10.8));    //(id)         - UIElement for the application extras menu bar.
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSAccessibilityOrientation) {
 | 
			
		||||
    NSAccessibilityOrientationUnknown = 0,
 | 
			
		||||
    NSAccessibilityOrientationVertical = 1,
 | 
			
		||||
    NSAccessibilityOrientationHorizontal = 2,
 | 
			
		||||
} API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityOrientationAttribute;	//(NSAccessibilityOrientationValue)
 | 
			
		||||
typedef NSString * NSAccessibilityOrientationValue NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityOrientationValue const NSAccessibilityVerticalOrientationValue;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityOrientationValue const NSAccessibilityHorizontalOrientationValue;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityOrientationValue const NSAccessibilityUnknownOrientationValue;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityColumnTitlesAttribute;	//(NSArray *)  - UIElements for titles
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySearchButtonAttribute;	//(id)         - UIElement for search field search btn
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySearchMenuAttribute;	//(id)         - UIElement for search field menu
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityClearButtonAttribute;	//(id)         - UIElement for search field clear btn
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Table/outline view attributes
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityRowsAttribute;		//(NSArray *)  - UIElements for rows
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityVisibleRowsAttribute;	//(NSArray *)  - UIElements for visible rows
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySelectedRowsAttribute;	//(NSArray *)  - UIElements for selected rows
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityColumnsAttribute;		//(NSArray *)  - UIElements for columns
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityVisibleColumnsAttribute;	//(NSArray *)  - UIElements for visible columns
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySelectedColumnsAttribute;	//(NSArray *)  - UIElements for selected columns
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySortDirectionAttribute;	//(NSAccessibilitySortDirectionValue)
 | 
			
		||||
 | 
			
		||||
/* Cell-based table attributes
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySelectedCellsAttribute API_AVAILABLE(macos(10.6));	//(NSArray *)  - UIElements for selected cells
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityVisibleCellsAttribute API_AVAILABLE(macos(10.6));	//(NSArray *)  - UIElements for visible cells
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityRowHeaderUIElementsAttribute API_AVAILABLE(macos(10.6));	//(NSArray *)  - UIElements for row headers
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityColumnHeaderUIElementsAttribute API_AVAILABLE(macos(10.6));	//(NSArray *)  - UIElements for column headers
 | 
			
		||||
 | 
			
		||||
/* Cell-based table parameterized attributes.  The parameter for this attribute is an NSArray containing two NSNumbers, the first NSNumber specifies the column index, the second NSNumber specifies the row index.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityParameterizedAttributeName const NSAccessibilityCellForColumnAndRowParameterizedAttribute API_AVAILABLE(macos(10.6));  // (id) - UIElement for cell at specified row and column
 | 
			
		||||
 | 
			
		||||
/* Cell attributes.  The index range contains both the starting index, and the index span in a table.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityRowIndexRangeAttribute API_AVAILABLE(macos(10.6));	//(NSValue *)  - (rangeValue) location and row span
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityColumnIndexRangeAttribute API_AVAILABLE(macos(10.6));   //(NSValue *)  - (rangeValue) location and column span
 | 
			
		||||
 | 
			
		||||
/* Layout area attributes
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityHorizontalUnitsAttribute API_AVAILABLE(macos(10.6));   //(NSAccessibilityRulerUnitValue)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityVerticalUnitsAttribute API_AVAILABLE(macos(10.6));	    //(NSAccessibilityRulerUnitValue)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityHorizontalUnitDescriptionAttribute API_AVAILABLE(macos(10.6)); //(NSString *)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityVerticalUnitDescriptionAttribute API_AVAILABLE(macos(10.6));    //(NSString *)
 | 
			
		||||
 | 
			
		||||
/* Layout area parameterized attributes
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityParameterizedAttributeName const NSAccessibilityLayoutPointForScreenPointParameterizedAttribute API_AVAILABLE(macos(10.6)); //(NSValue *)  - (pointValue); param:(NSValue * - pointValue)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityParameterizedAttributeName const NSAccessibilityLayoutSizeForScreenSizeParameterizedAttribute API_AVAILABLE(macos(10.6)); //(NSValue *)  - (sizeValue); param:(NSValue * - sizeValue)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityParameterizedAttributeName const NSAccessibilityScreenPointForLayoutPointParameterizedAttribute API_AVAILABLE(macos(10.6)); //(NSValue *)  - (pointValue); param:(NSValue * - pointValue)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityParameterizedAttributeName const NSAccessibilityScreenSizeForLayoutSizeParameterizedAttribute API_AVAILABLE(macos(10.6)); //(NSValue *)  - (sizeValue); param:(NSValue * - sizeValue)
 | 
			
		||||
 | 
			
		||||
/* Layout item attributes
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityHandlesAttribute API_AVAILABLE(macos(10.6)); //(NSArray *)  - UIElements for handles
 | 
			
		||||
 | 
			
		||||
/* Sort direction values
 | 
			
		||||
 */
 | 
			
		||||
typedef NSString * NSAccessibilitySortDirectionValue NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySortDirectionValue const NSAccessibilityAscendingSortDirectionValue;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySortDirectionValue const NSAccessibilityDescendingSortDirectionValue;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySortDirectionValue const NSAccessibilityUnknownSortDirectionValue;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSAccessibilitySortDirection) {
 | 
			
		||||
    NSAccessibilitySortDirectionUnknown = 0,
 | 
			
		||||
    NSAccessibilitySortDirectionAscending = 1,
 | 
			
		||||
    NSAccessibilitySortDirectionDescending = 2,
 | 
			
		||||
} API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
/* Outline attributes
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityDisclosingAttribute;	//(NSNumber *) - (boolValue) is disclosing rows?
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityDisclosedRowsAttribute;	//(NSArray *)  - UIElements for disclosed rows
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityDisclosedByRowAttribute;	//(id)         - UIElement for disclosing row
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityDisclosureLevelAttribute;	//(NSNumber *) - indentation level
 | 
			
		||||
 | 
			
		||||
/* Slider attributes
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityAllowedValuesAttribute;	//(NSArray<NSNumber *> *) - array of allowed values
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityLabelUIElementsAttribute;	//(NSArray *) - array of label UIElements
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityLabelValueAttribute;	//(NSNumber *) - value of a label UIElement
 | 
			
		||||
 | 
			
		||||
/* Matte attributes
 | 
			
		||||
 */
 | 
			
		||||
// Attributes no longer supported
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityMatteHoleAttribute API_DEPRECATED("", macos(10.1,10.10));		//(NSValue *) - (rect value) bounds of matte hole in screen coords
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityMatteContentUIElementAttribute API_DEPRECATED("", macos(10.1,10.10)); //(id) - UIElement clipped by the matte
 | 
			
		||||
 | 
			
		||||
/* Ruler view attributes
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityMarkerUIElementsAttribute;	//(NSArray *)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityMarkerValuesAttribute;		//
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityMarkerGroupUIElementAttribute;	//(id)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityUnitsAttribute;			//(NSAccessibilityRulerUnitValue)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityUnitDescriptionAttribute;	//(NSString *)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityMarkerTypeAttribute;		//(NSAccessibilityRulerMarkerTypeValue)
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityMarkerTypeDescriptionAttribute;	//(NSString *)
 | 
			
		||||
 | 
			
		||||
/* UI element identification attributes
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityIdentifierAttribute		//(NSString *)
 | 
			
		||||
API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Ruler marker type values
 | 
			
		||||
 */
 | 
			
		||||
typedef NSString * NSAccessibilityRulerMarkerTypeValue NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRulerMarkerTypeValue const NSAccessibilityLeftTabStopMarkerTypeValue;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRulerMarkerTypeValue const NSAccessibilityRightTabStopMarkerTypeValue;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRulerMarkerTypeValue const NSAccessibilityCenterTabStopMarkerTypeValue;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRulerMarkerTypeValue const NSAccessibilityDecimalTabStopMarkerTypeValue;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRulerMarkerTypeValue const NSAccessibilityHeadIndentMarkerTypeValue;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRulerMarkerTypeValue const NSAccessibilityTailIndentMarkerTypeValue;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRulerMarkerTypeValue const NSAccessibilityFirstLineIndentMarkerTypeValue;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRulerMarkerTypeValue const NSAccessibilityUnknownMarkerTypeValue;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSAccessibilityRulerMarkerType) {
 | 
			
		||||
    NSAccessibilityRulerMarkerTypeUnknown = 0,
 | 
			
		||||
    NSAccessibilityRulerMarkerTypeTabStopLeft = 1,
 | 
			
		||||
    NSAccessibilityRulerMarkerTypeTabStopRight = 2,
 | 
			
		||||
    NSAccessibilityRulerMarkerTypeTabStopCenter = 3,
 | 
			
		||||
    NSAccessibilityRulerMarkerTypeTabStopDecimal = 4,
 | 
			
		||||
    NSAccessibilityRulerMarkerTypeIndentHead = 5,
 | 
			
		||||
    NSAccessibilityRulerMarkerTypeIndentTail = 6,
 | 
			
		||||
    NSAccessibilityRulerMarkerTypeIndentFirstLine = 7
 | 
			
		||||
} API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
/* Ruler unit values
 | 
			
		||||
 */
 | 
			
		||||
typedef NSString * NSAccessibilityRulerUnitValue NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRulerUnitValue const NSAccessibilityInchesUnitValue;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRulerUnitValue const NSAccessibilityCentimetersUnitValue;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRulerUnitValue const NSAccessibilityPointsUnitValue;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRulerUnitValue const NSAccessibilityPicasUnitValue;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRulerUnitValue const NSAccessibilityUnknownUnitValue;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSAccessibilityUnits) {
 | 
			
		||||
    NSAccessibilityUnitsUnknown = 0,
 | 
			
		||||
    NSAccessibilityUnitsInches = 1,
 | 
			
		||||
    NSAccessibilityUnitsCentimeters = 2,
 | 
			
		||||
    NSAccessibilityUnitsPoints = 3,
 | 
			
		||||
    NSAccessibilityUnitsPicas = 4
 | 
			
		||||
} API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
/* Actions
 | 
			
		||||
 */
 | 
			
		||||
typedef NSString * NSAccessibilityActionName NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityActionName const NSAccessibilityPressAction;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityActionName const NSAccessibilityIncrementAction;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityActionName const NSAccessibilityDecrementAction;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityActionName const NSAccessibilityConfirmAction;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityActionName const NSAccessibilityPickAction;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityActionName const NSAccessibilityCancelAction;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityActionName const NSAccessibilityRaiseAction;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityActionName const NSAccessibilityShowMenuAction;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityActionName const NSAccessibilityDeleteAction;
 | 
			
		||||
 | 
			
		||||
/* Actions that allow the developer to present either alternative or original UI. There may be new UI elements that appear. There may be UI elements that disappear. There may be changes to existing UI elements. Or a combination of them. Currently this is typically seen during a mouse hovering event.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityActionName const NSAccessibilityShowAlternateUIAction API_AVAILABLE(macos(10.9));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityActionName const NSAccessibilityShowDefaultUIAction API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
/* Notifications
 | 
			
		||||
 */
 | 
			
		||||
typedef NSString * NSAccessibilityNotificationName NS_TYPED_ENUM;
 | 
			
		||||
 | 
			
		||||
/* Focus notifications
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityMainWindowChangedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityFocusedWindowChangedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityFocusedUIElementChangedNotification;
 | 
			
		||||
 | 
			
		||||
/* Application notifications
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityApplicationActivatedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityApplicationDeactivatedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityApplicationHiddenNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityApplicationShownNotification;
 | 
			
		||||
 | 
			
		||||
/* Window notifications
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityWindowCreatedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityWindowMovedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityWindowResizedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityWindowMiniaturizedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityWindowDeminiaturizedNotification;
 | 
			
		||||
 | 
			
		||||
/* Drawer & sheet notifications
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityDrawerCreatedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilitySheetCreatedNotification;
 | 
			
		||||
 | 
			
		||||
/* Element notifications
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityUIElementDestroyedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityValueChangedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityTitleChangedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityResizedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityMovedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityCreatedNotification;
 | 
			
		||||
 | 
			
		||||
/* Used when UI changes require the attention of assistive application.  Pass along a user info dictionary with the key NSAccessibilityUIElementsKey and an array of elements that have been added or changed as a result of this layout change.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityLayoutChangedNotification API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
/* Misc notifications
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityHelpTagCreatedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilitySelectedTextChangedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityRowCountChangedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilitySelectedChildrenChangedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilitySelectedRowsChangedNotification;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilitySelectedColumnsChangedNotification;
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityRowExpandedNotification API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityRowCollapsedNotification API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Cell-table notifications
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilitySelectedCellsChangedNotification API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Layout area notifications
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityUnitsChangedNotification API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilitySelectedChildrenMovedNotification API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* This notification allows an application to request that an announcement be made to the user by an assistive application such as VoiceOver.  The notification requires a user info dictionary with the key NSAccessibilityAnnouncementKey and the announcement as a localized string.  In addition, the key NSAccessibilityAnnouncementPriorityKey should also be used to help an assistive application determine the importance of this announcement.  This notification should be posted for the application element.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationName const NSAccessibilityAnnouncementRequestedNotification API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Roles
 | 
			
		||||
 */
 | 
			
		||||
typedef NSString * NSAccessibilityRole NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityUnknownRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityButtonRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityRadioButtonRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityCheckBoxRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilitySliderRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityTabGroupRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityTextFieldRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityStaticTextRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityTextAreaRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityScrollAreaRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityPopUpButtonRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityMenuButtonRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityTableRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityApplicationRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityGroupRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityRadioGroupRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityListRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityScrollBarRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityValueIndicatorRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityImageRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityMenuBarRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityMenuBarItemRole API_AVAILABLE(macos(10.12));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityMenuRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityMenuItemRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityColumnRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityRowRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityToolbarRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityBusyIndicatorRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityProgressIndicatorRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityWindowRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityDrawerRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilitySystemWideRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityOutlineRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityIncrementorRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityBrowserRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityComboBoxRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilitySplitGroupRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilitySplitterRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityColorWellRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityGrowAreaRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilitySheetRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityHelpTagRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityMatteRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityRulerRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityRulerMarkerRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityLinkRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityDisclosureTriangleRole API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityGridRole API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityRelevanceIndicatorRole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityLevelIndicatorRole API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityCellRole API_AVAILABLE(macos(10.6)); // As found in a cell-based table
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityPopoverRole API_AVAILABLE(macos(10.7));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityPageRole API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
/* Layout-area roles
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityLayoutAreaRole API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityLayoutItemRole API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilityHandleRole API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Subroles
 | 
			
		||||
 */
 | 
			
		||||
typedef NSString * NSAccessibilitySubrole NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityUnknownSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityCloseButtonSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityZoomButtonSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityMinimizeButtonSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityToolbarButtonSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityTableRowSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityOutlineRowSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilitySecureTextFieldSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityStandardWindowSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityDialogSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilitySystemDialogSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityFloatingWindowSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilitySystemFloatingWindowSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityIncrementArrowSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityDecrementArrowSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityIncrementPageSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityDecrementPageSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilitySearchFieldSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityTextAttachmentSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityTextLinkSubrole;
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityTimelineSubrole API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilitySortButtonSubrole API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityRatingIndicatorSubrole API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityContentListSubrole API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityDefinitionListSubrole API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityFullScreenButtonSubrole API_AVAILABLE(macos(10.7));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityToggleSubrole API_AVAILABLE(macos(10.9));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilitySwitchSubrole API_AVAILABLE(macos(10.9));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityDescriptionListSubrole API_AVAILABLE(macos(10.9));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityTabButtonSubrole API_AVAILABLE(macos(10.13));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilityCollectionListSubrole API_AVAILABLE(macos(10.13));
 | 
			
		||||
APPKIT_EXTERN NSAccessibilitySubrole const NSAccessibilitySectionListSubrole API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
/* Below are keys used for the user info dictionary of the NSAccessibilityPostNotificationWithUserInfo API */
 | 
			
		||||
typedef NSString * NSAccessibilityNotificationUserInfoKey NS_TYPED_ENUM;
 | 
			
		||||
/* Key used in the user info dictionary for notifications.  The value is an array of elements that is associated with the notification.  For example, a NSAccessibilityLayoutChangedNotification should include an array of elements that have been added/changed using this key.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationUserInfoKey const NSAccessibilityUIElementsKey API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
/* Key used in the user info dictionary for any relevant notification.  This gives the assistive application client an opportunity to determine how to handle the corresponding notification based on the priority.  For example, a developer should pass the priority key for NSAccessibilityAnnouncementRequestedNotification.  Then clients such as VoiceOver can decide to speak the announcement immediately or after the current speech is completed based on the priority level.  This key is required for NSAccessibilityAnnouncementRequestedNotification.  The NSAccessibilityLayoutChangedNotification is another example where priority can help assistive applications determine how to handle the UI change.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationUserInfoKey const NSAccessibilityPriorityKey API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
/* Key used in the user info dictionary sent with the NSAccessibilityAnnouncementRequestedNotification.  The value for the announcement should be a localized string.  This should generally be used in conjunction with the NSAccessibilityPriorityKey to help assistive applications determine the importance of this announcement.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityNotificationUserInfoKey const NSAccessibilityAnnouncementKey API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* This function allows an accessibility notification to be posted with a user info dictionary.  The user info dictionary can be nil.  Valid contents of the user info dictionary are limited to classes which can be returned to an accessibility client.  That list currently includes NSString, NSNumber, NSArray, NSValues of points, ranges, sizes, rects, and valid NSAccessibility objects.  Most accessibility notifications do not require a user info dictionary.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN void NSAccessibilityPostNotificationWithUserInfo(id element, NSAccessibilityNotificationName notification, NSDictionary<NSAccessibilityNotificationUserInfoKey, id> * _Nullable userInfo) API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* System defined priority levels.  This priority level should be included for every NSAccessibilityAnnouncementRequestedNotification.
 | 
			
		||||
 */
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSAccessibilityPriorityLevel) {
 | 
			
		||||
    NSAccessibilityPriorityLow = 10,
 | 
			
		||||
    NSAccessibilityPriorityMedium = 50,
 | 
			
		||||
    NSAccessibilityPriorityHigh = 90
 | 
			
		||||
} API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// token type for loading search element
 | 
			
		||||
typedef id<NSSecureCoding, NSObject> NSAccessibilityLoadingToken;
 | 
			
		||||
 | 
			
		||||
/* Deprecated
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAccessibilityRole const NSAccessibilitySortButtonRole API_DEPRECATED("", macos(10.4,10.6));
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,46 @@
 | 
			
		||||
/*
 | 
			
		||||
     NSAccessibilityCustomAction.h
 | 
			
		||||
     Application Kit
 | 
			
		||||
     Copyright (c) 2017-2021, Apple Inc. All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.13)) @interface NSAccessibilityCustomAction : NSObject
 | 
			
		||||
 | 
			
		||||
/* Creates a custom action that performs the action via a block handler.
 | 
			
		||||
    The block should return whether the action was executed successfully or not.
 | 
			
		||||
    The return status will help accessibility clients know what to communicate back to the user.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)initWithName:(NSString *)name handler:(BOOL(^ _Nullable)(void))handler;
 | 
			
		||||
 | 
			
		||||
/* Creates a custom action that performs the action via selector/target.
 | 
			
		||||
    The selector should have a signature that returns a BOOL for the success status of the execution.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)initWithName:(NSString *)name target:(id<NSObject>)target selector:(SEL)selector;
 | 
			
		||||
 | 
			
		||||
// A localized name that describes the action.  This is a string that may be displayed to the user.
 | 
			
		||||
@property (copy) NSString *name;
 | 
			
		||||
 | 
			
		||||
// The block that handles the execution of the action
 | 
			
		||||
@property (nullable, copy) BOOL (^handler)(void);
 | 
			
		||||
 | 
			
		||||
// The object that will perform the action via selector
 | 
			
		||||
@property (nullable, weak) id<NSObject> target;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 The method that will be called on the target to perform the action.
 | 
			
		||||
 It must conform to one of the following signatures:
 | 
			
		||||
 - (BOOL)myPerformActionMethod;
 | 
			
		||||
 - (BOOL)myPerformActionMethod:(NSAccessibilityCustomAction *)action;
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable) SEL selector;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,236 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSAccessibilityCustomRotor.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2016-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
#import <AppKit/NSAccessibilityProtocols.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @discussion NSAccessibilityCustomRotor:
 | 
			
		||||
 *
 | 
			
		||||
 * Assistive technologies, such as VoiceOver, provide interfaces to quickly
 | 
			
		||||
 * search applications for content of a given type. For example, in a web
 | 
			
		||||
 * browser, a list of navigational links or buttons can quickly be explored
 | 
			
		||||
 * using VoiceOver's content menus.
 | 
			
		||||
 *
 | 
			
		||||
 * The classes defined here provide a way for applications to vend their own
 | 
			
		||||
 * content menus. For example, Pages can create a "Headings" custom rotor
 | 
			
		||||
 * that allows assistive technologies to search the Pages document for all
 | 
			
		||||
 * headings.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSAccessibilityCustomRotor;
 | 
			
		||||
@class NSAccessibilityCustomRotorItemResult;
 | 
			
		||||
@class NSAccessibilityCustomRotorSearchParameters;
 | 
			
		||||
 | 
			
		||||
@protocol NSAccessibilityCustomRotorItemSearchDelegate;
 | 
			
		||||
@protocol NSAccessibilityCustomRotorItemLoadDelegate;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief Direction to search for an NSAccessibilityCustomRotorItemResult.
 | 
			
		||||
 */
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSAccessibilityCustomRotorSearchDirection) {
 | 
			
		||||
    NSAccessibilityCustomRotorSearchDirectionPrevious,
 | 
			
		||||
    NSAccessibilityCustomRotorSearchDirectionNext,
 | 
			
		||||
} API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief Use NSAccessibilityCustomRotorType when providing results for the
 | 
			
		||||
 * following types. This allows assistive technologies to assign keyboard
 | 
			
		||||
 * commands and gestures for these common search types.
 | 
			
		||||
 */
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSAccessibilityCustomRotorType) {
 | 
			
		||||
    // Default if using a custom labeled rotor
 | 
			
		||||
    NSAccessibilityCustomRotorTypeCustom = 0,
 | 
			
		||||
    
 | 
			
		||||
    // This type is used for searching the current
 | 
			
		||||
    // element for any type of item.
 | 
			
		||||
    NSAccessibilityCustomRotorTypeAny = 1,
 | 
			
		||||
    
 | 
			
		||||
    // Common types of rotors
 | 
			
		||||
    NSAccessibilityCustomRotorTypeAnnotation,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeBoldText,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeHeading,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeHeadingLevel1,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeHeadingLevel2,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeHeadingLevel3,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeHeadingLevel4,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeHeadingLevel5,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeHeadingLevel6,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeImage,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeItalicText,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeLandmark,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeLink,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeList,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeMisspelledWord,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeTable,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeTextField,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeUnderlinedText,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeVisitedLink,
 | 
			
		||||
    NSAccessibilityCustomRotorTypeAudiograph,
 | 
			
		||||
} API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief NSAccessibilityCustomRotors allow assistive technologies, like
 | 
			
		||||
 * VoiceOver, to search applications for content related to the given label.
 | 
			
		||||
 */
 | 
			
		||||
API_AVAILABLE(macos(10.13)) @interface NSAccessibilityCustomRotor : NSObject
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief Convenience initializer that uses
 | 
			
		||||
 * NSAccessibilityCustomRotorTypeCustom as the default rotor type. Use this
 | 
			
		||||
 * initializer for custom rotors that are not one of the common types.
 | 
			
		||||
 */
 | 
			
		||||
- (instancetype)initWithLabel:(NSString *)label
 | 
			
		||||
           itemSearchDelegate:(id<NSAccessibilityCustomRotorItemSearchDelegate>)itemSearchDelegate;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief Convenience initializer for custom rotors that use a common type
 | 
			
		||||
 * such as links, headings, etc. A default label will be provided.
 | 
			
		||||
 */
 | 
			
		||||
- (instancetype)initWithRotorType:(NSAccessibilityCustomRotorType)rotorType
 | 
			
		||||
               itemSearchDelegate:(id<NSAccessibilityCustomRotorItemSearchDelegate>)itemSearchDelegate;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief The rotor type to provide results for.
 | 
			
		||||
 * @remark The default type is NSAccessibilityCustomRotorTypeCustom, unless
 | 
			
		||||
 * the rotor type was specified in the initializer.
 | 
			
		||||
 */
 | 
			
		||||
@property NSAccessibilityCustomRotorType type;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief The localized label assistive technologies will use to describe
 | 
			
		||||
 * the custom rotor.
 | 
			
		||||
 * @remark The label is only used when the rotor type is
 | 
			
		||||
 * NSAccessibilityCustomRotorTypeCustom since a default is provided
 | 
			
		||||
 * for all other types.
 | 
			
		||||
 */
 | 
			
		||||
@property (copy) NSString *label;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief The itemSearchDelegate will be asked to find the next item result
 | 
			
		||||
 * after performing a search with the given search parameters.
 | 
			
		||||
 */
 | 
			
		||||
@property (weak) id<NSAccessibilityCustomRotorItemSearchDelegate> itemSearchDelegate;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief Provide an item load delegate if the rotor vends item results that
 | 
			
		||||
 * do not have a backing UI element yet. The loader will be asked to load an
 | 
			
		||||
 * element via the accessibilityElementWithToken protocol method when the
 | 
			
		||||
 * item result is selected by an assistive client. Applications can use the
 | 
			
		||||
 * item result's token to determine which item to return.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, weak) id<NSAccessibilityElementLoading> itemLoadingDelegate;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief NSAccessibilityCustomRotorSearchParameters is a container for 
 | 
			
		||||
 * search parameters. It should be examined to determine the next matching
 | 
			
		||||
 * NSAccessibilityCustomRotorItemResult.
 | 
			
		||||
 */
 | 
			
		||||
API_AVAILABLE(macos(10.13)) @interface NSAccessibilityCustomRotorSearchParameters : NSObject
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief The currentItem determines where the search will start from. If 
 | 
			
		||||
 * it is nil, the search should begin from, and include, the first or last
 | 
			
		||||
 * item, depending on which search direction is used (e.g. search direction
 | 
			
		||||
 * next will return the first item and previous will return the last item).
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, strong) NSAccessibilityCustomRotorItemResult *currentItem;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief Either NSAccessibilityCustomRotorSearchDirectionPrevious or
 | 
			
		||||
 * NSAccessibilityCustomRotorSearchDirectionNext.
 | 
			
		||||
 */
 | 
			
		||||
@property NSAccessibilityCustomRotorSearchDirection searchDirection;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief A string of text to filter the results against. This is used to get
 | 
			
		||||
 * type-ahead results. For example, given a list of primary colors and filter
 | 
			
		||||
 * text "Re", color item "Red" would be returned as a result.
 | 
			
		||||
 */
 | 
			
		||||
@property (copy) NSString *filterString;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief NSAccessibilityCustomRotorItemResults are the objects returned
 | 
			
		||||
 * to assistive technologies that match a search parameter criteria.
 | 
			
		||||
 */
 | 
			
		||||
API_AVAILABLE(macos(10.13)) @interface NSAccessibilityCustomRotorItemResult : NSObject
 | 
			
		||||
 | 
			
		||||
+ (instancetype)new NS_UNAVAILABLE;
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief Creates an item result with a given target element. Assistive
 | 
			
		||||
 * technologies may try to set accessibility focus on the element.
 | 
			
		||||
 */
 | 
			
		||||
- (instancetype)initWithTargetElement:(id<NSAccessibilityElement>)targetElement NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief Creates an item result with a given item load token and custom label.
 | 
			
		||||
 * Use this initializer if the application has not yet loaded the element
 | 
			
		||||
 * backing the item result.
 | 
			
		||||
 */
 | 
			
		||||
- (instancetype)initWithItemLoadingToken:(NSAccessibilityLoadingToken)itemLoadingToken
 | 
			
		||||
                             customLabel:(NSString *)customLabel NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief A target element references an element that will be messaged for
 | 
			
		||||
 * other accessibility properties. If it is not nil, assistive technologies
 | 
			
		||||
 * may try to set accessibility focus on it.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, weak, readonly) id<NSAccessibilityElement> targetElement;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief Provide an item load token if the application has not yet
 | 
			
		||||
 * loaded the element backing the item result. Application can use the token
 | 
			
		||||
 * to determine which item to return.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, strong, readonly) NSAccessibilityLoadingToken itemLoadingToken;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief For text-based elements such as an NSTextView, this is an NSRange
 | 
			
		||||
 * that specifies the area of interest. If the target range has NSNotFound
 | 
			
		||||
 * for the location, the search should begin from the first or last character
 | 
			
		||||
 * of the text element, depending on the search direction.
 | 
			
		||||
 */
 | 
			
		||||
@property NSRange targetRange;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief A localized label that can be used instead of the default item 
 | 
			
		||||
 * label to describe the item result.
 | 
			
		||||
 * @remark Required if using the loader-based initializer. Optional otherwise.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, copy) NSString *customLabel;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.13)) @protocol NSAccessibilityCustomRotorItemSearchDelegate <NSObject>
 | 
			
		||||
 | 
			
		||||
@required
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief Returns the found NSAccessibilityCustomRotorItemResult after
 | 
			
		||||
 * performing a search with the given search parameters.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSAccessibilityCustomRotorItemResult *)rotor:(NSAccessibilityCustomRotor *)rotor
 | 
			
		||||
                               resultForSearchParameters:(NSAccessibilityCustomRotorSearchParameters *)searchParameters;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,30 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSAccessibilityElement.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2013-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
#import <AppKit/NSAccessibilityConstants.h>
 | 
			
		||||
#import <AppKit/NSAccessibilityProtocols.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
/* An NSAccessibilityElement is used to convey information regarding onscreen UI through the  accessibility API for UI that may not already have a single backing object. For example, if a single NSView subclass draws 4 buttons, it would vend 4 NSAccessibilityElements as accessibilityChildren. Note that as long as the UI is around, the vendor of NSAccessibilityElements must maintain ownership of the NSAccessibilityElements. */
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.10))
 | 
			
		||||
@interface NSAccessibilityElement : NSObject <NSAccessibility>
 | 
			
		||||
 | 
			
		||||
+ (id)accessibilityElementWithRole:(NSAccessibilityRole)role frame:(NSRect)frame label:(nullable NSString *)label parent:(nullable id)parent;
 | 
			
		||||
- (void)accessibilityAddChildElement:(NSAccessibilityElement *)childElement;
 | 
			
		||||
 | 
			
		||||
// Accessibility frame in the cordinate system of the accessibility parent
 | 
			
		||||
@property NSRect accessibilityFrameInParentSpace;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,845 @@
 | 
			
		||||
/*
 | 
			
		||||
 NSAccessibilityProtocols.h
 | 
			
		||||
 Application Kit
 | 
			
		||||
 Copyright (c) 2013-2021, Apple Inc.
 | 
			
		||||
 All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
#import <AppKit/NSAccessibilityConstants.h>
 | 
			
		||||
#import <AppKit/NSAccessibilityCustomAction.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
@class NSAccessibilityCustomRotor;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityElement <NSObject>
 | 
			
		||||
@required
 | 
			
		||||
- (NSRect)accessibilityFrame;
 | 
			
		||||
- (nullable id)accessibilityParent;
 | 
			
		||||
 | 
			
		||||
@optional
 | 
			
		||||
- (BOOL)isAccessibilityFocused;
 | 
			
		||||
- (NSString *)accessibilityIdentifier;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityGroup <NSAccessibilityElement>
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#pragma mark Buttons
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityButton <NSAccessibilityElement>
 | 
			
		||||
@required
 | 
			
		||||
- (nullable NSString *)accessibilityLabel;
 | 
			
		||||
- (BOOL)accessibilityPerformPress;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilitySwitch <NSAccessibilityButton>
 | 
			
		||||
// Post NSAccessibilityValueChangedNotification when the value changes
 | 
			
		||||
 | 
			
		||||
@required
 | 
			
		||||
- (nullable NSString *)accessibilityValue;
 | 
			
		||||
 | 
			
		||||
@optional
 | 
			
		||||
- (BOOL)accessibilityPerformIncrement;
 | 
			
		||||
- (BOOL)accessibilityPerformDecrement;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityRadioButton <NSAccessibilityButton>
 | 
			
		||||
// NSAccessibilityValueChangedNotification should be posted whenever accessibilityValue changes
 | 
			
		||||
 | 
			
		||||
@required
 | 
			
		||||
// Return @YES if selected, or @NO if not selected
 | 
			
		||||
- (nullable NSNumber *)accessibilityValue;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityCheckBox <NSAccessibilityButton>
 | 
			
		||||
// NSAccessibilityValueChangedNotification should be posted whenever accessibilityValue changes
 | 
			
		||||
 | 
			
		||||
@required
 | 
			
		||||
// Return @YES if checked, or @NO if unchecked
 | 
			
		||||
- (nullable NSNumber *)accessibilityValue;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#pragma mark Text
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityStaticText <NSAccessibilityElement>
 | 
			
		||||
@required
 | 
			
		||||
- (nullable NSString *)accessibilityValue;
 | 
			
		||||
 | 
			
		||||
@optional
 | 
			
		||||
- (nullable NSAttributedString *)accessibilityAttributedStringForRange:(NSRange)range;
 | 
			
		||||
- (NSRange)accessibilityVisibleCharacterRange;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityNavigableStaticText <NSAccessibilityStaticText>
 | 
			
		||||
@required
 | 
			
		||||
- (nullable NSString *)accessibilityStringForRange:(NSRange)range;
 | 
			
		||||
- (NSInteger)accessibilityLineForIndex:(NSInteger)index;
 | 
			
		||||
- (NSRange)accessibilityRangeForLine:(NSInteger)lineNumber;
 | 
			
		||||
 | 
			
		||||
// Frame is in screen coordinates. See NSAccessibilityFrameInView()
 | 
			
		||||
- (NSRect)accessibilityFrameForRange:(NSRange)range;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#pragma mark Miscellaneous
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityProgressIndicator <NSAccessibilityGroup>
 | 
			
		||||
@required
 | 
			
		||||
- (nullable NSNumber *)accessibilityValue;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityStepper <NSAccessibilityElement>
 | 
			
		||||
@required
 | 
			
		||||
- (nullable NSString *)accessibilityLabel;
 | 
			
		||||
- (BOOL)accessibilityPerformIncrement;
 | 
			
		||||
- (BOOL)accessibilityPerformDecrement;
 | 
			
		||||
@optional
 | 
			
		||||
// Value is a NSString or a NSNumber
 | 
			
		||||
- (nullable id)accessibilityValue;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilitySlider <NSAccessibilityElement>
 | 
			
		||||
@required
 | 
			
		||||
- (nullable NSString *)accessibilityLabel;
 | 
			
		||||
// Value is a NSString or a NSNumber
 | 
			
		||||
- (nullable id)accessibilityValue;
 | 
			
		||||
- (BOOL)accessibilityPerformIncrement;
 | 
			
		||||
- (BOOL)accessibilityPerformDecrement;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityImage <NSAccessibilityElement>
 | 
			
		||||
@required
 | 
			
		||||
- (nullable NSString *)accessibilityLabel;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityContainsTransientUI <NSAccessibilityElement>
 | 
			
		||||
@required
 | 
			
		||||
- (BOOL)accessibilityPerformShowAlternateUI;
 | 
			
		||||
- (BOOL)accessibilityPerformShowDefaultUI;
 | 
			
		||||
- (BOOL)isAccessibilityAlternateUIVisible;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSAccessibilityRow;
 | 
			
		||||
 | 
			
		||||
#pragma mark Tables, Lists, Outlines
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityTable <NSAccessibilityGroup>
 | 
			
		||||
@required
 | 
			
		||||
- (nullable NSString *)accessibilityLabel;
 | 
			
		||||
 | 
			
		||||
// An array of accessibility row elements
 | 
			
		||||
- (nullable NSArray<id<NSAccessibilityRow>> *)accessibilityRows;
 | 
			
		||||
 | 
			
		||||
@optional
 | 
			
		||||
// For tables that have a selection
 | 
			
		||||
// Make sure to post a selected-rows-changed notification when appropriate
 | 
			
		||||
// NSAccessibilityPostNotification(table, NSAccessibilitySelectedRowsChangedNotification);
 | 
			
		||||
- (nullable NSArray<id<NSAccessibilityRow>> *)accessibilitySelectedRows;
 | 
			
		||||
- (void)setAccessibilitySelectedRows:(NSArray<id<NSAccessibilityRow>> *)selectedRows;
 | 
			
		||||
 | 
			
		||||
// Advanced table accessibility
 | 
			
		||||
- (nullable NSArray<id<NSAccessibilityRow>> *)accessibilityVisibleRows;
 | 
			
		||||
- (nullable NSArray *)accessibilityColumns;
 | 
			
		||||
- (nullable NSArray *)accessibilityVisibleColumns;
 | 
			
		||||
- (nullable NSArray *)accessibilitySelectedColumns;
 | 
			
		||||
 | 
			
		||||
- (nullable NSString *)accessibilityHeaderGroup API_DEPRECATED_WITH_REPLACEMENT("accessibilityHeader", macos(10.9,10.14));
 | 
			
		||||
 | 
			
		||||
- (nullable NSArray *)accessibilitySelectedCells;
 | 
			
		||||
- (nullable NSArray *)accessibilityVisibleCells;
 | 
			
		||||
- (nullable NSArray *)accessibilityRowHeaderUIElements;
 | 
			
		||||
- (nullable NSArray *)accessibilityColumnHeaderUIElements;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityOutline <NSAccessibilityTable>
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityList <NSAccessibilityTable>
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityRow <NSAccessibilityGroup>
 | 
			
		||||
@required
 | 
			
		||||
- (NSInteger)accessibilityIndex;
 | 
			
		||||
 | 
			
		||||
@optional
 | 
			
		||||
- (NSInteger)accessibilityDisclosureLevel;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#pragma mark Layout Area (Canvas)
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityLayoutArea <NSAccessibilityGroup>
 | 
			
		||||
@required
 | 
			
		||||
- (NSString *)accessibilityLabel;
 | 
			
		||||
 | 
			
		||||
// All of the layoutItem children
 | 
			
		||||
- (nullable NSArray *)accessibilityChildren;
 | 
			
		||||
 | 
			
		||||
// Selected layoutItem children
 | 
			
		||||
- (nullable NSArray *)accessibilitySelectedChildren;
 | 
			
		||||
 | 
			
		||||
// The focused layoutItem
 | 
			
		||||
@property (readonly, strong) id accessibilityFocusedUIElement;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
 | 
			
		||||
@protocol NSAccessibilityLayoutItem <NSAccessibilityGroup>
 | 
			
		||||
 | 
			
		||||
@optional
 | 
			
		||||
// For layout items that can be moved
 | 
			
		||||
- (void)setAccessibilityFrame:(NSRect)frame;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark  Element Loading
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.13)) @protocol NSAccessibilityElementLoading <NSObject>
 | 
			
		||||
@required
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief Loads the target element with the given load token.
 | 
			
		||||
 * @returns An element that will be messaged for other accessibility
 | 
			
		||||
 * properties. Assistive technologies may try to set accessibility
 | 
			
		||||
 * focus on the returned element.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable id<NSAccessibilityElement>)accessibilityElementWithToken:(NSAccessibilityLoadingToken)token;
 | 
			
		||||
 | 
			
		||||
@optional
 | 
			
		||||
/*!
 | 
			
		||||
 * @brief For text-based elements returned from accessibilityElementWithToken,
 | 
			
		||||
 * such as an NSTextView, the range specifies an area of interest. Assistive
 | 
			
		||||
 * technologies will try to bring focus to the specified text range.
 | 
			
		||||
 * @remark Either do not implement this method or return NSNotFound for the
 | 
			
		||||
 * location if there is no range of interest for a given load token.
 | 
			
		||||
 */
 | 
			
		||||
- (NSRange)accessibilityRangeInTargetElementWithToken:(NSAccessibilityLoadingToken)token;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
// The complete accessibility protocol
 | 
			
		||||
@protocol NSAccessibility <NSObject>
 | 
			
		||||
@required
 | 
			
		||||
 | 
			
		||||
#pragma mark General
 | 
			
		||||
// Return YES if the UIElement should be exposed
 | 
			
		||||
@property (getter = isAccessibilityElement) BOOL accessibilityElement API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// The frame of the UIElement in screen coordinates. See NSAccessibilityFrameInView()
 | 
			
		||||
// Invokes when clients request NSAccessibilitySizeAttribute or NSAccessibilityPositionAttribute
 | 
			
		||||
@property NSRect accessibilityFrame API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Returns YES if the element is focused (generally, accessibilityFocused is equivilent to the
 | 
			
		||||
// UIElement with the focus ring or selection)
 | 
			
		||||
// Invokes when clients request NSAccessibilityFocusedAttribute
 | 
			
		||||
@property (getter = isAccessibilityFocused) BOOL accessibilityFocused API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Activation point for the UIElement, in screen coordinates. See NSAccessibilityPointInView()
 | 
			
		||||
@property NSPoint accessibilityActivationPoint API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for the containing top level element
 | 
			
		||||
// Invokes when clients request NSAccessibilityTopLevelUIElementAttribute
 | 
			
		||||
@property (nullable, weak) id accessibilityTopLevelUIElement API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// URL of the UIElement
 | 
			
		||||
// Invokes when clients request NSAccessibilityURLAttribute
 | 
			
		||||
@property (nullable, copy) NSURL *accessibilityURL API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Value of the UIElement
 | 
			
		||||
// Invokes when clients request NSAccessibilityValueAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityValue API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Human-readable description of value
 | 
			
		||||
// Invokes when clients request NSAccessibilityValueDescriptionAttribute
 | 
			
		||||
@property (nullable, copy) NSString *accessibilityValueDescription API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of child UIElement which are visible
 | 
			
		||||
// Invokes when clients request NSAccessibilityVisibleChildrenAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityVisibleChildren API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Sub-role, non - localized (e.g. NSAccessibilityCloseButtonSubrole)
 | 
			
		||||
// Invokes when clients request NSAccessibilitySubroleAttribute
 | 
			
		||||
@property (nullable, copy) NSAccessibilitySubrole accessibilitySubrole API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Visible text on the UIElement
 | 
			
		||||
// Invokes when clients request NSAccessibilityTitleAttribute
 | 
			
		||||
@property (nullable, copy) NSString *accessibilityTitle API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for the title
 | 
			
		||||
// Invokes when clients request NSAccessibilityTitleUIElementAttribute
 | 
			
		||||
@property (nullable, weak) id accessibilityTitleUIElement API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Next content UIElement
 | 
			
		||||
// Invokes when clients request NSAccessibilityNextContentsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityNextContents API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement orientation
 | 
			
		||||
// Invokes when clients request NSAccessibilityOrientationAttribute
 | 
			
		||||
@property NSAccessibilityOrientation accessibilityOrientation API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for overflow
 | 
			
		||||
// Invokes when clients request NSAccessibilityOverflowButtonAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityOverflowButton API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Element containing this UIElement
 | 
			
		||||
// Invokes when clients request NSAccessibilityParentAttribute
 | 
			
		||||
@property (nullable, weak) id accessibilityParent API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Placeholder value of a control such as a text field
 | 
			
		||||
// Invokes when clients request NSAccessibilityPlaceholderValueAttribute
 | 
			
		||||
@property (nullable, copy) NSString *accessibilityPlaceholderValue API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Previous content UIElement.
 | 
			
		||||
// Invokes when clients request NSAccessibilityPreviousContentsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityPreviousContents API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Role, non - localized (e.g. NSAccessibilityRadioButtonRole)
 | 
			
		||||
// Invokes when clients request NSAccessibilityRoleAttribute
 | 
			
		||||
@property (nullable, copy) NSAccessibilityRole accessibilityRole API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Human readable role description (e.g. "radio button");
 | 
			
		||||
// Invokes when clients request NSAccessibilityRoleDescriptionAttribute
 | 
			
		||||
@property (nullable, copy) NSString *accessibilityRoleDescription API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for search field search button
 | 
			
		||||
// Invokes when clients request NSAccessibilitySearchButtonAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilitySearchButton API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for search field menu
 | 
			
		||||
// Invokes when clients request NSAccessibilitySearchMenuAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilitySearchMenu API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Returns YES if the UIElement is selected
 | 
			
		||||
// Invokes when clients request NSAccessibilitySelectedAttribute
 | 
			
		||||
@property (getter = isAccessibilitySelected) BOOL accessibilitySelected API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of selected child UIElements
 | 
			
		||||
// Invokes when clients request NSAccessibilitySelectedChildrenAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilitySelectedChildren API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of UIElements that this titles
 | 
			
		||||
// Invokes when clients request NSAccessibilityServesAsTitleForUIElementsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityServesAsTitleForUIElements API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Menu being displayed for the UIElement
 | 
			
		||||
// Invokes when clients request NSAccessibilityShownMenuAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityShownMenu API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// The UIElement's minimum value
 | 
			
		||||
// Invokes when clients request NSAccessibilityMinValueAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityMinValue API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// The UIElement's maximum value
 | 
			
		||||
// Invokes when clients request NSAccessibilityMaxValueAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityMaxValue API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Corresponding UIElements
 | 
			
		||||
// Invokes when clients request NSAccessibilityLinkedUIElementsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityLinkedUIElements API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for the containing window
 | 
			
		||||
// Invokes when clients request NSAccessibilityWindowAttribute
 | 
			
		||||
@property (nullable, weak) id accessibilityWindow API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Unique identifier for the UIElement
 | 
			
		||||
// Invokes when clients request NSAccessibilityIdentifierAttribute
 | 
			
		||||
@property (nullable, copy) NSString *accessibilityIdentifier API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Instance description (e.g. a tool tip)
 | 
			
		||||
// Invokes when clients request NSAccessibilityHelpAttribute
 | 
			
		||||
@property (nullable, copy) NSString *accessibilityHelp API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Filename of the underlying asset
 | 
			
		||||
// Invokes when clients request NSAccessibilityFilenameAttribute
 | 
			
		||||
@property (nullable, copy) NSString *accessibilityFilename API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Returns YES if the UIElement is expanded
 | 
			
		||||
// Invokes when clients request NSAccessibilityExpandedAttribute
 | 
			
		||||
@property (getter = isAccessibilityExpanded) BOOL accessibilityExpanded API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Returns YES if the UIElement has been edited
 | 
			
		||||
// Invokes when clients request NSAccessibilityEditedAttribute
 | 
			
		||||
@property (getter = isAccessibilityEdited) BOOL accessibilityEdited API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Returns YES if the element responds to user events
 | 
			
		||||
// Invokes when clients request NSAccessibilityEnabledAttribute
 | 
			
		||||
@property (getter = isAccessibilityEnabled) BOOL accessibilityEnabled API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of UIElements that represent children of the current UIElement
 | 
			
		||||
// Invokes when clients request NSAccessibilityChildrenAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityChildren API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Returns an array of children UIElements ordered for linear navigation.
 | 
			
		||||
// This array should match all UIElements found in accessibilityChildren, but in an order that's more suitable for navigation
 | 
			
		||||
@property (nullable, copy) NSArray <id<NSAccessibilityElement>> *accessibilityChildrenInNavigationOrder API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
// UIElement for search field clear button
 | 
			
		||||
// Invokes when clients request NSAccessibilityClearButtonAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityClearButton API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for cancel button
 | 
			
		||||
// Invokes when clients request NSAccessibilityCancelButtonAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityCancelButton API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Returns YES if the UIElement contains protected content
 | 
			
		||||
// Invokes when clients request NSAccessibilityContainsProtectedContentAttribute
 | 
			
		||||
@property (getter = isAccessibilityProtectedContent) BOOL accessibilityProtectedContent API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of primary content elements
 | 
			
		||||
// Invokes when clients request NSAccessibilityContentsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityContents API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Description of UIElement
 | 
			
		||||
// Invokes when clients request NSAccessibilityDescriptionAttribute
 | 
			
		||||
@property (nullable, copy) NSString *accessibilityLabel API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Returns YES if the element is has been triggered to display alternate UIs
 | 
			
		||||
// Invokes when clients request NSAccessibilityAlternateUIVisibleAttribute
 | 
			
		||||
@property (getter = isAccessibilityAlternateUIVisible) BOOL accessibilityAlternateUIVisible API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of elements with which this element shares keyboard focus
 | 
			
		||||
// Invokes when clients request NSAccessibilitySharedFocusElementsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilitySharedFocusElements API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Returns YES if the UIElement is required to have content for successful submission of a form
 | 
			
		||||
// Invokes when clients request NSAccessibilityRequiredAttribute
 | 
			
		||||
@property (getter=isAccessibilityRequired) BOOL accessibilityRequired API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * @brief Returns an array of custom rotors. Custom rotors are lists of
 | 
			
		||||
 * items of a specific category. For example, a "Headings" rotor would
 | 
			
		||||
 * return a list of headings a given document.
 | 
			
		||||
 */
 | 
			
		||||
@property (copy) NSArray<NSAccessibilityCustomRotor *> *accessibilityCustomRotors API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
#pragma mark Application
 | 
			
		||||
 | 
			
		||||
// Returns YES if the element is focused (generally, accessibilityFocused is equivalent to the
 | 
			
		||||
// to the UIElement with the focus ring or selection)
 | 
			
		||||
// Invokes when clients request NSAccessibilityFocusedUIElementAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityApplicationFocusedUIElement API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for the main window.
 | 
			
		||||
// Invokes when clients request NSAccessibilityMainWindowAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityMainWindow API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Returns YES if the app hidden
 | 
			
		||||
// Invokes when clients request NSAccessibilityHiddenAttribute
 | 
			
		||||
@property (getter = isAccessibilityHidden) BOOL accessibilityHidden API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Returns YES if the app is active
 | 
			
		||||
// Invokes when clients request NSAccessibilityFrontmostAttribute
 | 
			
		||||
@property (getter = isAccessibilityFrontmost) BOOL accessibilityFrontmost API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for the key window.
 | 
			
		||||
// Invokes when clients request NSAccessibilityFocusedWindowAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityFocusedWindow API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of UIElements for the windows
 | 
			
		||||
// Invokes when clients request NSAccessibilityWindowsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityWindows API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for the application extras menu bar.
 | 
			
		||||
// Invokes when clients request NSAccessibilityExtrasMenuBarAttribute
 | 
			
		||||
@property (nullable, weak) id accessibilityExtrasMenuBar API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for the menu bar
 | 
			
		||||
// Invokes when clients request NSAccessibilityMenuBarAttribute
 | 
			
		||||
@property (nullable, weak) id accessibilityMenuBar API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Browser
 | 
			
		||||
// Array of UIElements for titles
 | 
			
		||||
// Invokes when clients request NSAccessibilityColumnTitlesAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityColumnTitles API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Grid
 | 
			
		||||
// Returns a BOOL indicating whether the children are ordered row major, or column major.
 | 
			
		||||
// Invokes when clients request NSAccessibilityOrderedByRowAttribute
 | 
			
		||||
@property (getter = isAccessibilityOrderedByRow) BOOL accessibilityOrderedByRow API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Layout area
 | 
			
		||||
// Horizontal units
 | 
			
		||||
// Invokes when clients request NSAccessibilityHorizontalUnitsAttribute
 | 
			
		||||
@property NSAccessibilityUnits accessibilityHorizontalUnits API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Vertical units
 | 
			
		||||
// Invokes when clients request NSAccessibilityVerticalUnitsAttribute
 | 
			
		||||
@property NSAccessibilityUnits accessibilityVerticalUnits API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Human-readable description of the horizontal units
 | 
			
		||||
// Invokes when clients request NSAccessibilityHorizontalUnitDescriptionAttribute
 | 
			
		||||
@property (nullable, copy) NSString *accessibilityHorizontalUnitDescription API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Human-readable description of the vertical units
 | 
			
		||||
// Invokes when clients request NSAccessibilityVerticalUnitDescriptionAttribute
 | 
			
		||||
@property (nullable, copy) NSString *accessibilityVerticalUnitDescription API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Layout point from screen point
 | 
			
		||||
// Invokes when clients request NSAccessibilityLayoutPointForScreenPointParameterizedAttribute
 | 
			
		||||
- (NSPoint)accessibilityLayoutPointForScreenPoint:(NSPoint)point API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Layout size from screen size
 | 
			
		||||
// Invokes when clients request NSAccessibilityLayoutSizeForScreenSizeParameterizedAttribute
 | 
			
		||||
- (NSSize)accessibilityLayoutSizeForScreenSize:(NSSize)size API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Screen point from layout point
 | 
			
		||||
// Invokes when clients request NSAccessibilityScreenPointForLayoutPointParameterizedAttribute
 | 
			
		||||
- (NSPoint)accessibilityScreenPointForLayoutPoint:(NSPoint)point API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Screen size from layout size
 | 
			
		||||
// Invokes when clients request NSAccessibilityScreenSizeForLayoutSizeParameterizedAttribute
 | 
			
		||||
- (NSSize)accessibilityScreenSizeForLayoutSize:(NSSize)size API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Layout item
 | 
			
		||||
// UIElements for handles
 | 
			
		||||
// Invokes when clients request NSAccessibilityHandlesAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityHandles API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Level indicator
 | 
			
		||||
// Warning value of a level indicator, typically a number
 | 
			
		||||
// Invokes when clients request NSAccessibilityWarningValueAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityWarningValue API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Critical value of a level indicator, typically a number
 | 
			
		||||
// Invokes when clients request NSAccessibilityCriticalValueAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityCriticalValue API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Outline
 | 
			
		||||
// Returns true if sub-rows are visible
 | 
			
		||||
// Invokes when clients request NSAccessibilityDisclosingAttribute
 | 
			
		||||
@property (getter = isAccessibilityDisclosed) BOOL accessibilityDisclosed API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for disclosing row
 | 
			
		||||
// Invokes when clients request NSAccessibilityDisclosedByRowAttribute
 | 
			
		||||
@property (nullable, weak) id accessibilityDisclosedByRow API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of UIElements for disclosed rows of the current ruw (ie, sub-rows)
 | 
			
		||||
// Invokes when clients request NSAccessibilityDisclosedRowsAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityDisclosedRows API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Indentation level
 | 
			
		||||
// Invokes when clients request NSAccessibilityDisclosureLevelAttribute
 | 
			
		||||
@property NSInteger accessibilityDisclosureLevel API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Ruler
 | 
			
		||||
// Invokes when clients request NSAccessibilityMarkerUIElementsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityMarkerUIElements API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Invokes when clients request NSAccessibilityMarkerValuesAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityMarkerValues API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Invokes when clients request NSAccessibilityMarkerGroupUIElementAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityMarkerGroupUIElement API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Ruler units
 | 
			
		||||
// Invokes when clients request NSAccessibilityUnitsAttribute
 | 
			
		||||
@property NSAccessibilityUnits accessibilityUnits API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Human-readable description of the ruler units
 | 
			
		||||
// Invokes when clients request NSAccessibilityUnitDescriptionAttribute
 | 
			
		||||
@property (nullable, copy) NSString *accessibilityUnitDescription API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Marker type
 | 
			
		||||
// Invokes when clients request NSAccessibilityMarkerTypeAttribute
 | 
			
		||||
@property NSAccessibilityRulerMarkerType accessibilityRulerMarkerType API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Human-readable description of the marker type
 | 
			
		||||
// Invokes when clients request NSAccessibilityMarkerTypeDescriptionAttribute
 | 
			
		||||
@property (nullable, copy) NSString *accessibilityMarkerTypeDescription API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Scrollable region
 | 
			
		||||
// UIElement for the horizontal scroller
 | 
			
		||||
// Invokes when clients request NSAccessibilityHorizontalScrollBarAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityHorizontalScrollBar API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for the vertical scroller
 | 
			
		||||
// Invokes when clients request NSAccessibilityVerticalScrollBarAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityVerticalScrollBar API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Slider
 | 
			
		||||
// Array of allowed values
 | 
			
		||||
// Invokes when clients request NSAccessibilityAllowedValuesAttribute
 | 
			
		||||
@property (nullable, copy) NSArray<NSNumber *> *accessibilityAllowedValues API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of label UIElements
 | 
			
		||||
// Invokes when clients request NSAccessibilityLabelUIElementsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityLabelUIElements API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Value of a label UIElement
 | 
			
		||||
// Invokes when clients request NSAccessibilityLabelValueAttribute
 | 
			
		||||
@property float accessibilityLabelValue API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Splitter
 | 
			
		||||
// UIElements for splitters
 | 
			
		||||
// Invokes when clients request NSAccessibilitySplittersAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilitySplitters API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Stepper
 | 
			
		||||
// UIElement for the decrement button
 | 
			
		||||
// Invokes when clients request NSAccessibilityDecrementButtonAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityDecrementButton API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for the increment button
 | 
			
		||||
// Invokes when clients request NSAccessibilityIncrementButtonAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityIncrementButton API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Tab view
 | 
			
		||||
// UIElements for tabs
 | 
			
		||||
// Invokes when clients request NSAccessibilityTabsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityTabs API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Table/Outline
 | 
			
		||||
// UIElement for header
 | 
			
		||||
// Invokes when clients request NSAccessibilityHeaderAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityHeader API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Number of columns
 | 
			
		||||
// Invokes when clients request NSAccessibilityColumnCountAttribute
 | 
			
		||||
@property NSInteger accessibilityColumnCount API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Number of rows
 | 
			
		||||
// Invokes when clients request NSAccessibilityRowCountAttribute
 | 
			
		||||
@property NSInteger accessibilityRowCount API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Index of the current UIElement (row index for a row, column index for a column)
 | 
			
		||||
// Invokes when clients request NSAccessibilityIndexAttribute
 | 
			
		||||
@property NSInteger accessibilityIndex API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of UIElements for columns
 | 
			
		||||
// Invokes when clients request NSAccessibilityColumnsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityColumns API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of UIElements for rows
 | 
			
		||||
// Invokes when clients request NSAccessibilityRowsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityRows API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of UIElements for visible rows
 | 
			
		||||
// Invokes when clients request NSAccessibilityVisibleRowsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityVisibleRows API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of UIElements for selected rows
 | 
			
		||||
// Invokes when clients request NSAccessibilitySelectedRowsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilitySelectedRows API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of UIElements for visible columns
 | 
			
		||||
// Invokes when clients request NSAccessibilityVisibleColumnsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityVisibleColumns API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of UIElements for selected columns
 | 
			
		||||
// Invokes when clients request NSAccessibilitySelectedColumnsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilitySelectedColumns API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Sort direction
 | 
			
		||||
// Invokes when clients request NSAccessibilitySortDirectionAttribute
 | 
			
		||||
@property NSAccessibilitySortDirection accessibilitySortDirection API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Table (cell based)
 | 
			
		||||
// Array of UIElements for row headers
 | 
			
		||||
// Invokes when clients request NSAccessibilityRowHeaderUIElementsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityRowHeaderUIElements API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of UIElements for selected cells
 | 
			
		||||
// Invokes when clients request NSAccessibilitySelectedCellsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilitySelectedCells API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of UIElements for visible cells
 | 
			
		||||
// Invokes when clients request NSAccessibilityVisibleCellsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityVisibleCells API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of UIElements for column headers
 | 
			
		||||
// Invokes when clients request NSAccessibilityColumnHeaderUIElementsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilityColumnHeaderUIElements API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for cell at specified row and column
 | 
			
		||||
// Invokes when clients request NSAccessibilityCellForColumnAndRowParameterizedAttribute
 | 
			
		||||
- (nullable id)accessibilityCellForColumn:(NSInteger)column row:(NSInteger)row API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Table cell
 | 
			
		||||
// Cell location and row span
 | 
			
		||||
// Invokes when clients request NSAccessibilityRowIndexRangeAttribute
 | 
			
		||||
@property NSRange accessibilityRowIndexRange API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Cell location and column span
 | 
			
		||||
// Invokes when clients request NSAccessibilityColumnIndexRangeAttribute
 | 
			
		||||
@property NSRange accessibilityColumnIndexRange API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Text
 | 
			
		||||
// Line number containing caret
 | 
			
		||||
// Invokes when clients request NSAccessibilityInsertionPointLineNumberAttribute
 | 
			
		||||
@property NSInteger accessibilityInsertionPointLineNumber API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Part of shared text in this view
 | 
			
		||||
// Invokes when clients request NSAccessibilitySharedCharacterRangeAttribute
 | 
			
		||||
@property NSRange accessibilitySharedCharacterRange API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Text views sharing text
 | 
			
		||||
// Invokes when clients request NSAccessibilitySharedTextUIElementsAttribute
 | 
			
		||||
@property (nullable, copy) NSArray *accessibilitySharedTextUIElements API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Range of visible text
 | 
			
		||||
// Invokes when clients request NSAccessibilityVisibleCharacterRangeAttribute
 | 
			
		||||
@property NSRange accessibilityVisibleCharacterRange API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Number of characters
 | 
			
		||||
// Invokes when clients request NSAccessibilityNumberOfCharactersAttribute
 | 
			
		||||
@property NSInteger accessibilityNumberOfCharacters API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// String of selected text
 | 
			
		||||
// Invokes when clients request NSAccessibilitySelectedTextAttribute
 | 
			
		||||
@property (nullable, copy) NSString *accessibilitySelectedText API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Range of selected text
 | 
			
		||||
// Invokes when clients request NSAccessibilitySelectedTextRangeAttribute
 | 
			
		||||
@property NSRange accessibilitySelectedTextRange API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Array of NSValue (rangeValue) ranges of selected text
 | 
			
		||||
// Invokes when clients request NSAccessibilitySelectedTextRangesAttribute
 | 
			
		||||
@property (nullable, copy) NSArray<NSValue *> *accessibilitySelectedTextRanges API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Attributed string for a provided range.
 | 
			
		||||
// does _not_ use attributes from Appkit/AttributedString.h
 | 
			
		||||
// Invokes when clients request NSAccessibilityAttributedStringForRangeParameterizedAttribute
 | 
			
		||||
- (nullable NSAttributedString *)accessibilityAttributedStringForRange:(NSRange)range API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Range for the provided line number
 | 
			
		||||
// Invokes when clients request NSAccessibilityRangeForLineParameterizedAttribute
 | 
			
		||||
- (NSRange)accessibilityRangeForLine:(NSInteger)line API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// String for the provided range
 | 
			
		||||
// Invokes when clients request NSAccessibilityStringForRangeParameterizedAttribute
 | 
			
		||||
- (nullable NSString *)accessibilityStringForRange:(NSRange)range API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Composed character range for the character at the provided point
 | 
			
		||||
// Invokes when clients request NSAccessibilityRangeForPositionParameterizedAttribute
 | 
			
		||||
- (NSRange)accessibilityRangeForPosition:(NSPoint)point API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Composed character range for the provided index
 | 
			
		||||
// Invokes when clients request NSAccessibilityRangeForIndexParameterizedAttribute
 | 
			
		||||
- (NSRange)accessibilityRangeForIndex:(NSInteger)index API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Frame of text in the provided range (in screen coordinates.) See NSAccessibilityFrameInView()
 | 
			
		||||
// Invokes when clients request NSAccessibilityBoundsForRangeParameterizedAttribute
 | 
			
		||||
- (NSRect)accessibilityFrameForRange:(NSRange)range API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// RTF data for text in the provided range
 | 
			
		||||
// Invokes when clients request NSAccessibilityRTFForRangeParameterizedAttribute
 | 
			
		||||
- (nullable NSData *)accessibilityRTFForRange:(NSRange)range API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Extent of style run at the provided index
 | 
			
		||||
// Invokes when clients request NSAccessibilityStyleRangeForIndexParameterizedAttribute
 | 
			
		||||
- (NSRange)accessibilityStyleRangeForIndex:(NSInteger)index API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Line number for character index
 | 
			
		||||
// Invokes when clients request NSAccessibilityLineForIndexParameterizedAttribute
 | 
			
		||||
- (NSInteger)accessibilityLineForIndex:(NSInteger)index API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Window
 | 
			
		||||
// UIElement for toolbar box (or nil)
 | 
			
		||||
// Invokes when clients request NSAccessibilityToolbarButtonAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityToolbarButton API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Is the window modal
 | 
			
		||||
// Invokes when clients request NSAccessibilityModalAttribute
 | 
			
		||||
@property (getter = isAccessibilityModal) BOOL accessibilityModal API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for title's icon (or nil)
 | 
			
		||||
// Invokes when clients request NSAccessibilityProxyAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityProxy API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Returns YES if this is it the main window
 | 
			
		||||
// Invokes when clients request NSAccessibilityMainAttribute
 | 
			
		||||
@property (getter = isAccessibilityMain) BOOL accessibilityMain API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for full screen button
 | 
			
		||||
// Invokes when clients request NSAccessibilityFullScreenButtonAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityFullScreenButton API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for grow box
 | 
			
		||||
// Invokes when clients request NSAccessibilityGrowAreaAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityGrowArea API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// URL for open document
 | 
			
		||||
// Invokes when clients request NSAccessibilityDocumentAttribute
 | 
			
		||||
@property (nullable, copy) NSString *accessibilityDocument API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for default button
 | 
			
		||||
// Invokes when clients request NSAccessibilityDefaultButtonAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityDefaultButton API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for close button
 | 
			
		||||
// Invokes when clients request NSAccessibilityCloseButtonAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityCloseButton API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for zoom button
 | 
			
		||||
// Invokes when clients request NSAccessibilityZoomButtonAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityZoomButton API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// UIElement for minimize button
 | 
			
		||||
// Invokes when clients request NSAccessibilityMinimizeButtonAttribute
 | 
			
		||||
@property (nullable, strong) id accessibilityMinimizeButton API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Returns YES if the window minimized
 | 
			
		||||
// Invokes when clients request NSAccessibilityMinimizedAttribute
 | 
			
		||||
@property (getter = isAccessibilityMinimized) BOOL accessibilityMinimized API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Actions
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSArray<NSAccessibilityCustomAction *> *accessibilityCustomActions API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
// Invokes when clients perform NSAccessibilityCancelAction
 | 
			
		||||
- (BOOL)accessibilityPerformCancel API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Invokes when clients perform NSAccessibilityConfirmAction
 | 
			
		||||
- (BOOL)accessibilityPerformConfirm API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Invokes when clients perform NSAccessibilityDecrementAction
 | 
			
		||||
- (BOOL)accessibilityPerformDecrement API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Invokes when clients perform NSAccessibilityDeleteAction
 | 
			
		||||
- (BOOL)accessibilityPerformDelete API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Invokes when clients perform NSAccessibilityIncrementAction
 | 
			
		||||
- (BOOL)accessibilityPerformIncrement API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Invokes when clients perform NSAccessibilityPickAction
 | 
			
		||||
- (BOOL)accessibilityPerformPick API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Invokes when clients perform NSAccessibilityPressAction
 | 
			
		||||
- (BOOL)accessibilityPerformPress API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Invokes when clients perform NSAccessibilityRaiseAction
 | 
			
		||||
- (BOOL)accessibilityPerformRaise API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Invokes when clients perform NSAccessibilityShowAlternateUIAction
 | 
			
		||||
- (BOOL)accessibilityPerformShowAlternateUI API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Invokes when clients perform NSAccessibilityShowDefaultUIAction
 | 
			
		||||
- (BOOL)accessibilityPerformShowDefaultUI API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Invokes when clients perform NSAccessibilityShowMenuAction
 | 
			
		||||
- (BOOL)accessibilityPerformShowMenu API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#pragma mark Allowed Selectors
 | 
			
		||||
// Returns YES if accessibility clients should be able to invoke the provided selector
 | 
			
		||||
- (BOOL)isAccessibilitySelectorAllowed:(SEL)selector API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,23 @@
 | 
			
		||||
/*
 | 
			
		||||
        NSActionCell.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSCell.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@interface NSActionCell : NSCell
 | 
			
		||||
 | 
			
		||||
@property (nullable, weak) id target; // Target is weak for zeroing-weak compatible objects in apps linked on 10.10 or later. Otherwise the behavior of this property is 'assign’.
 | 
			
		||||
@property (nullable) SEL action;
 | 
			
		||||
@property NSInteger tag;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,26 @@
 | 
			
		||||
/*
 | 
			
		||||
        NSAffineTransform.h
 | 
			
		||||
        Application Kit
 | 
			
		||||
        Copyright (c) 1997-2021, Apple Inc.
 | 
			
		||||
        All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSAffineTransform.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSBezierPath;
 | 
			
		||||
 | 
			
		||||
@interface NSAffineTransform (NSAppKitAdditions)
 | 
			
		||||
// Transform a path
 | 
			
		||||
- (NSBezierPath *)transformBezierPath:(NSBezierPath *)path;
 | 
			
		||||
 | 
			
		||||
// Setting a transform in NSGraphicsContext
 | 
			
		||||
- (void)set;
 | 
			
		||||
- (void)concat;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,147 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSAlert.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <AppKit/NSApplication.h>
 | 
			
		||||
#import <AppKit/NSHelpManager.h>
 | 
			
		||||
#import <AppKit/NSGraphics.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSTextField, NSPanel, NSWindow, NSImage, NSButton, NSError;
 | 
			
		||||
@protocol NSAlertDelegate;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* The default alert style is NSAlertStyleWarning.  NSAlertStyleCritical should be reserved for critical alerts and will cause the icon to be badged with a caution icon.
 | 
			
		||||
*/
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSAlertStyle) {
 | 
			
		||||
    NSAlertStyleWarning = 0,
 | 
			
		||||
    NSAlertStyleInformational = 1,
 | 
			
		||||
    NSAlertStyleCritical = 2
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* These are additional NSModalResponse values used by NSAlert's -runModal and -beginSheetModalForWindow:completionHandler:.
 | 
			
		||||
 | 
			
		||||
 By default, NSAlert return values are position dependent, with this mapping:
 | 
			
		||||
 first (rightmost) button = NSAlertFirstButtonReturn
 | 
			
		||||
 second button = NSAlertSecondButtonReturn
 | 
			
		||||
 third button = NSAlertThirdButtonReturn
 | 
			
		||||
 buttonPosition 3+x = NSAlertThirdButtonReturn + x
 | 
			
		||||
 | 
			
		||||
 Note that these return values do not apply to an NSAlert created via +alertWithMessageText:defaultButton:alternateButton:otherButton:informativeTextWithFormat:, which instead uses the same return values as NSRunAlertPanel.  See NSAlertDefaultReturn, etc. in NSPanel.h
 | 
			
		||||
 */
 | 
			
		||||
static const NSModalResponse NSAlertFirstButtonReturn = 1000;
 | 
			
		||||
static const NSModalResponse NSAlertSecondButtonReturn = 1001;
 | 
			
		||||
static const NSModalResponse NSAlertThirdButtonReturn = 1002;
 | 
			
		||||
 | 
			
		||||
NS_SWIFT_UI_ACTOR
 | 
			
		||||
@interface NSAlert : NSObject
 | 
			
		||||
 | 
			
		||||
/* Given an NSError, create an NSAlert that can be used to present the error to the user. The error's localized description, recovery suggestion, and recovery options will be used to set the alert's message text, informative text, and button titles, respectively.
 | 
			
		||||
*/
 | 
			
		||||
+ (NSAlert *)alertWithError:(NSError *)error;
 | 
			
		||||
 | 
			
		||||
@property (copy) NSString *messageText;
 | 
			
		||||
@property (copy) NSString *informativeText;
 | 
			
		||||
 | 
			
		||||
/* customize the icon.  By default uses the image named NSApplicationIcon.
 | 
			
		||||
*/
 | 
			
		||||
@property (null_resettable, strong) NSImage *icon;
 | 
			
		||||
 | 
			
		||||
/* customize the buttons in the alert panel.  Buttons are added from right to left (for left to right languages).
 | 
			
		||||
*/
 | 
			
		||||
- (NSButton *)addButtonWithTitle:(NSString *)title;
 | 
			
		||||
/* get the buttons, where the rightmost button is at index 0.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSArray<NSButton *> *buttons;
 | 
			
		||||
 | 
			
		||||
/* In order to customize a return value for a button:
 | 
			
		||||
   setTag:(NSInteger)tag;	setting a tag on a button will cause that tag to be the button's return value
 | 
			
		||||
   
 | 
			
		||||
   Note that we reserve the use of the tag for this purpose.  We also reserve the use of the target and the action.
 | 
			
		||||
   
 | 
			
		||||
   By default, the first button has a key equivalent of return which implies a pulsing default button, the button named "Cancel", if any, has a key equivalent of escape, and the button named "Don't Save", if any, has a key equivalent of cmd-d.  The following methods can be used to customize key equivalents:
 | 
			
		||||
   setKeyEquivalent:(NSString *)charCode:
 | 
			
		||||
   setKeyEquivalentModifierMask:(NSUInt)mask;
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* -setShowsHelp:YES adds a help button to the alert panel. When the help button is pressed, the delegate is first consulted.  If the delegate does not implement alertShowHelp: or returns NO, then -[NSHelpManager openHelpAnchor:inBook:] is called with a nil book and the anchor specified by -setHelpAnchor:, if any.  An exception will be raised if the delegate returns NO and there is no help anchor set.
 | 
			
		||||
*/
 | 
			
		||||
@property BOOL showsHelp;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSHelpAnchorName helpAnchor;
 | 
			
		||||
 | 
			
		||||
@property NSAlertStyle alertStyle;
 | 
			
		||||
 | 
			
		||||
/* The delegate of the receiver, currently only allows for custom help behavior of the alert.
 | 
			
		||||
   For apps linked against 10.12, this property has zeroing weak memory semantics. When linked against an older SDK this back to having `retain` semantics, matching legacy behavior.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, weak) id<NSAlertDelegate> delegate;
 | 
			
		||||
 | 
			
		||||
/* -setShowsSuppressionButton: indicates whether or not the alert should contain a suppression checkbox.  The default is NO.  This checkbox is typically used to give the user an option to not show this alert again.  If shown, the suppression button will have a default localized title similar to @"Do not show this message again" (single-button alert) or @"Don't ask again" (multi-button alert).  You can customize this title using [[alert suppressionButton] setTitle:].  When the alert is dismissed, you can get the state of the suppression button, using [[alert suppressionButton] state] and store the result in user defaults, for example.  This setting can then be checked before showing the alert again.  By default, the suppression button is positioned below the informative text, and above the accessory view (if any) and the alert buttons, and left-aligned with the informative text.  However do not count on the placement of this button, since it might be moved if the alert panel user interface is changed in the future. If you need a checkbox for purposes other than suppression text, it is recommended you create your own using an accessory view.
 | 
			
		||||
*/
 | 
			
		||||
@property BOOL showsSuppressionButton API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* -suppressionButton returns a suppression button which may be customized, including the title and the initial state.  You can also use this method to get the state of the button after the alert is dismissed, which may be stored in user defaults and checked before showing the alert again.  In order to show the suppression button in the alert panel, you must call -setShowsSuppressionButton:YES.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, strong) NSButton *suppressionButton API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* -setAccessoryView: sets the accessory view displayed in the alert panel.  By default, the accessory view is positioned below the informative text and the suppression button (if any) and above the alert buttons, left-aligned with the informative text.  If you want to customize the location of the accessory view, you must first call -layout.  See the discussion of -layout for more information.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, strong) NSView *accessoryView API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* -layout can be used to indicate that the alert panel should do immediate layout, overriding the default behavior of laying out lazily just before showing panel.  You should only call this method if you want to do your own custom layout after it returns.  You should call this method only after you have finished with NSAlert customization, including setting message and informative text, and adding buttons and an accessory view if needed.  You can make layout changes after this method returns, in particular to adjust the frame of an accessory view.  Note that the standard layout of the alert may change in the future, so layout customization should be done with caution.
 | 
			
		||||
*/
 | 
			
		||||
- (void)layout API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Run the alert as an application-modal panel and return the result.
 | 
			
		||||
*/
 | 
			
		||||
- (NSModalResponse)runModal;
 | 
			
		||||
 | 
			
		||||
/* Begins a sheet on the doc window using NSWindow's sheet API.
 | 
			
		||||
   If the alert has an alertStyle of NSAlertStyleCritical, it will be shown as a "critical" sheet; it will otherwise be presented as a normal sheet.
 | 
			
		||||
 */
 | 
			
		||||
- (void)beginSheetModalForWindow:(NSWindow *)sheetWindow completionHandler:(void (^ _Nullable)(NSModalResponse returnCode))handler API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
/* return the application-modal panel or the document-modal sheet corresponding to this alert.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, strong) NSWindow *window;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSAlertDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
/* the delegate should implement this if custom help behavior is required.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)alertShowHelp:(NSAlert *)alert;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSAlert (NSAlertDeprecated)
 | 
			
		||||
 | 
			
		||||
/* This was intended for use by apps migrating from the C-based API.  This uses alternate return codes that were compatible with this C-based API, but not with modern alerts, see NSAlertDefaultReturn, etc. in NSPanel.h
 | 
			
		||||
 Alerts should be created with the -init method and setting properties.
 | 
			
		||||
 */
 | 
			
		||||
+ (NSAlert *)alertWithMessageText:(nullable NSString *)message defaultButton:(nullable NSString *)defaultButton alternateButton:(nullable NSString *)alternateButton otherButton:(nullable NSString *)otherButton informativeTextWithFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(5,6) API_DEPRECATED("Use -init instead", macos(10.3,10.10));
 | 
			
		||||
 | 
			
		||||
- (void)beginSheetModalForWindow:(NSWindow *)window modalDelegate:(nullable id)delegate didEndSelector:(nullable SEL)didEndSelector contextInfo:(nullable void *)contextInfo API_DEPRECATED("Use -beginSheetModalForWindow:completionHandler: instead", macos(10.3,10.10));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
static const NSAlertStyle NSWarningAlertStyle API_DEPRECATED_WITH_REPLACEMENT("NSAlertStyleWarning", macos(10.3,10.12)) = NSAlertStyleWarning;
 | 
			
		||||
static const NSAlertStyle NSInformationalAlertStyle API_DEPRECATED_WITH_REPLACEMENT("NSAlertStyleInformational", macos(10.3,10.12)) = NSAlertStyleInformational;
 | 
			
		||||
static const NSAlertStyle NSCriticalAlertStyle API_DEPRECATED_WITH_REPLACEMENT("NSAlertStyleCritical", macos(10.3,10.12)) = NSAlertStyleCritical;
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,56 @@
 | 
			
		||||
/*
 | 
			
		||||
 NSAlignmentFeedbackFilter.h
 | 
			
		||||
 Application Kit
 | 
			
		||||
 Copyright (c) 2015-2021, Apple Inc.
 | 
			
		||||
 All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
#import <AppKit/NSEvent.h>
 | 
			
		||||
#import <AppKit/NSHapticFeedback.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
@class NSPanGestureRecognizer;
 | 
			
		||||
@class NSView;
 | 
			
		||||
 | 
			
		||||
@protocol NSAlignmentFeedbackToken <NSObject>
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.11))
 | 
			
		||||
@interface NSAlignmentFeedbackFilter : NSObject
 | 
			
		||||
 | 
			
		||||
/*  The event mask indicating which event types the filter accepts. Suitable for use in tracking loops.
 | 
			
		||||
 */
 | 
			
		||||
@property (class, readonly) NSEventMask inputEventMask;
 | 
			
		||||
 | 
			
		||||
/*  Input a new event matching +inputEventMask.
 | 
			
		||||
 */
 | 
			
		||||
- (void)updateWithEvent:(NSEvent *)event;
 | 
			
		||||
 | 
			
		||||
/*  Input events from a pan gesture recognizer. Use this instead of -updateWithEvent: if your event handling uses gesture recognizers.
 | 
			
		||||
 */
 | 
			
		||||
- (void)updateWithPanRecognizer:(NSPanGestureRecognizer *)panRecognizer;
 | 
			
		||||
 | 
			
		||||
/*  Prepare haptic feedback for object movement due to alignment from one location to another. Returns a context object which may be performed later, or nil if no alignment should be performed. previousPoint must be the last location which the user saw the object at. alignedPoint must be the latest location if the alignment is allowed. defaultPoint must be the location which the item will be at if the alignment does not take effect. To prevent unnecessary haptic feedback to the user, it's important that the correct three locations are used.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable id<NSAlignmentFeedbackToken>)alignmentFeedbackTokenForMovementInView:(nullable NSView *)view previousPoint:(NSPoint)previousPoint alignedPoint:(NSPoint)alignedPoint defaultPoint:(NSPoint)defaultPoint;
 | 
			
		||||
 | 
			
		||||
/*  Same as alignmentFeedbackTokenForMovementInView:previousPoint:alignedPoint:defaultPoint:, except that it ignores any vertical movement.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable id<NSAlignmentFeedbackToken>)alignmentFeedbackTokenForHorizontalMovementInView:(nullable NSView *)view previousX:(CGFloat)previousX alignedX:(CGFloat)alignedX defaultX:(CGFloat)defaultX;
 | 
			
		||||
 | 
			
		||||
/*  Same as alignmentFeedbackTokenForMovementInView:previousPoint:alignedPoint:defaultPoint:, except that it ignores any horizontal movement.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable id<NSAlignmentFeedbackToken>)alignmentFeedbackTokenForVerticalMovementInView:(nullable NSView *)view previousY:(CGFloat)previousY alignedY:(CGFloat)alignedY defaultY:(CGFloat)defaultY;
 | 
			
		||||
 | 
			
		||||
/*  Performs haptic feedback described by one or more alignment feedback tokens, typically at most one per dimension. This should be called immediately before the updated location will be presented to the user.
 | 
			
		||||
 */
 | 
			
		||||
- (void)performFeedback:(NSArray<id<NSAlignmentFeedbackToken>> *)alignmentFeedbackTokens performanceTime:(NSHapticFeedbackPerformanceTime)performanceTime;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,152 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSAnimation.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 2004-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSGraphicsContext, NSString;
 | 
			
		||||
@protocol NSAnimationDelegate;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSAnimationCurve) {
 | 
			
		||||
    NSAnimationEaseInOut,       // default
 | 
			
		||||
    NSAnimationEaseIn,
 | 
			
		||||
    NSAnimationEaseOut,
 | 
			
		||||
    NSAnimationLinear
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSAnimationBlockingMode) {
 | 
			
		||||
    NSAnimationBlocking,
 | 
			
		||||
    NSAnimationNonblocking,
 | 
			
		||||
    NSAnimationNonblockingThreaded
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef float NSAnimationProgress;
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSAnimationProgressMarkNotification; // has single entry in user info dictionary
 | 
			
		||||
APPKIT_EXTERN NSString * NSAnimationProgressMark; // NSNumber(float) with NSAnimationProgress
 | 
			
		||||
 | 
			
		||||
@interface NSAnimation : NSObject <NSCopying, NSCoding>
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithDuration:(NSTimeInterval)duration animationCurve:(NSAnimationCurve)animationCurve NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (void)startAnimation;
 | 
			
		||||
- (void)stopAnimation;
 | 
			
		||||
@property (getter=isAnimating, readonly) BOOL animating;
 | 
			
		||||
 | 
			
		||||
@property NSAnimationProgress currentProgress;
 | 
			
		||||
 | 
			
		||||
@property NSTimeInterval duration;
 | 
			
		||||
 | 
			
		||||
@property NSAnimationBlockingMode animationBlockingMode;
 | 
			
		||||
 | 
			
		||||
@property float frameRate;
 | 
			
		||||
 | 
			
		||||
@property NSAnimationCurve animationCurve;
 | 
			
		||||
 | 
			
		||||
@property (readonly) float currentValue;
 | 
			
		||||
 | 
			
		||||
@property (nullable, weak) id<NSAnimationDelegate> delegate;
 | 
			
		||||
 | 
			
		||||
@property (copy) NSArray<NSNumber *> *progressMarks;
 | 
			
		||||
 | 
			
		||||
- (void)addProgressMark:(NSAnimationProgress)progressMark;
 | 
			
		||||
- (void)removeProgressMark:(NSAnimationProgress)progressMark;
 | 
			
		||||
 | 
			
		||||
- (void)startWhenAnimation:(NSAnimation *)animation reachesProgress:(NSAnimationProgress)startProgress;
 | 
			
		||||
- (void)stopWhenAnimation:(NSAnimation *)animation reachesProgress:(NSAnimationProgress)stopProgress;
 | 
			
		||||
 | 
			
		||||
- (void)clearStartAnimation;
 | 
			
		||||
- (void)clearStopAnimation;
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSArray<NSRunLoopMode> *runLoopModesForAnimating;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSAnimationDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
- (BOOL)animationShouldStart:(NSAnimation *)animation;
 | 
			
		||||
- (void)animationDidStop:(NSAnimation *)animation;
 | 
			
		||||
- (void)animationDidEnd:(NSAnimation *)animation;
 | 
			
		||||
- (float)animation:(NSAnimation *)animation valueForProgress:(NSAnimationProgress)progress;
 | 
			
		||||
- (void)animation:(NSAnimation *)animation didReachProgressMark:(NSAnimationProgress)progress;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/*-----------------------------------------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSViewAnimationKey NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSViewAnimationKey NSViewAnimationTargetKey;       // NSWindow* or NSView* (required)
 | 
			
		||||
APPKIT_EXTERN NSViewAnimationKey NSViewAnimationStartFrameKey;   // NSValue*(NSRect) (optional)
 | 
			
		||||
APPKIT_EXTERN NSViewAnimationKey NSViewAnimationEndFrameKey;     // NSValue*(NSRect) (optional)
 | 
			
		||||
APPKIT_EXTERN NSViewAnimationKey NSViewAnimationEffectKey;       // NSViewAnimationEffectName (optional)
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSViewAnimationEffectName NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSViewAnimationEffectName NSViewAnimationFadeInEffect;
 | 
			
		||||
APPKIT_EXTERN NSViewAnimationEffectName NSViewAnimationFadeOutEffect;
 | 
			
		||||
 | 
			
		||||
@interface NSViewAnimation : NSAnimation
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithViewAnimations:(NSArray<NSDictionary<NSViewAnimationKey, id> *> *)viewAnimations;
 | 
			
		||||
 | 
			
		||||
@property (copy) NSArray<NSDictionary<NSViewAnimationKey, id> *> *viewAnimations;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSAnimatablePropertyKey NS_SWIFT_BRIDGED_TYPEDEF;
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.5), ios(10.13))
 | 
			
		||||
@protocol NSAnimatablePropertyContainer
 | 
			
		||||
 | 
			
		||||
/* Returns a proxy object for the receiver that can be used to initiate implied animation of property changes. An object's "animator" should be treated as if it was the object itself, and may be passed to any code that accepts the object as a parameter. Sending of KVC-compliant "set" messages to the proxy will trigger animation for automatically animated properties of its target object, if the active NSAnimationContext in the current thread has a duration value greater than zero, and an animation to use for the property key is found by the -animationForKey: search mechanism defined below. An object's automatically animated properties are those for which [theObject animationForKey:] finds and returns an CAAnimation instead of nil, often because [[theObject class] defaultAnimationForKey:] specifies a default animation for the key.
 | 
			
		||||
 | 
			
		||||
It's perfectly valid to set a new value for a property for which an animation is currently in progress; this simply sets a new target value for that property, with animation to the new target proceeding from whatever current value the property has reached. An in-flight property animation can be stopped by setting a new value for the property with 0.0 as the surrounding NSAnimationContext's duration value.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)animator API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* An animatable property container's optional "animations" dictionary maps NSString keys to CAAnimation values. When an occurrence matching the key fires for the view, -animationForKey: first looks in this dictionary for an animation to execute in response. Typically, the key will name a property of the object whose value has just changed, but it may instead specify a special event trigger (NSAnimationTriggerOrderIn or NSAnimationTriggerOrderOut).
 | 
			
		||||
*/
 | 
			
		||||
@property (readwrite, copy) NSDictionary<NSAnimatablePropertyKey, id> *animations API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* When the occurrence specified by "key" fires for an object, this method is consulted to find the animation, if any, that should be performed in response. Like its counterpart, -[CALayer actionForKey:], this method is a funnel point that defines the order in which the search for an animation proceeds, and is not one that clients would typically need to override. It first checks the receiver's "animations" dictionary, then falls back to  +defaultAnimationForKey: for the receiver's class.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable id)animationForKey:(NSAnimatablePropertyKey)key API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* As described above, -animationForKey: consults this class method when its search of an instance's "animations" dictionary doesn't turn up an animation to use for a given property change.
 | 
			
		||||
 | 
			
		||||
An animatable property container should implement +defaultAnimationForKey: to return a default animation to be performed for each key that it wants to make auto-animatable, where "key" usually names a property of the receiver, but can also specify a special animation trigger (NSAnimationTriggerOrderIn or NSAnimationTriggerOrderOut).
 | 
			
		||||
 | 
			
		||||
A developer implementing a custom view subclass, for example, can enable automatic animation the subclass' added properties by overriding this method, and having it return the desired default CAAnimation to use for each of the property keys of interest. The override should defer to super for any keys it doesn't specifically handle, facilitating inheritance of default animation specifications.
 | 
			
		||||
 | 
			
		||||
The full set of available CAAnimation classes can be found in QuartzCore/CAAnimation.h.  Useful concrete animation classes are CABasicAnimation, CAKeyframeAnimation, CAAnimationGroup, and CATransition, all of which can be instantiated with default parameters by sending the class an +animation message.
 | 
			
		||||
 | 
			
		||||
@implementation MyView
 | 
			
		||||
+ (id)defaultAnimationForKey:(NSString *)key {
 | 
			
		||||
    if ([key isEqualToString:@"borderColor"]) {
 | 
			
		||||
        // By default, animate border color changes with simple linear interpolation to the new color value.
 | 
			
		||||
        return [CABasicAnimation animation];
 | 
			
		||||
    } else {
 | 
			
		||||
        // Defer to super's implementation for any keys we don't specifically handle.
 | 
			
		||||
        return [super defaultAnimationForKey:key];
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@end
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable id)defaultAnimationForKey:(NSAnimatablePropertyKey)key API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
@end /* @protocol NSAnimatablePropertyContainer */
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAnimatablePropertyKey NSAnimationTriggerOrderIn API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSAnimatablePropertyKey NSAnimationTriggerOrderOut API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,42 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSAnimationContext.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 2006-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSDate.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class CAMediaTimingFunction;
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.5))
 | 
			
		||||
@interface NSAnimationContext : NSObject
 | 
			
		||||
 | 
			
		||||
+ (void)runAnimationGroup:(void (NS_NOESCAPE ^)(NSAnimationContext * context))changes completionHandler:(nullable void (^)(void))completionHandler API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
+ (void)runAnimationGroup:(void (NS_NOESCAPE ^)(NSAnimationContext * context))changes API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
+ (void)beginGrouping;
 | 
			
		||||
+ (void)endGrouping;
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, strong) NSAnimationContext *currentContext;
 | 
			
		||||
 | 
			
		||||
@property NSTimeInterval duration;
 | 
			
		||||
@property (nullable, strong) CAMediaTimingFunction *timingFunction API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) void (^completionHandler)(void) API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Determine if animations are enabled or not. Using the -animator proxy will automatically set allowsImplicitAnimation to YES. When YES, other properties can implicitly animate along with the initially changed property. For instance, calling [[view animator] setFrame:frame] will allow subviews to also animate their frame positions. This is only applicable when layer backed on Mac OS 10.8 and later. The default value is NO.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL allowsImplicitAnimation API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,95 @@
 | 
			
		||||
/*
 | 
			
		||||
        NSAppearance.h
 | 
			
		||||
        Application Kit
 | 
			
		||||
        Copyright (c) 2011-2021, Apple Inc.
 | 
			
		||||
        All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSString, NSBundle;
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSAppearanceName NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.9))
 | 
			
		||||
@interface NSAppearance : NSObject <NSSecureCoding> 
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSAppearanceName name API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
// Sets the current thread's appearance, which is used for drawing, resolving colors/images, and laying out views.
 | 
			
		||||
// Automatically set by NSView before that view's drawRect:, updateLayer, and layout methods are invoked.
 | 
			
		||||
// At other times its return value is unreliable (depending on if the previous caller restored it to a previous value after setting it).
 | 
			
		||||
// This is not the correct way to determine the 'system' appearance. Use a view's, window's, or the app's effectiveAppearance.
 | 
			
		||||
@property (class, null_resettable, strong) NSAppearance *currentAppearance API_DEPRECATED("Use -performAsCurrentDrawingAppearance: to temporarily set the drawing appearance, or +currentDrawingAppearance to access the currently drawing appearance.", macos(10.9, 12.0));
 | 
			
		||||
 | 
			
		||||
// The appearance which has been made active for drawing (usually by locking focus on a view)
 | 
			
		||||
// and is used for color and asset resolution.
 | 
			
		||||
@property (class, readonly, strong) NSAppearance *currentDrawingAppearance API_AVAILABLE(macos(11.0));
 | 
			
		||||
 | 
			
		||||
// Make the receiver the active drawing appearance and perform the block.
 | 
			
		||||
// Saves and restores the previous current appearance.
 | 
			
		||||
- (void)performAsCurrentDrawingAppearance:(void (NS_NOESCAPE ^)(void))block API_AVAILABLE(macos(11.0));
 | 
			
		||||
 | 
			
		||||
/* Finds and returns an NSAppearance based on the name. 
 | 
			
		||||
 For standard appearances such as NSAppearanceNameAqua, a built-in appearance is returned.
 | 
			
		||||
 For other names, the main bundle is searched.
 | 
			
		||||
 */
 | 
			
		||||
+ (nullable NSAppearance *)appearanceNamed:(NSAppearanceName)name;
 | 
			
		||||
 | 
			
		||||
/* Creates an NSAppearance by searching the specified bundle for a file with the specified name (without path extension).
 | 
			
		||||
    If bundle is nil, the main bundle is assumed.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable instancetype)initWithAppearanceNamed:(NSAppearanceName)name bundle:(nullable NSBundle *)bundle NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
/* Query allowsVibrancy to see if the given appearance actually needs vibrant drawing. You may want to draw differently if the current apperance is vibrant.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) BOOL allowsVibrancy API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
/* Given a list of appearance names, returns the one that best matches the receiver
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSAppearanceName)bestMatchFromAppearancesWithNames:(NSArray<NSAppearanceName> *)appearances API_AVAILABLE(macos(10.14));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
#pragma mark Standard Appearances
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameAqua API_AVAILABLE(macos(10.9));
 | 
			
		||||
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameDarkAqua API_AVAILABLE(macos(10.14));
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameLightContent API_DEPRECATED("Light content should use the default Aqua apppearance.", macos(10.9,10.10));
 | 
			
		||||
 | 
			
		||||
/* The following two Vibrant appearances should only be set on an NSVisualEffectView, or one of its container subviews.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameVibrantDark API_AVAILABLE(macos(10.10));
 | 
			
		||||
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameVibrantLight API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
/* The following appearance names are for matching using bestMatchFromAppearancesWithNames:
 | 
			
		||||
   Passing any of them to appearanceNamed: will return NULL
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameAccessibilityHighContrastAqua API_AVAILABLE(macos(10.14));
 | 
			
		||||
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameAccessibilityHighContrastDarkAqua API_AVAILABLE(macos(10.14));
 | 
			
		||||
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameAccessibilityHighContrastVibrantLight API_AVAILABLE(macos(10.14));
 | 
			
		||||
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameAccessibilityHighContrastVibrantDark API_AVAILABLE(macos(10.14));
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
 | 
			
		||||
@protocol NSAppearanceCustomization <NSObject>
 | 
			
		||||
@required
 | 
			
		||||
 | 
			
		||||
@property (nullable, strong) NSAppearance *appearance API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
/* This returns the appearance that would be used when drawing the receiver, taking inherited appearances into account.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly, strong) NSAppearance *effectiveAppearance API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,27 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSAppleScriptExtensions.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2002-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSAppleScript.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSAttributedString;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSAppleScript(NSExtensions)
 | 
			
		||||
 | 
			
		||||
// Return the syntax-highlighted source code of the script if the script has been compiled and its source code is available, nil otherwise.  It is possible for an NSAppleScript that has been instantiated with -initWithContentsOfURL:error: to be a script for which the source code is not available, but is nonetheless executable.
 | 
			
		||||
@property (nullable, readonly, strong) NSAttributedString *richTextSource;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,610 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSApplication.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <AppKit/NSResponder.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <AppKit/NSUserInterfaceValidation.h>
 | 
			
		||||
#import <AppKit/NSRunningApplication.h>
 | 
			
		||||
#import <AppKit/NSUserActivity.h>
 | 
			
		||||
#import <AppKit/NSUserInterfaceLayout.h>
 | 
			
		||||
#import <AppKit/NSPrintInfo.h>
 | 
			
		||||
#import <AppKit/NSPasteboard.h>
 | 
			
		||||
#import <AppKit/NSAppearance.h>
 | 
			
		||||
#import <AppKit/NSMenu.h>
 | 
			
		||||
 | 
			
		||||
@protocol NSUserActivityRestoring;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSDate, NSDictionary, NSError, NSException, NSNotification;
 | 
			
		||||
@class NSGraphicsContext, NSImage, NSPasteboard, NSWindow;
 | 
			
		||||
@class NSDockTile;
 | 
			
		||||
@class NSUserActivity;
 | 
			
		||||
@class CKShareMetadata;
 | 
			
		||||
@class INIntent;
 | 
			
		||||
@protocol NSApplicationDelegate;
 | 
			
		||||
 | 
			
		||||
typedef double NSAppKitVersion NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
/* The version of the AppKit framework */
 | 
			
		||||
APPKIT_EXTERN const NSAppKitVersion NSAppKitVersionNumber;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_0 = 577;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_1 = 620;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_2 = 663;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_2_3 = 663.6;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_3 = 743;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_3_2 = 743.14;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_3_3 = 743.2;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_3_5 = 743.24;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_3_7 = 743.33;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_3_9 = 743.36;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_4 = 824;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_4_1 = 824.1;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_4_3 = 824.23;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_4_4 = 824.33;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_4_7 = 824.41;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_5 = 949;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_5_2 = 949.27;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_5_3 = 949.33;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_6 = 1038;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_7 = 1138;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_7_2 = 1138.23;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_7_3 = 1138.32;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_7_4 = 1138.47;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_8 = 1187;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_9 = 1265;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_10 = 1343;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_10_2 = 1344;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_10_3 = 1347;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_10_4 = 1348;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_10_5 = 1348;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_10_Max = 1349;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_11 = 1404;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_11_1 = 1404.13;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_11_2 = 1404.34;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_11_3 = 1404.34;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_12 = 1504;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_12_1 = 1504.60;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_12_2 = 1504.76;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_13 = 1561;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_13_1 = 1561.1;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_13_2 = 1561.2;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_13_4 = 1561.4;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_14 = 1671;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_14_1 = 1671.1;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_14_2 = 1671.2;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_14_3 = 1671.3;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_14_4 = 1671.4;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_14_5 = 1671.5;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_15 = 1894;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_15_1 = 1894.1;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_15_2 = 1894.2;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_15_3 = 1894.3;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_15_4 = 1894.4;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_15_5 = 1894.5;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber10_15_6 = 1894.6;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber11_0 = 2022;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber11_1 = 2022.2;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber11_2 = 2022.3;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber11_3 = 2022.4;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumber11_4 = 2022.5;
 | 
			
		||||
 | 
			
		||||
/* Modes passed to NSRunLoop */
 | 
			
		||||
APPKIT_EXTERN NSRunLoopMode NSModalPanelRunLoopMode;
 | 
			
		||||
APPKIT_EXTERN NSRunLoopMode NSEventTrackingRunLoopMode;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Pre-defined return values for -runModalFor: and -runModalSession:. The system also reserves all values below these. Other values can be used. */
 | 
			
		||||
typedef NSInteger NSModalResponse NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
/// Also used as the default response for sheets
 | 
			
		||||
static const NSModalResponse NSModalResponseStop API_AVAILABLE(macos(10.9)) = (-1000);
 | 
			
		||||
static const NSModalResponse NSModalResponseAbort API_AVAILABLE(macos(10.9)) = (-1001);
 | 
			
		||||
static const NSModalResponse NSModalResponseContinue API_AVAILABLE(macos(10.9)) = (-1002);
 | 
			
		||||
 | 
			
		||||
/* used with NSRunLoop's performSelector:target:argument:order:modes: */
 | 
			
		||||
enum {
 | 
			
		||||
    NSUpdateWindowsRunLoopOrdering		= 500000
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSApplicationPresentationOptions) {
 | 
			
		||||
/* Flags that comprise an application's presentationOptions */
 | 
			
		||||
    NSApplicationPresentationDefault                    = 0,
 | 
			
		||||
    NSApplicationPresentationAutoHideDock               = (1 <<  0),    // Dock appears when moused to
 | 
			
		||||
    NSApplicationPresentationHideDock                   = (1 <<  1),    // Dock is entirely unavailable
 | 
			
		||||
 | 
			
		||||
    NSApplicationPresentationAutoHideMenuBar            = (1 <<  2),    // Menu Bar appears when moused to
 | 
			
		||||
    NSApplicationPresentationHideMenuBar                = (1 <<  3),    // Menu Bar is entirely unavailable
 | 
			
		||||
 | 
			
		||||
    NSApplicationPresentationDisableAppleMenu           = (1 <<  4),    // all Apple menu items are disabled
 | 
			
		||||
    NSApplicationPresentationDisableProcessSwitching    = (1 <<  5),    // Cmd+Tab UI is disabled
 | 
			
		||||
    NSApplicationPresentationDisableForceQuit           = (1 <<  6),    // Cmd+Opt+Esc panel is disabled
 | 
			
		||||
    NSApplicationPresentationDisableSessionTermination  = (1 <<  7),    // PowerKey panel and Restart/Shut Down/Log Out disabled
 | 
			
		||||
    NSApplicationPresentationDisableHideApplication     = (1 <<  8),    // Application "Hide" menu item is disabled
 | 
			
		||||
    NSApplicationPresentationDisableMenuBarTransparency = (1 <<  9),    // Menu Bar's transparent appearance is disabled
 | 
			
		||||
 | 
			
		||||
    NSApplicationPresentationFullScreen API_AVAILABLE(macos(10.7)) = (1 << 10),         // Application is in fullscreen mode
 | 
			
		||||
    NSApplicationPresentationAutoHideToolbar API_AVAILABLE(macos(10.7)) = (1 << 11),    // Fullscreen window toolbar is detached from window and hides/shows on rollover.  May be used only when both NSApplicationPresentationFullScreen is also set
 | 
			
		||||
    
 | 
			
		||||
    NSApplicationPresentationDisableCursorLocationAssistance API_AVAILABLE(macos(10.11.2)) = (1 << 12)    // "Shake mouse pointer to locate" is disabled for this application
 | 
			
		||||
} API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSApplicationOcclusionState) {
 | 
			
		||||
    // If set, at least part of any window owned by this application is visible. If not set, all parts of all windows owned by this application are completely occluded. The menu bar does not count as a window owned by this application, so if only the menu bar is showing then the application is considered not visible. Status items, however, have windows owned by your application. If the status item is present in the menu bar, your application will be considered visible as long as the menu bar is visible.
 | 
			
		||||
    NSApplicationOcclusionStateVisible = 1UL << 1,
 | 
			
		||||
} API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSInteger, NSWindowListOptions) {
 | 
			
		||||
    NSWindowListOrderedFrontToBack = (1 << 0), /* Onscreen application windows in front to back order. By default, -[NSApp windows] is used. */
 | 
			
		||||
} API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/* Information used by the system during modal sessions */
 | 
			
		||||
typedef struct _NSModalSession *NSModalSession;
 | 
			
		||||
 | 
			
		||||
@interface NSApplication : NSResponder <NSUserInterfaceValidations, NSMenuItemValidation, NSAccessibilityElement, NSAccessibility>
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN __kindof NSApplication * _Null_unspecified NSApp;
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, strong) __kindof NSApplication *sharedApplication;
 | 
			
		||||
@property (nullable, weak) id<NSApplicationDelegate> delegate;
 | 
			
		||||
- (void)hide:(nullable id)sender;
 | 
			
		||||
- (void)unhide:(nullable id)sender;
 | 
			
		||||
- (void)unhideWithoutActivation;
 | 
			
		||||
- (nullable NSWindow *)windowWithWindowNumber:(NSInteger)windowNum;
 | 
			
		||||
@property (nullable, readonly, weak) NSWindow *mainWindow;
 | 
			
		||||
@property (nullable, readonly, weak) NSWindow *keyWindow;
 | 
			
		||||
@property (getter=isActive, readonly) BOOL active;
 | 
			
		||||
@property (getter=isHidden, readonly) BOOL hidden;
 | 
			
		||||
@property (getter=isRunning, readonly) BOOL running;
 | 
			
		||||
- (void)deactivate;
 | 
			
		||||
- (void)activateIgnoringOtherApps:(BOOL)flag;
 | 
			
		||||
 | 
			
		||||
- (void)hideOtherApplications:(nullable id)sender;
 | 
			
		||||
- (void)unhideAllApplications:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
- (void)finishLaunching;
 | 
			
		||||
- (void)run;
 | 
			
		||||
- (NSModalResponse)runModalForWindow:(NSWindow *)window;
 | 
			
		||||
- (void)stop:(nullable id)sender;
 | 
			
		||||
- (void)stopModal;
 | 
			
		||||
- (void)stopModalWithCode:(NSModalResponse)returnCode;
 | 
			
		||||
- (void)abortModal;
 | 
			
		||||
@property (nullable, readonly, strong) NSWindow *modalWindow;
 | 
			
		||||
- (NSModalSession)beginModalSessionForWindow:(NSWindow *)window NS_RETURNS_INNER_POINTER;
 | 
			
		||||
- (NSModalResponse)runModalSession:(NSModalSession)session;
 | 
			
		||||
- (void)endModalSession:(NSModalSession)session;
 | 
			
		||||
- (void)terminate:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSRequestUserAttentionType) {
 | 
			
		||||
      NSCriticalRequest = 0,
 | 
			
		||||
      NSInformationalRequest = 10
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* inform the user that this application needs attention - call this method only if your application is not already active */
 | 
			
		||||
- (NSInteger)requestUserAttention:(NSRequestUserAttentionType)requestType;
 | 
			
		||||
- (void)cancelUserAttentionRequest:(NSInteger)request;
 | 
			
		||||
 | 
			
		||||
/*  Execute a block for each of the app's windows. Set *stop = YES if desired, to halt the enumeration early.
 | 
			
		||||
 */
 | 
			
		||||
- (void)enumerateWindowsWithOptions:(NSWindowListOptions)options usingBlock:(void (NS_NOESCAPE ^)(NSWindow *window, BOOL *stop))block API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
- (void)preventWindowOrdering;
 | 
			
		||||
@property (readonly, copy) NSArray<NSWindow *> *windows;
 | 
			
		||||
- (void)setWindowsNeedUpdate:(BOOL)needUpdate;
 | 
			
		||||
- (void)updateWindows;
 | 
			
		||||
 | 
			
		||||
@property (nullable, strong) NSMenu *mainMenu;
 | 
			
		||||
 | 
			
		||||
/* Set or get the Help menu for the app.  If a non-nil menu is set as the Help menu, Spotlight for Help will be installed in it; otherwise AppKit will install Spotlight for Help into a menu of its choosing (and that menu is not returned from -helpMenu).  If you wish to completely suppress Spotlight for Help, you can set a menu that does not appear in the menu bar.  NSApplication retains its Help menu and releases it when a different menu is set.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, strong) NSMenu *helpMenu API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
@property (null_resettable, strong) NSImage *applicationIconImage;
 | 
			
		||||
 | 
			
		||||
/* Returns the activation policy of the application.
 | 
			
		||||
 */
 | 
			
		||||
- (NSApplicationActivationPolicy)activationPolicy API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Attempts to modify the application's activation policy.  In OS X 10.9, any policy may be set; prior to 10.9, the activation policy may be changed to NSApplicationActivationPolicyProhibited or NSApplicationActivationPolicyRegular, but may not be changed to NSApplicationActivationPolicyAccessory.  This returns YES if setting the activation policy is successful, and NO if not.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)setActivationPolicy:(NSApplicationActivationPolicy)activationPolicy API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@property (readonly, strong) NSDockTile *dockTile API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
- (void)reportException:(NSException *)exception;
 | 
			
		||||
+ (void)detachDrawingThread:(SEL)selector toTarget:(id)target withObject:(nullable id)argument;
 | 
			
		||||
 | 
			
		||||
/* If an application delegate returns NSTerminateLater from -applicationShouldTerminate:, -replyToApplicationShouldTerminate: must be called with YES or NO once the application decides if it can terminate */
 | 
			
		||||
- (void)replyToApplicationShouldTerminate:(BOOL)shouldTerminate;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSApplicationDelegateReply) {
 | 
			
		||||
    NSApplicationDelegateReplySuccess = 0,
 | 
			
		||||
    NSApplicationDelegateReplyCancel = 1,
 | 
			
		||||
    NSApplicationDelegateReplyFailure = 2
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* If an application delegate encounters an error while handling -application:openFiles: or -application:printFiles:, -replyToOpenOrPrint: should be called with NSApplicationDelegateReplyFailure.  If the user cancels the operation, NSApplicationDelegateReplyCancel should be used, and if the operation succeeds, NSApplicationDelegateReplySuccess should be used */
 | 
			
		||||
- (void)replyToOpenOrPrint:(NSApplicationDelegateReply)reply;
 | 
			
		||||
 | 
			
		||||
/* Opens the character palette
 | 
			
		||||
*/
 | 
			
		||||
- (void)orderFrontCharacterPalette:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
/* Gets or sets the presentationOptions that should be in effect for the system when this application is the active application.  Only certain combinations of NSApplicationPresentationOptions flags are allowed, as detailed in the AppKit Release Notes and the reference documentation for -setPresentationOptions:.  When given an invalid combination of option flags, -setPresentationOptions: raises an exception.
 | 
			
		||||
*/
 | 
			
		||||
@property NSApplicationPresentationOptions presentationOptions API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Returns the set of application presentation options that are currently in effect for the system.  These are the presentation options that have been put into effect by the currently active application.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) NSApplicationPresentationOptions currentSystemPresentationOptions API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSApplicationOcclusionState occlusionState API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
@property (readonly, getter=isProtectedDataAvailable) BOOL protectedDataAvailable API_AVAILABLE(macos(12.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSApplication (NSAppearanceCustomization) <NSAppearanceCustomization>
 | 
			
		||||
#pragma clang diagnostic push
 | 
			
		||||
#pragma clang diagnostic ignored "-Wavailability"
 | 
			
		||||
@property (nullable, strong) NSAppearance *appearance API_AVAILABLE(macos(10.14));
 | 
			
		||||
@property (readonly, strong) NSAppearance *effectiveAppearance API_AVAILABLE(macos(10.14));
 | 
			
		||||
#pragma clang diagnostic pop
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSApplication(NSEvent)
 | 
			
		||||
- (void)sendEvent:(NSEvent *)event;
 | 
			
		||||
- (void)postEvent:(NSEvent *)event atStart:(BOOL)flag;
 | 
			
		||||
@property (nullable, readonly, strong) NSEvent *currentEvent;
 | 
			
		||||
- (nullable NSEvent *)nextEventMatchingMask:(NSEventMask)mask untilDate:(nullable NSDate *)expiration inMode:(NSRunLoopMode)mode dequeue:(BOOL)deqFlag;
 | 
			
		||||
- (void)discardEventsMatchingMask:(NSEventMask)mask beforeEvent:(nullable NSEvent *)lastEvent;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSApplication(NSResponder)
 | 
			
		||||
- (BOOL)sendAction:(SEL)action to:(nullable id)target from:(nullable id)sender;
 | 
			
		||||
- (nullable id)targetForAction:(SEL)action;
 | 
			
		||||
- (nullable id)targetForAction:(SEL)action to:(nullable id)target from:(nullable id)sender;
 | 
			
		||||
- (BOOL)tryToPerform:(SEL)action with:(nullable id)object;
 | 
			
		||||
- (nullable id)validRequestorForSendType:(nullable NSPasteboardType)sendType returnType:(nullable NSPasteboardType)returnType;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSApplication(NSWindowsMenu)
 | 
			
		||||
@property (nullable, strong) NSMenu *windowsMenu;
 | 
			
		||||
- (void)arrangeInFront:(nullable id)sender;
 | 
			
		||||
- (void)removeWindowsItem:(NSWindow *)win;
 | 
			
		||||
- (void)addWindowsItem:(NSWindow *)win title:(NSString *)string filename:(BOOL)isFilename;
 | 
			
		||||
- (void)changeWindowsItem:(NSWindow *)win title:(NSString *)string filename:(BOOL)isFilename;
 | 
			
		||||
- (void)updateWindowsItem:(NSWindow *)win;
 | 
			
		||||
- (void)miniaturizeAll:(nullable id)sender;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSApplication(NSFullKeyboardAccess)
 | 
			
		||||
/* Use this method to get the status of Full Keyboard Access, as configured in the Keyboard preference pane. You may use this status to implement your own key loop or to implement in-control tabbing behavior similar to NSTableView. Because of the nature of the preference storage, you will not be notified of changes to the key if you attempt to observe it via key-value observing; however, calling this method is fairly inexpensive, so you should always call it when you need the underlying value instead of caching it.
 | 
			
		||||
 */
 | 
			
		||||
@property (getter=isFullKeyboardAccessEnabled, readonly) BOOL fullKeyboardAccessEnabled API_AVAILABLE(macos(10.6));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
// return values for -applicationShouldTerminate:
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSApplicationTerminateReply) {
 | 
			
		||||
        NSTerminateCancel = 0,
 | 
			
		||||
        NSTerminateNow = 1, 
 | 
			
		||||
        NSTerminateLater = 2
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// return values for -application:printFiles:withSettings:showPrintPanels:.
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSApplicationPrintReply) {
 | 
			
		||||
    NSPrintingCancelled = 0,
 | 
			
		||||
    NSPrintingSuccess = 1, 
 | 
			
		||||
    NSPrintingFailure = 3,
 | 
			
		||||
    NSPrintingReplyLater = 2
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@protocol NSApplicationDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
/* 
 | 
			
		||||
    Allowable return values are:
 | 
			
		||||
        NSTerminateNow - it is ok to proceed with termination
 | 
			
		||||
        NSTerminateCancel - the application should not be terminated
 | 
			
		||||
        NSTerminateLater - it may be ok to proceed with termination later.  The application must call -replyToApplicationShouldTerminate: with YES or NO once the answer is known
 | 
			
		||||
            this return value is for delegates who need to provide document modal alerts (sheets) in order to decide whether to quit.
 | 
			
		||||
*/
 | 
			
		||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
 | 
			
		||||
 | 
			
		||||
/* This will be called for any URLs your application is asked to open. This includes URL types (CFBundleURLTypes) defined in your Info.plist, and Document types (CFBundleDocumentTypes) that have no associated NSDocument class. Document URLs that have an associated NSDocument class will be opened through NSDocumentController. If this is implemented, application:openFiles: and application:openFile: will not be called.
 | 
			
		||||
 */
 | 
			
		||||
- (void)application:(NSApplication *)application openURLs:(NSArray<NSURL *> *)urls API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename;
 | 
			
		||||
- (void)application:(NSApplication *)sender openFiles:(NSArray<NSString *> *)filenames;
 | 
			
		||||
- (BOOL)application:(NSApplication *)sender openTempFile:(NSString *)filename;
 | 
			
		||||
- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender;
 | 
			
		||||
- (BOOL)applicationOpenUntitledFile:(NSApplication *)sender;
 | 
			
		||||
- (BOOL)application:(id)sender openFileWithoutUI:(NSString *)filename;
 | 
			
		||||
- (BOOL)application:(NSApplication *)sender printFile:(NSString *)filename;
 | 
			
		||||
- (NSApplicationPrintReply)application:(NSApplication *)application printFiles:(NSArray<NSString *> *)fileNames withSettings:(NSDictionary<NSPrintInfoAttributeKey, id> *)printSettings showPrintPanels:(BOOL)showPrintPanels;
 | 
			
		||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender;
 | 
			
		||||
- (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag;
 | 
			
		||||
- (nullable NSMenu *)applicationDockMenu:(NSApplication *)sender;
 | 
			
		||||
- (NSError *)application:(NSApplication *)application willPresentError:(NSError *)error;
 | 
			
		||||
 | 
			
		||||
- (void)application:(NSApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken API_AVAILABLE(macos(10.7));
 | 
			
		||||
- (void)application:(NSApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error API_AVAILABLE(macos(10.7));
 | 
			
		||||
- (void)application:(NSApplication *)application didReceiveRemoteNotification:(NSDictionary<NSString *, id> *)userInfo API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/** Method to opt-in to secure restorable state.
 | 
			
		||||
 
 | 
			
		||||
    When this returns YES:
 | 
			
		||||
    * NSCoders that are passed into the various NSWindowRestoration methods will requiresSecureCoding and have a decodingFailurePolicy of NSDecodingFailurePolicySetErrorAndReturn.
 | 
			
		||||
    * Any restorationClass set on a window must explicitly conform to NSWindowRestoration.
 | 
			
		||||
 
 | 
			
		||||
    This method will be called prior to any state encoding or restoration.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app API_AVAILABLE(macos(12.0));
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 Returns the object capable of handling the specified intent.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable id)application:(NSApplication *)application handlerForIntent:(INIntent *)intent API_AVAILABLE(macos(12.0));
 | 
			
		||||
 | 
			
		||||
/* Method called by -[NSApplication encodeRestorableStateWithCoder:] to give the delegate a chance to encode any additional state into the NSCoder. If the restorable state managed by the delegate changes, you must call -[NSApplication invalidateRestorableState] so that it will be re-encoded. See the header NSWindowRestoration.h for more information.
 | 
			
		||||
*/
 | 
			
		||||
- (void)application:(NSApplication *)app willEncodeRestorableState:(NSCoder *)coder API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Method called by -[NSApplication restoreStateWithCoder:] to give the delegate a chance to restore its own state, which it may decode from the NSCoder. See the header NSWindowRestoration.h for more information.
 | 
			
		||||
*/
 | 
			
		||||
- (void)application:(NSApplication *)app didDecodeRestorableState:(NSCoder *)coder API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* NSUserActivity support:
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 
 | 
			
		||||
 This will be called on the main thread as soon as the user indicates they want to continue an activity in your application. The NSUserActivity object may not be available instantly, so use this as an opportunity to show the user that an activity will be continued shortly. Return YES to indicate that you are doing so. Return NO (or leave it unimplemented) and AppKit/UIKit will put up a default UI.
 | 
			
		||||
 
 | 
			
		||||
 For each application:willContinueUserActivityWithType: invocation, you are guaranteed to get exactly one invocation of application:continueUserActivity:restorationHandler: on success, or application:didFailToContinueUserActivityWithType:error: if an error was encountered.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)application:(NSApplication *)application willContinueUserActivityWithType:(NSString *)userActivityType API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 This will be called on the main thread after the NSUserActivity object is available. Use the data you stored in the NSUserActivity object to re-create what the user was doing. Return YES to indicate that the activity was handled. Return NO (or leave it unimplemented) and AppKit will attempt to continue the user activity.
 | 
			
		||||
 
 | 
			
		||||
 You should create/fetch any restorable objects associated with the user activity, and pass them to the restorationHandler. They will then get the above restoreUserActivityState: method invoked with the user activity. Invoking the restorationHandler is optional. It may be copied and invoked later, but must be invoked on the main thread.
 | 
			
		||||
 
 | 
			
		||||
 If this user activity was created automatically by having NSUbiquitousDocumentUserActivityType in a CFBundleDocumentTypes entry, AppKit can automatically restore the NSUserActivity on OS X if NO is returned, or this method is unimplemented. It will do so by creating a document of the appropriate type using the URL stored in the userInfo under the NSUserActivityDocumentURLKey. The document will have restoreUserActivity: called on it.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)application:(NSApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray<id<NSUserActivityRestoring>> *restorableObjects))restorationHandler API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
/* There are instances where continuing a NSUserActivity may fail. This will get called on the main thread if it does so. If it is unimplemented, AppKit will present the error. */
 | 
			
		||||
- (void)application:(NSApplication *)application didFailToContinueUserActivityWithType:(NSString *)userActivityType error:(NSError *)error API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
/* This will be called on the main thread when a user activity managed by AppKit/UIKit has been updated. You should use this as a last chance to add additional data to the userActivity. */
 | 
			
		||||
- (void)application:(NSApplication *)application didUpdateUserActivity:(NSUserActivity *)userActivity API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* This will be called on the main thread after the user indicates they want to accept a CloudKit sharing invitation in your application.
 | 
			
		||||
 
 | 
			
		||||
 You should use the CKShareMetadata object's shareURL and containerIdentifier to schedule a CKAcceptSharesOperation, then start using the resulting CKShare and its associated record(s), which will appear in the CKContainer's shared database in a zone matching that of the record's owner.
 | 
			
		||||
*/
 | 
			
		||||
- (void)application:(NSApplication *)application userDidAcceptCloudKitShareWithMetadata:(CKShareMetadata *)metadata API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/* Key Value Coding support:
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* Return YES if the receiving delegate object can respond to key value coding messages for a specific keyed attribute, to-one relationship, or to-many relationship.  Return NO otherwise.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)application:(NSApplication *)sender delegateHandlesKey:(NSString *)key;
 | 
			
		||||
 | 
			
		||||
/* NSMenu system-wide keyboard shortcut localization support
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* This method will be called once during application launch at [NSApplication finishLaunching].
 | 
			
		||||
 
 | 
			
		||||
   Return NO if the receiving delegate object wishes to opt-out of system-wide keyboard shortcut localization for all application-supplied menus. Return YES by default for apps linked against 12.0 and later SDK.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)applicationShouldAutomaticallyLocalizeKeyEquivalents:(NSApplication *)application API_AVAILABLE(macos(12.0));
 | 
			
		||||
 | 
			
		||||
/* Notifications:
 | 
			
		||||
 */
 | 
			
		||||
- (void)applicationWillFinishLaunching:(NSNotification *)notification;
 | 
			
		||||
- (void)applicationDidFinishLaunching:(NSNotification *)notification;
 | 
			
		||||
- (void)applicationWillHide:(NSNotification *)notification;
 | 
			
		||||
- (void)applicationDidHide:(NSNotification *)notification;
 | 
			
		||||
- (void)applicationWillUnhide:(NSNotification *)notification;
 | 
			
		||||
- (void)applicationDidUnhide:(NSNotification *)notification;
 | 
			
		||||
- (void)applicationWillBecomeActive:(NSNotification *)notification;
 | 
			
		||||
- (void)applicationDidBecomeActive:(NSNotification *)notification;
 | 
			
		||||
- (void)applicationWillResignActive:(NSNotification *)notification;
 | 
			
		||||
- (void)applicationDidResignActive:(NSNotification *)notification;
 | 
			
		||||
- (void)applicationWillUpdate:(NSNotification *)notification;
 | 
			
		||||
- (void)applicationDidUpdate:(NSNotification *)notification;
 | 
			
		||||
- (void)applicationWillTerminate:(NSNotification *)notification;
 | 
			
		||||
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification;
 | 
			
		||||
- (void)applicationDidChangeOcclusionState:(NSNotification *)notification API_AVAILABLE(macos(10.9));
 | 
			
		||||
- (void)applicationProtectedDataWillBecomeUnavailable:(NSNotification *)notification API_AVAILABLE(macos(12.0));
 | 
			
		||||
- (void)applicationProtectedDataDidBecomeAvailable:(NSNotification *)notification API_AVAILABLE(macos(12.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSApplication(NSServicesMenu)
 | 
			
		||||
@property (nullable, strong) NSMenu *servicesMenu;
 | 
			
		||||
- (void)registerServicesMenuSendTypes:(NSArray<NSPasteboardType> *)sendTypes returnTypes:(NSArray<NSPasteboardType> *)returnTypes;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSServicesMenuRequestor <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
- (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pboard types:(NSArray<NSPasteboardType> *)types;
 | 
			
		||||
- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSApplication(NSServicesHandling)
 | 
			
		||||
@property (nullable, strong) id servicesProvider;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* Optional keys in -orderFrontStandardAboutPanelWithOptions: optionsDictionary */
 | 
			
		||||
typedef NSString * NSAboutPanelOptionKey NS_TYPED_ENUM;
 | 
			
		||||
 | 
			
		||||
/// NSAttributedString displayed in the info area of the panel. If not specified, contents obtained from "Credits.rtf" (.rtfd, .html) in [NSBundle mainBundle]; if not available, blank. Note that  in applications built against the 10.14 SDK or earlier, the credits are shown in light appearance even when the application is running in dark appearance, except when the credits are specified as an attributed string, or come from a file are the text is just pure black. In applications built against the 10.15 SDK or newer, credits will be shown in dark appearance, using the "adaptive color mapping" setting in NSTextView.
 | 
			
		||||
APPKIT_EXTERN NSAboutPanelOptionKey const NSAboutPanelOptionCredits API_AVAILABLE(macos(10.13));
 | 
			
		||||
/// NSString displayed in place of the default app name. If not specified, uses the value of CFBundleName (localizable). Fallback is [[NSProcessInfo processInfo] processName].
 | 
			
		||||
APPKIT_EXTERN NSAboutPanelOptionKey const NSAboutPanelOptionApplicationName API_AVAILABLE(macos(10.13));
 | 
			
		||||
/// NSImage displayed in place of NSApplicationIcon. If not specified, use [NSImage imageNamed:@"NSApplicationIcon"]; if not available, generic icon.
 | 
			
		||||
APPKIT_EXTERN NSAboutPanelOptionKey const NSAboutPanelOptionApplicationIcon API_AVAILABLE(macos(10.13));
 | 
			
		||||
/// NSString containing the build version number of the application ("58.4", "1.2d3"); displayed as "Version 58.4" or "Version 1.0 (58.4) depending on the presence of ApplicationVersion. If not specified, obtain from the CFBundleVersion key in infoDictionary; if not specified or empty string, leave blank.
 | 
			
		||||
APPKIT_EXTERN NSAboutPanelOptionKey const NSAboutPanelOptionVersion API_AVAILABLE(macos(10.13));
 | 
			
		||||
/// NSString displayed as the marketing version  ("1.0", "Mac OS X", "3", "WebObjects 3.5", ...), before the build version. If not specified, obtain from CFBundleShortVersionString key in infoDictionary. Prefixed with word "Version" if it looks like a number.
 | 
			
		||||
APPKIT_EXTERN NSAboutPanelOptionKey const NSAboutPanelOptionApplicationVersion API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
@interface NSApplication(NSStandardAboutPanel)
 | 
			
		||||
- (void)orderFrontStandardAboutPanel:(nullable id)sender;
 | 
			
		||||
- (void)orderFrontStandardAboutPanelWithOptions:(NSDictionary<NSAboutPanelOptionKey, id> *)optionsDictionary;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* Bi-directional User Interface
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
@interface NSApplication (NSApplicationLayoutDirection)
 | 
			
		||||
@property (readonly) NSUserInterfaceLayoutDirection userInterfaceLayoutDirection API_AVAILABLE(macos(10.6)); // Returns the application-wide user interface layout direction.
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSApplication (NSRestorableUserInterface)
 | 
			
		||||
 | 
			
		||||
/* Disable or reenable relaunching this app on login, if the app was running at the time the user logged out.  These methods increment and decrement a counter respectively; if the counter is 0 at the time the user logs out, then the app may be relaunched when the user logs back in.  The counter is initially zero, so by default apps are relaunched.
 | 
			
		||||
 
 | 
			
		||||
 If your app should not be relaunched because it launches via some other mechanism (e.g. launchd), then the recommended usage is to call [NSApp disableRelaunchOnLogin] once, and never pair it with an -enable call.
 | 
			
		||||
 
 | 
			
		||||
 If your app should not be relaunched because it triggers a restart (e.g. an installer), then the recommended usage is to call [NSApp disableRelaunchOnLogin] immediately before you attempt to trigger a restart, and [NSApp enableRelaunchOnLogin] immediately after.  This is because the user may cancel restarting; if the user later restarts for another reason, then your app should be brought back.
 | 
			
		||||
 
 | 
			
		||||
 These methods are thread safe.
 | 
			
		||||
 */
 | 
			
		||||
- (void)disableRelaunchOnLogin API_AVAILABLE(macos(10.7));
 | 
			
		||||
- (void)enableRelaunchOnLogin API_AVAILABLE(macos(10.7));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* Soft deprecated. Please use NSApplication's registerForRemoteNotifications along with requestAuthorizationWithOptions: from the UserNotifications.framework to specify allowable notification types.
 | 
			
		||||
*/
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSRemoteNotificationType) {
 | 
			
		||||
    NSRemoteNotificationTypeNone API_AVAILABLE(macos(10.7))    = 0,
 | 
			
		||||
    NSRemoteNotificationTypeBadge API_AVAILABLE(macos(10.7))   = 1 << 0,
 | 
			
		||||
    NSRemoteNotificationTypeSound API_AVAILABLE(macos(10.8))   = 1 << 1,
 | 
			
		||||
    NSRemoteNotificationTypeAlert API_AVAILABLE(macos(10.8))   = 1 << 2,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSApplication (NSRemoteNotifications)
 | 
			
		||||
- (void)registerForRemoteNotifications API_AVAILABLE(macos(10.14));
 | 
			
		||||
- (void)unregisterForRemoteNotifications API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Returns YES if the application is currently registered for remote notifications, taking into account any systemwide settings; doesn't relate to connectivity.
 | 
			
		||||
*/
 | 
			
		||||
@property(readonly, getter=isRegisteredForRemoteNotifications) BOOL registeredForRemoteNotifications API_AVAILABLE(macos(10.14));
 | 
			
		||||
 | 
			
		||||
/* The following are soft deprecated. Please use the registerForRemoteNotifications above and requestAuthorizationWithOptions: from UserNotifications.framework
 | 
			
		||||
*/
 | 
			
		||||
- (void)registerForRemoteNotificationTypes:(NSRemoteNotificationType)types API_AVAILABLE(macos(10.7));
 | 
			
		||||
@property (readonly) NSRemoteNotificationType enabledRemoteNotificationTypes API_AVAILABLE(macos(10.7));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* An Application's startup function */
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN int NSApplicationMain(int argc, const char *_Nonnull argv[_Nonnull]);
 | 
			
		||||
 | 
			
		||||
/* NSApplicationLoad should be called when loading a Cocoa bundle in a Carbon app in order to initialize NSApplication and other Cocoa objects.  Redundant calls are ignored.
 | 
			
		||||
*/  
 | 
			
		||||
APPKIT_EXTERN BOOL NSApplicationLoad(void);
 | 
			
		||||
 | 
			
		||||
/* NSShowsServicesMenuItem() always returns YES. */
 | 
			
		||||
APPKIT_EXTERN BOOL NSShowsServicesMenuItem(NSString *itemName);
 | 
			
		||||
 | 
			
		||||
/* NSSetShowsServicesMenuItem() has no effect, and always returns 0. */
 | 
			
		||||
APPKIT_EXTERN NSInteger NSSetShowsServicesMenuItem(NSString *itemName, BOOL enabled);
 | 
			
		||||
 | 
			
		||||
/* NSUpdateDynamicServices() causes the services information for the system to be updated.  This will only be necessary if your program adds dynamic services to the system (i.e. services not found in mach-o segments of executables).
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN void NSUpdateDynamicServices(void);
 | 
			
		||||
APPKIT_EXTERN BOOL NSPerformService(NSString *itemName, NSPasteboard * _Nullable pboard);
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSServiceProviderName NS_SWIFT_BRIDGED_TYPEDEF;
 | 
			
		||||
APPKIT_EXTERN void NSRegisterServicesProvider(id _Nullable provider, NSServiceProviderName name); // apps should use -setServicesProvider
 | 
			
		||||
APPKIT_EXTERN void NSUnregisterServicesProvider(NSServiceProviderName name);
 | 
			
		||||
 | 
			
		||||
/* Notifications */
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationDidBecomeActiveNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationDidHideNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationDidFinishLaunchingNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationDidResignActiveNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationDidUnhideNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationDidUpdateNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationWillBecomeActiveNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationWillHideNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationWillFinishLaunchingNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationWillResignActiveNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationWillUnhideNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationWillUpdateNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationWillTerminateNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationDidChangeScreenParametersNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationProtectedDataWillBecomeUnavailableNotification API_AVAILABLE(macos(12.0));
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSApplicationProtectedDataDidBecomeAvailableNotification API_AVAILABLE(macos(12.0));
 | 
			
		||||
 | 
			
		||||
/* User info keys for NSApplicationDidFinishLaunchingNotification */
 | 
			
		||||
 | 
			
		||||
/* The following key is present in the userInfo of NSApplicationDidFinishLaunchingNotification.  Its value is an NSNumber containing a bool.  It will be NO if the app was launched to open or print a file, to perform a Service, if the app had saved state that will be restored, or if the app launch was in some other sense not a "default" launch.  Otherwise its value will be YES.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSString * const NSApplicationLaunchIsDefaultLaunchKey API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* The following key is present in the userInfo of NSApplicationDidFinishLaunchingNotification. It will be present if your application was launched because a user activated a notification in the Notification Center. Its value is an NSUserNotification object. */
 | 
			
		||||
APPKIT_EXTERN NSString * const NSApplicationLaunchUserNotificationKey API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
/* Deprecated Keys for NSApplicationDidFinishLaunchingNotification */
 | 
			
		||||
/* NSApplicationLaunchRemoteNotificationKey is unimplemented.  Please use NSApplicationLaunchUserNotificationKey to get the NSUserNotification object.  The NSUserNotification object has an isRemote property to indicate whether this application was launched as a result of a remote notification */
 | 
			
		||||
APPKIT_EXTERN NSString * const NSApplicationLaunchRemoteNotificationKey API_DEPRECATED("", macos(10.7,10.8));
 | 
			
		||||
 | 
			
		||||
/* Upon receiving this notification, you can query the NSApplication for its occlusion state. Note that this only notifies about changes in the state of the occlusion, not when the occlusion region changes. You can use this notification to increase responsiveness and save power, by halting any expensive calculations that the user can not see. */
 | 
			
		||||
APPKIT_EXTERN NSNotificationName const NSApplicationDidChangeOcclusionStateNotification API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Deprecated Methods */
 | 
			
		||||
@interface NSApplication (NSDeprecated)
 | 
			
		||||
 | 
			
		||||
/* -runModalForWindow:relativeToWindow: was deprecated in Mac OS X 10.0. Please use -[NSWindow beginSheet:completionHandler:] instead.
 | 
			
		||||
 */
 | 
			
		||||
- (NSInteger)runModalForWindow:(null_unspecified NSWindow *)window relativeToWindow:(null_unspecified NSWindow *)docWindow API_DEPRECATED("Use -[NSWindow beginSheet:completionHandler:] instead", macos(10.0,10.0));
 | 
			
		||||
 | 
			
		||||
/* -beginModalSessionForWindow:relativeToWindow: was deprecated in Mac OS X 10.0. Please use -[NSWindow beginSheet:completionHandler:] instead.
 | 
			
		||||
 */
 | 
			
		||||
- (NSModalSession)beginModalSessionForWindow:(null_unspecified NSWindow *)window relativeToWindow:(null_unspecified NSWindow *)docWindow NS_RETURNS_INNER_POINTER API_DEPRECATED("Use -[NSWindow beginSheet:completionHandler:] instead", macos(10.0,10.0));
 | 
			
		||||
 | 
			
		||||
/* -application:printFiles: was deprecated in Mac OS X 10.4. Implement application:printFiles:withSettings:showPrintPanels: in your application delegate instead.
 | 
			
		||||
 */
 | 
			
		||||
- (void)application:(null_unspecified NSApplication *)sender printFiles:(null_unspecified NSArray<NSString *> *)filenames API_DEPRECATED("", macos(10.3,10.4));
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
    NSRunStoppedResponse API_DEPRECATED("Use NSModalResponseStop instead", macos(10.0,10.10)) = (-1000),
 | 
			
		||||
    NSRunAbortedResponse API_DEPRECATED("Use NSModalResponseAbort instead", macos(10.0,10.10)) = (-1001),
 | 
			
		||||
    NSRunContinuesResponse API_DEPRECATED("Use NSModalResponseContinue instead", macos(10.0,10.10)) = (-1002)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* NSWindow's -beginSheet:completionHandler: and -endSheet:returnCode: should be used instead.  NSApplication's -beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: will continue to work as it previously did, leaking contextInfo and failing when there is already an existing sheet.
 | 
			
		||||
 */
 | 
			
		||||
- (void)beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow *)docWindow modalDelegate:(nullable id)modalDelegate didEndSelector:(nullable SEL)didEndSelector contextInfo:(null_unspecified void *)contextInfo API_DEPRECATED("Use -[NSWindow beginSheet:completionHandler:] instead", macos(10.0,10.10));
 | 
			
		||||
- (void)endSheet:(NSWindow *)sheet API_DEPRECATED("Use -[NSWindow endSheet:] instead", macos(10.0,10.10));
 | 
			
		||||
- (void)endSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode API_DEPRECATED("Use -[NSWindow endSheet:returnCode:] instead", macos(10.0,10.10));
 | 
			
		||||
 | 
			
		||||
- (nullable NSWindow *)makeWindowsPerform:(SEL)selector inOrder:(BOOL)flag API_DEPRECATED("Use -enumerateWindowsWithOptions:usingBlock: instead", macos(10.0,10.14));
 | 
			
		||||
 | 
			
		||||
/* This method is deprecated as of macOS 10.12. Beginning in OS X 10.11 it would always return nil. Prior to this it would return an undefined graphics context that was not generally suitable for drawing.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, readonly, strong) NSGraphicsContext *context API_DEPRECATED("This method always returns nil. If you need access to the current drawing context, use [NSGraphicsContext currentContext] inside of a draw operation.", macos(10.0,10.12));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,37 @@
 | 
			
		||||
/*
 | 
			
		||||
        NSApplicationScripting.h
 | 
			
		||||
        AppKit Framework
 | 
			
		||||
        Copyright (c) 1997-2021, Apple Inc.
 | 
			
		||||
        All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <AppKit/NSApplication.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSDocument, NSWindow;
 | 
			
		||||
 | 
			
		||||
@interface NSApplication(NSScripting)
 | 
			
		||||
 | 
			
		||||
// A key value coding compliant get-accessor for the orderedDocuments to-many-relationship declared in Cocoa's definition of the Standard Suite.  Return an array of currently open scriptable documents, in a predictable order that will be meaningful to script writers.  NSApplication's implementation of this method returns pointers to all NSDocuments in the front-to-back order of each document's frontmost window.  NSDocuments that have no associated windows are at the end of the array.
 | 
			
		||||
@property (readonly, copy) NSArray<NSDocument *> *orderedDocuments;
 | 
			
		||||
 | 
			
		||||
// A key value coding compliant get-accessor for the orderedWindows to-many-relationship declared in Cocoa's definition of the Standard Suite.  Return an array of currently open scriptable windows, including hidden windows, but typically not includings things like panels.
 | 
			
		||||
@property (readonly, copy) NSArray<NSWindow *> *orderedWindows;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#if __swift__ < 40200
 | 
			
		||||
@interface NSObject(NSApplicationScriptingDelegation)
 | 
			
		||||
 | 
			
		||||
// Return YES if the receiving delegate object can respond to key value coding messages for a specific keyed attribute, to-one relationship, or to-many relationship.  Return NO otherwise.
 | 
			
		||||
- (BOOL)application:(NSApplication *)sender delegateHandlesKey:(NSString *)key API_DEPRECATED("This is now an optional method of the NSApplicationDelegate protocol.", macos(10.0, 11.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,82 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSArrayController.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2002-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSObjectController.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSPredicate.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSIndexSet, NSMutableIndexSet, NSSortDescriptor;
 | 
			
		||||
 | 
			
		||||
@interface NSArrayController : NSObjectController
 | 
			
		||||
 | 
			
		||||
- (void)rearrangeObjects;    // triggers rearranging the content objects for the user interface, including sorting and filtering; subclasses can override and invoke this method if any parameter that affects the arranged objects changes
 | 
			
		||||
 | 
			
		||||
@property BOOL automaticallyRearrangesObjects API_AVAILABLE(macos(10.5));   // default: NO
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSArray<NSString *> *automaticRearrangementKeyPaths API_AVAILABLE(macos(10.5));    // computes the array of key paths that trigger automatic rearranging from the sort descriptors and filter predicates; subclasses may override this method to customize the default behavior (for example if additional arrangement criteria are used in custom implementations of -rearrangeObjects)
 | 
			
		||||
- (void)didChangeArrangementCriteria API_AVAILABLE(macos(10.5));    // invoked by the controller itself when any criteria for arranging objects change (sort descriptors or filter predicates) to reset the key paths for automatic rearranging; subclasses should invoke this method if additional arrangement criteria are used in custom implementations of -rearrangeObjects and those criteria change
 | 
			
		||||
 | 
			
		||||
@property (copy) NSArray<NSSortDescriptor *> *sortDescriptors;
 | 
			
		||||
 | 
			
		||||
@property (nullable, strong) NSPredicate *filterPredicate;
 | 
			
		||||
 | 
			
		||||
/* Indicates whether the controller should nil out its filter predicate before inserting (or adding) new objects. When set to yes, this eliminates the problem of inserting a new object into the array that would otherwise immediately be filtered out of the array of arranged objects.
 | 
			
		||||
*/
 | 
			
		||||
@property BOOL clearsFilterPredicateOnInsertion; // default: YES
 | 
			
		||||
 | 
			
		||||
- (NSArray *)arrangeObjects:(NSArray *)objects;    // returns objects to be arranged in the user interface for the content object array objects - method can be overridden to use a different kind of sort mechanism or to filter the display objects
 | 
			
		||||
@property (readonly, strong) id arrangedObjects;     // array of all displayed objects (after sorting and potentially filtering)
 | 
			
		||||
 | 
			
		||||
@property BOOL avoidsEmptySelection;   // default: YES
 | 
			
		||||
@property BOOL preservesSelection;   // default: YES
 | 
			
		||||
@property BOOL selectsInsertedObjects;    // default: YES
 | 
			
		||||
 | 
			
		||||
/* Indicates whether the controller should indicate all multiple selections through the NSMultipleValuesMarker, whether the selected values are equal or not (by default, the controller will only use the NSMultipleValuesMarker if the selected objects actually have different values) - this may act as a performance enhancement in certain applications.
 | 
			
		||||
*/
 | 
			
		||||
@property BOOL alwaysUsesMultipleValuesMarker;
 | 
			
		||||
 | 
			
		||||
/* All selection modification methods returning a BOOL indicate through that flag whether changing the selection was successful (changing the selection might trigger an commitEditing call which fails and thus deny's the selection change).
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)setSelectionIndexes:(NSIndexSet *)indexes;    // to deselect all: empty index set, to select all: index set with indexes [0...count - 1]
 | 
			
		||||
@property (readonly, copy) NSIndexSet *selectionIndexes;
 | 
			
		||||
- (BOOL)setSelectionIndex:(NSUInteger)index;
 | 
			
		||||
@property (readonly) NSUInteger selectionIndex;
 | 
			
		||||
- (BOOL)addSelectionIndexes:(NSIndexSet *)indexes;
 | 
			
		||||
- (BOOL)removeSelectionIndexes:(NSIndexSet *)indexes;
 | 
			
		||||
 | 
			
		||||
- (BOOL)setSelectedObjects:(NSArray *)objects;
 | 
			
		||||
@property (null_unspecified, readonly, copy) NSArray *selectedObjects;
 | 
			
		||||
- (BOOL)addSelectedObjects:(NSArray *)objects;
 | 
			
		||||
- (BOOL)removeSelectedObjects:(NSArray *)objects;
 | 
			
		||||
 | 
			
		||||
- (IBAction)add:(nullable id)sender;    // overridden to add a new object to the content objects and to the arranged objects
 | 
			
		||||
- (IBAction)remove:(nullable id)sender;    // overridden to remove the selected objects
 | 
			
		||||
- (IBAction)insert:(nullable id)sender;
 | 
			
		||||
@property (readonly) BOOL canInsert;    // can be used in bindings controlling the enabling of buttons, for example
 | 
			
		||||
- (IBAction)selectNext:(nullable id)sender;
 | 
			
		||||
- (IBAction)selectPrevious:(nullable id)sender;
 | 
			
		||||
@property (readonly) BOOL canSelectNext;
 | 
			
		||||
@property (readonly) BOOL canSelectPrevious;
 | 
			
		||||
 | 
			
		||||
- (void)addObject:(id)object;    // overridden to add to the content objects and to the arranged objects if all filters currently applied are matched
 | 
			
		||||
- (void)addObjects:(NSArray *)objects;
 | 
			
		||||
- (void)insertObject:(id)object atArrangedObjectIndex:(NSUInteger)index;    // inserts into the content objects and the arranged objects (as specified by index in the arranged objects) - will raise an exception if the object does not match all filters currently applied
 | 
			
		||||
- (void)insertObjects:(NSArray *)objects atArrangedObjectIndexes:(NSIndexSet *)indexes;
 | 
			
		||||
- (void)removeObjectAtArrangedObjectIndex:(NSUInteger)index;    // removes from the content objects and the arranged objects (as specified by index in the arranged objects)
 | 
			
		||||
- (void)removeObjectsAtArrangedObjectIndexes:(NSIndexSet *)indexes;
 | 
			
		||||
- (void)removeObject:(id)object;    // removes from the content objects and the arranged objects (if currently contained)
 | 
			
		||||
- (void)removeObjects:(NSArray *)objects;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,341 @@
 | 
			
		||||
#if !__has_include(<UIFoundation/NSAttributedString.h>)
 | 
			
		||||
/*
 | 
			
		||||
        NSAttributedString.h
 | 
			
		||||
        Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
        All rights reserved.
 | 
			
		||||
 
 | 
			
		||||
        This file defines Application Kit extensions to NSAttributedString and NSMutableAttributedString.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSAttributedString.h>
 | 
			
		||||
#import <Foundation/NSItemProvider.h>
 | 
			
		||||
#import <AppKit/NSFontManager.h>
 | 
			
		||||
#import <AppKit/NSText.h>
 | 
			
		||||
#import <AppKit/NSPasteboard.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
@class NSTextBlock, NSTextTable, NSTextList;
 | 
			
		||||
@class NSFileWrapper;
 | 
			
		||||
@class NSURL;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
 | 
			
		||||
/************************ Attributes ************************/
 | 
			
		||||
 | 
			
		||||
// Predefined character attributes for text. If the key is not present in the dictionary, it indicates the default value described below.
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSFontAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));                // NSFont, default Helvetica(Neue) 12
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSParagraphStyleAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));      // NSParagraphStyle, default defaultParagraphStyle
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSForegroundColorAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));     // NSColor, default blackColor
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSBackgroundColorAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));     // NSColor, default nil: no background
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSLigatureAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));            // NSNumber containing integer, default 1: default ligatures, 0: no ligatures
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSKernAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));                // NSNumber containing floating point value, in points; amount to modify default kerning. 0 means kerning is disabled.
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSTrackingAttributeName API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0));         // NSNumber containing floating point value, in points; amount to modify default tracking. 0 means tracking is disabled.
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSStrikethroughStyleAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));  // NSNumber containing integer, default 0: no strikethrough
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSUnderlineStyleAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));      // NSNumber containing integer, default 0: no underline
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSStrokeColorAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));         // NSColor, default nil: same as foreground color
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSStrokeWidthAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));         // NSNumber containing floating point value, in percent of font point size, default 0: no stroke; positive for stroke alone, negative for stroke and fill (a typical value for outlined text would be 3.0)
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSShadowAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));              // NSShadow, default nil: no shadow
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey const NSTextEffectAttributeName API_AVAILABLE(macos(10.10), ios(7.0), watchos(2.0), tvos(9.0));          // NSString, default nil: no text effect
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSAttachmentAttributeName API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));          // NSTextAttachment, default nil
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSLinkAttributeName API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));                // NSURL (preferred) or NSString
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSBaselineOffsetAttributeName API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));      // NSNumber containing floating point value, in points; offset from baseline, default 0
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSUnderlineColorAttributeName API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));      // NSColor, default nil: same as foreground color
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSStrikethroughColorAttributeName API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));  // NSColor, default nil: same as foreground color
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSObliquenessAttributeName API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));         // NSNumber containing floating point value; skew to be applied to glyphs, default 0: no skew
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSExpansionAttributeName API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));           // NSNumber containing floating point value; log of expansion factor to be applied to glyphs, default 0: no expansion
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSWritingDirectionAttributeName API_AVAILABLE(macos(10.6), ios(7.0), watchos(2.0), tvos(9.0));    // NSArray of NSNumbers representing the nested levels of writing direction overrides as defined by Unicode LRE, RLE, LRO, and RLO characters.  The control characters can be obtained by masking NSWritingDirection and NSWritingDirectionFormatType values.  LRE: NSWritingDirectionLeftToRight|NSWritingDirectionEmbedding, RLE: NSWritingDirectionRightToLeft|NSWritingDirectionEmbedding, LRO: NSWritingDirectionLeftToRight|NSWritingDirectionOverride, RLO: NSWritingDirectionRightToLeft|NSWritingDirectionOverride,
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey  NSVerticalGlyphFormAttributeName API_AVAILABLE(macos(10.7), ios(6.0), watchos(2.0), tvos(9.0));   // An NSNumber containing an integer value.  0 means horizontal text.  1 indicates vertical text.  If not specified, it could follow higher-level vertical orientation settings.  Currently on iOS, it's always horizontal.  The behavior for any other value is undefined.
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey NSCursorAttributeName; // NSCursor, default IBeamCursor
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey NSToolTipAttributeName; // NSString, default nil: no tooltip
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey NSMarkedClauseSegmentAttributeName; // Clause segment index NSNumber (intValue). This attribute is used in marked text indicating clause segments
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey NSTextAlternativesAttributeName API_AVAILABLE(macos(10.8)); // An NSTextAlternatives object.  Used primarily as a temporary attribute, with primaryString equal to the substring for the range to which it is attached, and alternativeStrings representing alternatives for that string that may be presented to the user.
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey NSSpellingStateAttributeName;  // NSSpellingStateAttributeName is used and recognized only as a temporary attribute (see NSLayoutManager.h).  It indicates that spelling and/or grammar indicators should be shown for the specified characters, default 0: no spelling or grammar indicator
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey NSSuperscriptAttributeName; // NSNumber containing integer, default 0
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey NSGlyphInfoAttributeName;  // NSGlyphInfo specifying glyph for the associated attribute range
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/************************ Attribute values ************************/
 | 
			
		||||
// This defines currently supported values for NSUnderlineStyleAttributeName and NSStrikethroughStyleAttributeName. These values are or'ed together to produce an underline style.
 | 
			
		||||
// Underlines will be drawn with a solid pattern by default, so NSUnderlineStylePatternSolid does not need to be specified.
 | 
			
		||||
typedef NS_OPTIONS(NSInteger, NSUnderlineStyle) {
 | 
			
		||||
    NSUnderlineStyleNone                                    = 0x00,
 | 
			
		||||
    NSUnderlineStyleSingle                                  = 0x01,
 | 
			
		||||
    NSUnderlineStyleThick API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0))      = 0x02,
 | 
			
		||||
    NSUnderlineStyleDouble API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0))     = 0x09,
 | 
			
		||||
 | 
			
		||||
    NSUnderlineStylePatternSolid API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0))      = 0x0000,
 | 
			
		||||
    NSUnderlineStylePatternDot API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0))        = 0x0100,
 | 
			
		||||
    NSUnderlineStylePatternDash API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0))       = 0x0200,
 | 
			
		||||
    NSUnderlineStylePatternDashDot API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0))    = 0x0300,
 | 
			
		||||
    NSUnderlineStylePatternDashDotDot API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)) = 0x0400,
 | 
			
		||||
 | 
			
		||||
    NSUnderlineStyleByWord API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0))            = 0x8000
 | 
			
		||||
} API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// NSWritingDirectionFormatType values used by NSWritingDirectionAttributeName. It is or'ed with either NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft. Can specify the formatting controls defined by Unicode Bidirectional Algorithm.
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSWritingDirectionFormatType) {
 | 
			
		||||
    NSWritingDirectionEmbedding     = (0 << 1),
 | 
			
		||||
    NSWritingDirectionOverride      = (1 << 1)
 | 
			
		||||
} API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// NSTextEffectAttributeName values
 | 
			
		||||
typedef NSString * NSTextEffectStyle NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSTextEffectStyle const NSTextEffectLetterpressStyle API_AVAILABLE(macos(10.10), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// Flag values supported for NSSpellingStateAttributeName as of Mac OS X version 10.5.  Prior to 10.5, any non-zero value caused the spelling indicator to be shown.
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSSpellingState) {
 | 
			
		||||
    NSSpellingStateSpellingFlag API_AVAILABLE(macos(10.5)) = (1 << 0),
 | 
			
		||||
    NSSpellingStateGrammarFlag API_AVAILABLE(macos(10.5))  = (1 << 1)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/************************ Attribute fixing ************************/
 | 
			
		||||
 | 
			
		||||
@interface NSMutableAttributedString (NSAttributedStringAttributeFixing)
 | 
			
		||||
// This method fixes attribute inconsistencies inside range.  It ensures NSFontAttributeName covers the characters, NSParagraphStyleAttributeName is only changing at paragraph boundaries, and NSTextAttachmentAttributeName is assigned to NSAttachmentCharacter.  NSTextStorage automatically invokes this method via -ensureAttributesAreFixedInRange:.
 | 
			
		||||
- (void)fixAttributesInRange:(NSRange)range API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (void)fixFontAttributeInRange:(NSRange)range;
 | 
			
		||||
- (void)fixParagraphStyleAttributeInRange:(NSRange)range;
 | 
			
		||||
- (void)fixAttachmentAttributeInRange:(NSRange)range;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/************************ Document formats ************************/
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSAttributedStringDocumentType NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
 | 
			
		||||
// Supported document types for the NSDocumentTypeDocumentAttribute key in the document attributes dictionary.
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentType  NSPlainTextDocumentType API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentType  NSRTFTextDocumentType  API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentType  NSRTFDTextDocumentType API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentType  NSHTMLTextDocumentType  API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentType NSMacSimpleTextDocumentType;
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentType NSDocFormatTextDocumentType;
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentType NSWordMLTextDocumentType;
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentType NSWebArchiveTextDocumentType;
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentType NSOfficeOpenXMLTextDocumentType API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentType NSOpenDocumentTextDocumentType API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSTextLayoutSectionKey NS_TYPED_ENUM;
 | 
			
		||||
 | 
			
		||||
// Keys for NSLayoutOrientationSectionsAttribute.
 | 
			
		||||
APPKIT_EXTERN NSTextLayoutSectionKey  NSTextLayoutSectionOrientation API_AVAILABLE(macos(10.7), ios(7.0), watchos(2.0), tvos(9.0)); // NSNumber containing NSTextLayoutOrientation value. default: NSTextLayoutOrientationHorizontal
 | 
			
		||||
APPKIT_EXTERN NSTextLayoutSectionKey  NSTextLayoutSectionRange API_AVAILABLE(macos(10.7), ios(7.0), watchos(2.0), tvos(9.0)); // NSValue containing NSRange representing a character range. default: a range covering the whole document
 | 
			
		||||
 | 
			
		||||
// Supported values for NSTextScalingDocumentAttribute, NSSourceTextScalingDocumentAttribute, NSTargetTextScalingDocumentOption, NSSourceTextScalingDocumentOption
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSTextScalingType) {
 | 
			
		||||
    NSTextScalingStandard = 0,  // Font sizes throughout the document should appear visually similar to how they would render on macOS and non-Apple platforms
 | 
			
		||||
    NSTextScalingiOS  // Font sizes throughout the document should appear visually similar to how they would render on iOS
 | 
			
		||||
} API_AVAILABLE(macos(10.15), ios(13.0));
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSAttributedStringDocumentAttributeKey NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
 | 
			
		||||
// Keys for options and document attributes dictionaries.  They are in and out document properties used by both read/write methods.
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey  NSDocumentTypeDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));  // @"DocumentType", one of the document types declared above.  For reader methods, this key in options can specify the document type for interpreting the contents.  Upon return, the document attributes can contain this key for indicating the actual format used to read the contents.  For write methods, this key specifies the format for generating the data.
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSConvertedDocumentAttribute;  // @"Converted", NSNumber containing integer; if missing, or 0, the file was originally in the format specified by document type; if negative, the file was originally in the format specified by document type, but the conversion to NSAttributedString may have been lossy; if 1 or more, it was converted to the specified type by a filter service
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSCocoaVersionDocumentAttribute;  // @"CocoaRTFVersion", NSNumber containing integer.  Stores the version of Cocoa the file was created with.  NSNumber containing float.  Absence of this value indicates file not labelled as being created by Cocoa or its predecessors.  Values less than 100 are pre-Mac OS X; 100 is Mac OS X 10.0 and 10.1; 102 is Mac OS X 10.2 and 10.3; values greater than 102 correspond to values of NSAppKitVersionNumber on 10.4 and later systems.
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSFileTypeDocumentAttribute API_AVAILABLE(macos(10.6));  // NSString indicating which document type was used to interpret the document, specified as a UTI; for reading, this is available along with NSDocumentTypeDocumentAttribute, but for writing the two are mutually exclusive
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSTitleDocumentAttribute;  // NSString containing document title
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSCompanyDocumentAttribute;  // NSString containing company or organization name
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSCopyrightDocumentAttribute;  // NSString containing document copyright info
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSSubjectDocumentAttribute;  // NSString containing subject of document
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSAuthorDocumentAttribute;  // NSString containing author name (not necessarily same as "last editor," see below)
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSKeywordsDocumentAttribute;  // NSArray of NSString, containing keywords
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSCommentDocumentAttribute;  // NSString containing document comments
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSEditorDocumentAttribute;  // NSString containing name of person who last edited the document
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSCreationTimeDocumentAttribute;  // NSDate containing the creation date of the document; note that this is not the file system creation date of the file, but of the document, as stored in the document
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSModificationTimeDocumentAttribute;  // NSDate containing the modification date of the document contents
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSManagerDocumentAttribute API_AVAILABLE(macos(10.5));  // NSString containing name of the author's manager
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSCategoryDocumentAttribute API_AVAILABLE(macos(10.6));  // NSString containing the document category
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSAppearanceDocumentAttribute API_AVAILABLE(macos(10.14)); // NSAppearance used to evaluate named NSColors when saving. The appearance itself is not written out; it is just used to determine the generated color component values. If not specified the canonical default light appearance is used.
 | 
			
		||||
 | 
			
		||||
// NSPlainTextDocumentType document attributes
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey  NSCharacterEncodingDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));  // @"CharacterEncoding", NSNumber containing integer specifying NSStringEncoding for the file; default for plain text is the default encoding.  This key in options can specify the string encoding for reading the data.  Upon return, the document attributes can contain the actual encoding used.  For writing methods, this value is used for generating the plain text data.
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey  NSDefaultAttributesDocumentAttribute API_AVAILABLE(macos(10.11), ios(7.0), watchos(2.0), tvos(9.0));  // @"DefaultAttributes", NSDictionary containing attributes to be applied to plain files.  Used by reader methods.  This key in options can specify the default attributes applied to the entire document contents.  The document attributes can contain this key indicating the actual attributes used.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// NSRTFTextDocumentType and NSRTFDTextDocumentType document attributes
 | 
			
		||||
// Document dimension
 | 
			
		||||
// They are document attributes used by read/write methods.
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey  NSPaperSizeDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));  // @"PaperSize", NSValue containing NSSize (in points)
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSLeftMarginDocumentAttribute;  // @"LeftMargin", NSNumber containing floating point value (in points)
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSRightMarginDocumentAttribute;  // @"RightMargin", NSNumber containing floating point value (in points)
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSTopMarginDocumentAttribute;  // @"TopMargin", NSNumber containing floating point value (in points)
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSBottomMarginDocumentAttribute;  // @"BottomMargin", NSNumber containing floating point value (in points)
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey  NSViewSizeDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));  // @"ViewSize", NSValue containing NSSize (in points)
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey  NSViewZoomDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));  // @"ViewZoom", NSNumber containing floating point value (100 == 100% zoom)
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey  NSViewModeDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));  // @"ViewMode", NSNumber containing integer; 0 = normal; 1 = page layout
 | 
			
		||||
 | 
			
		||||
// Document settings
 | 
			
		||||
// They are document attributes used by read/write methods.
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey  NSReadOnlyDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));  // @"ReadOnly", NSNumber containing integer; if missing, or 0 or negative, not readonly; 1 or more, readonly. Note that this has nothing to do with the file system protection on the file, but instead, on how the file should be displayed to the user
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey  NSBackgroundColorDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));  // @"BackgroundColor", NSColor, representing the document-wide page background color
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey  NSHyphenationFactorDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));  // @"HyphenationFactor", NSNumber containing floating point value (0=off, 1=full hyphenation)
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey  NSDefaultTabIntervalDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));  // @"DefaultTabInterval", NSNumber containing floating point value, representing the document-wide default tab stop interval, in points
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey  NSTextLayoutSectionsAttribute API_AVAILABLE(macos(10.7), ios(7.0), watchos(2.0), tvos(9.0));  // NSArray of dictionaries.  Each dictionary describing a layout orientation section.  The dictionary can have two attributes: NSTextLayoutSectionOrientation and NSTextLayoutSectionRange.  When there is a gap between sections, it's assumed to have NSTextLayoutOrientationHorizontal.
 | 
			
		||||
 | 
			
		||||
// NSHTMLTextDocumentType document attributes
 | 
			
		||||
// Additional document attributes added in 10.4, for HTML writing only.  These provide control over the form of generated HTML.  NSExcludedElementsDocumentAttribute allows control over the tags used.  The recognized values in the NSExcludedElementsDocumentAttribute array are (case-insensitive) HTML tags, plus DOCTYPE (representing a doctype declaration) and XML (representing an XML declaration).  By default, if this attribute is not present, the excluded elements will be those deprecated in HTML 4 (APPLET, BASEFONT, CENTER, DIR, FONT, ISINDEX, MENU, S, STRIKE, and U) plus XML.  If XML is on the list, HTML forms will be used; if XML is not on the list, XHTML forms will be used where there is a distinction.  Either NSCharacterEncodingDocumentAttribute or NSTextEncodingNameDocumentAttribute may be used to control the encoding used for generated HTML; character entities will be used for characters not representable in the specified encoding.  Finally, NSPrefixSpacesDocumentAttribute allows some control over formatting.
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSExcludedElementsDocumentAttribute;  // for HTML writing only; NSArray containing NSStrings, representing HTML elements not to be used in generated HTML
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSTextEncodingNameDocumentAttribute;  // for HTML writing only; NSString containing the name, IANA or otherwise, of a text encoding to be used; mutually exclusive with NSCharacterEncodingDocumentAttribute
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSPrefixSpacesDocumentAttribute;  // for HTML writing only; NSNumber containing integer, default 0, representing the number of spaces per level by which to indent certain nested HTML elements
 | 
			
		||||
 | 
			
		||||
// Document text scaling
 | 
			
		||||
// They are document attributes used by read/write methods.
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey const NSTextScalingDocumentAttribute API_AVAILABLE(macos(10.15), ios(13.0));  // @"TextScaling", one of the text scaling types declared above. Only affects RTF documents.  For reading methods, this indicates the type of text scaling used in the returned attributed string.  For write methods, this attribute can be used in two different ways: (1) Passing only this attribute will overwrite the text scaling metadata in the document, but will not perform any conversion on the font sizes in the document, or (2) Passing both this attribute and NSSourceTextScalingDocumentAttribute will convert the font sizes in the document from the source text scaling type to the text scaling type specified by this attribute.
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey const NSSourceTextScalingDocumentAttribute API_AVAILABLE(macos(10.15), ios(13.0));  // @"SourceTextScaling", one of the text scaling types declared above. Only affects RTF documents.  For writing methods, this indicates the type of text scaling in the attributed string that will be used as the base type for conversion.  Use this in conjunction with NSTextScalingDocumentAttribute to convert font point sizes between text scalings when writing attributed strings to RTF.  This attribute is optional and does nothing unless NSTextScalingDocumentAttribute is also specified.
 | 
			
		||||
 | 
			
		||||
// The following are keys for various options that can be specified in the options dictionaries for the text import APIs below.  Except for NSTextSizeMultiplierDocumentOption and NSFileTypeDocumentOption, the values have been recognized for some time, but the actual identifier shown below was added in 10.4. If you want your app to run on earlier systems, you need to continue using the actual string value that these identifiers represent. The actual string value is specified in the comments below.
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSAttributedStringDocumentReadingOptionKey NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey  NSDocumentTypeDocumentOption;  // @"DocumentType", NSString indicating a document type to be forced when loading the document, specified as one of the NSDocumentTypeDocumentAttribute constants listed above
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey  NSDefaultAttributesDocumentOption;  // @"DefaultAttributes", for plain text only; NSDictionary containing attributes to be applied to plain files
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey  NSCharacterEncodingDocumentOption;  // @"CharacterEncoding", for plain text and HTML; NSNumber containing integer specifying NSStringEncoding to be used to interpret the file
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSTextEncodingNameDocumentOption;  // @"TextEncodingName", for HTML only; NSString containing a name, IANA or otherwise, specifying an encoding to be used to interpret the file; mutually exclusive with NSCharacterEncodingDocumentOption
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSBaseURLDocumentOption;  // @"BaseURL", for HTML only; NSURL containing a URL to be treated as the base URL for the document
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSTimeoutDocumentOption;  // @"Timeout", for HTML only; NSNumber containing floating point value; time in seconds to wait for a document to finish loading; if not present or not positive, a default timeout will be used
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSWebPreferencesDocumentOption;  // @"WebPreferences", for HTML only; WebPreferences; specifies a WebPreferences object describing a set of preferences; if not present, a default set of preferences will be used
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSWebResourceLoadDelegateDocumentOption;  // @"WebResourceLoadDelegate", for HTML only; NSObject; specifies an object to serve as the WebResourceLoadDelegate; if not present, a default delegate will be used that will permit the loading of subsidiary resources but will not respond to authentication challenges
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSTextSizeMultiplierDocumentOption;  // for HTML only; NSNumber containing floating point value, default 1.0; specifies a scale factor for font sizes, corresponding to WebView's textSizeMultiplier
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSFileTypeDocumentOption API_AVAILABLE(macos(10.6));  // NSString indicating a document type to be forced when loading the document, specified as a UTI string; mutually exclusive with NSDocumentTypeDocumentOption
 | 
			
		||||
 | 
			
		||||
// In Mac OS X 10.4 and later, WebKit is always used for HTML documents, and all of the above options are recognized.  In Mac OS X 10.3, there is an additional options key, @"UseWebKit" (NSNumber containing integer; if present and positive, specifies that WebKit-based HTML importing is to be used).  In Mac OS X 10.3, the Timeout, WebPreferences, and WebResourceLoadDelegate options are recognized only when WebKit-based HTML importing is used.
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey const NSTargetTextScalingDocumentOption API_AVAILABLE(macos(10.15), ios(13.0));  // @"TargetTextScaling", one of the text scaling types declared above.  Only affects RTF documents.  For reading methods, you can pass this option to request that the returned attributed string uses the specified scaling.  The font point sizes in the document may be converted if necessary.  If this option is not provided, the system will deduce the target text scaling type based on application framework and platform.
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey const NSSourceTextScalingDocumentOption API_AVAILABLE(macos(10.15), ios(13.0));  // @"SourceTextScaling", one of the text scaling types declared above.  Only affects RTF documents.  For reading methods, you can pass this option to indicate the source text scaling type of the RTF document being read.  Use this in conjunction with NSTargetTextScalingDocumentOption to control text scaling conversions on the font point sizes in the returned attributed string.  This option does nothing unless NSTargetTextScalingDocumentOption is also specified.  If this option is not provided, the system will deduce the source text scaling type based on the information in the document.
 | 
			
		||||
 | 
			
		||||
@interface NSAttributedString (NSAttributedStringDocumentFormats)
 | 
			
		||||
// Methods initializing the receiver contents with an external document data.  options specify document attributes for interpreting the document contents.  NSDocumentTypeDocumentAttribute, NSCharacterEncodingDocumentAttribute, and NSDefaultAttributesDocumentAttribute are supported options key.  When they are not specified, these methods will examine the data and do their best to detect the appropriate attributes.  If dict is non-NULL, it will return a dictionary with various document-wide attributes accessible via NS...DocumentAttribute keys.
 | 
			
		||||
- (nullable instancetype)initWithURL:(NSURL *)url options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)options documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict error:(NSError **)error API_AVAILABLE(macos(10.4), ios(9.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (nullable instancetype)initWithData:(NSData *)data options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)options documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict error:(NSError **)error API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// Generates an NSData object for the receiver contents in range.  It requires a document attributes dict specifying at least the NSDocumentTypeDocumentAttribute to determine the format to be written.
 | 
			
		||||
- (nullable NSData *)dataFromRange:(NSRange)range documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> *)dict error:(NSError **)error API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// Returns an NSFileWrapper object for the receiver contents in range.  It requires a document attributes dict specifying at least the NSDocumentTypeDocumentAttribute to determine the format to be written.  The method returns a directory file wrapper for those document types represented by a file package such as NSRTFDTextDocumentType; otherwise, it returns a regular-file file wrapper.
 | 
			
		||||
- (nullable NSFileWrapper *)fileWrapperFromRange:(NSRange)range documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> *)dict error:(NSError **)error API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithRTF:(NSData *)data documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict;
 | 
			
		||||
- (nullable instancetype)initWithRTFD:(NSData *)data documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict;
 | 
			
		||||
- (nullable instancetype)initWithHTML:(NSData *)data documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict;
 | 
			
		||||
- (nullable instancetype)initWithHTML:(NSData *)data baseURL:(NSURL *)base documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict;
 | 
			
		||||
- (nullable instancetype)initWithDocFormat:(NSData *)data documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict;
 | 
			
		||||
- (nullable instancetype)initWithHTML:(NSData *)data options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)options documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict;
 | 
			
		||||
- (nullable instancetype)initWithRTFDFileWrapper:(NSFileWrapper *)wrapper documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict;
 | 
			
		||||
- (nullable NSData *)RTFFromRange:(NSRange)range documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> *)dict;
 | 
			
		||||
- (nullable NSData *)RTFDFromRange:(NSRange)range documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> *)dict;
 | 
			
		||||
- (nullable NSFileWrapper *)RTFDFileWrapperFromRange:(NSRange)range documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> *)dict;
 | 
			
		||||
- (nullable NSData *)docFormatFromRange:(NSRange)range documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> *)dict;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableAttributedString (NSMutableAttributedStringDocumentFormats)
 | 
			
		||||
// Methods replacing the receiver contents with an external document data.  options specify document attributes for interpreting the document contents.  NSDocumentTypeDocumentAttribute, NSCharacterEncodingDocumentAttribute, and NSDefaultAttributesDocumentAttribute are supported options key.  When they are not specified, these methods will examine the data and do their best to detect the appropriate attributes.  If dict is non-NULL, it will return a dictionary with various document-wide attributes accessible via NS...DocumentAttribute keys.
 | 
			
		||||
- (BOOL)readFromURL:(NSURL *)url options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)opts documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict error:(NSError **)error  API_AVAILABLE(macos(10.5), ios(9.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
- (BOOL)readFromData:(NSData *)data options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)opts documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict error:(NSError **)error API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/************************ Misc methods ************************/
 | 
			
		||||
@interface NSAttributedString (NSAttributedStringKitAdditions)
 | 
			
		||||
// Attributes which should be copied/pasted with "copy font".
 | 
			
		||||
- (NSDictionary<NSAttributedStringKey, id> *)fontAttributesInRange:(NSRange)range;
 | 
			
		||||
 | 
			
		||||
// Attributes which should be copied/pasted with "copy ruler".
 | 
			
		||||
- (NSDictionary<NSAttributedStringKey, id> *)rulerAttributesInRange:(NSRange)range;
 | 
			
		||||
 | 
			
		||||
// Returns YES if the receiver contains a property configured (NSAttachmentAttributeName with NSAttachmentCharacter) in range
 | 
			
		||||
- (BOOL)containsAttachmentsInRange:(NSRange)range API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
 | 
			
		||||
 | 
			
		||||
// Returns NSNotFound if no line break location found in the specified range; otherwise returns the index of the first character that should go on the NEXT line.
 | 
			
		||||
- (NSUInteger)lineBreakBeforeIndex:(NSUInteger)location withinRange:(NSRange)aRange;
 | 
			
		||||
- (NSUInteger)lineBreakByHyphenatingBeforeIndex:(NSUInteger)location withinRange:(NSRange)aRange;
 | 
			
		||||
 | 
			
		||||
- (NSRange)doubleClickAtIndex:(NSUInteger)location;
 | 
			
		||||
- (NSUInteger)nextWordFromIndex:(NSUInteger)location forward:(BOOL)isForward;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Convenience methods for calculating the range of an individual text block, range of an entire table, range of a list, and the index within a list.
 | 
			
		||||
- (NSRange)rangeOfTextBlock:(NSTextBlock *)block atIndex:(NSUInteger)location;
 | 
			
		||||
- (NSRange)rangeOfTextTable:(NSTextTable *)table atIndex:(NSUInteger)location;
 | 
			
		||||
- (NSRange)rangeOfTextList:(NSTextList *)list atIndex:(NSUInteger)location;
 | 
			
		||||
- (NSInteger)itemNumberInTextList:(NSTextList *)list atIndex:(NSUInteger)location;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSAttributedString (NSAttributedStringPasteboardAdditions)  <NSPasteboardReading, NSPasteboardWriting>
 | 
			
		||||
// Methods to determine what types can be loaded as NSAttributedStrings.
 | 
			
		||||
@property(class, readonly, copy) NSArray<NSString *> *textTypes API_AVAILABLE(macos(10.5));
 | 
			
		||||
@property(class, readonly, copy) NSArray<NSString *> *textUnfilteredTypes API_AVAILABLE(macos(10.5));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableAttributedString (NSMutableAttributedStringKitAdditions)
 | 
			
		||||
- (void)superscriptRange:(NSRange)range;
 | 
			
		||||
- (void)subscriptRange:(NSRange)range;
 | 
			
		||||
- (void)unscriptRange:(NSRange)range;
 | 
			
		||||
- (void)applyFontTraits:(NSFontTraitMask)traitMask range:(NSRange)range;
 | 
			
		||||
- (void)setAlignment:(NSTextAlignment)alignment range:(NSRange)range;
 | 
			
		||||
- (void)setBaseWritingDirection:(NSWritingDirection)writingDirection range:(NSRange)range;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/************************ Deprecated ************************/
 | 
			
		||||
// NSUnderlineByWord and the NSUnderlinePattern* values are soft deprecated starting with macOS 10.14/iOS 12 and will be officially deprecated in a future release.  Please use the NSUnderlineStyle* equivalents instead.
 | 
			
		||||
// Underlines will be drawn with a solid pattern by default, so NSUnderlinePatternSolid does not need to be specified.
 | 
			
		||||
static const NSUnderlineStyle NSUnderlinePatternSolid = NSUnderlineStylePatternSolid;
 | 
			
		||||
static const NSUnderlineStyle NSUnderlinePatternDot = NSUnderlineStylePatternDot;
 | 
			
		||||
static const NSUnderlineStyle NSUnderlinePatternDash = NSUnderlineStylePatternDash;
 | 
			
		||||
static const NSUnderlineStyle NSUnderlinePatternDashDot = NSUnderlineStylePatternDashDot;
 | 
			
		||||
static const NSUnderlineStyle NSUnderlinePatternDashDotDot = NSUnderlineStylePatternDashDotDot;
 | 
			
		||||
static const NSUnderlineStyle NSUnderlineByWord = NSUnderlineStyleByWord;
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey NSCharacterShapeAttributeName API_DEPRECATED("This attribute is bound to a specific implementation of ATS feature and not generically supported by wide range of fonts. The majority of characters accessed through this API are now encoded in the Unicode standard. Use the CTFont feature API for fine control over character shape choices.", macos(10.0,10.11));
 | 
			
		||||
APPKIT_EXTERN NSAttributedStringKey NSUsesScreenFontsDocumentAttribute API_DEPRECATED("", macos(10.8,10.11));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
    NSNoUnderlineStyle API_DEPRECATED("Use NSUnderlineStyleNone instead", macos(10.0,10.9)) = 0,
 | 
			
		||||
    NSSingleUnderlineStyle API_DEPRECATED("Use NSUnderlineStyleSingle instead", macos(10.0,10.9))
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSUInteger NSUnderlineStrikethroughMask API_DEPRECATED("Use NSStrikethroughStyleAttributeName instead", macos(10.0,10.9));
 | 
			
		||||
APPKIT_EXTERN NSUInteger NSUnderlineByWordMask API_DEPRECATED("Use NSUnderlineByWord instead", macos(10.0,10.11));
 | 
			
		||||
 | 
			
		||||
@interface NSAttributedString(NSDeprecatedKitAdditions)
 | 
			
		||||
// This property is soft deprecated starting with OS X 10.11. It will be officially deprecated in a future release. Use -containsAttachmentsInRange: instead
 | 
			
		||||
@property (readonly) BOOL containsAttachments;
 | 
			
		||||
 | 
			
		||||
+ (NSArray *)textFileTypes API_DEPRECATED("", macos(10.1,10.5));
 | 
			
		||||
+ (NSArray *)textPasteboardTypes API_DEPRECATED("", macos(10.1,10.5));
 | 
			
		||||
+ (NSArray *)textUnfilteredFileTypes API_DEPRECATED("", macos(10.1,10.5));
 | 
			
		||||
+ (NSArray *)textUnfilteredPasteboardTypes API_DEPRECATED("", macos(10.1,10.5));
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithURL:(NSURL *)url documentAttributes:(NSDictionary* _Nullable * _Nullable)dict API_DEPRECATED("Use -initWithURL:options:documentAttributes:error: instead", macos(10.0,10.11));
 | 
			
		||||
- (nullable instancetype)initWithPath:(NSString *)path documentAttributes:(NSDictionary* _Nullable * _Nullable)dict API_DEPRECATED("Use -initWithURL:options:documentAttributes:error: instead", macos(10.0,10.11));
 | 
			
		||||
 | 
			
		||||
- (nullable NSURL *)URLAtIndex:(NSUInteger)location effectiveRange:(NSRangePointer)effectiveRange API_DEPRECATED("Use NSDataDetector instead", macos(10.5,10.11));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSMutableAttributedString (NSDeprecatedKitAdditions)
 | 
			
		||||
- (BOOL)readFromURL:(NSURL *)url options:(NSDictionary *)options documentAttributes:(NSDictionary* _Nullable * _Nullable)dict API_DEPRECATED("Use -readFromURL:options:documentAttributes:error: instead", macos(10.0,10.11));
 | 
			
		||||
- (BOOL)readFromData:(NSData *)data options:(NSDictionary *)options documentAttributes:(NSDictionary* _Nullable * _Nullable)dict API_DEPRECATED("Use -readFromData:options:documentAttributes:error: instead", macos(10.0,10.11));
 | 
			
		||||
@end
 | 
			
		||||
#endif // !TARGET_OS_IPHONE
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
#else
 | 
			
		||||
#import <UIFoundation/NSAttributedString.h>
 | 
			
		||||
#endif
 | 
			
		||||
@@ -0,0 +1,199 @@
 | 
			
		||||
/*
 | 
			
		||||
        NSBezierPath.h
 | 
			
		||||
        Application Kit
 | 
			
		||||
        Copyright (c) 1997-2021, Apple Inc.
 | 
			
		||||
        All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <AppKit/NSFont.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSAffineTransform;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSLineCapStyle) {
 | 
			
		||||
    NSLineCapStyleButt = 0,
 | 
			
		||||
    NSLineCapStyleRound = 1,
 | 
			
		||||
    NSLineCapStyleSquare = 2
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSLineJoinStyle) {
 | 
			
		||||
    NSLineJoinStyleMiter = 0,
 | 
			
		||||
    NSLineJoinStyleRound = 1,
 | 
			
		||||
    NSLineJoinStyleBevel = 2
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSWindingRule) {
 | 
			
		||||
    NSWindingRuleNonZero = 0,
 | 
			
		||||
    NSWindingRuleEvenOdd = 1
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSBezierPathElement) {
 | 
			
		||||
    NSBezierPathElementMoveTo,
 | 
			
		||||
    NSBezierPathElementLineTo,
 | 
			
		||||
    NSBezierPathElementCurveTo,
 | 
			
		||||
    NSBezierPathElementClosePath
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@interface NSBezierPath : NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
// Creating common paths.
 | 
			
		||||
 | 
			
		||||
+ (NSBezierPath *)bezierPath;
 | 
			
		||||
+ (NSBezierPath *)bezierPathWithRect:(NSRect)rect;
 | 
			
		||||
+ (NSBezierPath *)bezierPathWithOvalInRect:(NSRect)rect;
 | 
			
		||||
+ (NSBezierPath *)bezierPathWithRoundedRect:(NSRect)rect xRadius:(CGFloat)xRadius yRadius:(CGFloat)yRadius API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
// Immediate mode drawing of common paths.
 | 
			
		||||
 | 
			
		||||
+ (void)fillRect:(NSRect)rect;
 | 
			
		||||
+ (void)strokeRect:(NSRect)rect;
 | 
			
		||||
+ (void)clipRect:(NSRect)rect;
 | 
			
		||||
+ (void)strokeLineFromPoint:(NSPoint)point1 toPoint:(NSPoint)point2;
 | 
			
		||||
+ (void)drawPackedGlyphs:(const char *)packedGlyphs atPoint:(NSPoint)point;
 | 
			
		||||
 | 
			
		||||
// Default path rendering parameters.
 | 
			
		||||
 | 
			
		||||
@property (class) CGFloat defaultMiterLimit;
 | 
			
		||||
@property (class) CGFloat defaultFlatness;
 | 
			
		||||
 | 
			
		||||
@property (class) NSWindingRule defaultWindingRule;
 | 
			
		||||
@property (class) NSLineCapStyle defaultLineCapStyle;
 | 
			
		||||
@property (class) NSLineJoinStyle defaultLineJoinStyle;
 | 
			
		||||
@property (class) CGFloat defaultLineWidth;
 | 
			
		||||
 | 
			
		||||
// Path construction.
 | 
			
		||||
 | 
			
		||||
- (void)moveToPoint:(NSPoint)point;
 | 
			
		||||
- (void)lineToPoint:(NSPoint)point;
 | 
			
		||||
- (void)curveToPoint:(NSPoint)endPoint
 | 
			
		||||
       controlPoint1:(NSPoint)controlPoint1
 | 
			
		||||
       controlPoint2:(NSPoint)controlPoint2;
 | 
			
		||||
- (void)closePath;
 | 
			
		||||
 | 
			
		||||
- (void)removeAllPoints;
 | 
			
		||||
 | 
			
		||||
// Relative path construction.
 | 
			
		||||
 | 
			
		||||
- (void)relativeMoveToPoint:(NSPoint)point;
 | 
			
		||||
- (void)relativeLineToPoint:(NSPoint)point;
 | 
			
		||||
- (void)relativeCurveToPoint:(NSPoint)endPoint
 | 
			
		||||
	       controlPoint1:(NSPoint)controlPoint1
 | 
			
		||||
	       controlPoint2:(NSPoint)controlPoint2;
 | 
			
		||||
 | 
			
		||||
// Path rendering parameters.
 | 
			
		||||
 | 
			
		||||
@property CGFloat lineWidth;
 | 
			
		||||
@property NSLineCapStyle lineCapStyle;
 | 
			
		||||
@property NSLineJoinStyle lineJoinStyle;
 | 
			
		||||
@property NSWindingRule windingRule;
 | 
			
		||||
@property CGFloat miterLimit;
 | 
			
		||||
@property CGFloat flatness;
 | 
			
		||||
- (void)getLineDash:(nullable CGFloat *)pattern count:(nullable NSInteger *)count phase:(nullable CGFloat *)phase;
 | 
			
		||||
- (void)setLineDash:(nullable const CGFloat *)pattern count:(NSInteger)count phase:(CGFloat)phase;
 | 
			
		||||
 | 
			
		||||
// Path operations.
 | 
			
		||||
 | 
			
		||||
- (void)stroke;
 | 
			
		||||
- (void)fill;
 | 
			
		||||
- (void)addClip;
 | 
			
		||||
- (void)setClip;
 | 
			
		||||
 | 
			
		||||
// Path modifications.
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSBezierPath *bezierPathByFlatteningPath;
 | 
			
		||||
@property (readonly, copy) NSBezierPath *bezierPathByReversingPath;
 | 
			
		||||
 | 
			
		||||
// Applying transformations.
 | 
			
		||||
 | 
			
		||||
- (void)transformUsingAffineTransform:(NSAffineTransform *)transform;
 | 
			
		||||
 | 
			
		||||
// Path info
 | 
			
		||||
 | 
			
		||||
@property (getter=isEmpty, readonly) BOOL empty;
 | 
			
		||||
@property (readonly) NSPoint currentPoint;
 | 
			
		||||
@property (readonly) NSRect controlPointBounds;
 | 
			
		||||
@property (readonly) NSRect bounds;
 | 
			
		||||
 | 
			
		||||
// Elements.
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSInteger elementCount;
 | 
			
		||||
 | 
			
		||||
// `points' should contain space for at least three points.  `points'
 | 
			
		||||
// may be NULL.  In the case of NSBezierPathElementCurveTo, the order
 | 
			
		||||
// of the points is controlPoint1 (points[0]), controlPoint2 (points[1]),
 | 
			
		||||
// endPoint (points[2]).
 | 
			
		||||
- (NSBezierPathElement)elementAtIndex:(NSInteger)index
 | 
			
		||||
		     associatedPoints:(nullable NSPointArray)points;
 | 
			
		||||
// As above with points == NULL.
 | 
			
		||||
- (NSBezierPathElement)elementAtIndex:(NSInteger)index;
 | 
			
		||||
- (void)setAssociatedPoints:(nullable NSPointArray)points atIndex:(NSInteger)index;
 | 
			
		||||
 | 
			
		||||
// Appending common paths
 | 
			
		||||
 | 
			
		||||
- (void)appendBezierPath:(NSBezierPath *)path;
 | 
			
		||||
- (void)appendBezierPathWithRect:(NSRect)rect;
 | 
			
		||||
- (void)appendBezierPathWithPoints:(NSPointArray)points count:(NSInteger)count;
 | 
			
		||||
- (void)appendBezierPathWithOvalInRect:(NSRect)rect;
 | 
			
		||||
- (void)appendBezierPathWithArcWithCenter:(NSPoint)center radius:(CGFloat)radius
 | 
			
		||||
			       startAngle:(CGFloat)startAngle
 | 
			
		||||
				 endAngle:(CGFloat)endAngle
 | 
			
		||||
				clockwise:(BOOL)clockwise;
 | 
			
		||||
// As above with clockwise == NO. */	
 | 
			
		||||
- (void)appendBezierPathWithArcWithCenter:(NSPoint)center radius:(CGFloat)radius
 | 
			
		||||
			       startAngle:(CGFloat)startAngle
 | 
			
		||||
				 endAngle:(CGFloat)endAngle;
 | 
			
		||||
- (void)appendBezierPathWithArcFromPoint:(NSPoint)point1
 | 
			
		||||
				 toPoint:(NSPoint)point2
 | 
			
		||||
				  radius:(CGFloat)radius;
 | 
			
		||||
 | 
			
		||||
- (void)appendBezierPathWithCGGlyph:(CGGlyph)glyph inFont:(NSFont *)font API_AVAILABLE(macos(10.13));
 | 
			
		||||
- (void)appendBezierPathWithCGGlyphs:(const CGGlyph *)glyphs count:(NSInteger)count inFont:(NSFont *)font API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
// Appends paths for a rounded rectangle.
 | 
			
		||||
- (void)appendBezierPathWithRoundedRect:(NSRect)rect xRadius:(CGFloat)xRadius yRadius:(CGFloat)yRadius API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
// Hit detection.
 | 
			
		||||
- (BOOL)containsPoint:(NSPoint)point;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSBezierPath (NSBezierPathDeprecated)
 | 
			
		||||
- (BOOL)cachesBezierPath API_DEPRECATED("", macos(10.0,10.0));
 | 
			
		||||
- (void)setCachesBezierPath:(BOOL)flag API_DEPRECATED("", macos(10.0,10.0));
 | 
			
		||||
 | 
			
		||||
// The following NSGlyph-related methods are deprecated. Use corresponding CGGlyph-based methods instead
 | 
			
		||||
- (void)appendBezierPathWithGlyph:(NSGlyph)glyph inFont:(NSFont *)font API_DEPRECATED("Use -appendBezierPathWithCGGlyph:inFont: instead", macos(10.0,10.14));
 | 
			
		||||
- (void)appendBezierPathWithGlyphs:(NSGlyph *)glyphs count:(NSInteger)count inFont:(NSFont *)font API_DEPRECATED("Use -appendBezierPathWithCGGlyphs:count:inFont: instead", macos(10.0,10.14));
 | 
			
		||||
- (void)appendBezierPathWithPackedGlyphs:(const char *)packedGlyphs API_DEPRECATED("Use -appendBezierPathWithCGGlyphs:count:inFont: instead", macos(10.0,10.14));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* Deprecated legacy line cap style constants. Prefer to use NSLineCapStyle values instead.
 | 
			
		||||
*/
 | 
			
		||||
static const NSLineCapStyle NSButtLineCapStyle API_DEPRECATED_WITH_REPLACEMENT("NSLineCapStyleButt", macos(10.0, 11.0)) = NSLineCapStyleButt;
 | 
			
		||||
static const NSLineCapStyle NSRoundLineCapStyle API_DEPRECATED_WITH_REPLACEMENT("NSLineCapStyleRound", macos(10.0, 11.0)) = NSLineCapStyleRound;
 | 
			
		||||
static const NSLineCapStyle NSSquareLineCapStyle API_DEPRECATED_WITH_REPLACEMENT("NSLineCapStyleSquare", macos(10.0, 11.0)) = NSLineCapStyleSquare;
 | 
			
		||||
 | 
			
		||||
/* Deprecated legacy line join style constants. Prefer to use NSLineJoinStyle values instead.
 | 
			
		||||
*/
 | 
			
		||||
static const NSLineJoinStyle NSMiterLineJoinStyle API_DEPRECATED_WITH_REPLACEMENT("NSLineJoinStyleMiter", macos(10.0, 11.0)) = NSLineJoinStyleMiter;
 | 
			
		||||
static const NSLineJoinStyle NSRoundLineJoinStyle API_DEPRECATED_WITH_REPLACEMENT("NSLineJoinStyleRound", macos(10.0, 11.0)) = NSLineJoinStyleRound;
 | 
			
		||||
static const NSLineJoinStyle NSBevelLineJoinStyle API_DEPRECATED_WITH_REPLACEMENT("NSLineJoinStyleBevel", macos(10.0, 11.0)) = NSLineJoinStyleBevel;
 | 
			
		||||
 | 
			
		||||
/* Deprecated legacy winding rule constants. Prefer to use NSWindingRule values instead.
 | 
			
		||||
*/
 | 
			
		||||
static const NSWindingRule NSNonZeroWindingRule API_DEPRECATED_WITH_REPLACEMENT("NSWindingRuleNonZero", macos(10.0, 11.0)) = NSWindingRuleNonZero;
 | 
			
		||||
static const NSWindingRule NSEvenOddWindingRule API_DEPRECATED_WITH_REPLACEMENT("NSWindingRuleEvenOdd", macos(10.0, 11.0)) = NSWindingRuleEvenOdd;
 | 
			
		||||
 | 
			
		||||
/* Deprecated legacy Bezier path element constants. Prefer to use NSBezierPathElement values instead.
 | 
			
		||||
*/
 | 
			
		||||
static const NSBezierPathElement NSMoveToBezierPathElement API_DEPRECATED_WITH_REPLACEMENT("NSBezierPathElementMoveTo", macos(10.0, 11.0)) = NSBezierPathElementMoveTo;
 | 
			
		||||
static const NSBezierPathElement NSLineToBezierPathElement API_DEPRECATED_WITH_REPLACEMENT("NSBezierPathElementLineTo", macos(10.0, 11.0)) = NSBezierPathElementLineTo;
 | 
			
		||||
static const NSBezierPathElement NSCurveToBezierPathElement API_DEPRECATED_WITH_REPLACEMENT("NSBezierPathElementCurveTo", macos(10.0, 11.0)) = NSBezierPathElementCurveTo;
 | 
			
		||||
static const NSBezierPathElement NSClosePathBezierPathElement API_DEPRECATED_WITH_REPLACEMENT("NSBezierPathElementClosePath", macos(10.0, 11.0)) = NSBezierPathElementClosePath;
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,172 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSBitmapImageRep.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <AppKit/NSImageRep.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <ApplicationServices/ApplicationServices.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class CIImage;
 | 
			
		||||
@class NSColor;
 | 
			
		||||
@class NSColorSpace;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSTIFFCompression) {
 | 
			
		||||
    NSTIFFCompressionNone		= 1,
 | 
			
		||||
    NSTIFFCompressionCCITTFAX3		= 3,		/* 1 bps only */
 | 
			
		||||
    NSTIFFCompressionCCITTFAX4		= 4,		/* 1 bps only */
 | 
			
		||||
    NSTIFFCompressionLZW		= 5,
 | 
			
		||||
    NSTIFFCompressionJPEG		= 6,		/* No longer supported for input or output */
 | 
			
		||||
    NSTIFFCompressionNEXT		= 32766,	/* Input only */
 | 
			
		||||
    NSTIFFCompressionPackBits		= 32773,
 | 
			
		||||
    NSTIFFCompressionOldJPEG		= 32865		/* No longer supported for input or output */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSBitmapImageFileType) {
 | 
			
		||||
    NSBitmapImageFileTypeTIFF,
 | 
			
		||||
    NSBitmapImageFileTypeBMP,
 | 
			
		||||
    NSBitmapImageFileTypeGIF,
 | 
			
		||||
    NSBitmapImageFileTypeJPEG,
 | 
			
		||||
    NSBitmapImageFileTypePNG,
 | 
			
		||||
    NSBitmapImageFileTypeJPEG2000
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSImageRepLoadStatus) {
 | 
			
		||||
    NSImageRepLoadStatusUnknownType     = -1, // not enough data to determine image format. please feed me more data
 | 
			
		||||
    NSImageRepLoadStatusReadingHeader   = -2, // image format known, reading header. not yet valid. more data needed
 | 
			
		||||
    NSImageRepLoadStatusWillNeedAllData = -3, // can't read incrementally. will wait for complete data to become avail.
 | 
			
		||||
    NSImageRepLoadStatusInvalidData     = -4, // image decompression encountered error.
 | 
			
		||||
    NSImageRepLoadStatusUnexpectedEOF   = -5, // ran out of data before full image was decompressed.
 | 
			
		||||
    NSImageRepLoadStatusCompleted       = -6  // all is well, the full pixelsHigh image is valid.
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSBitmapFormat) {
 | 
			
		||||
    NSBitmapFormatAlphaFirst            = 1 << 0,       // 0 means is alpha last (RGBA, CMYKA, etc.)
 | 
			
		||||
    NSBitmapFormatAlphaNonpremultiplied = 1 << 1,       // 0 means is premultiplied
 | 
			
		||||
    NSBitmapFormatFloatingPointSamples  = 1 << 2,  // 0 is integer
 | 
			
		||||
 | 
			
		||||
    NSBitmapFormatSixteenBitLittleEndian API_AVAILABLE(macos(10.10)) = (1 << 8),
 | 
			
		||||
    NSBitmapFormatThirtyTwoBitLittleEndian API_AVAILABLE(macos(10.10)) = (1 << 9),
 | 
			
		||||
    NSBitmapFormatSixteenBitBigEndian API_AVAILABLE(macos(10.10)) = (1 << 10),
 | 
			
		||||
    NSBitmapFormatThirtyTwoBitBigEndian API_AVAILABLE(macos(10.10)) = (1 << 11)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSBitmapImageRepPropertyKey NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSBitmapImageRepPropertyKey NSImageCompressionMethod;       // TIFF input/output (NSTIFFCompression in NSNumber)
 | 
			
		||||
APPKIT_EXTERN NSBitmapImageRepPropertyKey NSImageCompressionFactor;	// TIFF/JPEG input/output (float in NSNumber)
 | 
			
		||||
APPKIT_EXTERN NSBitmapImageRepPropertyKey NSImageDitherTransparency;	// GIF output (BOOL in NSNumber)
 | 
			
		||||
APPKIT_EXTERN NSBitmapImageRepPropertyKey NSImageRGBColorTable;		// GIF input/output (packed RGB in NSData)
 | 
			
		||||
APPKIT_EXTERN NSBitmapImageRepPropertyKey NSImageInterlaced;                     // PNG output (BOOL in NSNumber)
 | 
			
		||||
APPKIT_EXTERN NSBitmapImageRepPropertyKey NSImageColorSyncProfileData; // TIFF,GIF input/output (NSData)
 | 
			
		||||
APPKIT_EXTERN NSBitmapImageRepPropertyKey NSImageFrameCount;                     // GIF input (int in NSNumber) (read-only)
 | 
			
		||||
APPKIT_EXTERN NSBitmapImageRepPropertyKey NSImageCurrentFrame;                 // GIF input (int in NSNumber)
 | 
			
		||||
APPKIT_EXTERN NSBitmapImageRepPropertyKey NSImageCurrentFrameDuration; // GIF input (float in NSNumber) (read-only)
 | 
			
		||||
APPKIT_EXTERN NSBitmapImageRepPropertyKey NSImageLoopCount;                       // GIF input (int in NSNumber) (read-only)
 | 
			
		||||
APPKIT_EXTERN NSBitmapImageRepPropertyKey NSImageGamma;                               // PNG input/output (float in NSNumber)
 | 
			
		||||
APPKIT_EXTERN NSBitmapImageRepPropertyKey NSImageProgressive;                   // JPEG input/output (BOOL in NSNumber)
 | 
			
		||||
APPKIT_EXTERN NSBitmapImageRepPropertyKey NSImageEXIFData;                         // JPEG input/output (NSDictionary)
 | 
			
		||||
APPKIT_EXTERN NSBitmapImageRepPropertyKey NSImageIPTCData;                      // Photo Metadata (NSDictionary)
 | 
			
		||||
APPKIT_EXTERN NSBitmapImageRepPropertyKey NSImageFallbackBackgroundColor API_AVAILABLE(macos(10.5)); // JPEG output (NSColor)
 | 
			
		||||
 | 
			
		||||
@interface NSBitmapImageRep : NSImageRep <NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithFocusedViewRect:(NSRect)rect API_DEPRECATED("Use -[NSView cacheDisplayInRect:toBitmapImageRep:] to snapshot a view.", macos(10.0,10.14));
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithBitmapDataPlanes:(unsigned char *_Nullable *_Nullable)planes pixelsWide:(NSInteger)width pixelsHigh:(NSInteger)height bitsPerSample:(NSInteger)bps samplesPerPixel:(NSInteger)spp hasAlpha:(BOOL)alpha isPlanar:(BOOL)isPlanar colorSpaceName:(NSColorSpaceName)colorSpaceName bytesPerRow:(NSInteger)rBytes bitsPerPixel:(NSInteger)pBits;
 | 
			
		||||
- (nullable instancetype)initWithBitmapDataPlanes:(unsigned char *_Nullable *_Nullable)planes pixelsWide:(NSInteger)width pixelsHigh:(NSInteger)height bitsPerSample:(NSInteger)bps samplesPerPixel:(NSInteger)spp hasAlpha:(BOOL)alpha isPlanar:(BOOL)isPlanar colorSpaceName:(NSColorSpaceName)colorSpaceName  bitmapFormat:(NSBitmapFormat)bitmapFormat bytesPerRow:(NSInteger)rBytes bitsPerPixel:(NSInteger)pBits;
 | 
			
		||||
- (instancetype)initWithCGImage:(CGImageRef)cgImage API_AVAILABLE(macos(10.5));
 | 
			
		||||
- (instancetype)initWithCIImage:(CIImage *)ciImage API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
+ (NSArray<NSImageRep *> *)imageRepsWithData:(NSData *)data;	/* some file formats can contain multiple images */
 | 
			
		||||
 | 
			
		||||
+ (nullable instancetype)imageRepWithData:(NSData *)data;	/* Convenience of initWithData: */
 | 
			
		||||
- (nullable instancetype)initWithData:(NSData *)data;
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly) unsigned char *bitmapData NS_RETURNS_INNER_POINTER;
 | 
			
		||||
- (void)getBitmapDataPlanes:(unsigned char *_Nullable *_Nonnull)data;
 | 
			
		||||
 | 
			
		||||
@property (getter=isPlanar, readonly) BOOL planar;
 | 
			
		||||
@property (readonly) NSInteger samplesPerPixel;
 | 
			
		||||
@property (readonly) NSInteger bitsPerPixel;
 | 
			
		||||
@property (readonly) NSInteger bytesPerRow;
 | 
			
		||||
@property (readonly) NSInteger bytesPerPlane;
 | 
			
		||||
@property (readonly) NSInteger numberOfPlanes;
 | 
			
		||||
@property (readonly) NSBitmapFormat bitmapFormat;
 | 
			
		||||
 | 
			
		||||
- (void)getCompression:(nullable NSTIFFCompression *)compression factor:(nullable float *)factor;
 | 
			
		||||
- (void)setCompression:(NSTIFFCompression)compression factor:(float)factor;
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSData *TIFFRepresentation;
 | 
			
		||||
- (nullable NSData *)TIFFRepresentationUsingCompression:(NSTIFFCompression)comp factor:(float)factor;
 | 
			
		||||
 | 
			
		||||
+ (nullable NSData *)TIFFRepresentationOfImageRepsInArray:(NSArray<NSImageRep *> *)array;
 | 
			
		||||
+ (nullable NSData *)TIFFRepresentationOfImageRepsInArray:(NSArray<NSImageRep *> *)array usingCompression:(NSTIFFCompression)comp factor:(float)factor;
 | 
			
		||||
 | 
			
		||||
+ (void)getTIFFCompressionTypes:(const NSTIFFCompression * _Nullable * _Nonnull)list count:(NSInteger *)numTypes;
 | 
			
		||||
+ (nullable NSString *)localizedNameForTIFFCompressionType:(NSTIFFCompression)compression;
 | 
			
		||||
- (BOOL)canBeCompressedUsing:(NSTIFFCompression)compression;
 | 
			
		||||
 | 
			
		||||
/* Support for colorization of grayscale images.  Maps the image such that:
 | 
			
		||||
Gray value of midPoint -> midPointColor, black -> shadowColor, white -> lightColor.
 | 
			
		||||
Works on images with 8-bit SPP; thus either 8-bit gray or 24-bit color (with optional alpha).
 | 
			
		||||
*/
 | 
			
		||||
- (void)colorizeByMappingGray:(CGFloat)midPoint toColor:(nullable NSColor *)midPointColor blackMapping:(nullable NSColor *)shadowColor whiteMapping:(nullable NSColor *)lightColor;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initForIncrementalLoad;
 | 
			
		||||
- (NSInteger)incrementalLoadFromData:(NSData*)data complete:(BOOL)complete;
 | 
			
		||||
 | 
			
		||||
- (void)setColor:(NSColor*)color atX:(NSInteger)x y:(NSInteger)y;
 | 
			
		||||
- (nullable NSColor *)colorAtX:(NSInteger)x y:(NSInteger)y;
 | 
			
		||||
 | 
			
		||||
- (void)getPixel:(NSUInteger[_Nonnull])p atX:(NSInteger)x y:(NSInteger)y;
 | 
			
		||||
- (void)setPixel:(NSUInteger[_Nonnull])p atX:(NSInteger)x y:(NSInteger)y;
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly) CGImageRef CGImage API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@property (readonly, strong) NSColorSpace *colorSpace API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
- (nullable NSBitmapImageRep *)bitmapImageRepByConvertingToColorSpace:(NSColorSpace *)targetSpace renderingIntent:(NSColorRenderingIntent)renderingIntent API_AVAILABLE(macos(10.6));
 | 
			
		||||
- (nullable NSBitmapImageRep *)bitmapImageRepByRetaggingWithColorSpace:(NSColorSpace *)newSpace API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSBitmapImageRep (NSBitmapImageFileTypeExtensions)
 | 
			
		||||
 | 
			
		||||
+ (nullable NSData *)representationOfImageRepsInArray:(NSArray<NSImageRep *> *)imageReps usingType:(NSBitmapImageFileType)storageType properties:(NSDictionary<NSBitmapImageRepPropertyKey, id> *)properties;
 | 
			
		||||
 | 
			
		||||
- (nullable NSData *)representationUsingType:(NSBitmapImageFileType)storageType properties:(NSDictionary<NSBitmapImageRepPropertyKey, id> *)properties;
 | 
			
		||||
 | 
			
		||||
- (void)setProperty:(NSBitmapImageRepPropertyKey)property withValue:(nullable id)value;
 | 
			
		||||
- (nullable id)valueForProperty:(NSBitmapImageRepPropertyKey)property;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static const NSBitmapImageFileType NSTIFFFileType API_DEPRECATED_WITH_REPLACEMENT("NSBitmapImageFileTypeTIFF", macos(10.0,10.14)) = NSBitmapImageFileTypeTIFF;
 | 
			
		||||
static const NSBitmapImageFileType NSBMPFileType API_DEPRECATED_WITH_REPLACEMENT("NSBitmapImageFileTypeBMP", macos(10.0,10.14)) = NSBitmapImageFileTypeBMP;
 | 
			
		||||
static const NSBitmapImageFileType NSGIFFileType API_DEPRECATED_WITH_REPLACEMENT("NSBitmapImageFileTypeGIF", macos(10.0,10.14)) = NSBitmapImageFileTypeGIF;
 | 
			
		||||
static const NSBitmapImageFileType NSJPEGFileType API_DEPRECATED_WITH_REPLACEMENT("NSBitmapImageFileTypeJPEG", macos(10.0,10.14)) = NSBitmapImageFileTypeJPEG;
 | 
			
		||||
static const NSBitmapImageFileType NSPNGFileType API_DEPRECATED_WITH_REPLACEMENT("NSBitmapImageFileTypePNG", macos(10.0,10.14)) = NSBitmapImageFileTypePNG;
 | 
			
		||||
static const NSBitmapImageFileType NSJPEG2000FileType API_DEPRECATED_WITH_REPLACEMENT("NSBitmapImageFileTypeJPEG2000", macos(10.0,10.14)) = NSBitmapImageFileTypeJPEG2000;
 | 
			
		||||
 | 
			
		||||
static const NSBitmapFormat NSAlphaFirstBitmapFormat API_DEPRECATED_WITH_REPLACEMENT("NSBitmapFormatAlphaFirst", macos(10.5,10.14)) = NSBitmapFormatAlphaFirst;
 | 
			
		||||
static const NSBitmapFormat NSAlphaNonpremultipliedBitmapFormat API_DEPRECATED_WITH_REPLACEMENT("NSBitmapFormatAlphaNonpremultiplied", macos(10.0,10.14)) = NSBitmapFormatAlphaNonpremultiplied;
 | 
			
		||||
static const NSBitmapFormat NSFloatingPointSamplesBitmapFormat API_DEPRECATED_WITH_REPLACEMENT("NSBitmapFormatFloatingPointSamples", macos(10.0,10.14)) = NSBitmapFormatFloatingPointSamples;
 | 
			
		||||
static const NSBitmapFormat NS16BitLittleEndianBitmapFormat API_DEPRECATED_WITH_REPLACEMENT("NSBitmapFormatSixteenBitLittleEndian", macos(10.5,10.14)) = NSBitmapFormatSixteenBitLittleEndian;
 | 
			
		||||
static const NSBitmapFormat NS32BitLittleEndianBitmapFormat API_DEPRECATED_WITH_REPLACEMENT("NSBitmapFormatThirtyTwoBitLittleEndian", macos(10.0,10.14)) = NSBitmapFormatThirtyTwoBitLittleEndian;
 | 
			
		||||
static const NSBitmapFormat NS16BitBigEndianBitmapFormat API_DEPRECATED_WITH_REPLACEMENT("NSBitmapFormatSixteenBitBigEndian", macos(10.0,10.14)) = NSBitmapFormatSixteenBitBigEndian;
 | 
			
		||||
static const NSBitmapFormat NS32BitBigEndianBitmapFormat API_DEPRECATED_WITH_REPLACEMENT("NSBitmapFormatThirtyTwoBitBigEndian", macos(10.0,10.14)) = NSBitmapFormatThirtyTwoBitBigEndian;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,90 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSBox.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSView.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSFont;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSTitlePosition) {
 | 
			
		||||
    NSNoTitle     = 0,
 | 
			
		||||
    NSAboveTop    = 1,
 | 
			
		||||
    NSAtTop       = 2,
 | 
			
		||||
    NSBelowTop    = 3,
 | 
			
		||||
    NSAboveBottom = 4,
 | 
			
		||||
    NSAtBottom    = 5,
 | 
			
		||||
    NSBelowBottom = 6,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSBoxType) {
 | 
			
		||||
    /* Group subviews with a standard look. This is the default style. */
 | 
			
		||||
    NSBoxPrimary = 0,
 | 
			
		||||
 | 
			
		||||
    /* Vertical or horizontal separtor line.  Not used with subviews. */
 | 
			
		||||
    NSBoxSeparator = 2,
 | 
			
		||||
 | 
			
		||||
    /* Custom boxes draw based entirely on user parameters; see the fillColor, borderColor, borderWidth, and cornerRadius properties for more information. */
 | 
			
		||||
    NSBoxCustom API_AVAILABLE(macos(10.5)) = 4,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@interface NSBox : NSView
 | 
			
		||||
 | 
			
		||||
@property NSBoxType boxType;
 | 
			
		||||
@property NSTitlePosition titlePosition;
 | 
			
		||||
@property (copy) NSString *title;
 | 
			
		||||
@property (strong) NSFont *titleFont;
 | 
			
		||||
@property (readonly) NSRect borderRect;
 | 
			
		||||
@property (readonly) NSRect titleRect;
 | 
			
		||||
@property (readonly, strong) id titleCell;
 | 
			
		||||
@property NSSize contentViewMargins;
 | 
			
		||||
- (void)sizeToFit;
 | 
			
		||||
- (void)setFrameFromContentFrame:(NSRect)contentFrame;
 | 
			
		||||
 | 
			
		||||
/* Get and set the content view for the box. Note that subviews added to the NSBox will be really added as subviews of the contentView. */
 | 
			
		||||
@property (nullable, strong) __kindof NSView *contentView;
 | 
			
		||||
 | 
			
		||||
/* Transparent boxes do not draw anything.  Subview drawing is unaffected.  The 'transparent' property corresponds to the binding 'NSTransparentBinding'. */
 | 
			
		||||
@property (getter=isTransparent) BOOL transparent API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* For boxType == NSBoxCustom: Get and set the border width of the box. The default value is 1.0. */
 | 
			
		||||
@property CGFloat borderWidth API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* For boxType == NSBoxCustom: Get and set the corner radius of the box. The default value is 0.0 (no corner radius). */
 | 
			
		||||
@property CGFloat cornerRadius API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* For boxType == NSBoxCustom: Get and set the border color the box. The default value is +[NSColor secondaryLabelColor], and may vary release-to-release. */
 | 
			
		||||
@property (copy) NSColor *borderColor API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* For boxType == NSBoxCustom: Get and set the fill (background) color the box. The default value is NSColor.clearColor. */
 | 
			
		||||
@property (copy) NSColor *fillColor API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* Deprecated Interfaces */
 | 
			
		||||
 | 
			
		||||
@interface NSBox (NSDeprecated)
 | 
			
		||||
 | 
			
		||||
@property NSBorderType borderType API_DEPRECATED("borderType is only applicable to NSBoxOldStyle, which is deprecated. To replace a borderType of NSNoBorder, use the `transparent` property.", macos(10.0, 10.15));
 | 
			
		||||
 | 
			
		||||
/* Mnemonics are deprecated in 10.8. Historically they have not done anything. For compatability, this method still calls setTitle: with the ampersand stripped from it. */
 | 
			
		||||
- (void)setTitleWithMnemonic:(null_unspecified NSString *)stringWithAmpersand API_DEPRECATED("", macos(10.0,10.8));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* The Secondary box type has been identical to Primary since Mac OS X 10.3. Use NSBoxPrimary instead. */
 | 
			
		||||
static const NSBoxType NSBoxSecondary API_DEPRECATED_WITH_REPLACEMENT("NSBoxPrimary", macos(10.0, 10.15)) = (NSBoxType)1;
 | 
			
		||||
 | 
			
		||||
/* Draws a border in the style of Mac OS X 10.2 and earlier. This style is not recommended. */
 | 
			
		||||
static const NSBoxType NSBoxOldStyle API_DEPRECATED("NSBoxOldStyle is discouraged in modern application design. It should be replaced with either NSBoxPrimary or NSBoxCustom.", macos(10.0, 10.15)) = (NSBoxType)3;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,490 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSBrowser.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <AppKit/NSControl.h>
 | 
			
		||||
#import <AppKit/NSDragging.h>
 | 
			
		||||
#import <AppKit/NSViewController.h>
 | 
			
		||||
#import <AppKit/NSApplication.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumberWithContinuousScrollingBrowser = 680.0;
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumberWithColumnResizingBrowser = 685.0;
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSBrowserColumnsAutosaveName NS_SWIFT_BRIDGED_TYPEDEF;
 | 
			
		||||
 | 
			
		||||
@class NSMatrix, NSScroller, NSIndexSet;
 | 
			
		||||
@protocol NSBrowserDelegate;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSBrowserColumnResizingType) {
 | 
			
		||||
/* Column sizes are fixed and set by developer.     
 | 
			
		||||
 */
 | 
			
		||||
    NSBrowserNoColumnResizing = 0,
 | 
			
		||||
    
 | 
			
		||||
/* No user resizing. Columns grow as window grows.  
 | 
			
		||||
 */
 | 
			
		||||
    NSBrowserAutoColumnResizing = 1,
 | 
			
		||||
    
 | 
			
		||||
/* Columns fixed as window grows.  User can resize. 
 | 
			
		||||
 */
 | 
			
		||||
    NSBrowserUserColumnResizing = 2,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* In drag and drop, used to specify the drop operation from inside the delegate method browser:validateDrop:proposedRow:column:dropOperation. See the delegate method description for more information.
 | 
			
		||||
 */
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSBrowserDropOperation) { 
 | 
			
		||||
    NSBrowserDropOn,
 | 
			
		||||
    NSBrowserDropAbove,
 | 
			
		||||
} API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSBrowser : NSControl
 | 
			
		||||
 | 
			
		||||
@property (class, readonly) Class cellClass;
 | 
			
		||||
 | 
			
		||||
- (void)loadColumnZero;
 | 
			
		||||
@property (getter=isLoaded, readonly) BOOL loaded;
 | 
			
		||||
 | 
			
		||||
@property (nullable) SEL doubleAction;
 | 
			
		||||
- (void)setCellClass:(Class)factoryId;
 | 
			
		||||
@property (null_resettable, strong) id /* NSCell * */ cellPrototype;
 | 
			
		||||
@property (nullable, weak) id<NSBrowserDelegate> delegate;
 | 
			
		||||
@property BOOL reusesColumns;
 | 
			
		||||
 | 
			
		||||
@property BOOL hasHorizontalScroller;
 | 
			
		||||
@property BOOL autohidesScroller API_AVAILABLE(macos(10.6));
 | 
			
		||||
@property BOOL separatesColumns;
 | 
			
		||||
@property (getter=isTitled) BOOL titled;
 | 
			
		||||
@property CGFloat minColumnWidth;
 | 
			
		||||
 | 
			
		||||
@property NSInteger maxVisibleColumns;
 | 
			
		||||
 | 
			
		||||
@property BOOL allowsMultipleSelection;
 | 
			
		||||
@property BOOL allowsBranchSelection;
 | 
			
		||||
@property BOOL allowsEmptySelection;
 | 
			
		||||
@property BOOL takesTitleFromPreviousColumn;
 | 
			
		||||
 | 
			
		||||
@property BOOL sendsActionOnArrowKeys;
 | 
			
		||||
 | 
			
		||||
/* Returns the item at the given index path. This method can only be used if the delegate implements the item data source methods. The indexPath must be displayable in the browser.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable id)itemAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Returns the item located at 'row' in 'column'.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable id)itemAtRow:(NSInteger)row inColumn:(NSInteger)column API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Returns the index path of the item whose children are displayed in the given column. This method can only be used if the delegate implements the item data source methods.
 | 
			
		||||
 */
 | 
			
		||||
- (NSIndexPath *)indexPathForColumn:(NSInteger)column API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Returns whether the given item is a leaf item. This method can only be used if the delegate implements the item data source methods.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)isLeafItem:(nullable id)item API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Updates a particular set of rows in 'column'. For rows that are visible, appropriate dataSource and delegate methods will be called and the row will be redrawn. For browsers that support variable row heights, the row height will not be re-queried from the delegate. This method can only be used if the delegate implements the item data source methods.
 | 
			
		||||
*/
 | 
			
		||||
- (void)reloadDataForRowIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Returns the item that contains all children located in 'column'. In other words, it is the parent item for that column.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable id)parentForItemsInColumn:(NSInteger)column API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Scrolls 'row' to be visible within 'column'. 'column' will not be scrolled visible. To scroll 'column' to visible, first call -[browser scrollColumnToVisible:column].
 | 
			
		||||
 */
 | 
			
		||||
- (void)scrollRowToVisible:(NSInteger)row inColumn:(NSInteger)column API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
- (void)setTitle:(NSString *)string ofColumn:(NSInteger)column;
 | 
			
		||||
- (nullable NSString *)titleOfColumn:(NSInteger)column;
 | 
			
		||||
@property (copy) NSString *pathSeparator;
 | 
			
		||||
- (BOOL)setPath:(NSString *)path;
 | 
			
		||||
- (NSString *)path;
 | 
			
		||||
- (NSString *)pathToColumn:(NSInteger)column;
 | 
			
		||||
 | 
			
		||||
/* Returns the column and row clicked on to display a context menu. These methods will return -1 when no menu is active.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) NSInteger clickedColumn API_AVAILABLE(macos(10.6));
 | 
			
		||||
@property (readonly) NSInteger clickedRow API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSInteger selectedColumn;
 | 
			
		||||
 | 
			
		||||
/* For the item based browser, selectedCell returns the prepared cell at the selected row in the selected column.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, readonly, strong) id selectedCell;
 | 
			
		||||
- (nullable id)selectedCellInColumn:(NSInteger)column;
 | 
			
		||||
 | 
			
		||||
/* For the item based browser, selectedCells returns a copy of all prepared cells in the selected row in the selected column
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, readonly, copy) NSArray<NSCell *> *selectedCells;
 | 
			
		||||
 | 
			
		||||
- (void)selectRow:(NSInteger)row inColumn:(NSInteger)column;
 | 
			
		||||
 | 
			
		||||
- (NSInteger)selectedRowInColumn:(NSInteger)column;
 | 
			
		||||
 | 
			
		||||
/* Returns the index path of the item selected in the browser, or nil if there is no selection. The setter sets the browser's selection to the item at path. Throws an exception if the path is invalid. This method can only be used if the delegate implements the item data source methods.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, copy) NSIndexPath *selectionIndexPath API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Returns the index paths of all items selected in the browser. The setter sets the browser's selection to the specified index paths. Throws an exception if any of the paths are invalid. This method can only be used if the delegate implements the item data source methods.
 | 
			
		||||
 */
 | 
			
		||||
@property (copy) NSArray<NSIndexPath *> *selectionIndexPaths API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Sets the selected row 'indexes' in the matrix located at 'column'. 
 | 
			
		||||
 */
 | 
			
		||||
- (void)selectRowIndexes:(NSIndexSet *)indexes inColumn:(NSInteger)column API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Returns the selected cell indexes in the matrix located at 'column'. 
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSIndexSet *)selectedRowIndexesInColumn:(NSInteger)column API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
- (void)reloadColumn:(NSInteger)column;
 | 
			
		||||
- (void)validateVisibleColumns;
 | 
			
		||||
- (void)scrollColumnsRightBy:(NSInteger)shiftAmount;
 | 
			
		||||
- (void)scrollColumnsLeftBy:(NSInteger)shiftAmount;
 | 
			
		||||
- (void)scrollColumnToVisible:(NSInteger)column;
 | 
			
		||||
 | 
			
		||||
/* Returns the last loaded column. This is equal to the total number of columns minus 1. When setting. 'column' must be equal to or less than -lastColumn. To add more columns, use -addColumn.
 | 
			
		||||
 */
 | 
			
		||||
@property NSInteger lastColumn;
 | 
			
		||||
 | 
			
		||||
/* Adds a column at the end. To remove columns, use -setLastColumn:
 | 
			
		||||
 */
 | 
			
		||||
- (void)addColumn;
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSInteger numberOfVisibleColumns;
 | 
			
		||||
@property (readonly) NSInteger firstVisibleColumn;
 | 
			
		||||
@property (readonly) NSInteger lastVisibleColumn;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
- (nullable id)loadedCellAtRow:(NSInteger)row column:(NSInteger)col;
 | 
			
		||||
- (void)selectAll:(nullable id)sender;
 | 
			
		||||
- (void)tile;
 | 
			
		||||
- (void)doClick:(nullable id)sender;
 | 
			
		||||
- (void)doDoubleClick:(nullable id)sender;
 | 
			
		||||
- (BOOL)sendAction;
 | 
			
		||||
 | 
			
		||||
- (NSRect)titleFrameOfColumn:(NSInteger)column;
 | 
			
		||||
- (void)drawTitleOfColumn:(NSInteger)column inRect:(NSRect)rect;
 | 
			
		||||
@property (readonly) CGFloat titleHeight;
 | 
			
		||||
- (NSRect)frameOfColumn:(NSInteger)column;
 | 
			
		||||
- (NSRect)frameOfInsideOfColumn:(NSInteger)column;
 | 
			
		||||
 | 
			
		||||
/* Returns the frame of the row at 'row' / 'column' including the area for the expandable arrow. The returned NSRect is in the NSBrowser coordinate space.
 | 
			
		||||
*/
 | 
			
		||||
- (NSRect)frameOfRow:(NSInteger)row inColumn:(NSInteger)column API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Finds the row and column located at 'point', returning YES if both can be found. If a row does not exist at 'point', then -1 is set for the row. If a column does not exist at 'point', then -1 is set for the column. 'point' is expected to be in the NSBrowser's coordinate system.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)getRow:(nullable NSInteger *)row column:(nullable NSInteger *)column forPoint:(NSPoint)point API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* These methods convert between column width (the column's scrollview), and the content width (the matrix in the scrollview).  For example, to guarantee that 16 pixels of your browser cell are always visible, call [browser setMinColumnWidth:[browser columnWidthForColumnContentWidth:16]] 
 | 
			
		||||
*/
 | 
			
		||||
- (CGFloat)columnWidthForColumnContentWidth:(CGFloat)columnContentWidth;
 | 
			
		||||
- (CGFloat)columnContentWidthForColumnWidth:(CGFloat)columnWidth;
 | 
			
		||||
 | 
			
		||||
/* Default is NSBrowserAutoColumnResizing.  This setting is persistent. 
 | 
			
		||||
 */
 | 
			
		||||
@property NSBrowserColumnResizingType columnResizingType;
 | 
			
		||||
 | 
			
		||||
/* Default is NO.  This setting is persistent.  This setting only applies to NSBrowserUserColumnResizing type browsers.  If YES, the browser defaults to resizing all columns simultaneously, otherwise it defaults to single column resizing. Holding down the option key while resizing switches the type of resizing used. 
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL prefersAllColumnUserResizing;
 | 
			
		||||
 | 
			
		||||
/* setWidth:ofColumn: does nothing if columnResizingType is NSBrowserAutoColumnResizing.  Otherwise, Sets the width of the specified column.  Due to binary compatibility constraints, you may still set the default width for new columns by passing a columnIndex of -1; you are encouraged to use -setDefaultColumnWidth: instead.  NSBrowserColumnConfigurationDidChangeNotification will be posted (not immediately) if necessary.  The receiver will autosave its column configuration if necessary. 
 | 
			
		||||
 */
 | 
			
		||||
- (void)setWidth:(CGFloat)columnWidth ofColumn:(NSInteger)columnIndex;
 | 
			
		||||
- (CGFloat)widthOfColumn:(NSInteger)column;
 | 
			
		||||
 | 
			
		||||
/* Get and set the rowHeight. The value must be greater than 0. Calling -setRowHeight: with a non-pixel aligning (fractional) value will be forced to a pixel aligning (integral) value. For variable row height browsers (ones that have the delegate implement -browser:heightOfRow:column:), -rowHeight will be used to draw alternating rows past the last row in each browser column. The default value is 17.0. Note: The rowHeight methods are only valid when using the item delegate methods introduced in Mac OS 10.6. (see NSObject(NSBrowserDelegate)). An exception is thrown if using the older matrix delegate methods 
 | 
			
		||||
 */
 | 
			
		||||
@property CGFloat rowHeight API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* If the delegate implements -browser:heightOfRow:inColumn:, this method immediately re-tiles the browser columns using row heights it provides.
 | 
			
		||||
*/
 | 
			
		||||
- (void)noteHeightOfRowsWithIndexesChanged:(NSIndexSet *)indexSet inColumn:(NSInteger)columnIndex API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Persistently sets the default width for new columns which don't otherwise have initial width from either defaults or the delegate. This method replaces -setWidth:ofColumn: with a columnIndex of -1. 
 | 
			
		||||
 */
 | 
			
		||||
- (void)setDefaultColumnWidth:(CGFloat)columnWidth API_AVAILABLE(macos(10.6));
 | 
			
		||||
- (CGFloat)defaultColumnWidth API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Sets the name used to automatically save the receivers column configuration.  This setting is persistent.  If name is different from the current name, this method also reads in the saved column configuration for the new name and applies the values to the browser.  Column configuration is defined as an array of column content widths.  One width is saved for each level the user has reached.  That is, browser saves column width based on depth, not based on unique paths.  To do more complex column persistence, you should register for NSBrowserColumnConfigurationDidChangeNotifications and handle persistence yourself. 
 | 
			
		||||
 */
 | 
			
		||||
@property (copy) NSBrowserColumnsAutosaveName columnsAutosaveName;
 | 
			
		||||
 | 
			
		||||
/* Removes the column data stored under name from the applications user defaults. 
 | 
			
		||||
 */
 | 
			
		||||
+ (void)removeSavedColumnsWithAutosaveName:(NSBrowserColumnsAutosaveName)name;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
#pragma mark **** Drag and Drop Support ****
 | 
			
		||||
 | 
			
		||||
/* The return value indicates whether the receiver can attempt to initiate a drag for the given event. You can override this method and return NO to disallow initiating drags at the location in the given event. By default, the method will return YES if rowIndexes contains at least one item, and each item is enabled. If the equivalent delegate method is present, it will be preferred over this method, and you can safely call this method from your delegate. 
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)canDragRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column withEvent:(NSEvent *)event API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* This method computes and returns an image to use for dragging. You can override this to return a custom drag image, or call it to get the default drag image from the delegate method. 'rowIndexes' are the indexes of the cells being dragged in matrix 'column'. 'event' is a reference to the mouse down event that began the drag. 'dragImageOffset' is an in/out parameter. This method will be called with dragImageOffset set to NSZeroPoint, but it can be modified to re-position the returned image. A dragImageOffset of NSZeroPoint will cause the image to be centered under the mouse. By default, an image will be created that contain the visible cells within 'rowIndexes'. If the equivalent delegate method is present, it will be preferred over this method, and you can safely call this method from your delegate. 
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSImage *)draggingImageForRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column withEvent:(NSEvent *)event offset:(nullable NSPointPointer)dragImageOffset API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Configures the value returned from -draggingSourceOperationMaskForLocal:. An isLocal value of YES indicates that 'mask' applies when the destination object is in the same application. By default, NSDragOperationEvery will be returned. An isLocal value of NO indicates that 'mask' applies when the destination object in an application outside the receiver's application. By default, NSDragOperationNone is returned. NSBrowser will save the values you set for each isLocal setting. You typically will invoke this method, and not override it. 
 | 
			
		||||
 */
 | 
			
		||||
- (void)setDraggingSourceOperationMask:(NSDragOperation)mask forLocal:(BOOL)isLocal API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
 | 
			
		||||
/* Allow type selection in this NSBrowser. The default for 'allowsTypeSelect' is YES.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL allowsTypeSelect API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* The background color to be drawn. By default, it will be set [NSColor whiteColor]. You can use [NSColor clearColor] to make the background transparent. NSBrowser will return YES from isOpaque if the backgroundColor has an alphaComponent of 1.0 and it doesn't have a title, otherwise, it will return NO. Calling setBackgroundColor: will cause all NSMatrix instances have setDrawsBackground:NO be called in order for the NSBrowser's background color to show through. When drawing with the background color, NSCompositeSourceOver is used for the compositing operation.
 | 
			
		||||
 */
 | 
			
		||||
@property (strong) NSColor *backgroundColor API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Begins editing the item at the specified path. event may be nil if programatically editing. The cell's contents will be selected if select is YES. Overriding this method will not affect the editing behavior of the browser.
 | 
			
		||||
 */
 | 
			
		||||
- (void)editItemAtIndexPath:(NSIndexPath *)indexPath withEvent:(nullable NSEvent *)event select:(BOOL)select API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
#pragma mark **** Notifications ****
 | 
			
		||||
 | 
			
		||||
/* The -object in the NSNotification is the browser whose column sizes need to be persisted. There is no userInfo.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSBrowserColumnConfigurationDidChangeNotification;
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
#pragma mark **** Delegate methods ****
 | 
			
		||||
 | 
			
		||||
@protocol NSBrowserDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
/* As of Mac OS X 10.6, browser has two different mechanisms for populating columns. You may implement either the matrix or item delegate methods listed below. Many newer features of the browser are only available if you implement the item delegate methods. */
 | 
			
		||||
 | 
			
		||||
/* Implement one of the following two methods to populate the browser's columns with instances of NSMatrix.
 | 
			
		||||
   Note: the matrix based NSBrowser is deprecated in Mac OS 10.10.  New code should use the item based interface.
 | 
			
		||||
 */
 | 
			
		||||
/* Called by the browser to determine the number of rows in the given column. The delegate will be called with -browser:willDisplayCell:atRow:column: before displaying each cell, giving it a chance to fill in the NSBrowserCell properties.
 | 
			
		||||
 */
 | 
			
		||||
- (NSInteger)browser:(NSBrowser *)sender numberOfRowsInColumn:(NSInteger)column;
 | 
			
		||||
 | 
			
		||||
/* Called by the browser to fill in the matrix with populated NSBrowserCells.
 | 
			
		||||
 */
 | 
			
		||||
- (void)browser:(NSBrowser *)sender createRowsForColumn:(NSInteger)column inMatrix:(NSMatrix *)matrix;
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
 | 
			
		||||
/* Alternatively, implement all of the following methods, patterned after NSOutlineView's data source methods. Note that browsers with delegates implementing these methods do not use NSMatrix to populate columns; the implementation is private. The item parameter passed to each of these methods will be nil if the browser is querying about the root of the tree, unless -rootItemForBrowser: is implemented.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* Return the number of children of the given item. */
 | 
			
		||||
- (NSInteger)browser:(NSBrowser *)browser numberOfChildrenOfItem:(nullable id)item API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Return the indexth child of item. You may expect that index is never equal to or greater to the number of children of item as reported by -browser:numberOfChildrenOfItem:.
 | 
			
		||||
 */
 | 
			
		||||
- (id)browser:(NSBrowser *)browser child:(NSInteger)index ofItem:(nullable id)item API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Return whether item should be shown as a leaf item; that is, an item that can not be expanded into another column. Returning NO does not prevent you from returning 0 from -browser:numberOfChildrenOfItem:.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)browser:(NSBrowser *)browser isLeafItem:(nullable id)item API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Return the object value passed to the cell displaying item.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable id)browser:(NSBrowser *)browser objectValueForItem:(nullable id)item API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Optional - Variable Row Heights
 | 
			
		||||
    Implement this method to support varying row heights per column.  The height returned by this method should not include intercell spacing and must be greater than zero.  NSBrowser may cache the values this method returns.  So if you would like to change a row's height make sure to invalidate the row height by calling -noteHeightOfRowsWithIndexesChanged:inColumn:.
 | 
			
		||||
*/
 | 
			
		||||
- (CGFloat)browser:(NSBrowser *)browser heightOfRow:(NSInteger)row inColumn:(NSInteger)columnIndex API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
 | 
			
		||||
/* Optional - Alternate root item. 
 | 
			
		||||
 By default, NSBrowser uses 'nil' to identify the root item. It can optionally use a different root item provided by this delegate method. To reload the rootItem that was previously set, call -loadColumnZero, and NSBrowser will call -rootItemForBrowser: again.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable id)rootItemForBrowser:(NSBrowser *)browser API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Optional - editing support.
 | 
			
		||||
 Implement this method to support editing of browser items. The browser will pass back the object value from the cell displaying item.
 | 
			
		||||
 */
 | 
			
		||||
- (void)browser:(NSBrowser *)browser setObjectValue:(nullable id)object forItem:(nullable id)item API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Optional - editing support.
 | 
			
		||||
 Implement this method to control whether the browser may start an editing session for item.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)browser:(NSBrowser *)browser shouldEditItem:(nullable id)item API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
 | 
			
		||||
/* Optional - display support.
 | 
			
		||||
 Called by the browser before displaying a cell at the given location.
 | 
			
		||||
 */
 | 
			
		||||
- (void)browser:(NSBrowser *)sender willDisplayCell:(id)cell atRow:(NSInteger)row column:(NSInteger)column;
 | 
			
		||||
 | 
			
		||||
- (nullable NSString *)browser:(NSBrowser *)sender titleOfColumn:(NSInteger)column;
 | 
			
		||||
 | 
			
		||||
/* Called by the browser when selecting cells by title, either from -setPath:, or when recomputing the selection after -reloadColumn:. Return NO if a matching cell could not be found.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)browser:(NSBrowser *)sender selectCellWithString:(NSString *)title inColumn:(NSInteger)column;
 | 
			
		||||
 | 
			
		||||
/* Called by the browser when selecting a cell using -selectRow:inColumn:. Return NO if a matching cell could not be found.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)browser:(NSBrowser *)sender selectRow:(NSInteger)row inColumn:(NSInteger)column;
 | 
			
		||||
 | 
			
		||||
/* Called by the browser from -validateVisibleColumns to determine whether the currently-displayed columns are valid. Returning NO will prompt the browser to call -reloadColumn:.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)browser:(NSBrowser *)sender isColumnValid:(NSInteger)column;
 | 
			
		||||
 | 
			
		||||
- (void)browserWillScroll:(NSBrowser *)sender;
 | 
			
		||||
- (void)browserDidScroll:(NSBrowser *)sender;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Delegate methods used by resizable column browsers.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* Optional for browsers with resize type NSBrowserNoColumnResizing, and NSBrowserUserColumnResizing.
 | 
			
		||||
 This method is used for both constraining column resize, and determining a columns initial size.  If 'forUserResize' is NO, this method should return the initial width for a newly added column.  If 'forUserResize' is YES, this method can be used to constrain resizing on a per-column basis.  (Currently per-column constraining is only implemented for single column resize).
 | 
			
		||||
 */
 | 
			
		||||
- (CGFloat)browser:(NSBrowser *)browser shouldSizeColumn:(NSInteger)columnIndex forUserResize:(BOOL)forUserResize toWidth:(CGFloat)suggestedWidth;
 | 
			
		||||
 | 
			
		||||
/* Optional for browsers with resize type NSBrowserUserColumnResizing only.
 | 
			
		||||
 This method returns the "ideal" width for a column.  This method is used when performing a "right-size-each" or "right-size-one" operation.  If columnIndex is -1, the result is used for a "right-size-all-simultaneous" operation.  In this case, you should return a best uniform right size for all column (every column will be set to this size).  You can opt out on a per column basis by returning -1 for that column. It is assumed that the implementation may be expensive, so it will be called only when necessary.  (See documentation for definitions of right-size one/each/all). 
 | 
			
		||||
 */
 | 
			
		||||
- (CGFloat)browser:(NSBrowser *)browser sizeToFitWidthOfColumn:(NSInteger)columnIndex;
 | 
			
		||||
 | 
			
		||||
/* Optional and used for browsers with resize type NSBrowserUserColumnResizing only.
 | 
			
		||||
 This method is intended to be used by clients wishing to implement their own column width persistence.  It is called when the width of any browser columns has changed.  User column resizing will cause a single notification to be posted when the user is finished resizing.  (See NSBrowserColumnConfigurationDidChangeNotification for more information.)  
 | 
			
		||||
 */
 | 
			
		||||
- (void)browserColumnConfigurationDidChange:(NSNotification *)notification;
 | 
			
		||||
 | 
			
		||||
/* Optional - Expansion ToolTip support.
 | 
			
		||||
    Implement this method and return NO to prevent an expansion tooltip from appearing for a particular cell at 'row' in 'column'. See NSCell.h for more information on expansion tool tips. 
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)browser:(NSBrowser *)browser shouldShowCellExpansionForRow:(NSInteger)row column:(NSInteger)column API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
#pragma mark **** Optional Drag and Drop Support Methods ****
 | 
			
		||||
 | 
			
		||||
#pragma mark ** Dragging Source Methods **
 | 
			
		||||
 | 
			
		||||
/* This method is called after it has been determined that a drag should begin, but before the drag has been started.  To refuse the drag, return NO. To start a drag, declared the pasteboard types that you support with [pasteboard declareTypes:owner:], place your data on the pasteboard, and return YES from the method. The drag image and other drag related information will be set up and provided by the view once this call returns with YES. You need to implement this method for your browser to be a drag source. 
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)browser:(NSBrowser *)browser writeRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column toPasteboard:(NSPasteboard *)pasteboard API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* The delegate can support file promise drags by adding NSFilesPromisePboardType to the pasteboard in browser:writeRowsWithIndexes:inColumn:toPasteboard:. NSBrowser implements -namesOfPromisedFilesDroppedAtDestination: to return the results of this data source method.  This method should returns an array of filenames for the created files (filenames only, not full paths).  The URL represents the drop location.  For more information on file promise dragging, see documentation on the NSDraggingSource protocol and -namesOfPromisedFilesDroppedAtDestination:. You do not need to implement this method for your browser to be a drag source.
 | 
			
		||||
 */
 | 
			
		||||
- (NSArray<NSString *> *)browser:(NSBrowser *)browser namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column API_DEPRECATED("Use NSFilePromiseReceiver objects instead", macos(10.5,10.13));
 | 
			
		||||
 | 
			
		||||
/* The delegate can control if some particular rows can be dragged or not for a particular event. You do not need to implement this method for your browser to be a drag source. 
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)browser:(NSBrowser *)browser canDragRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column withEvent:(NSEvent *)event API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Allows the delegate to compute a dragging image for the particular cells being dragged. 'rowIndexes' are the indexes of the cells being dragged in the matrix in 'column'. 'event' is a reference to the mouse down event that began the drag. 'dragImageOffset' is an in/out parameter. This method will be called with dragImageOffset set to NSZeroPoint, but it can be modified to re-position the returned image.  A dragImageOffset of NSZeroPoint will cause the image to be centered under the mouse. You can safely call [browser dragImageForRowsWithIndexes:inColumn:withEvent:offset:] from inside this method. You do not need to implement this method for your browser to be a drag source. You can safely call the corresponding NSBrowser method.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSImage *)browser:(NSBrowser *)browser draggingImageForRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
#pragma mark ** Dragging Destination Methods **
 | 
			
		||||
 | 
			
		||||
/* This method is used by the browser to determine a valid drop target. Based on the mouse position, the browser will suggest a proposed row, column and dropOperation. These values are in/out parameters and can be changed by the delegate to retarget the drop operation. The dropOperation suggested will be NSBrowserDropOn if the drag location is closer to the middle of a row. If it is closer to being between two rows, it will be NSBrowserDropAbove, indicating a drop above 'row' and below 'row - 1'. This method must return a value that indicates which dragging operation the data source will perform. It must return something other than NSDragOperationNone to accept the drop.
 | 
			
		||||
 | 
			
		||||
    To retarget a drop and specify a drop on row 2 (with the first visual row being row 0), one would set *row=2, and set *dropOperation=NSBrowserDropOn. To specify a drop below the last row, one would specify *row=[browser numberOfRows], and *dropOperation=NSBrowserDropAbove. To specify a drop on the entire column, you will specify *row=-1, and *dropOperation=NSBrowserDropOn. To specify a drop between rows 2 and 3, one would set *row=3 and *dropOperation=NSBrowserDropAbove.
 | 
			
		||||
 | 
			
		||||
    Note: to receive drag messages, you must first call [NSBrowser registerForDraggedTypes:] for the drag types you want to support (typically this is done in awakeFromNib). You must implement this method for your browser to be a drag destination. 
 | 
			
		||||
*/
 | 
			
		||||
- (NSDragOperation)browser:(NSBrowser *)browser validateDrop:(id <NSDraggingInfo>)info proposedRow:(NSInteger *)row column:(NSInteger *)column  dropOperation:(NSBrowserDropOperation *)dropOperation API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* This method is called when the mouse is released over a browser that previously decided to allow a drop via the above validateDrop method.  The delegate should incorporate the data from the dragging pasteboard at this time. You must implement this method for your browser to be a drag destination.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)browser:(NSBrowser *)browser acceptDrop:(id <NSDraggingInfo>)info atRow:(NSInteger)row column:(NSInteger)column dropOperation:(NSBrowserDropOperation)dropOperation API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
 | 
			
		||||
#pragma mark **** Type Select Support ****
 | 
			
		||||
 | 
			
		||||
/* Optional - Type select support
 | 
			
		||||
    Implement this method if you want to control the string that is used for type selection. You may want to change what is searched for based on what is displayed, or simply return an empty string for that row and/or column to not be searched. You can also return 'nil' if the cell does not contain any text. By default, all cells with text in them are searched. The default value when this delegate method is not implemented is the stringValue for the cell at that location.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSString *)browser:(NSBrowser *)browser typeSelectStringForRow:(NSInteger)row inColumn:(NSInteger)column API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Optional - Type select support
 | 
			
		||||
    Implement this method if you would like to prevent a type select from happening based on the current event and current search string. Generally, this will be called from keyDown: and the event will be a key event. The search string will be nil if no type select has began. 
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)browser:(NSBrowser *)browser shouldTypeSelectForEvent:(NSEvent *)event withCurrentSearchString:(nullable NSString *)searchString API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Optional - Type select support
 | 
			
		||||
    Implement this method if you want to control how type selection works. Return the first row that matches searchString from within the range of startRow to endRow. It is possible for endRow to be less than startRow if the search will wrap. Return -1 when there is no match. Include startRow as a possible match, but do not include endRow. It is not necessary to implement this method in order to support type select.
 | 
			
		||||
 */
 | 
			
		||||
- (NSInteger)browser:(NSBrowser *)browser nextTypeSelectMatchFromRow:(NSInteger)startRow toRow:(NSInteger)endRow inColumn:(NSInteger)column forString:(nullable NSString *)searchString API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
 | 
			
		||||
/* Optional - Preview column support
 | 
			
		||||
    Implement this method to provide a preview column for leaf items. Return nil to suppress the preview column. The controller's representedObject will be set to the browser's selected leaf item. This method is only called if the delegate implements the item data source methods.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSViewController *)browser:(NSBrowser *)browser previewViewControllerForLeafItem:(id)item API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Optional - Column header support
 | 
			
		||||
    Implement this method to provide a header view for columns. Return nil to omit the header view. The controller's representedObject will be set to the column's item. This method is only called if the delegate implements the item data source methods.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSViewController *)browser:(NSBrowser *)browser headerViewControllerForItem:(nullable id)item API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Optional - Notification when the lastColumn changes.
 | 
			
		||||
 */
 | 
			
		||||
- (void)browser:(NSBrowser *)browser didChangeLastColumn:(NSInteger)oldLastColumn toColumn:(NSInteger)column;
 | 
			
		||||
 | 
			
		||||
/* Optional - Return a set of new indexes to select when the user changes the selection with the keyboard or mouse. This method may be called multiple times with one new index added to the existing selection to find out if a particular index can be selected when the user is extending the selection with the keyboard or mouse. Note that 'proposedSelectionIndexes' will contain the entire newly suggested selection, and you can return the exsiting selection to avoid changing the selection. This method only works for item-based NSBrowsers.
 | 
			
		||||
 */
 | 
			
		||||
- (NSIndexSet *)browser:(NSBrowser *)browser selectionIndexesForProposedSelection:(NSIndexSet *)proposedSelectionIndexes inColumn:(NSInteger)column API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#pragma mark -
 | 
			
		||||
#pragma mark **** Deprecated Methods ****
 | 
			
		||||
 | 
			
		||||
@interface NSBrowser(NSDeprecated)
 | 
			
		||||
 | 
			
		||||
/* This property has been non-functional since before 10.0.
 | 
			
		||||
 */
 | 
			
		||||
- (void)setAcceptsArrowKeys:(BOOL)flag API_DEPRECATED("", macos(10.0,10.6));
 | 
			
		||||
- (BOOL)acceptsArrowKeys API_DEPRECATED("", macos(10.0,10.6));
 | 
			
		||||
 | 
			
		||||
/* Use of -displayColumn: is deprecated in 10.3.  Use setNeedsDisplayInRect: instead.
 | 
			
		||||
 */
 | 
			
		||||
- (void)displayColumn:(NSInteger)column API_DEPRECATED("", macos(10.0,10.3));
 | 
			
		||||
 | 
			
		||||
/* Use of -displayAllColumns; is deprecated in 10.3.  Use setNeedsDisplay/InRect: instead.
 | 
			
		||||
 */
 | 
			
		||||
- (void)displayAllColumns API_DEPRECATED("", macos(10.0,10.3));
 | 
			
		||||
 | 
			
		||||
/* Use of -scrollViaScroller: is deprecated in 10.3.  Continuous scrolling no longer requires this functionality.
 | 
			
		||||
 */
 | 
			
		||||
- (void)scrollViaScroller:(null_unspecified NSScroller *)sender API_DEPRECATED("", macos(10.0,10.3));
 | 
			
		||||
 | 
			
		||||
/* Use of -updateScroller is deprecated in 10.3.  Continuous scrolling no longer requires this functionality.
 | 
			
		||||
 */
 | 
			
		||||
- (void)updateScroller API_DEPRECATED("", macos(10.0,10.3));
 | 
			
		||||
 | 
			
		||||
/* Matrix based NSBrowser is deprecated in 10.10.
 | 
			
		||||
 */
 | 
			
		||||
- (void)setMatrixClass:(Class)factoryId  API_DEPRECATED("Use the item based NSBrowser instead", macos(10.0,10.10));
 | 
			
		||||
- (Class)matrixClass  API_DEPRECATED("Use the item based NSBrowser instead", macos(10.0,10.10));
 | 
			
		||||
- (NSInteger)columnOfMatrix:(NSMatrix *)matrix  API_DEPRECATED("Use the item based NSBrowser instead", macos(10.0,10.10));
 | 
			
		||||
- (nullable NSMatrix *)matrixInColumn:(NSInteger)column  API_DEPRECATED("Use the item based NSBrowser instead", macos(10.0,10.10));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,37 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSBrowserCell.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSCell.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSImage;
 | 
			
		||||
 | 
			
		||||
@interface NSBrowserCell : NSCell
 | 
			
		||||
 | 
			
		||||
- (instancetype)initTextCell:(NSString *)string NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initImageCell:(nullable NSImage *)image NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, nullable, strong) NSImage *branchImage;
 | 
			
		||||
@property (class, readonly, nullable, strong) NSImage *highlightedBranchImage;
 | 
			
		||||
 | 
			
		||||
- (nullable NSColor *)highlightColorInView:(NSView *)controlView;
 | 
			
		||||
 | 
			
		||||
@property (getter=isLeaf) BOOL leaf;
 | 
			
		||||
@property (getter=isLoaded) BOOL loaded;
 | 
			
		||||
- (void)reset;
 | 
			
		||||
- (void)set;
 | 
			
		||||
@property (nullable, strong) NSImage *image;
 | 
			
		||||
@property (nullable, strong) NSImage *alternateImage;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,186 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSButton.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSControl.h>
 | 
			
		||||
#import <AppKit/NSButtonCell.h>
 | 
			
		||||
#import <AppKit/NSUserInterfaceValidation.h>
 | 
			
		||||
#import <AppKit/NSUserInterfaceCompression.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSSound, NSImageSymbolConfiguration;
 | 
			
		||||
 | 
			
		||||
@interface NSButton : NSControl <NSUserInterfaceValidations, NSAccessibilityButton, NSUserInterfaceCompression>
 | 
			
		||||
 | 
			
		||||
#pragma mark Creating Standard Buttons
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 Creates a standard push button with a title and image.
 | 
			
		||||
 @param title The localized title string that is displayed on the button.
 | 
			
		||||
 @param image The image that is displayed alongside the title. In left-to-right localizations, the image is displayed to the left of the title. In right-to-left localizations, it is displayed to the right.
 | 
			
		||||
 @param target The target object that receives action messages from the control.
 | 
			
		||||
 @param action The action message sent by the control.
 | 
			
		||||
 @return An initialized button object.
 | 
			
		||||
 */
 | 
			
		||||
+ (instancetype)buttonWithTitle:(NSString *)title image:(NSImage *)image target:(nullable id)target action:(nullable SEL)action API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 Creates a standard push button with the provided title.
 | 
			
		||||
 @param title The localized title string that is displayed on the button.
 | 
			
		||||
 @param target The target object that receives action messages from the control.
 | 
			
		||||
 @param action The action message sent by the control.
 | 
			
		||||
 @return An initialized button object.
 | 
			
		||||
 */
 | 
			
		||||
+ (instancetype)buttonWithTitle:(NSString *)title target:(nullable id)target action:(nullable SEL)action API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 Creates a standard push button with the provided image. Set the image's accessibilityDescription property to ensure accessibility for this control.
 | 
			
		||||
 @param image The image to display in the body of the button.
 | 
			
		||||
 @param target The target object that receives action messages from the control.
 | 
			
		||||
 @param action The action message sent by the control.
 | 
			
		||||
 @return An initialized button object.
 | 
			
		||||
 */
 | 
			
		||||
+ (instancetype)buttonWithImage:(NSImage *)image target:(nullable id)target action:(nullable SEL)action API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 Creates a standard checkbox with the provided title.
 | 
			
		||||
 @param title The localized title string that is displayed alongside the checkbox.
 | 
			
		||||
 @param target The target object that receives action messages from the control.
 | 
			
		||||
 @param action The action message sent by the control.
 | 
			
		||||
 @return An initialized button object.
 | 
			
		||||
 */
 | 
			
		||||
+ (instancetype)checkboxWithTitle:(NSString *)title target:(nullable id)target action:(nullable SEL)action API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 Creates a standard radio button with the provided title.
 | 
			
		||||
 @param title The localized title string that is displayed alongside the radio button.
 | 
			
		||||
 @param target The target object that receives action messages from the control.
 | 
			
		||||
 @param action The action message sent by the control.
 | 
			
		||||
 @return An initialized button object.
 | 
			
		||||
 */
 | 
			
		||||
+ (instancetype)radioButtonWithTitle:(NSString *)title target:(nullable id)target action:(nullable SEL)action API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
#pragma mark Configuring Buttons
 | 
			
		||||
 | 
			
		||||
/*! Sets the button’s type, which affects its user interface and behavior when clicked. See the NSButtonType enumeration for possible options and their behaviors. */
 | 
			
		||||
- (void)setButtonType:(NSButtonType)type;
 | 
			
		||||
 | 
			
		||||
/*! The title displayed on the button when it’s in an off state, or an empty string if the button does not display a title. By default, a button's title is "Button". */
 | 
			
		||||
@property (copy) NSString *title;
 | 
			
		||||
 | 
			
		||||
/*! The button's title, expressed as an attributed string. */
 | 
			
		||||
@property (copy) NSAttributedString *attributedTitle;
 | 
			
		||||
 | 
			
		||||
/*! The title that the button displays when the button is in an on state, or an empty string if there is no such title. Note that some button types do not display an alternate title. */
 | 
			
		||||
@property (copy) NSString *alternateTitle;
 | 
			
		||||
 | 
			
		||||
/*! The alternate title, expressed as an attributed string. */
 | 
			
		||||
@property (copy) NSAttributedString *attributedAlternateTitle;
 | 
			
		||||
 | 
			
		||||
/*! Indicates whether the button's action has a destructive effect on user data.  AppKit may guard a destructive-actioned button against accidental presses, and may give the button a special appearance in certain contexts to caution against unintentional use.  Defaults to NO. */
 | 
			
		||||
@property BOOL hasDestructiveAction API_AVAILABLE(macos(11.0));
 | 
			
		||||
 | 
			
		||||
/*! The sound that plays when the user clicks the button, or nil if the button should not play a sound. The default value is nil. */
 | 
			
		||||
@property (nullable, strong) NSSound *sound;
 | 
			
		||||
 | 
			
		||||
/*! Sends action on deep-press or extended hover while dragging. Defaults to NO. */
 | 
			
		||||
@property (getter=isSpringLoaded) BOOL springLoaded API_AVAILABLE(macos(10.10.3));
 | 
			
		||||
 | 
			
		||||
/*! Configures the maximum allowed level for an NSMultiLevelAcceleratorButton, allowed values range from [1,5]. Defaults to 2. */
 | 
			
		||||
@property NSInteger maxAcceleratorLevel API_AVAILABLE(macos(10.10.3));
 | 
			
		||||
 | 
			
		||||
/*! Sets the initial delay and repeat interval, in seconds, for repeated action messages sent when `continuous` is YES. */
 | 
			
		||||
- (void)setPeriodicDelay:(float)delay interval:(float)interval;
 | 
			
		||||
 | 
			
		||||
/*! Gets the initial delay and repeat interval, in seconds, for repeated action messages sent when `continuous` is YES. Both parameters to this method must not be NULL. */
 | 
			
		||||
- (void)getPeriodicDelay:(float *)delay interval:(float *)interval;
 | 
			
		||||
 | 
			
		||||
#pragma mark Configuring Button Images
 | 
			
		||||
 | 
			
		||||
/*! The bezel style of the button, which provides a set of bezel artwork, layout metrics, and content styling from a set of system-provided styles. See the NSBezelStyle enumeration for a list of available styles. The bezel style is not used if the `bordered` property is set to `NO`. */
 | 
			
		||||
@property NSBezelStyle bezelStyle;
 | 
			
		||||
 | 
			
		||||
/*! A Boolean value that determines whether the button draws a border. */
 | 
			
		||||
@property (getter=isBordered) BOOL bordered;
 | 
			
		||||
 | 
			
		||||
/*! A Boolean value that indicates whether the button is transparent. A transparent button never draws itself, but it receives mouse events, sends its action, and tracks the mouse properly. */
 | 
			
		||||
@property (getter=isTransparent) BOOL transparent;
 | 
			
		||||
 | 
			
		||||
/* A Boolean value that determines whether the button displays its border only when the pointer is over it. */
 | 
			
		||||
@property BOOL showsBorderOnlyWhileMouseInside;
 | 
			
		||||
 | 
			
		||||
/*! The image that appears on the button when it’s in an off state, or nil if there is no such image. */
 | 
			
		||||
@property (nullable, strong) NSImage *image;
 | 
			
		||||
 | 
			
		||||
/*! An alternate image that appears on the button when the button is in an on state, or nil if there is no such image. Note that some button types do not display an alternate image. */
 | 
			
		||||
@property (nullable, strong) NSImage *alternateImage;
 | 
			
		||||
 | 
			
		||||
/*! The position of the button's image relative to its title. See the NSCellImagePosition enumeration for possible values. */
 | 
			
		||||
@property NSCellImagePosition imagePosition;
 | 
			
		||||
 | 
			
		||||
/*! The scaling mode applied to make the button's image fit within its bounds. */
 | 
			
		||||
@property NSImageScaling imageScaling API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/*! A Boolean value that determines how the button's image and title are positioned together within the button bezel. If false, the image is positioned according to the imagePosition property at the edge of the button bezel, and the title is positioned within the remaining space. If true, the button’s image is positioned directly adjacent to the title based on the imagePosition property, and the image and title are positioned within the button bezel as a single unit. */
 | 
			
		||||
@property BOOL imageHugsTitle API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 Specifies a combination of point size, weight, and scale to use when sizing and displaying symbol images. If a symbol configuration isn't provided, the symbol is matched to the button's `font` property. The default value is nil.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, copy) NSImageSymbolConfiguration *symbolConfiguration API_AVAILABLE(macos(11));
 | 
			
		||||
 | 
			
		||||
/*! Applies a custom color to the button's bezel, in appearances that support it. A nil value indicates an unmodified button appearance. The default value is nil. */
 | 
			
		||||
@property (nullable, copy) NSColor *bezelColor API_AVAILABLE(macos(10.12.2));
 | 
			
		||||
 | 
			
		||||
/*! Applies a tint color to template image and text content, in combination with other theme-appropriate effects. Only applicable to borderless buttons. A nil value indicates the standard set of effects without color modification. The default value is nil. Non-template images and attributed string values are not affected by the contentTintColor. */
 | 
			
		||||
@property (nullable, copy) NSColor *contentTintColor API_AVAILABLE(macos(10.14));
 | 
			
		||||
 | 
			
		||||
#pragma mark Managing Button State
 | 
			
		||||
 | 
			
		||||
/*! The button's state. Buttons support the off and on states, and an additional mixed state depending on the value of the `allowsMixedState` property. */
 | 
			
		||||
@property NSControlStateValue state;
 | 
			
		||||
 | 
			
		||||
/*! A Boolean value that indicates whether the button allows a mixed state. If NO, the button has two states (on and off), and if YES, the button has three states (on, off, and mixed). The mixed state is commonly used with checkboxes and radio buttons to indicate a value which is partially on. */
 | 
			
		||||
@property BOOL allowsMixedState;
 | 
			
		||||
 | 
			
		||||
/*! Sets the button to its next eligible state. If the button allows mixed state, this cycles through the states in the order: on, off, mixed, on, etc. If the button does not allow mixed state, it toggles between off and on. */
 | 
			
		||||
- (void)setNextState;
 | 
			
		||||
 | 
			
		||||
/*! Highlights, or un-highlights, the button. Highlighting makes the button appear "pressed", which may include showing an illuminated bezel, or showing the alternate image or title, depending on the type of button. */
 | 
			
		||||
- (void)highlight:(BOOL)flag;
 | 
			
		||||
 | 
			
		||||
#pragma mark Handling Keyboard Events
 | 
			
		||||
 | 
			
		||||
/*! This property contains the button's key equivalent, or the empty string if no equivalent has been defined. Buttons don’t have a default key equivalent. Setting the key equivalent to the Return character causes it to act as the default button for its window. */
 | 
			
		||||
@property (copy) NSString *keyEquivalent;
 | 
			
		||||
 | 
			
		||||
/*! A bitmask specifying the modifier keys that are applied to the button's key equivalent. Mask bits are defined by the NSEventModifierFlags option set. The only mask bits relevant in button key-equivalent modifier masks are NSEventModifierFlagControl, NSEventModifierFlagOption, and NSEventModifierFlagCommand. */
 | 
			
		||||
@property NSEventModifierFlags keyEquivalentModifierMask;
 | 
			
		||||
 | 
			
		||||
/*! If the event parameter matches the button's key equivalent, the button briefly highlights and performs its action, and then returns YES. Otherwise, returns NO. */
 | 
			
		||||
- (BOOL)performKeyEquivalent:(NSEvent *)key;
 | 
			
		||||
 | 
			
		||||
#pragma mark NSUserInterfaceCompression
 | 
			
		||||
 | 
			
		||||
- (void)compressWithPrioritizedCompressionOptions:(NSArray<NSUserInterfaceCompressionOptions *> *)prioritizedOptions API_AVAILABLE(macos(10.13));
 | 
			
		||||
- (NSSize)minimumSizeWithPrioritizedCompressionOptions:(NSArray<NSUserInterfaceCompressionOptions *> *)prioritizedOptions API_AVAILABLE(macos(10.13));
 | 
			
		||||
@property (readonly, copy) NSUserInterfaceCompressionOptions *activeCompressionOptions API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSButton (NSButtonDeprecated)
 | 
			
		||||
 | 
			
		||||
/* Mnemonics, which are underlined characters in the button title that can be used as a keyboard shortcut, are not used on macOS. The -setTitleWithMnemonic: method passes its input (minus the ampersand, which was used to denote the mnemonic) to -setTitle:, but otherwise has no effect. */
 | 
			
		||||
- (void)setTitleWithMnemonic:(null_unspecified NSString *)stringWithAmpersand API_DEPRECATED("Mnemonics are not used on macOS. Set the title property directly instead.", macos(10.0,10.8));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,159 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSButtonCell.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSActionCell.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSAttributedString, NSFont, NSImage, NSSound;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSButtonType) {
 | 
			
		||||
    NSButtonTypeMomentaryLight    = 0,
 | 
			
		||||
    NSButtonTypePushOnPushOff     = 1,
 | 
			
		||||
    NSButtonTypeToggle            = 2,
 | 
			
		||||
    NSButtonTypeSwitch            = 3,
 | 
			
		||||
    NSButtonTypeRadio             = 4,
 | 
			
		||||
    NSButtonTypeMomentaryChange   = 5,
 | 
			
		||||
    NSButtonTypeOnOff             = 6,
 | 
			
		||||
    NSButtonTypeMomentaryPushIn   = 7,
 | 
			
		||||
    NSButtonTypeAccelerator API_AVAILABLE(macos(10.10.3)) = 8,
 | 
			
		||||
    NSButtonTypeMultiLevelAccelerator API_AVAILABLE(macos(10.10.3)) = 9,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSBezelStyle) {
 | 
			
		||||
    NSBezelStyleRounded           = 1,
 | 
			
		||||
    NSBezelStyleRegularSquare     = 2,
 | 
			
		||||
    NSBezelStyleDisclosure        = 5,
 | 
			
		||||
    NSBezelStyleShadowlessSquare  = 6,
 | 
			
		||||
    NSBezelStyleCircular          = 7,
 | 
			
		||||
    NSBezelStyleTexturedSquare    = 8,
 | 
			
		||||
    NSBezelStyleHelpButton        = 9,
 | 
			
		||||
    NSBezelStyleSmallSquare       = 10,
 | 
			
		||||
    NSBezelStyleTexturedRounded   = 11,
 | 
			
		||||
    NSBezelStyleRoundRect         = 12,
 | 
			
		||||
    NSBezelStyleRecessed          = 13,
 | 
			
		||||
    NSBezelStyleRoundedDisclosure = 14,
 | 
			
		||||
    NSBezelStyleInline API_AVAILABLE(macos(10.7)) = 15,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@interface NSButtonCell : NSActionCell
 | 
			
		||||
 | 
			
		||||
- (instancetype)initTextCell:(NSString *)string NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initImageCell:(nullable NSImage *)image NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@property NSBezelStyle bezelStyle;
 | 
			
		||||
 | 
			
		||||
- (void)setButtonType:(NSButtonType)type;
 | 
			
		||||
@property NSCellStyleMask highlightsBy;
 | 
			
		||||
@property NSCellStyleMask showsStateBy;
 | 
			
		||||
 | 
			
		||||
@property (null_resettable, copy) NSString *title;
 | 
			
		||||
@property (copy) NSAttributedString *attributedTitle;
 | 
			
		||||
 | 
			
		||||
@property (copy) NSString *alternateTitle;
 | 
			
		||||
@property (copy) NSAttributedString *attributedAlternateTitle;
 | 
			
		||||
 | 
			
		||||
@property (nullable, strong) NSImage *alternateImage;
 | 
			
		||||
@property NSCellImagePosition imagePosition;
 | 
			
		||||
@property NSImageScaling imageScaling API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
@property (copy) NSString *keyEquivalent;
 | 
			
		||||
@property NSEventModifierFlags keyEquivalentModifierMask;
 | 
			
		||||
 | 
			
		||||
@property (getter=isTransparent) BOOL transparent;
 | 
			
		||||
@property (getter=isOpaque, readonly) BOOL opaque;
 | 
			
		||||
 | 
			
		||||
// When disabled, the image and text of an NSButtonCell are normally dimmed with gray.
 | 
			
		||||
// Radio buttons and switches use (imageDimsWhenDisabled == NO) so only their text is dimmed.
 | 
			
		||||
@property BOOL imageDimsWhenDisabled;
 | 
			
		||||
@property BOOL showsBorderOnlyWhileMouseInside;
 | 
			
		||||
 | 
			
		||||
@property (nullable, strong) NSSound *sound;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSColor *backgroundColor;
 | 
			
		||||
 | 
			
		||||
- (void)setPeriodicDelay:(float)delay interval:(float)interval;
 | 
			
		||||
- (void)getPeriodicDelay:(float *)delay interval:(float *)interval;
 | 
			
		||||
- (void)performClick:(nullable id)sender;
 | 
			
		||||
- (void)mouseEntered:(NSEvent *)event;
 | 
			
		||||
- (void)mouseExited:(NSEvent *)event;
 | 
			
		||||
 | 
			
		||||
- (void)drawBezelWithFrame:(NSRect)frame inView:(NSView *)controlView;
 | 
			
		||||
- (void)drawImage:(NSImage *)image withFrame:(NSRect)frame inView:(NSView *)controlView;
 | 
			
		||||
- (NSRect)drawTitle:(NSAttributedString *)title withFrame:(NSRect)frame inView:(NSView *)controlView;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* Deprecations */
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSGradientType) {
 | 
			
		||||
    NSGradientNone          = 0,
 | 
			
		||||
    NSGradientConcaveWeak   = 1,
 | 
			
		||||
    NSGradientConcaveStrong = 2,
 | 
			
		||||
    NSGradientConvexWeak    = 3,
 | 
			
		||||
    NSGradientConvexStrong  = 4
 | 
			
		||||
} API_DEPRECATED("", macos(10.0,10.12));
 | 
			
		||||
 | 
			
		||||
static const NSButtonType NSMomentaryLightButton API_DEPRECATED_WITH_REPLACEMENT("NSButtonTypeMomentaryLight", macos(10.0,10.14)) = NSButtonTypeMomentaryLight;
 | 
			
		||||
static const NSButtonType NSPushOnPushOffButton API_DEPRECATED_WITH_REPLACEMENT("NSButtonTypePushOnPushOff", macos(10.0,10.14)) = NSButtonTypePushOnPushOff;
 | 
			
		||||
static const NSButtonType NSToggleButton API_DEPRECATED_WITH_REPLACEMENT("NSButtonTypeToggle", macos(10.0,10.14)) = NSButtonTypeToggle;
 | 
			
		||||
static const NSButtonType NSSwitchButton API_DEPRECATED_WITH_REPLACEMENT("NSButtonTypeSwitch", macos(10.0,10.14)) = NSButtonTypeSwitch;
 | 
			
		||||
static const NSButtonType NSRadioButton API_DEPRECATED_WITH_REPLACEMENT("NSButtonTypeRadio", macos(10.0,10.14)) = NSButtonTypeRadio;
 | 
			
		||||
static const NSButtonType NSMomentaryChangeButton API_DEPRECATED_WITH_REPLACEMENT("NSButtonTypeMomentaryChange", macos(10.0,10.14)) = NSButtonTypeMomentaryChange;
 | 
			
		||||
static const NSButtonType NSOnOffButton API_DEPRECATED_WITH_REPLACEMENT("NSButtonTypeOnOff", macos(10.0,10.14)) = NSButtonTypeOnOff;
 | 
			
		||||
static const NSButtonType NSMomentaryPushInButton API_DEPRECATED_WITH_REPLACEMENT("NSButtonTypeMomentaryPushIn", macos(10.0,10.14)) = NSButtonTypeMomentaryPushIn;
 | 
			
		||||
static const NSButtonType NSAcceleratorButton API_DEPRECATED_WITH_REPLACEMENT("NSButtonTypeAccelerator", macos(10.10.3,10.14)) = NSButtonTypeAccelerator;
 | 
			
		||||
static const NSButtonType NSMultiLevelAcceleratorButton API_DEPRECATED_WITH_REPLACEMENT("NSButtonTypeMultiLevelAccelerator", macos(10.10.3,10.14)) = NSButtonTypeMultiLevelAccelerator;
 | 
			
		||||
 | 
			
		||||
/* These constants were accidentally reversed so that NSMomentaryPushButton lit and NSMomentaryLight pushed. These names are now deprecated */
 | 
			
		||||
static const NSButtonType NSMomentaryPushButton API_DEPRECATED("This constant is misnamed and has the same effect as NSButtonTypeMomentaryLight. Use that name instead, or switch to NSButtonTypeMomentaryPushIn.", macos(10.0,10.9)) = NSButtonTypeMomentaryLight;
 | 
			
		||||
static const NSButtonType NSMomentaryLight API_DEPRECATED("This constant is misnamed and has the same effect as NSButtonTypeMomentaryPushIn. Use that name instead, or switch to NSButtonTypeMomentaryLight.", macos(10.0,10.9)) = NSButtonTypeMomentaryPushIn;
 | 
			
		||||
 | 
			
		||||
static const NSBezelStyle NSRoundedBezelStyle API_DEPRECATED_WITH_REPLACEMENT("NSBezelStyleRounded", macos(10.0,10.14)) = NSBezelStyleRounded;
 | 
			
		||||
static const NSBezelStyle NSRegularSquareBezelStyle API_DEPRECATED_WITH_REPLACEMENT("NSBezelStyleRegularSquare", macos(10.0,10.14)) = NSBezelStyleRegularSquare;
 | 
			
		||||
static const NSBezelStyle NSDisclosureBezelStyle API_DEPRECATED_WITH_REPLACEMENT("NSBezelStyleDisclosure", macos(10.0,10.14)) = NSBezelStyleDisclosure;
 | 
			
		||||
static const NSBezelStyle NSShadowlessSquareBezelStyle API_DEPRECATED_WITH_REPLACEMENT("NSBezelStyleShadowlessSquare", macos(10.0,10.14)) = NSBezelStyleShadowlessSquare;
 | 
			
		||||
static const NSBezelStyle NSCircularBezelStyle API_DEPRECATED_WITH_REPLACEMENT("NSBezelStyleCircular", macos(10.0,10.14)) = NSBezelStyleCircular;
 | 
			
		||||
static const NSBezelStyle NSTexturedSquareBezelStyle API_DEPRECATED_WITH_REPLACEMENT("NSBezelStyleTexturedSquare", macos(10.0,10.14)) = NSBezelStyleTexturedSquare;
 | 
			
		||||
static const NSBezelStyle NSHelpButtonBezelStyle API_DEPRECATED_WITH_REPLACEMENT("NSBezelStyleHelpButton", macos(10.0,10.14)) = NSBezelStyleHelpButton;
 | 
			
		||||
static const NSBezelStyle NSSmallSquareBezelStyle API_DEPRECATED_WITH_REPLACEMENT("NSBezelStyleSmallSquare", macos(10.0,10.14)) = NSBezelStyleSmallSquare;
 | 
			
		||||
static const NSBezelStyle NSTexturedRoundedBezelStyle API_DEPRECATED_WITH_REPLACEMENT("NSBezelStyleTexturedRounded", macos(10.0,10.14)) = NSBezelStyleTexturedRounded;
 | 
			
		||||
static const NSBezelStyle NSRoundRectBezelStyle API_DEPRECATED_WITH_REPLACEMENT("NSBezelStyleRoundRect", macos(10.0,10.14)) = NSBezelStyleRoundRect;
 | 
			
		||||
static const NSBezelStyle NSRecessedBezelStyle API_DEPRECATED_WITH_REPLACEMENT("NSBezelStyleRecessed", macos(10.0,10.14)) = NSBezelStyleRecessed;
 | 
			
		||||
static const NSBezelStyle NSRoundedDisclosureBezelStyle API_DEPRECATED_WITH_REPLACEMENT("NSBezelStyleRoundedDisclosure", macos(10.0,10.14)) = NSBezelStyleRoundedDisclosure;
 | 
			
		||||
static const NSBezelStyle NSInlineBezelStyle API_DEPRECATED_WITH_REPLACEMENT("NSBezelStyleInline", macos(10.0,10.14)) = NSBezelStyleInline;
 | 
			
		||||
 | 
			
		||||
static const NSBezelStyle NSSmallIconButtonBezelStyle API_DEPRECATED("This bezel style is obsolete and should not be used.", macos(10.0,10.0)) = (NSBezelStyle)2;
 | 
			
		||||
static const NSBezelStyle NSThickSquareBezelStyle API_DEPRECATED_WITH_REPLACEMENT("NSBezelStyleRegularSquare", macos(10.0,10.12)) = (NSBezelStyle)3;
 | 
			
		||||
static const NSBezelStyle NSThickerSquareBezelStyle API_DEPRECATED_WITH_REPLACEMENT("NSBezelStyleRegularSquare", macos(10.0,10.12)) = (NSBezelStyle)4;
 | 
			
		||||
 | 
			
		||||
@interface NSButtonCell(NSDeprecated)
 | 
			
		||||
 | 
			
		||||
/* The NSGradientType enumeration and corresponding gradientType property are not used on macOS. */
 | 
			
		||||
@property NSGradientType gradientType API_DEPRECATED("The gradientType property is unused, and setting it has no effect.", macos(10.0,10.12));
 | 
			
		||||
 | 
			
		||||
/* Mnemonics, which are underlined characters in the button title that can be used as a keyboard shortcut, are not used on macOS. The related APIs for setting and querying the mnemonic should not be used. */
 | 
			
		||||
- (void)setTitleWithMnemonic:(null_unspecified NSString *)stringWithAmpersand API_DEPRECATED("Mnemonics are not used on macOS. Set the title property directly instead.", macos(10.0,10.8));
 | 
			
		||||
- (void)setAlternateTitleWithMnemonic:(null_unspecified NSString *)stringWithAmpersand API_DEPRECATED("Mnemonics are not used on macOS. Set the alternateTitle property directly instead.", macos(10.0,10.8));
 | 
			
		||||
- (void)setAlternateMnemonicLocation:(NSUInteger)location API_DEPRECATED("Mnemonics are not used on macOS. Calling this method has no effect.", macos(10.0,10.8));
 | 
			
		||||
- (NSUInteger)alternateMnemonicLocation API_DEPRECATED("Mnemonics are not used on macOS. This property always returns NSNotFound.", macos(10.0,10.8));
 | 
			
		||||
- (null_unspecified NSString *)alternateMnemonic API_DEPRECATED("Mnemonics are not used on macOS. This property always returns an empty string.", macos(10.0,10.8));
 | 
			
		||||
 | 
			
		||||
/* Buttons on macOS do not draw their key equivalents. The methods for specifying the key equivalent font are obsolete. */
 | 
			
		||||
@property (nullable, strong) NSFont *keyEquivalentFont API_DEPRECATED("The keyEquivalentFont property is no longer used. It always returns the NSButtonCell's font, and setting it has no effect.", macos(10.0,10.15));
 | 
			
		||||
- (void)setKeyEquivalentFont:(NSString *)fontName size:(CGFloat)fontSize API_DEPRECATED("The keyEquivalentFont property is no longer used. Setting it has no effect.", macos(10.0,10.15));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,54 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSButtonTouchBarItem.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2019-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSTouchBarItem.h>
 | 
			
		||||
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
@class NSColor, NSImage;
 | 
			
		||||
#else
 | 
			
		||||
@class UIColor, UIImage;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15), ios(13.0))
 | 
			
		||||
@interface NSButtonTouchBarItem : NSTouchBarItem
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Creates a standard item with an button appropriate for use in an NSTouchBar
 | 
			
		||||
 */
 | 
			
		||||
+ (instancetype)buttonTouchBarItemWithIdentifier:(NSTouchBarItemIdentifier)identifier title:(NSString *)title target:(nullable id)target action:(nullable SEL)action;
 | 
			
		||||
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
+ (instancetype)buttonTouchBarItemWithIdentifier:(NSTouchBarItemIdentifier)identifier image:(NSImage *)image target:(nullable id)target action:(nullable SEL)action;
 | 
			
		||||
+ (instancetype)buttonTouchBarItemWithIdentifier:(NSTouchBarItemIdentifier)identifier title:(NSString *)title image:(NSImage *)image target:(nullable id)target action:(nullable SEL)action;
 | 
			
		||||
#else
 | 
			
		||||
+ (instancetype)buttonTouchBarItemWithIdentifier:(NSTouchBarItemIdentifier)identifier image:(UIImage *)image target:(nullable id)target action:(nullable SEL)action;
 | 
			
		||||
+ (instancetype)buttonTouchBarItemWithIdentifier:(NSTouchBarItemIdentifier)identifier title:(NSString *)title image:(UIImage *)image target:(nullable id)target action:(nullable SEL)action;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@property (copy) NSString *title;
 | 
			
		||||
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
@property (nullable, strong) NSImage *image;
 | 
			
		||||
@property (nullable, copy) NSColor *bezelColor;
 | 
			
		||||
#else
 | 
			
		||||
@property (nullable, strong) UIImage *image;
 | 
			
		||||
@property (nullable, copy) UIColor *bezelColor;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@property (nullable, weak) id target;
 | 
			
		||||
@property (nullable ) SEL action;
 | 
			
		||||
 | 
			
		||||
@property (getter=isEnabled) BOOL enabled;
 | 
			
		||||
 | 
			
		||||
/// The localized string labelling this item during user customization. The default value is empty string.
 | 
			
		||||
@property (readwrite, copy, null_resettable) NSString *customizationLabel;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,33 @@
 | 
			
		||||
/*
 | 
			
		||||
        NSCIImageRep.h
 | 
			
		||||
        Application Kit
 | 
			
		||||
        Copyright (c) 2003-2021, Apple Inc.
 | 
			
		||||
        All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSImageRep.h>
 | 
			
		||||
#import <AppKit/NSGraphics.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <CoreImage/CIImage.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSBitmapImageRep;
 | 
			
		||||
 | 
			
		||||
@interface NSCIImageRep : NSImageRep
 | 
			
		||||
+ (instancetype)imageRepWithCIImage:(CIImage *)image;
 | 
			
		||||
- (instancetype)initWithCIImage:(CIImage *)image;
 | 
			
		||||
@property (readonly, strong) CIImage *CIImage;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface CIImage (NSAppKitAdditions)
 | 
			
		||||
- (nullable instancetype)initWithBitmapImageRep:(NSBitmapImageRep *)bitmapImageRep;
 | 
			
		||||
 | 
			
		||||
- (void)drawInRect:(NSRect)rect fromRect:(NSRect)fromRect operation:(NSCompositingOperation)op fraction:(CGFloat)delta;
 | 
			
		||||
- (void)drawAtPoint:(NSPoint)point fromRect:(NSRect)fromRect operation:(NSCompositingOperation)op fraction:(CGFloat)delta;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,31 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSCachedImageRep.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSImageRep.h>
 | 
			
		||||
#import <AppKit/NSGraphics.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSWindow;
 | 
			
		||||
 | 
			
		||||
// this entire class is deprecated.  Please see the 10.6 AppKit release notes for more information.
 | 
			
		||||
API_DEPRECATED("", macos(10.0,10.6))
 | 
			
		||||
@interface NSCachedImageRep : NSImageRep
 | 
			
		||||
 | 
			
		||||
/* References the specified rect within the window; the window is retained */
 | 
			
		||||
- (id)initWithWindow:(NSWindow *)win rect:(NSRect)rect API_DEPRECATED("", macos(10.0,10.6));
 | 
			
		||||
 | 
			
		||||
/* Creates a location in some window. Will be freed when rep is freed */
 | 
			
		||||
- (id)initWithSize:(NSSize)size depth:(NSWindowDepth)depth separate:(BOOL)flag alpha:(BOOL)alpha API_DEPRECATED("", macos(10.0,10.6));
 | 
			
		||||
 | 
			
		||||
- (NSWindow *)window API_DEPRECATED("", macos(10.0,10.6));
 | 
			
		||||
- (NSRect)rect API_DEPRECATED("", macos(10.0,10.6));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
@@ -0,0 +1,90 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSCandidateListTouchBarItem.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 2016-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSTouchBar.h>
 | 
			
		||||
#import <AppKit/NSTouchBarItem.h>
 | 
			
		||||
#import <AppKit/NSView.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
@protocol NSCandidateListTouchBarItemDelegate;
 | 
			
		||||
@protocol NSTextInputClient;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
/* NSCandidateListTouchBarItem is an NSTouchBarItem that shows the word completion candidates for assisting users typing with text input capable views. In addition to candidates supplied by its client, the NSTouchBarItem can show candidates coming from the active input method. NSCandidateListTouchBarItem has two states: expanded and collapsed. When expanded, the item replaces any NSTouchBarItems occupying its location on the bar.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#pragma mark NSCandidateListTouchBarItem
 | 
			
		||||
API_AVAILABLE(macos(10.12.2)) API_UNAVAILABLE(macCatalyst)
 | 
			
		||||
@interface NSCandidateListTouchBarItem<CandidateType> : NSTouchBarItem
 | 
			
		||||
 | 
			
		||||
#pragma mark Client
 | 
			
		||||
// The client object for the receiver.
 | 
			
		||||
@property (nullable, weak) NSView <NSTextInputClient> *client;
 | 
			
		||||
 | 
			
		||||
@property (nullable, weak) id <NSCandidateListTouchBarItemDelegate> delegate API_UNAVAILABLE(macCatalyst);
 | 
			
		||||
 | 
			
		||||
#pragma mark Appearance State
 | 
			
		||||
// Controls the visible state of the item. The default is YES.
 | 
			
		||||
@property (getter=isCollapsed) BOOL collapsed API_UNAVAILABLE(macCatalyst);
 | 
			
		||||
 | 
			
		||||
// When YES, the item is allowed to be collapsed. YES by default.
 | 
			
		||||
@property BOOL allowsCollapsing API_UNAVAILABLE(macCatalyst);
 | 
			
		||||
 | 
			
		||||
// Returns the state of its native candidate list visibility. When -collapsed=NO and not obscured by UI from the text input system, this property returns YES. KVO compliant. Clients should set candidates when YES.
 | 
			
		||||
@property (readonly, getter=isCandidateListVisible) BOOL candidateListVisible API_UNAVAILABLE(macCatalyst);
 | 
			
		||||
 | 
			
		||||
// Updates the candidate list visibility configuration based on the client's insertion point state. The client is expected to update the candidate list visibility configuration whenever its selection changes. When the selection length is 0 and the insertion cursor is visible, isVisible should be YES; otherwise, it should be NO. When -hasMarkedText is YES, it should be considered the cursor is visible.
 | 
			
		||||
- (void)updateWithInsertionPointVisibility:(BOOL)isVisible API_UNAVAILABLE(macCatalyst);
 | 
			
		||||
 | 
			
		||||
#pragma mark Input Method support
 | 
			
		||||
// When YES, the item displays candidates from input methods when available instead of -candidates. YES by default.
 | 
			
		||||
@property BOOL allowsTextInputContextCandidates;
 | 
			
		||||
 | 
			
		||||
#pragma mark Candidates
 | 
			
		||||
// A block function for converting a candidate object into an NSAttributedString that will be displayed in the candidate bar. nil by default. Not required for displaying NSString, NSAttributedString, and NSTextCheckingResult candidates. In absence of NSFontAttributeName and NSForegroundColorAttributeName in the returned string, the standard bar appearance font and color are used instead of Helvetica 12.0 and +[NSColor blackColor].
 | 
			
		||||
@property (nullable, copy) NSAttributedString * (^attributedStringForCandidate)(CandidateType candidate, NSInteger index) API_UNAVAILABLE(macCatalyst);
 | 
			
		||||
 | 
			
		||||
// Returns an array of candidate objects previously set via -setCandidates:forSelectedRange:inString:view:
 | 
			
		||||
@property (readonly, copy) NSArray<CandidateType> *candidates API_UNAVAILABLE(macCatalyst);
 | 
			
		||||
 
 | 
			
		||||
// Sets an array of candidate objects to be displayed in the candidate list bar item. The candidate objects are interpreted by -attributedStringForCandidate if the property is non-nil. NSCandidateListTouchBarItem can format NSString, NSAttributedString, and NSTextCheckingResult without the formatting block specified. The NSTouchBarItem will decide which candidates to place in the candidates array and in which order. The selectedRange and originalString arguments tell the context the list of candidates was originally derived from. For NSTextCheckingResult candidates, the selectedRange and originalString arguments should match those passed in to NSSpellChecker. The NSTouchBarItem will also arrange to display candidates near the selection in the view when appropriate.
 | 
			
		||||
- (void)setCandidates:(NSArray<CandidateType> *)candidates forSelectedRange:(NSRange)selectedRange inString:(nullable NSString *)originalString API_UNAVAILABLE(macCatalyst);
 | 
			
		||||
 | 
			
		||||
// The label displayed in the customization panel. The default is an empty string.
 | 
			
		||||
@property (readwrite, copy, null_resettable) NSString *customizationLabel API_UNAVAILABLE(macCatalyst);
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#pragma mark NSCandidateListTouchBarItemDelegate
 | 
			
		||||
API_UNAVAILABLE(macCatalyst)
 | 
			
		||||
@protocol NSCandidateListTouchBarItemDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
// Invoked when user touches down on a candidate in the bar.
 | 
			
		||||
- (void)candidateListTouchBarItem:(NSCandidateListTouchBarItem *)anItem beginSelectingCandidateAtIndex:(NSInteger)index API_AVAILABLE(macos(10.12.2)) API_UNAVAILABLE(macCatalyst);
 | 
			
		||||
 | 
			
		||||
// Invoked when user moves from touching one candidate in the bar to another.
 | 
			
		||||
- (void)candidateListTouchBarItem:(NSCandidateListTouchBarItem *)anItem changeSelectionFromCandidateAtIndex:(NSInteger)previousIndex toIndex:(NSInteger)index API_AVAILABLE(macos(10.12.2)) API_UNAVAILABLE(macCatalyst);
 | 
			
		||||
 | 
			
		||||
// Invoked when user stops touching candidates in the bar. If index==NSNotFound, user didn't select any candidate.
 | 
			
		||||
- (void)candidateListTouchBarItem:(NSCandidateListTouchBarItem *)anItem endSelectingCandidateAtIndex:(NSInteger)index API_AVAILABLE(macos(10.12.2)) API_UNAVAILABLE(macCatalyst);
 | 
			
		||||
 | 
			
		||||
// Invoked when -candidateListVisible changed the visibility state.
 | 
			
		||||
- (void)candidateListTouchBarItem:(NSCandidateListTouchBarItem *)anItem changedCandidateListVisibility:(BOOL)isVisible API_AVAILABLE(macos(10.12.2)) API_UNAVAILABLE(macCatalyst);
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSView (NSCandidateListTouchBarItem)
 | 
			
		||||
// Returns NSCandidateListTouchBarItem used by the receiver when the first responder. The default implementation just returns nil. NSTextInputContext uses the item returned from this method for showing the candidates from input methods.
 | 
			
		||||
@property (nullable, readonly, strong) NSCandidateListTouchBarItem *candidateListTouchBarItem API_AVAILABLE(macos(10.12.2));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
// The standard identifier for NSCandidateListTouchBarItem. -[NSView candidateListTouchBarItem] concrete overrides should be using this identifier for instantiating the NSTouchBarItem.
 | 
			
		||||
APPKIT_EXTERN NSTouchBarItemIdentifier const NSTouchBarItemIdentifierCandidateList API_AVAILABLE(macos(10.12.2)) API_UNAVAILABLE(macCatalyst);
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,374 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSCell.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <AppKit/NSText.h>
 | 
			
		||||
#import <AppKit/NSParagraphStyle.h>
 | 
			
		||||
#import <AppKit/NSUserInterfaceItemIdentification.h>
 | 
			
		||||
#import <AppKit/NSAccessibilityProtocols.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSAttributedString, NSDraggingImageComponent, NSEvent, NSFont, NSFormatter, NSImage, NSMenu, NSText, NSTextView, NSView;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSCellType) {
 | 
			
		||||
    NSNullCellType  = 0,
 | 
			
		||||
    NSTextCellType  = 1,
 | 
			
		||||
    NSImageCellType = 2
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSCellAttribute) {
 | 
			
		||||
    NSCellDisabled               = 0,
 | 
			
		||||
    NSCellState                  = 1,
 | 
			
		||||
    NSPushInCell                 = 2,
 | 
			
		||||
    NSCellEditable               = 3,
 | 
			
		||||
    NSChangeGrayCell             = 4,
 | 
			
		||||
    NSCellHighlighted            = 5,
 | 
			
		||||
    NSCellLightsByContents       = 6,
 | 
			
		||||
    NSCellLightsByGray           = 7,
 | 
			
		||||
    NSChangeBackgroundCell       = 8,
 | 
			
		||||
    NSCellLightsByBackground     = 9,
 | 
			
		||||
    NSCellIsBordered             = 10,
 | 
			
		||||
    NSCellHasOverlappingImage    = 11,
 | 
			
		||||
    NSCellHasImageHorizontal     = 12,
 | 
			
		||||
    NSCellHasImageOnLeftOrBottom = 13,
 | 
			
		||||
    NSCellChangesContents        = 14,
 | 
			
		||||
    NSCellIsInsetButton          = 15,
 | 
			
		||||
    NSCellAllowsMixedState       = 16
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSCellImagePosition) {
 | 
			
		||||
    NSNoImage       = 0,
 | 
			
		||||
    NSImageOnly     = 1,
 | 
			
		||||
    NSImageLeft     = 2,
 | 
			
		||||
    NSImageRight    = 3,
 | 
			
		||||
    NSImageBelow    = 4,
 | 
			
		||||
    NSImageAbove    = 5,
 | 
			
		||||
    NSImageOverlaps = 6,
 | 
			
		||||
    NSImageLeading  API_AVAILABLE(macos(10.12)) = 7,
 | 
			
		||||
    NSImageTrailing API_AVAILABLE(macos(10.12)) = 8
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSImageScaling) {
 | 
			
		||||
    NSImageScaleProportionallyDown = 0, // Scale image down if it is too large for destination. Preserve aspect ratio.
 | 
			
		||||
    NSImageScaleAxesIndependently,      // Scale each dimension to exactly fit destination. Do not preserve aspect ratio.
 | 
			
		||||
    NSImageScaleNone,                   // Do not scale.
 | 
			
		||||
    NSImageScaleProportionallyUpOrDown, // Scale image to maximum possible dimensions while (1) staying within destination area (2) preserving aspect ratio
 | 
			
		||||
    
 | 
			
		||||
    NSScaleProportionally API_DEPRECATED("Use NSImageScaleProportionallyDown instead", macos(10.0,10.10)) = 0,
 | 
			
		||||
    NSScaleToFit API_DEPRECATED("Use NSImageScaleAxesIndependently instead", macos(10.0,10.10)),
 | 
			
		||||
    NSScaleNone API_DEPRECATED("Use NSImageScaleNone instead", macos(10.0,10.10))
 | 
			
		||||
} API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
typedef NSInteger NSControlStateValue NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
static const NSControlStateValue NSControlStateValueMixed = -1;
 | 
			
		||||
static const NSControlStateValue NSControlStateValueOff = 0;
 | 
			
		||||
static const NSControlStateValue NSControlStateValueOn = 1;
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSCellStyleMask) {
 | 
			
		||||
    NSNoCellMask               = 0,
 | 
			
		||||
    NSContentsCellMask         = 1,
 | 
			
		||||
    NSPushInCellMask           = 2,
 | 
			
		||||
    NSChangeGrayCellMask       = 4,
 | 
			
		||||
    NSChangeBackgroundCellMask = 8
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSControlTint) {
 | 
			
		||||
    NSDefaultControlTint  = 0,
 | 
			
		||||
    NSBlueControlTint     = 1,
 | 
			
		||||
    NSGraphiteControlTint = 6,
 | 
			
		||||
    NSClearControlTint    = 7
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSControlSize) {
 | 
			
		||||
    NSControlSizeRegular = 0,
 | 
			
		||||
    NSControlSizeSmall = 1,
 | 
			
		||||
    NSControlSizeMini = 2,
 | 
			
		||||
    NSControlSizeLarge API_AVAILABLE(macos(11.0)) = 3
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
NS_SWIFT_UI_ACTOR
 | 
			
		||||
@interface NSCell : NSObject <NSCopying, NSCoding, NSUserInterfaceItemIdentification, NSAccessibilityElement, NSAccessibility>
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initTextCell:(NSString *)string NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initImageCell:(nullable NSImage *)image NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@property (class, readonly) BOOL prefersTrackingUntilMouseUp;
 | 
			
		||||
 | 
			
		||||
@property (nullable, assign) NSView *controlView; // Must be an NSControl subclass
 | 
			
		||||
@property NSCellType type;
 | 
			
		||||
@property NSControlStateValue state;
 | 
			
		||||
@property (nullable, weak) id target; // Target is weak for zeroing-weak compatible objects in apps linked on 10.10 or later. Otherwise the behavior of this property is 'assign'.
 | 
			
		||||
@property (nullable) SEL action;
 | 
			
		||||
@property NSInteger tag;
 | 
			
		||||
@property (copy) NSString *title;
 | 
			
		||||
@property (getter=isOpaque, readonly) BOOL opaque;
 | 
			
		||||
@property (getter=isEnabled) BOOL enabled;
 | 
			
		||||
 | 
			
		||||
- (NSInteger)sendActionOn:(NSEventMask)mask;
 | 
			
		||||
 | 
			
		||||
@property (getter=isContinuous) BOOL continuous;
 | 
			
		||||
@property (getter=isEditable) BOOL editable;
 | 
			
		||||
@property (getter=isSelectable) BOOL selectable;
 | 
			
		||||
@property (getter=isBordered) BOOL bordered;
 | 
			
		||||
@property (getter=isBezeled) BOOL bezeled;
 | 
			
		||||
@property (getter=isScrollable) BOOL scrollable; /* If YES, sets wraps to NO */
 | 
			
		||||
@property (getter=isHighlighted) BOOL highlighted;
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
@property NSTextAlignment alignment;
 | 
			
		||||
#endif
 | 
			
		||||
@property BOOL wraps;    /* If YES, sets scrollable to NO */
 | 
			
		||||
@property (nullable, strong) NSFont *font;
 | 
			
		||||
@property (readonly, copy) NSString *keyEquivalent;
 | 
			
		||||
@property (nullable, strong) __kindof NSFormatter *formatter;
 | 
			
		||||
@property (nullable, copy) id /* id <NSCopying> */ objectValue;
 | 
			
		||||
@property (readonly) BOOL hasValidObjectValue;
 | 
			
		||||
@property (copy) NSString *stringValue;
 | 
			
		||||
- (NSComparisonResult)compare:(id)otherCell;
 | 
			
		||||
@property int intValue;
 | 
			
		||||
@property float floatValue;
 | 
			
		||||
@property double doubleValue;
 | 
			
		||||
@property NSInteger integerValue API_AVAILABLE(macos(10.5));
 | 
			
		||||
- (void)takeIntValueFrom:(nullable id)sender;
 | 
			
		||||
- (void)takeFloatValueFrom:(nullable id)sender;
 | 
			
		||||
- (void)takeDoubleValueFrom:(nullable id)sender;
 | 
			
		||||
- (void)takeStringValueFrom:(nullable id)sender;
 | 
			
		||||
- (void)takeObjectValueFrom:(nullable id)sender;
 | 
			
		||||
- (void)takeIntegerValueFrom:(nullable id)sender API_AVAILABLE(macos(10.5));
 | 
			
		||||
@property (nullable, strong) NSImage *image;
 | 
			
		||||
@property NSControlSize controlSize;
 | 
			
		||||
@property (nullable, strong) id representedObject;
 | 
			
		||||
- (NSInteger)cellAttribute:(NSCellAttribute)parameter;
 | 
			
		||||
- (void)setCellAttribute:(NSCellAttribute)parameter to:(NSInteger)value;
 | 
			
		||||
- (NSRect)imageRectForBounds:(NSRect)rect;
 | 
			
		||||
- (NSRect)titleRectForBounds:(NSRect)rect;
 | 
			
		||||
- (NSRect)drawingRectForBounds:(NSRect)rect;
 | 
			
		||||
@property (readonly) NSSize cellSize;
 | 
			
		||||
- (NSSize)cellSizeForBounds:(NSRect)rect;
 | 
			
		||||
- (nullable NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
 | 
			
		||||
- (void)calcDrawInfo:(NSRect)rect;
 | 
			
		||||
- (NSText *)setUpFieldEditorAttributes:(NSText *)textObj;
 | 
			
		||||
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
 | 
			
		||||
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
 | 
			
		||||
- (void)highlight:(BOOL)flag withFrame:(NSRect)cellFrame inView:(NSView *)controlView;
 | 
			
		||||
@property (readonly) NSInteger mouseDownFlags;
 | 
			
		||||
- (void)getPeriodicDelay:(float *)delay interval:(float *)interval;
 | 
			
		||||
- (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView;
 | 
			
		||||
- (BOOL)continueTracking:(NSPoint)lastPoint at:(NSPoint)currentPoint inView:(NSView *)controlView;
 | 
			
		||||
- (void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:(NSView *)controlView mouseIsUp:(BOOL)flag;
 | 
			
		||||
- (BOOL)trackMouse:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView untilMouseUp:(BOOL)flag;
 | 
			
		||||
- (void)editWithFrame:(NSRect)rect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(nullable id)delegate event:(nullable NSEvent *)event;
 | 
			
		||||
- (void)selectWithFrame:(NSRect)rect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(nullable id)delegate start:(NSInteger)selStart length:(NSInteger)selLength;
 | 
			
		||||
- (void)endEditing:(NSText *)textObj;
 | 
			
		||||
- (void)resetCursorRect:(NSRect)cellFrame inView:(NSView *)controlView;
 | 
			
		||||
 | 
			
		||||
@property (nullable, strong) NSMenu *menu;
 | 
			
		||||
- (nullable NSMenu *)menuForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)view;
 | 
			
		||||
@property (class, readonly, nullable, strong) NSMenu *defaultMenu;
 | 
			
		||||
 | 
			
		||||
@property BOOL sendsActionOnEndEditing;
 | 
			
		||||
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
@property NSWritingDirection baseWritingDirection;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
@property NSLineBreakMode lineBreakMode;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@property BOOL allowsUndo;
 | 
			
		||||
 | 
			
		||||
/* Truncates and adds the ellipsis character to the last visible line if the text doesn't fit into the cell bounds. The setting is ignored if -lineBreakMode is neither NSLineBreakByWordWrapping nor NSLineBreakByCharWrapping.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL truncatesLastVisibleLine API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Bi-directional User Interface. It specifies the general UI layout flow directions.
 | 
			
		||||
*/
 | 
			
		||||
@property NSUserInterfaceLayoutDirection userInterfaceLayoutDirection API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Returns a custom field editor for editing inside controlView. This is an override point for NSCell subclasses designed to work with its own custom field editor. This message is sent to the selected cell of controlView in -[NSWindow fieldEditor:forObject:]. Returning non-nil from this method indicates skipping the standard field editor querying processes including -windowWillReturnFieldEditor:toObject: delegation. The default NSCell implementation returns nil. The field editor returned from this method should have isFieldEditor == YES.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSTextView *)fieldEditorForView:(NSView *)controlView API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Tells the text cell to layout/render its content in single-line. If YES, the cell ignores the return value from -wraps, interprets NSLineBreakByWordWrapping and NSLineBreakByCharWrapping from -lineBreakMode as NSLineBreakByClipping, and configures the field editor to ignore key binding commands that insert paragraph/line separators. Also, the field editor bound to a single line cell filters paragraph/line separator insertion from user actions. Cells in the single line mode use the fixed baseline layout. The text baseline position is determined solely by the control size regardless of content font style/size.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL usesSingleLineMode API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Multi-image Drag Support. The default implementation will return an array of up to two NSDraggingImageComponent instances -- one for the image portion and another for the text portion (if appropriate). This method can be subclassed and overridden to provide a custom set of NSDraggingImageComponents to create the drag image for the cell. This method is generally used by NSTableView/NSOutlineView.
 | 
			
		||||
 */
 | 
			
		||||
- (NSArray<NSDraggingImageComponent *> *)draggingImageComponentsWithFrame:(NSRect)frame inView:(NSView *)view API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSCell(NSKeyboardUI)
 | 
			
		||||
@property BOOL refusesFirstResponder;
 | 
			
		||||
@property (readonly) BOOL acceptsFirstResponder;
 | 
			
		||||
@property BOOL showsFirstResponder;
 | 
			
		||||
 | 
			
		||||
- (void)performClick:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
@property NSFocusRingType focusRingType;
 | 
			
		||||
@property (class, readonly) NSFocusRingType defaultFocusRingType;
 | 
			
		||||
 | 
			
		||||
- (void)drawFocusRingMaskWithFrame:(NSRect)cellFrame inView:(NSView *)controlView API_AVAILABLE(macos(10.7));
 | 
			
		||||
- (NSRect)focusRingMaskBoundsForFrame:(NSRect)cellFrame inView:(NSView *)controlView API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
@property (readonly) BOOL wantsNotificationForMarkedText; // If the receiver returns YES, the field editor initiated by it posts text change notifications (i.e. NSTextDidChangeNotification) while editing marked text; otherwise, they are delayed until the marked text confirmation. The NSCell's implementation returns NO.
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSCell(NSCellAttributedStringMethods)
 | 
			
		||||
@property (copy) NSAttributedString *attributedStringValue;
 | 
			
		||||
/* These methods determine whether the user can modify text attributes and import graphics in a rich cell.  Note that whatever these flags are, cells can still contain attributed text if programmatically set. */
 | 
			
		||||
@property BOOL allowsEditingTextAttributes;       /* If NO, also clears setImportsGraphics: */
 | 
			
		||||
@property BOOL importsGraphics;                   /* If YES, also sets setAllowsEditingTextAttributes: */
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSCell(NSCellMixedState)	/* allow button to have mixed state value*/
 | 
			
		||||
@property BOOL allowsMixedState;
 | 
			
		||||
@property (readonly) NSInteger nextState;			/* get next state state in cycle */
 | 
			
		||||
- (void)setNextState;			/* toggle/cycle through states */
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* Cell Hit testing support */
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSCellHitResult) {
 | 
			
		||||
    // An empty area, or did not hit in the cell
 | 
			
		||||
    NSCellHitNone = 0,
 | 
			
		||||
    // A content area in the cell
 | 
			
		||||
    NSCellHitContentArea = 1 << 0,
 | 
			
		||||
    // An editable text area of the cell
 | 
			
		||||
    NSCellHitEditableTextArea = 1 << 1,
 | 
			
		||||
    // A trackable area in the cell
 | 
			
		||||
    NSCellHitTrackableArea = 1 << 2,
 | 
			
		||||
} API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
@interface NSCell(NSCellHitTest)
 | 
			
		||||
/* Return hit testing information for the cell. Use a bit-wise mask to look for a specific value when calling the method. Generally, this should be overridden by custom NSCell subclasses to return the correct result. Currently, it is called by some multi-cell views, such as NSTableView.
 | 
			
		||||
 | 
			
		||||
    By default, NSCell will look at the cell type and do the following:
 | 
			
		||||
 | 
			
		||||
    NSImageCellType: 
 | 
			
		||||
        If the image exists, and the event point is in the image return NSCellHitContentArea, else NSCellHitNone.
 | 
			
		||||
 | 
			
		||||
    NSTextCellType (also applies to NSTextFieldCell): 
 | 
			
		||||
        If there is text:
 | 
			
		||||
            If the event point hits in the text, return NSCellHitContentArea. Additionally, if the cell is enabled return NSCellHitContentArea | NSCellHitEditableTextArea.
 | 
			
		||||
        If there is not text:
 | 
			
		||||
            Returns NSCellHitNone.
 | 
			
		||||
 | 
			
		||||
    NSNullCellType (this is the default that applies to non text or image cells who don't override hitTestForEvent:):
 | 
			
		||||
        Return NSCellHitContentArea by default.
 | 
			
		||||
        If the cell not disabled, and it would track, return NSCellHitContentArea | NSCellHitTrackableArea.
 | 
			
		||||
*/
 | 
			
		||||
- (NSCellHitResult)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView API_AVAILABLE(macos(10.5));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSCell(NSCellExpansion)
 | 
			
		||||
/*  Allows the cell to return an expansion cell frame if cellFrame is too small for the entire contents in the view. When the mouse is hovered over the cell in certain controls, the full cell contents will be shown in a special floating tool tip view. If the frame is not too small, return an empty rect, and no expansion tool tip view will be shown. By default, NSCell returns NSZeroRect, while some subclasses (such as NSTextFieldCell) will return the proper frame when required. 
 | 
			
		||||
*/
 | 
			
		||||
- (NSRect)expansionFrameWithFrame:(NSRect)cellFrame inView:(NSView *)view API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Allows the cell to perform custom expansion tool tip drawing. Note that the view may be different from the original view that the cell appeared in. By default, NSCell simply calls drawWithFrame:inView:.
 | 
			
		||||
*/
 | 
			
		||||
- (void)drawWithExpansionFrame:(NSRect)cellFrame inView:(NSView *)view API_AVAILABLE(macos(10.5));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSBackgroundStyle) {
 | 
			
		||||
    /* The background reflects the predominant color scheme of the view's appearance. */
 | 
			
		||||
    NSBackgroundStyleNormal = 0,
 | 
			
		||||
 | 
			
		||||
    /* The background is indicating emphasis (e.g. selection state) using an alternate color or visual effect. Content may alter its appearance to reflect this emphasis. */
 | 
			
		||||
    NSBackgroundStyleEmphasized,
 | 
			
		||||
 | 
			
		||||
    /* The background is intended to appear higher than the content drawn on it. Content might need to be inset. */
 | 
			
		||||
    NSBackgroundStyleRaised,
 | 
			
		||||
 | 
			
		||||
    /* The background is intended to appear lower than the content drawn on it. Content might need to be embossed. */
 | 
			
		||||
    NSBackgroundStyleLowered,
 | 
			
		||||
} API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
@interface NSCell (NSCellBackgroundStyle)
 | 
			
		||||
 | 
			
		||||
/* Describes the surface the cell is drawn onto in -[NSCell drawWithFrame:inView:]. A control typically sets this before it asks the cell to draw. A cell may draw differently based on background characteristics. For example, a tableview drawing a cell in a selected row might call [cell setBackgroundStyle:NSBackgroundStyleEmphasized]. A text cell might decide to render its text using alternateSelectedControlTextColor as a result.
 | 
			
		||||
 */
 | 
			
		||||
@property NSBackgroundStyle backgroundStyle API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Describes the surface drawn onto in -[NSCell drawInteriorWithFrame:inView:]. This is often the same as the backgroundStyle, but a button that draws a bezel would have a different interiorBackgroundStyle.  
 | 
			
		||||
 
 | 
			
		||||
 This is both an override point and a useful method to call. A button that draws a custom bezel would override this to describe that surface. A cell that has custom interior drawing might query this method to help pick an image that looks good on the cell. Calling this method gives you some independence from changes in framework art style.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) NSBackgroundStyle interiorBackgroundStyle API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* Draw an image from two end caps and a fill.  The end caps are scaled proportionally to match the thickness of the destination frame.  In the horizontal case, the startCap is drawn into the left part of the destination, the endCap is drawn into the right part of the destination, and the fill is tiled over the remaining area.  The caps and the fill should all be the same height.  The vertical case is similar.
 | 
			
		||||
 | 
			
		||||
 This is an appropriate way to draw the bezel of a button that can be resized in one dimension.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN void NSDrawThreePartImage(NSRect frame, NSImage * _Nullable startCap, NSImage * _Nullable centerFill, NSImage * _Nullable endCap, BOOL vertical, NSCompositingOperation op, CGFloat alphaFraction, BOOL flipped) API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Draw an image from nine pieces.  When drawn, the destination rect is partitioned into nine rectangular regions: the corner pieces are the natural size of the corner images, the edge pieces are the natural size of the edge fill images in the direction perpendicular to the edge and flush with the corners.  The center rect fills the remaining space.  The supplied images and fills are drawn into the corresponding regions, with fill images tiled at their natural dimensions.  Images that share a border should have the same thickness in that dimension.
 | 
			
		||||
 | 
			
		||||
 This method is appropriate for the bezel of a control, like a box, that can be resized in both dimensions.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN void NSDrawNinePartImage(NSRect frame, NSImage * _Nullable topLeftCorner, NSImage * _Nullable topEdgeFill, NSImage * _Nullable topRightCorner, NSImage * _Nullable leftEdgeFill, NSImage * _Nullable centerFill, NSImage * _Nullable rightEdgeFill, NSImage * _Nullable bottomLeftCorner, NSImage * _Nullable bottomEdgeFill, NSImage * _Nullable bottomRightCorner, NSCompositingOperation op, CGFloat alphaFraction, BOOL flipped) API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
@interface NSCell (NSDeprecated)
 | 
			
		||||
 | 
			
		||||
@property NSControlTint controlTint API_DEPRECATED("The controlTint property is not respected on 10.14 and later. For custom cells, use +[NSColor controlAccentColor] to respect the user's preferred accent color when drawing.", macos(10.0, 11.0));
 | 
			
		||||
 | 
			
		||||
// Use formatters instead.  See -[NSCell formatter] and -[NSCell setFormatter:].
 | 
			
		||||
- (NSInteger)entryType API_DEPRECATED("", macos(10.0,10.0));
 | 
			
		||||
- (void)setEntryType:(NSInteger)type API_DEPRECATED("", macos(10.0,10.0));
 | 
			
		||||
- (BOOL)isEntryAcceptable:(NSString *)string API_DEPRECATED("", macos(10.0,10.0));
 | 
			
		||||
- (void)setFloatingPointFormat:(BOOL)autoRange left:(NSUInteger)leftDigits right:(NSUInteger)rightDigits API_DEPRECATED("", macos(10.0,10.0));
 | 
			
		||||
 | 
			
		||||
/* In 10.8 and higher, all the *Mnemonic* methods are deprecated. On MacOS they have typically not been used.
 | 
			
		||||
 */
 | 
			
		||||
- (void)setMnemonicLocation:(NSUInteger)location API_DEPRECATED("", macos(10.0,10.8));
 | 
			
		||||
- (NSUInteger)mnemonicLocation API_DEPRECATED("", macos(10.0,10.8));
 | 
			
		||||
- (NSString *)mnemonic API_DEPRECATED("", macos(10.0,10.8));
 | 
			
		||||
- (void)setTitleWithMnemonic:(NSString *)stringWithAmpersand API_DEPRECATED("", macos(10.0,10.8));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* In some appearances, NSBackgroundStyleLight may refer to a state where the background is actually a dark color. Use NSBackgroundStyleNormal instead. */
 | 
			
		||||
static const NSBackgroundStyle NSBackgroundStyleLight API_DEPRECATED_WITH_REPLACEMENT("NSBackgroundStyleNormal", macos(10.5, 11.0)) = NSBackgroundStyleNormal;
 | 
			
		||||
/* NSBackgroundStyleDark is not a reliable indicator of background states with visually dark or saturated colors. Use NSBackgroundStyleEmphasized instead. */
 | 
			
		||||
static const NSBackgroundStyle NSBackgroundStyleDark API_DEPRECATED_WITH_REPLACEMENT("NSBackgroundStyleEmphasized", macos(10.5, 11.0)) = NSBackgroundStyleEmphasized;
 | 
			
		||||
 | 
			
		||||
typedef NSControlStateValue NSCellStateValue API_DEPRECATED_WITH_REPLACEMENT("NSControlStateValue", macos(10.0,10.14));
 | 
			
		||||
static const NSControlStateValue NSMixedState API_DEPRECATED_WITH_REPLACEMENT("NSControlStateValueMixed", macos(10.0,10.14)) = NSControlStateValueMixed;
 | 
			
		||||
static const NSControlStateValue NSOffState API_DEPRECATED_WITH_REPLACEMENT("NSControlStateValueOff", macos(10.0,10.14)) = NSControlStateValueOff;
 | 
			
		||||
static const NSControlStateValue NSOnState API_DEPRECATED_WITH_REPLACEMENT("NSControlStateValueOn", macos(10.0,10.14)) = NSControlStateValueOn;
 | 
			
		||||
 | 
			
		||||
static const NSControlSize NSRegularControlSize API_DEPRECATED_WITH_REPLACEMENT("NSControlSizeRegular", macos(10.0,10.12)) = NSControlSizeRegular;
 | 
			
		||||
static const NSControlSize NSSmallControlSize API_DEPRECATED_WITH_REPLACEMENT("NSControlSizeSmall", macos(10.0,10.12)) = NSControlSizeSmall;
 | 
			
		||||
static const NSControlSize NSMiniControlSize API_DEPRECATED_WITH_REPLACEMENT("NSControlSizeMini", macos(10.0,10.12)) = NSControlSizeMini;
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSControlTintDidChangeNotification API_DEPRECATED("Changes to the accent color can be manually observed by implementing -viewDidChangeEffectiveAppearance in a NSView subclass, or by Key-Value Observing the -effectiveAppearance property on NSApplication. Views are automatically redisplayed when the accent color changes.", macos(10.0, 11.0));
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
    NSAnyType API_DEPRECATED("Use formatters instead", macos(10.0,10.0)) = 0,
 | 
			
		||||
    NSIntType API_DEPRECATED("Use formatters instead", macos(10.0,10.0)) = 1,
 | 
			
		||||
    NSPositiveIntType API_DEPRECATED("Use formatters instead", macos(10.0,10.0)) = 2,
 | 
			
		||||
    NSFloatType API_DEPRECATED("Use formatters instead", macos(10.0,10.0)) = 3,
 | 
			
		||||
    NSPositiveFloatType API_DEPRECATED("Use formatters instead", macos(10.0,10.0)) = 4,
 | 
			
		||||
    NSDoubleType API_DEPRECATED("Use formatters instead", macos(10.0,10.0)) = 6,
 | 
			
		||||
    NSPositiveDoubleType API_DEPRECATED("Use formatters instead", macos(10.0,10.0)) = 7
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,30 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSClickGestureRecognizer.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 2013-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
#import <AppKit/NSGestureRecognizer.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.10))
 | 
			
		||||
@interface NSClickGestureRecognizer : NSGestureRecognizer <NSCoding>
 | 
			
		||||
 | 
			
		||||
/* bitfield of the button(s) required to recognize this click where bit 0 is the primary button, 1 is the secondary button, etc...
 | 
			
		||||
   NSClickGestureRecognizer dynamically returns YES to delay primary, secondary and other mouse events depending on this value.
 | 
			
		||||
*/
 | 
			
		||||
@property NSUInteger buttonMask; // Defaults to 0x1
 | 
			
		||||
 | 
			
		||||
/* the number of clicks required to match */
 | 
			
		||||
@property NSInteger numberOfClicksRequired; // Defaults to 1
 | 
			
		||||
 | 
			
		||||
@property NSInteger numberOfTouchesRequired API_AVAILABLE(macos(10.12.2));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,63 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSClipView.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSView.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
#import <Availability.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSColor;
 | 
			
		||||
 | 
			
		||||
@interface NSClipView : NSView
 | 
			
		||||
 | 
			
		||||
@property (copy) NSColor *backgroundColor;
 | 
			
		||||
@property BOOL drawsBackground;
 | 
			
		||||
@property (nullable, strong) __kindof NSView *documentView;
 | 
			
		||||
@property (readonly) NSRect documentRect;
 | 
			
		||||
@property (nullable, strong) NSCursor *documentCursor;
 | 
			
		||||
@property (readonly) NSRect documentVisibleRect;
 | 
			
		||||
- (void)viewFrameChanged:(NSNotification *)notification;
 | 
			
		||||
- (void)viewBoundsChanged:(NSNotification *)notification;
 | 
			
		||||
- (BOOL)autoscroll:(NSEvent *)event;
 | 
			
		||||
- (void)scrollToPoint:(NSPoint)newOrigin;
 | 
			
		||||
 | 
			
		||||
/* This is used to constrain the bounds of the clip view under magnification and scrolling. This also comes with the deprecation of -constrainScrollPoint:. The logic of an existing -constrainScrollPoint: can be moved to -constrainBoundsRect: by adjusting the proposedBounds origin (as opposed to 'newOrigin').
 | 
			
		||||
 
 | 
			
		||||
 To preserve compatibility, if a subclass overrides -constrainScrollPoint:, the default behavior of -constrainBoundsRect: will be to use that -constrainScrollPoint: to adjust the proposedBounds origin, and to not change the size.
 | 
			
		||||
 */
 | 
			
		||||
- (NSRect)constrainBoundsRect:(NSRect)proposedBounds API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
/* The distance that the content view is inset from the enclosing scroll view.
 | 
			
		||||
   Note: animate with [self animator]
 | 
			
		||||
*/
 | 
			
		||||
@property NSEdgeInsets contentInsets API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
/* When YES, and used as the contentView of an NSScrollView, the clip view will automatically account for other scroll view subviews such as rulers and headers. Defaults to YES.
 | 
			
		||||
*/
 | 
			
		||||
@property BOOL automaticallyAdjustsContentInsets API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSView (NSClipViewSuperview)
 | 
			
		||||
- (void)reflectScrolledClipView:(NSClipView *)clipView;
 | 
			
		||||
- (void)scrollClipView:(NSClipView *)clipView toPoint:(NSPoint)point;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#pragma mark Deprecated declarations
 | 
			
		||||
 | 
			
		||||
@interface NSClipView ()
 | 
			
		||||
- (NSPoint)constrainScrollPoint:(NSPoint)newOrigin API_DEPRECATED("Use -constrainBoundsRect: instead.", macos(10.0,10.10));
 | 
			
		||||
@property BOOL copiesOnScroll API_DEPRECATED("Setting this property has no effect.  NSClipView will always minimize the area of the document view that is invalidated.  To force invalidation of the document view, use -[NSView setNeedsDisplayInRect:].", macos(10.0, 11.0));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,676 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSCollectionView.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 2005-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSView.h>
 | 
			
		||||
#import <AppKit/NSViewController.h>
 | 
			
		||||
#import <AppKit/NSDragging.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSCollectionViewDropOperation) {
 | 
			
		||||
    NSCollectionViewDropOn = 0,
 | 
			
		||||
    NSCollectionViewDropBefore = 1,
 | 
			
		||||
} API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSCollectionViewItemHighlightState) {
 | 
			
		||||
    NSCollectionViewItemHighlightNone = 0,
 | 
			
		||||
    NSCollectionViewItemHighlightForSelection = 1,
 | 
			
		||||
    NSCollectionViewItemHighlightForDeselection = 2,
 | 
			
		||||
    NSCollectionViewItemHighlightAsDropTarget = 3,
 | 
			
		||||
} API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Used with NSCollectionView's -selectItemsAtIndexPaths:scrollPosition: and -scrollToItemsAtIndexPaths:scrollPosition: to specify how the bounding box of the specified items should be positioned within the CollectionView's visibleRect.  NSCollectionView will try to satisfy this request as closely as feasible, while staying within the enclosing ClipView's scrollable range.
 | 
			
		||||
*/
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSCollectionViewScrollPosition) {
 | 
			
		||||
    NSCollectionViewScrollPositionNone                 = 0,
 | 
			
		||||
    
 | 
			
		||||
    /* The vertical positions are mutually exclusive to each other, but are bitwise or-able with the horizontal scroll positions.  Combining positions from the same grouping (horizontal or vertical) will result in an NSInvalidArgumentException.
 | 
			
		||||
    */
 | 
			
		||||
    NSCollectionViewScrollPositionTop                   = 1 << 0,
 | 
			
		||||
    NSCollectionViewScrollPositionCenteredVertically    = 1 << 1,
 | 
			
		||||
    NSCollectionViewScrollPositionBottom                = 1 << 2,
 | 
			
		||||
    NSCollectionViewScrollPositionNearestHorizontalEdge = 1 << 9, /* Nearer of Top,Bottom */
 | 
			
		||||
    
 | 
			
		||||
    /* Likewise, the horizontal positions are mutually exclusive to each other.
 | 
			
		||||
    */
 | 
			
		||||
    NSCollectionViewScrollPositionLeft                 = 1 << 3,
 | 
			
		||||
    NSCollectionViewScrollPositionCenteredHorizontally = 1 << 4,
 | 
			
		||||
    NSCollectionViewScrollPositionRight                = 1 << 5,
 | 
			
		||||
    NSCollectionViewScrollPositionLeadingEdge          = 1 << 6, /* Left if LTR, Right if RTL */
 | 
			
		||||
    NSCollectionViewScrollPositionTrailingEdge         = 1 << 7, /* Right if LTR, Left, if RTL */
 | 
			
		||||
    NSCollectionViewScrollPositionNearestVerticalEdge  = 1 << 8, /* Nearer of Leading,Trailing */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSCollectionViewSupplementaryElementKind NS_SWIFT_BRIDGED_TYPEDEF;
 | 
			
		||||
 | 
			
		||||
@class NSButton, NSCollectionView, NSCollectionViewLayout, NSCollectionViewLayoutAttributes, NSCollectionViewTransitionLayout, NSDraggingImageComponent, NSImageView, NSIndexSet, NSMutableIndexSet, NSNib, NSTextField;
 | 
			
		||||
@protocol NSCollectionViewDataSource, NSCollectionViewDelegate, NSCollectionViewPrefetching;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
/* NSCollectionViewElement declares functionality shared by (1) NSCollectionViewItems and (2) "supplementary" or "decoration" views that can be added to an NSCollectionView.  Each such reusable entity has the ability to be reset to its initial state by being sent -prepareForReuse, the ability to take size, position, and other state from an NSCollectionViewLayoutAttributes instance, and the ability to respond to transitions from one layout to another.  Note that, since these methods are all optional and invoked only when found to be present, all existing NSView classes can be considered conforming, and are therefore eligible to be used a supplementary and decorative views.  NSView and NSCollectionViewElement both conform to NSUserInterfaceItemIdentification, which provides an "identifier" property that CollectionView uses to track an item or supplementary/decoration view's kind.
 | 
			
		||||
 */
 | 
			
		||||
@protocol NSCollectionViewElement <NSObject, NSUserInterfaceItemIdentification>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
/* Called by the NSCollectionView before the instance is returned from the reuse queue.  Subclassers must call super.  NSCollectionViewItem's implementation of this method sends -prepareForReuse to the ViewController's view.
 | 
			
		||||
 */
 | 
			
		||||
- (void)prepareForReuse API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Classes that want to support custom layout attributes specific to a given NSCollectionViewLayout subclass can apply them here.  This allows the view to work in conjunction with a layout class that returns a custom subclass of NSCollectionViewLayoutAttributes from -layoutAttributesForItem: or the corresponding layoutAttributesForHeader/Footer methods.  -applyLayoutAttributes: is then called after the view is added to the collection view and just before the view is returned from the reuse queue.  Note that -applyLayoutAttributes: is only called when attributes change, as defined by -isEqual:.
 | 
			
		||||
 */
 | 
			
		||||
- (void)applyLayoutAttributes:(NSCollectionViewLayoutAttributes *)layoutAttributes API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Override points for participating in layout transitions.  These messages are sent to a reusable part before and after the transition to a new layout occurs.
 | 
			
		||||
 */
 | 
			
		||||
- (void)willTransitionFromLayout:(NSCollectionViewLayout *)oldLayout toLayout:(NSCollectionViewLayout *)newLayout API_AVAILABLE(macos(10.11));
 | 
			
		||||
- (void)didTransitionFromLayout:(NSCollectionViewLayout *)oldLayout toLayout:(NSCollectionViewLayout *)newLayout API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Invoked when present to give a reusable entity the opportunity to make any desired final adjustments to its layout.
 | 
			
		||||
 */
 | 
			
		||||
- (NSCollectionViewLayoutAttributes *)preferredLayoutAttributesFittingAttributes:(NSCollectionViewLayoutAttributes *)layoutAttributes API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* Section header views can conform to this protocol, to enable a CollectionView to find the section collapse toggle button (when present).
 | 
			
		||||
*/
 | 
			
		||||
@protocol NSCollectionViewSectionHeaderView <NSCollectionViewElement>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
/* If your header contains a button that's set up to toggle section collapse, wire this outlet to it.  This enables CollectionView to automatically show and hide the button, based on whether the section's items all fit.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, weak) IBOutlet NSButton *sectionCollapseButton API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* An NSCollectionViewItem associates a visual representation (view subtree) with a representedObject of arbitrary type.  It also tracks whether the representedObject is part of the enclosing NSCollectionView's current selection.  Note that NSCollectionViewItem inherits some useful properties -- in particular, "representedObject" and "view" -- from NSViewController.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.5))
 | 
			
		||||
@interface NSCollectionViewItem : NSViewController <NSCopying, NSCollectionViewElement>
 | 
			
		||||
 | 
			
		||||
/* Non-retained backlink to the containing CollectionView.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, nullable, weak) NSCollectionView *collectionView;
 | 
			
		||||
 | 
			
		||||
/* Whether the item is part of its collectionView's current selection.
 | 
			
		||||
*/
 | 
			
		||||
@property (getter=isSelected) BOOL selected;
 | 
			
		||||
 | 
			
		||||
/* Whether the item should be shown as highlighted for proposed selection, deselection, as a drop target, or not highlighted.
 | 
			
		||||
*/
 | 
			
		||||
@property NSCollectionViewItemHighlightState highlightState API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Convenience outlet to the item's primary NSImageView (if any).
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, weak) IBOutlet NSImageView *imageView API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Convenience outlet to the item's primary NSTextField (if any).
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, weak) IBOutlet NSTextField *textField API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Multi-image drag and drop support. The default implementation will return an array of up to two NSDraggingImageComponent instances -- one for the imageView and another for the textField (if not nil). This methods can be subclassed and overridden to provide a custom set of NSDraggingImageComponents to create the drag image. Note: the component frames are relative to a coordinate system that has its origin at the bottom left, so you need to take into account the flippedness of your view when computing the component frames.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) NSArray<NSDraggingImageComponent *> *draggingImageComponents API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
/* An NSCollectionView presents an ordered collection of items, with flexible, customizable appearance and layout.  The user may be permitted to select items, and/or drag items into and out of the CollectionView.
 | 
			
		||||
*/
 | 
			
		||||
API_AVAILABLE(macos(10.5))
 | 
			
		||||
@interface NSCollectionView : NSView <NSDraggingSource, NSDraggingDestination>
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Data Source / Model Objects ***
 | 
			
		||||
 | 
			
		||||
/* A non-retained data source object, that the CollectionView will consult to obtain information about the model objects to be represented and the number of sections to divide them among, and to make (recycle or instantiate) items and supplementary views.  See the NSCollectionViewDataSource protocol, declared below, for the methods this delegate should implement.
 | 
			
		||||
 | 
			
		||||
Defaults to nil, which makes the CollectionView look to its "content" property or NSContentBinding for model object information.  The "content" property should only be used with the default "Grid" collectionViewLayout and legacy -newItemForRepresentedObject: / itemPrototype mechanisms for instantiating items.
 | 
			
		||||
 | 
			
		||||
To get the new capabilities and behaviors, and use the new NSCollectionView APIs added in OS X 10.11, you must specify a dataSource.  Setting dataSource != nil causes the CollectionView to empty its "content" array, and attempting to set "content" to a non-empty array while dataSource != nil is considered a programming error that will cause an exception to be raised.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, weak) id<NSCollectionViewDataSource> dataSource API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* An optional assistant to the CollectionView's 'dataSource' (potentially the same object), that receives notifications conducive to managing item data pre-fetching.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, weak) id<NSCollectionViewPrefetching> prefetchDataSource API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
/* The array of model objects that will be shown as "items" in this CollectionView.  The objects may be of any type(s).  If you prefer not to give the CollectionView a "dataSource", you can set its "content" property explicitly, or bind the CollectionView's NSContentBinding to an NSArrayController's arrangedObjects property, to provide the CollectionView with its model objects.  A CollectionView whose content is provided in this way cannot have more than one section.
 | 
			
		||||
 | 
			
		||||
Each corresponding "item" instantiated by the CollectionView will have its representedObject property wired to the corresponding model object from this "content" array.  Attempts to set "content" to nil are ignored on OS X 10.10 and earlier.  On OS X 10.11 and later, setting "content" to nil raises an exception.  (Set "content" to an empty NSArray instead, if you want to empty the CollectionView.)
 | 
			
		||||
*/
 | 
			
		||||
@property (copy) NSArray<id> *content;
 | 
			
		||||
 | 
			
		||||
/* Call this method to reload all of the items in the collection view.  This causes the collection view to discard any currently visible items and redisplay them.  For efficiency, the collection view only displays those items and supplementary views that are visible.  If the collection data shrinks as a result of the reload, the collection view adjusts its scroll position accordingly.  You should not call this method in the middle of animation blocks where items are being inserted or deleted.  Insertions and deletions automatically cause the table’s data to be updated appropriately.
 | 
			
		||||
*/
 | 
			
		||||
- (void)reloadData API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Delegate ***
 | 
			
		||||
 | 
			
		||||
/* An optional, non-retained delegate object, that will have the opportunity to influence the CollectionView's drag-and-drop, selection, highlighting, and layout transitioning behaviors.  See the NSCollectionViewDelegate protocol, declared below, for the methods this delegate may implement.  Defaults to nil, which leaves the CollectionView to determine its own behaviors.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, weak) id<NSCollectionViewDelegate> delegate;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Decoration ***
 | 
			
		||||
 | 
			
		||||
/* An optional background view that's positioned underneath all of the CollectionView's content.  Defaults to nil.  The backgroundView's scrolling behavior and frame are determined by the "backgroundViewScrollsWithContent" property, as described below.  If "backgroundColors" are also specified for the CollectionView, backgroundColor[0] is drawn anywhere the backgroundView's content allows it to show through.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, strong) NSView *backgroundView API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* When YES, the CollectionView's backgroundView (if any) will match the CollectionView's frame and scroll with the CollectionView's items and other content.  When NO (the default, compatible with the behavior on OS X 10.11), the backgroundView is made to fill the CollectionView's visible area, and remains stationary when the CollectionView's content is scrolled.  Archived with the CollectionView's other persistent properties.
 | 
			
		||||
*/
 | 
			
		||||
@property BOOL backgroundViewScrollsWithContent API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Layout ***
 | 
			
		||||
 | 
			
		||||
/* The layout object that determines how the NSCollectionView's items will be sized and positioned.  Defaults to an instance of NSCollectionViewGridLayout whose maxNumberOfRows, maxNumberOfColumns, minItemSize, maxItemSize, and backgroundColors properties mirror the NSCollectionView's.  Replace this object, or change the values of its parameters, to change the layout.  collectionViewLayout may be set to nil for an NSCollectionView that is not using the dataSource-based API.
 | 
			
		||||
 | 
			
		||||
To get an animated transition to the new layout, use [[collectionView animator] setCollectionViewLayout:].  You can use NSAnimationContext's completionHandler provisions to notify you when the transition is complete.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, strong) __kindof NSCollectionViewLayout *collectionViewLayout API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Returns the layout information for the item at the specified index path (or nil if no such item exists).  Use this method to retrieve the layout information for a particular item.  You should always use this method instead of querying the layout object directly.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSCollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Returns the layout information for the specified supplementary view.
 | 
			
		||||
 | 
			
		||||
Use this method to retrieve the layout information for a particular supplementary view. You should always use this method instead of querying the layout object directly.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSCollectionViewLayoutAttributes *)layoutAttributesForSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)kind atIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Returns the frame calculated by the receiver where it intends to place the subview for the NSCollectionViewItem at the given index. You can use this method in the draggingImage methods to determine which views are in the visible portion of the enclosing scroll view. Overriding this method will have no effect on the receiver's subview layout. For apps that target OS X 10.11 and later, you may want to use -layoutAttributesForItemAtIndexPath: instead, which provides more than just the item's frame. This method raises an exception if invoked for a CollectionView that has more than one section. Use -layoutAttributesForItemAtIndexPath: instead.
 | 
			
		||||
*/
 | 
			
		||||
- (NSRect)frameForItemAtIndex:(NSUInteger)index API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Returns the frame calculated by the receiver where it would place a subview for an NSCollectionViewItem at the given index in a collection with the given number of items. You should use this method when updating NSDraggingItem frames when your collection is a drag destination. You should not use -frameForItemAtIndex:, since a drag and drop operation may change the number of items in the collection, which affects the layout of the item views. This method raises an exception if invoked for a CollectionView that has more than one section. Use -layoutAttributesForItemAtIndexPath: instead.
 | 
			
		||||
*/
 | 
			
		||||
- (NSRect)frameForItemAtIndex:(NSUInteger)index withNumberOfItems:(NSUInteger)numberOfItems API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* The first background color in the array is used as the background of the entire collection view. Passing nil resets the background colors back to the default.
 | 
			
		||||
*/
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSColor *> *backgroundColors;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Section and Item Counts ***
 | 
			
		||||
 | 
			
		||||
/* The number of sections displayed by the collection view.
 | 
			
		||||
*/
 | 
			
		||||
@property(readonly) NSInteger numberOfSections API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Returns the number of items in the specified "section".
 | 
			
		||||
*/
 | 
			
		||||
- (NSInteger)numberOfItemsInSection:(NSInteger)section API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Selection State ***
 | 
			
		||||
 | 
			
		||||
/* Whether the CollectionView is its window's current firstResponder.  This bindable property is useful for determining appropriate appearance for selected items.
 | 
			
		||||
 */
 | 
			
		||||
@property (getter=isFirstResponder, readonly) BOOL firstResponder;
 | 
			
		||||
 | 
			
		||||
/* Whether the user can select items in the CollectionView.  Defaults to NO.  Changing this from YES to NO clears the CollectionView's current selection (if any), causing selectionIndexes to become an empty index set.
 | 
			
		||||
 */
 | 
			
		||||
@property (getter=isSelectable) BOOL selectable;
 | 
			
		||||
 | 
			
		||||
/* Whether the CollectionView allows its selection to become empty.  Defaults to YES.  When this is set to NO and "selectable" is YES, the CollectionView will attempt to always leave at least one item selected, when the CollectionView has at least one item.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL allowsEmptySelection API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Whether the user can simultaneously select multiple items in the CollectionView.  Defaults to NO, which means only one item at a time (or none) may be selected.  Changing this from YES to NO causes the CollectionView's selection to be reduced to the selected item with the lowest index in the section with the lowest index, if more than one item was selected.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL allowsMultipleSelection;
 | 
			
		||||
 | 
			
		||||
/* (Soft-Deprecated)  The indexes of the items that are currently "selected", indicating that user operations should target the "content" objects having these indexes.  Getting or setting this property raises an exception on 10.11 and later, if the CollectionView has more than one section.  Use "selectionIndexPaths" instead.
 | 
			
		||||
 */
 | 
			
		||||
@property (copy) NSIndexSet *selectionIndexes;
 | 
			
		||||
 | 
			
		||||
/* A set of of NSIndexPath values, that identify the currently selected items by (section,indexInSection).  When using the new NSCollectionView APIs on 10.11 and later, use this property instead of "selectionIndexes".  You can change the set of selected items by setting this property.  To request an animated transition of affected items between their selected and deselected appearances, you can set this property via the CollectionView's "animator" proxy: [[collectionView animator] setSelectionIndexPaths:newIndexPaths].  CollectionView will raise an exception if any of the given indexPaths is out-of-bounds.  This property is Key-Value Observable.
 | 
			
		||||
 */
 | 
			
		||||
@property (copy) NSSet<NSIndexPath *> *selectionIndexPaths API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Adds the specified items to the selection, and optionally scrolls their bounding box into view according to the value of "scrollPosition".  This method does not cause any selection-related delegate methods to be invoked.
 | 
			
		||||
 
 | 
			
		||||
 To animate the scroll (if any) and the view property changes that indicate selected state, use [[collectionView animator] selectItemsAtIndexPaths:scrollPosition:].
 | 
			
		||||
 */
 | 
			
		||||
- (void)selectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths scrollPosition:(NSCollectionViewScrollPosition)scrollPosition API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Removes the specified items from the selection, potentially in an animated way.  This method does not cause any selection-related delegate methods to be invoked.
 | 
			
		||||
 
 | 
			
		||||
 To animate the view property changes that indicate deselected state, use [[collectionView animator] deselectItemsAtIndexPaths:].
 | 
			
		||||
 */
 | 
			
		||||
- (void)deselectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Selects all of the CollectionView's items, if and only if it is "selectable" and it "allowsMultipleSelection", and notifies the CollectionView's delegate about any newly selected items.  If either "selectable" or "allowsMultipleSelection" is NO, this action silently does nothing (and its associated user interface item does not validate).
 | 
			
		||||
 */
 | 
			
		||||
- (IBAction)selectAll:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
/* Clears the CollectionView's selection (if any), if and only if it is "selectable", and notifies the CollectionView's delegate about any newly deselected items.  If "selectable" is NO, this action silently does nothing (and its associated user interface item does not validate).
 | 
			
		||||
 */
 | 
			
		||||
- (IBAction)deselectAll:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* For each item identifier that the collection view will use, register either a nib or class from which to instantiate an item, or provide a nib file or class whose name matches the identifier you plan to use.  If a nib is registered, it must contain exactly one top-level NSCollectionViewItem.  If a class is registered instead of a nib, it will be instantiated via alloc/init.
 | 
			
		||||
 */
 | 
			
		||||
- (void)registerClass:(nullable Class)itemClass forItemWithIdentifier:(NSUserInterfaceItemIdentifier)identifier API_AVAILABLE(macos(10.11));
 | 
			
		||||
- (void)registerNib:(nullable NSNib *)nib forItemWithIdentifier:(NSUserInterfaceItemIdentifier)identifier API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* For each supplementary view identifier that the collection view will use, register either a nib or class from which to instantiate a view, or provide a nib file or class whose name matches the identifier you plan to use.  If a nib is registered, it must contain exactly one top-level view, that conforms to the NSCollectionViewElement protocol.  If a class is registered instead of a nib, it will be instantiated via alloc/initWithFrame:.
 | 
			
		||||
 */
 | 
			
		||||
- (void)registerClass:(nullable Class)viewClass forSupplementaryViewOfKind:(NSCollectionViewSupplementaryElementKind)kind withIdentifier:(NSUserInterfaceItemIdentifier)identifier API_AVAILABLE(macos(10.11));
 | 
			
		||||
- (void)registerNib:(nullable NSNib *)nib forSupplementaryViewOfKind:(NSCollectionViewSupplementaryElementKind)kind withIdentifier:(NSUserInterfaceItemIdentifier)identifier API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Call this method from your data source object when asked to provide a new item for the collection view.  This method dequeues an existing item if one is available or creates a new one based on the nib file or class you previously registered.  If you have not registered a nib file or class for the given identifier, CollectionView will try to load a nib file named identifier.nib, or (failing that) find and instantiate an NSCollectionViewItem subclass named "identifier".
 | 
			
		||||
 
 | 
			
		||||
 If a new item must be created from a class, this method initializes the item by invoking its -init method.  For nib-based items, this method loads the item from the provided nib file.  If an existing item was available for reuse, this method invokes the item's -prepareForReuse method instead.
 | 
			
		||||
 */
 | 
			
		||||
- (__kindof NSCollectionViewItem *)makeItemWithIdentifier:(NSUserInterfaceItemIdentifier)identifier forIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Call this method from your data source object when asked to provide a new supplementary view for the collection view.  This method dequeues an existing view if one is available or creates a new one based on the nib file or class you previously registered.  If you have not registered a nib file or class for the given identifier, CollectionView will try to load a nib file named identifier.nib, or (failing that) find and instantiate an NSView subclass named "identifier".
 | 
			
		||||
 
 | 
			
		||||
 If a new view must be created from a class, this method initializes the view by invoking its -initWithFrame: method. For nib-based views, this method loads the view from the provided nib file.  If an existing view was available for reuse, this method invokes the view's -prepareForReuse method instead.
 | 
			
		||||
 */
 | 
			
		||||
- (__kindof NSView *)makeSupplementaryViewOfKind:(NSCollectionViewSupplementaryElementKind)elementKind withIdentifier:(NSUserInterfaceItemIdentifier)identifier forIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Finding Items ***
 | 
			
		||||
 | 
			
		||||
/* (Soft-Deprecated)  Returns the NSCollectionViewItem associated with the represented object at the given index.  Sending this to a CollectionView that has more than one section raises an exception.  Use -itemAtIndexPath: instead.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSCollectionViewItem *)itemAtIndex:(NSUInteger)index API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Returns the NSCollectionViewItem (if any) associated with the represented object at the given indexPath.  This method returns nil if the CollectionView isn't currently maintaining an NSCollectionViewItem instance for the given indexPath, as may be the case if the specified item is outside the CollectionView's visibleRect.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSCollectionViewItem *)itemAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Returns the NSCollectionViewItems that the CollectionView has instantiated and is managing as currently active. Each such item is associated with an item indexPath, and its view is part of the currently displayed view hierarchy. Note that this list may include items whose views fall outside the CollectionView's current visibleRect (for example, recently visible items that have been scrolled out of view, or items that the CollectionView anticipates may soon be visible). To determine which of these items may actually be visible to the user, test each item.view.frame for intersection with the CollectionView's visibleRect.
 | 
			
		||||
*/
 | 
			
		||||
- (NSArray<NSCollectionViewItem *> *)visibleItems API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Returns the index paths of the items that are currently displayed by the CollectionView. Note that these indexPaths correspond to the same items as "visibleItems", and thus may include items whose views fall outside the CollectionView's current "visibleRect".
 | 
			
		||||
*/
 | 
			
		||||
- (NSSet<NSIndexPath *> *)indexPathsForVisibleItems API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Returns the index path of the specified item (or nil if the specified item is not in the collection view).
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSIndexPath *)indexPathForItem:(NSCollectionViewItem *)item API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Returns the index path of the item at the specified point in the collection view.
 | 
			
		||||
 
 | 
			
		||||
 This method relies on the layout information provided by the associated layout object to determine which item contains the point.  It does not take opacity of the item's displayed content at that point into account.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSIndexPath *)indexPathForItemAtPoint:(NSPoint)point API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Finding Supplementary Views ***
 | 
			
		||||
 | 
			
		||||
/* Returns the supplementary view (if any) of the given elementKind that's associated with the given indexPath.  Returns nil if no such supplementary view is currently instantiated.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSView<NSCollectionViewElement> *)supplementaryViewForElementKind:(NSCollectionViewSupplementaryElementKind)elementKind atIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Returns the supplementary views that the CollectionView has instantiated and is managing as currently active.  Each such supplementary view is associated with an indexPath, and is part of the currently displayed view hierarchy.  Note that this list may include supplementary views that fall outside the CollectionView's current visibleRect (for example, recently visible section header or footer views that have been scrolled out of view, or section header or footer views that the CollectionView anticipates may soon be visible). To determine which of these views may actually be visible to the user, test each view.frame for intersection with the CollectionView's visibleRect.
 | 
			
		||||
 */
 | 
			
		||||
- (NSArray<NSView<NSCollectionViewElement> *> *)visibleSupplementaryViewsOfKind:(NSCollectionViewSupplementaryElementKind)elementKind API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Returns the index paths of the supplementary views of the given elementKind that are currently displayed by the CollectionView.  Note that these indexPaths correspond to the same supplementary views that "visibleSupplementaryViewsOfKind:" reports, and thus may include supplementary views that fall outside the CollectionView's current "visibleRect".
 | 
			
		||||
 */
 | 
			
		||||
- (NSSet<NSIndexPath *> *)indexPathsForVisibleSupplementaryElementsOfKind:(NSCollectionViewSupplementaryElementKind)elementKind API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Modifying Items and Sections ***
 | 
			
		||||
 | 
			
		||||
/* Use the following methods to communicate imminent model changes to a dataSource-based CollectionView.  Their function is similar to that of NSOutlineView's insert/move/remove methods.
 | 
			
		||||
 | 
			
		||||
When invoking any of these methods, you can request an animated instead of immediate layout update by messaging the CollectionView's animator.  For example: [[collectionView animator] insertItemsAtIndexPaths:indexPaths]
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* Use this method to insert one or more sections into the collection view. This method adds the sections, and it is up to your data source to report the number of items in each section when asked for the information. The collection view then uses that information to get updated layout attributes for the newly inserted sections and items. If the insertions cause a change in the collection view’s visible content, those changes are animated into place.
 | 
			
		||||
 | 
			
		||||
You can also call this method from a block passed to the performBatchUpdates:completionHandler: method when you want to animate multiple separate changes into place at the same time. See the description of that method for more information.
 | 
			
		||||
 | 
			
		||||
Raises an exception if "sections" is nil.
 | 
			
		||||
*/
 | 
			
		||||
- (void)insertSections:(NSIndexSet *)sections API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Use this method to remove the sections and their items from the collection view. You might do this when you remove the sections from your data source object or in response to user interactions with the collection view. The collection view updates the layout of the remaining sections and items to account for the deletions, animating the remaining items into position as needed.
 | 
			
		||||
 | 
			
		||||
You can also call this method from a block passed to the performBatchUpdates:completionHandler: method when you want to animate multiple separate changes into place at the same time. See the description of that method for more information.
 | 
			
		||||
 | 
			
		||||
Raises an exception if "sections" is nil.
 | 
			
		||||
*/
 | 
			
		||||
- (void)deleteSections:(NSIndexSet *)sections API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Call this method to selectively reload only the objects in the specified sections. This causes the collection view to discard any items associated with those objects and redisplay them.
 | 
			
		||||
 | 
			
		||||
Raises an exception if "sections" is nil.
 | 
			
		||||
*/
 | 
			
		||||
- (void)reloadSections:(NSIndexSet *)sections API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Use this method to reorganize existing sections and their contained items. You might do this when you rearrange sections within your data source object or in response to user interactions with the collection view. The collection view updates the layout as needed to account for the move, animating new views into position as needed.
 | 
			
		||||
 | 
			
		||||
You can also call this method from a block passed to the performBatchUpdates:completionHandler: method when you want to animate multiple separate changes into place at the same time. See the description of that method for more information.
 | 
			
		||||
*/
 | 
			
		||||
- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Call this method to insert one or more new items into the collection view. You might do this when your data source object receives data for new items or in response to user interactions with the collection view. The collection view gets the layout information for the new items as part of calling this method. And if the layout information indicates that the items should appear onscreen, the collection view asks your data source to provide the appropriate views, animating them into position as needed.
 | 
			
		||||
 | 
			
		||||
You can also call this method from a block passed to the performBatchUpdates:completionHandler: method when you want to animate multiple separate changes into place at the same time. See the description of that method for more information.
 | 
			
		||||
 | 
			
		||||
Raises an exception if "indexPaths" is nil.
 | 
			
		||||
*/
 | 
			
		||||
- (void)insertItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Use this method to remove items from the collection view. You might do this when you remove the represented objects from your data source object or in response to user interactions with the collection view. The collection view updates the layout of the remaining items to account for the deletions, animating the remaining items into position as needed.
 | 
			
		||||
 | 
			
		||||
You can also call this method from a block passed to the performBatchUpdates:completionHandler: method when you want to animate multiple separate changes into place at the same time. See the description of that method for more information.
 | 
			
		||||
 | 
			
		||||
Raises an exception if "indexPaths" is nil.
 | 
			
		||||
*/
 | 
			
		||||
- (void)deleteItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Call this method to selectively reload only the specified objects. This causes the collection view to discard any items associated with those objects and redisplay them.
 | 
			
		||||
 | 
			
		||||
Raises an exception if "indexPaths" is nil.
 | 
			
		||||
*/
 | 
			
		||||
- (void)reloadItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Use this method to reorganize existing data items. You might do this when you rearrange the represented objects within your data source object or in response to user interactions with the collection view. You can move items between sections or within the same section. The collection view updates the layout as needed to account for the move, animating items into position as needed.
 | 
			
		||||
 | 
			
		||||
You can also call this method from a block passed to the performBatchUpdates:completionHandler: method when you want to animate multiple separate changes into place at the same time. See the description of that method for more information.
 | 
			
		||||
 | 
			
		||||
Raises an exception if "indexPath" or "newIndexPath" is nil.
 | 
			
		||||
*/
 | 
			
		||||
- (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Animates multiple insert, delete, reload, and move operations as a group.
 | 
			
		||||
 | 
			
		||||
You can use this method in cases where you want to make multiple changes to the collection view in one single animated operation, as opposed to in several separate animations. You might use this method to insert, delete, reload or move items or use it to change the layout parameters associated with one or more items. Use the block passed in the "updates" parameter to specify all of the operations you want to perform.
 | 
			
		||||
 | 
			
		||||
Deletes are processed before inserts in batch operations. This means the indexes for the insertions are processed relative to the indexes of the state before the batch operation, and the indexes for the deletions are processed relative to the indexes of the state after all the insertions in the batch operation.
 | 
			
		||||
 | 
			
		||||
Invocations of this method can be nested.
 | 
			
		||||
*/
 | 
			
		||||
- (void)performBatchUpdates:(void (NS_NOESCAPE ^_Nullable)(void))updates completionHandler:(void (^_Nullable)(BOOL finished))completionHandler API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Section Collapse ***
 | 
			
		||||
 | 
			
		||||
/* Toggles collapse of the CollectionView section that the sender resides in.  Typically you'll wire this action from a section header view's "sectionCollapse" button.  (See the NSCollectionViewSectionHeaderView protocol.)
 | 
			
		||||
 */
 | 
			
		||||
- (IBAction)toggleSectionCollapse:(id)sender API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Scrolling ***
 | 
			
		||||
 | 
			
		||||
/* Scrolls the collection view contents until the bounding box of the specified items is visible.  The final position of that bounding box within the scrollable area is determined by "scrollPosition".
 | 
			
		||||
 | 
			
		||||
To request an animated scroll, use [[collectionView animator] scrollToItemsAtIndexPaths:scrollPosition:].  You can use NSAnimationContext's completionHandler provisions to notify you when the animated scroll has finished.
 | 
			
		||||
*/
 | 
			
		||||
- (void)scrollToItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths scrollPosition:(NSCollectionViewScrollPosition)scrollPosition API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Drag and Drop ***
 | 
			
		||||
 | 
			
		||||
/* Configures the value returned from -draggingSourceOperationMaskForLocal:. An isLocal value of YES indicates that 'dragOperationMask' applies when the destination object is in the same application. By default, NSDragOperationEvery will be returned. An isLocal value of NO indicates that 'dragOperationMask' applies when the destination object is in an application outside the receiver's application. By default, NSDragOperationNone is returned. NSCollectionView will save the values you set for each isLocal setting. You typically will invoke this method, and not override it.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setDraggingSourceOperationMask:(NSDragOperation)dragOperationMask forLocal:(BOOL)localDestination API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* This method computes and returns an image to use for dragging. You can override this to return a custom drag image, or call it from the delegate method to get the default drag image. 'indexPaths' contains the NSIndexPaths of the items being dragged. 'event' is a reference to the mouse down event that began the drag. 'dragImageOffset' is an in/out parameter. This method will be called with dragImageOffset set to NSZeroPoint, but it can be modified to re-position the returned image. A dragImageOffset of NSZeroPoint will cause the image to be centered under the mouse. By default, an image will be created that contains a rendering of the visible portions of the views for each item. If the delegate implements the equivalent delegate method, it will be preferred over this method.
 | 
			
		||||
*/
 | 
			
		||||
- (NSImage *)draggingImageForItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Old Form (Single Section Only) */
 | 
			
		||||
/* This is an older variant of -draggingImageForItemsAtIndexPaths:withEvent:offset:.  It assumes all of the indexes are in section 0.  New code should use -draggingImageForItemsAtIndexPaths:withEvent:offset: instead.
 | 
			
		||||
*/
 | 
			
		||||
- (NSImage *)draggingImageForItemsAtIndexes:(NSIndexSet *)indexes withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@protocol NSCollectionViewDataSource <NSObject>
 | 
			
		||||
@required
 | 
			
		||||
 | 
			
		||||
/* Asks the data source for the number of items in the specified section.
 | 
			
		||||
 */
 | 
			
		||||
- (NSInteger)collectionView:(NSCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Asks the data source to provide an NSCollectionViewItem for the specified represented object.
 | 
			
		||||
 | 
			
		||||
Your implementation of this method is responsible for creating, configuring, and returning the appropriate item for the given represented object.  You do this by sending -makeItemWithIdentifier:forIndexPath: method to the collection view and passing the identifier that corresponds to the item type you want.  Upon receiving the item, you should set any properties that correspond to the data of the corresponding model object, perform any additional needed configuration, and return the item.
 | 
			
		||||
 | 
			
		||||
You do not need to set the location of the item's view inside the collection view’s bounds. The collection view sets the location of each item automatically using the layout attributes provided by its layout object.
 | 
			
		||||
 | 
			
		||||
This method must always return a valid item instance.
 | 
			
		||||
*/
 | 
			
		||||
- (NSCollectionViewItem *)collectionView:(NSCollectionView *)collectionView itemForRepresentedObjectAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
/* Asks the data source for the number of sections in the collection view.
 | 
			
		||||
 | 
			
		||||
If you do not implement this method, the collection view assumes it has only one section.
 | 
			
		||||
*/
 | 
			
		||||
- (NSInteger)numberOfSectionsInCollectionView:(NSCollectionView *)collectionView API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Asks the data source to provide a view for the specified supplementary element.
 | 
			
		||||
 | 
			
		||||
Your implementation of this method is responsible for creating, configuring, and returning an appropriate view.  You do this by sending -makeSupplementaryViewOfKind:withIdentifier:forIndexPath: to the collection view and passing the identifier that corresponds to the supplementary view type you want.  Upon receiving the view, you should set any desired appearance properties, perform any additional needed configuration, and return the item.
 | 
			
		||||
 | 
			
		||||
You do not need to set the location of the view inside the collection view’s bounds. The collection view sets the location of each supplementary view automatically using the layout attributes provided by its layout object.
 | 
			
		||||
 | 
			
		||||
This method must always return a valid view.
 | 
			
		||||
*/
 | 
			
		||||
- (NSView *)collectionView:(NSCollectionView *)collectionView viewForSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)kind atIndexPath:(NSIndexPath *)indexPath;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@protocol NSCollectionViewPrefetching <NSObject>
 | 
			
		||||
 | 
			
		||||
@required
 | 
			
		||||
 | 
			
		||||
/* Notifies your 'prefetchDataSource' that items at the specified 'indexPaths' are likely to be instantiated and displayed soon.  The CollectionView sends this as early as possible, to give your 'prefetchDataSource' the opportunity to begin acquiring any resources such as thumbnail images or metadata that you might need in order to prepare the item's content for display.  The given 'indexPaths' are sorted by the order in which they are likely to be needed.
 | 
			
		||||
*/
 | 
			
		||||
- (void)collectionView:(NSCollectionView *)collectionView prefetchItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;
 | 
			
		||||
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
/* Notifies your 'prefetchDataSource' that items at the specified 'indexPaths', for which the CollectionView previously sent -collectionView:prefetchItemsAtIndexPaths:, are no longer expected to be displayed.  This is a good opportunity to cancel any pending resource fetches you've initiated for the items, if possible and worthwhile.  This is only sent for items that don't end up being displayed; CollectionView doesn't cancel prefetching for items that it actually instantiates and shows.
 | 
			
		||||
*/
 | 
			
		||||
- (void)collectionView:(NSCollectionView *)collectionView cancelPrefetchingForItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@protocol NSCollectionViewDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
/* Drag and drop support */
 | 
			
		||||
 | 
			
		||||
/* To enable dealing with (section,item) NSIndexPaths now that NSCollectionView supports sections, many of the drag-and-drop delegate methods have been replaced with new versions that take NSIndexPath and array-of-NSIndexPath parameters.  In each such case, NSCollectionView will look for and invoke the newer method first.  If the delegate doesn't respond to the newer version, NSCollectionView will look for the old method, provided that the NSCollectionView has only a single section.  The old methods will not be invoked for a multi-section NSCollectionView.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* The return value indicates whether the collection view can attempt to initiate a drag for the given event and items. If the delegate does not implement this method, the collection view will act as if it returned YES.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)collectionView:(NSCollectionView *)collectionView canDragItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths withEvent:(NSEvent *)event API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Old Form (Single Section Only) */
 | 
			
		||||
- (BOOL)collectionView:(NSCollectionView *)collectionView canDragItemsAtIndexes:(NSIndexSet *)indexes withEvent:(NSEvent *)event API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* This method is called after it has been determined that a drag should begin, but before the drag has been started. To refuse the drag, return NO. To start the drag, declare the pasteboard types that you support with -[NSPasteboard declareTypes:owner:], place your data for the items at the given index paths on the pasteboard, and return YES from the method. The drag image and other drag related information will be set up and provided by the view once this call returns YES. You need to implement this method, or -collectionView:pasteboardWriterForItemAtIndexPath: (its more modern counterpart), for your collection view to be a drag source.  If you want to put file promises on the pasteboard, using the modern NSFilePromiseProvider API added in macOS 10.12, implement -collectionView:pasteboardWriterForItemAtIndexPath: instead of this method, and have it return an NSFilePromiseProvider.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)collectionView:(NSCollectionView *)collectionView writeItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths toPasteboard:(NSPasteboard *)pasteboard API_DEPRECATED("Use -collectionView:pasteboardWriterForItemAtIndexPath: instead", macos(10.11, 10.15));
 | 
			
		||||
 | 
			
		||||
/* Old Form (Single Section Only) */
 | 
			
		||||
- (BOOL)collectionView:(NSCollectionView *)collectionView writeItemsAtIndexes:(NSIndexSet *)indexes toPasteboard:(NSPasteboard *)pasteboard API_DEPRECATED("Use -collectionView:pasteboardWriterForItemAtIndexPath: instead", macos(10.6, 10.15));
 | 
			
		||||
 | 
			
		||||
/* This is a legacy method for file promise dragging, that's invoked when the delegate has placed NSFilesPromisePboardType data on the dragging pasteboard (typically in -collectionView:writeItemsAtIndexPaths:toPasteboard:). When using file promises and targeting macOS 10.12 and later, you should instead implement -collectionView:pasteboardWriterForItemAtIndexPath: to return a fully configured NSFilePromiseProvider, whose delegate provides the file name resolution functionality that was previously delegated to this method.
 | 
			
		||||
 | 
			
		||||
 NSCollectionView implements -namesOfPromisedFilesDroppedAtDestination: to return the results of this delegate method. This method should return an array of filenames (not full paths) for the created files. `dropURL` specifies the drop location. You do not need to implement this method for your collection view to be a drag source.
 | 
			
		||||
 */
 | 
			
		||||
- (NSArray<NSString *> *)collectionView:(NSCollectionView *)collectionView namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropURL forDraggedItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_DEPRECATED("Use NSFilePromiseReceiver objects instead", macos(10.11,10.13));
 | 
			
		||||
 | 
			
		||||
/* Old Form (Single Section Only) */
 | 
			
		||||
- (NSArray<NSString *> *)collectionView:(NSCollectionView *)collectionView namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropURL forDraggedItemsAtIndexes:(NSIndexSet *)indexes API_DEPRECATED("Use NSFilePromiseReceiver objects instead", macos(10.6,10.13));
 | 
			
		||||
 | 
			
		||||
/* Allows the delegate to construct a custom dragging image for the items being dragged. 'indexPaths' contains the (section,item) identification of the items being dragged. 'event' is a reference to the  mouse down event that began the drag. 'dragImageOffset' is an in/out parameter. This method will be called with dragImageOffset set to NSZeroPoint, but it can be modified to re-position the returned image. A dragImageOffset of NSZeroPoint will cause the image to be centered under the mouse. You can safely call -[NSCollectionView draggingImageForItemsAtIndexPaths:withEvent:offset:] from within this method. You do not need to implement this method for your collection view to be a drag source.
 | 
			
		||||
*/
 | 
			
		||||
- (NSImage *)collectionView:(NSCollectionView *)collectionView draggingImageForItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Old Form (Single Section Only) */
 | 
			
		||||
- (NSImage *)collectionView:(NSCollectionView *)collectionView draggingImageForItemsAtIndexes:(NSIndexSet *)indexes withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* This method is used by the collection view to determine a valid drop target. Based on the mouse position, the collection view will suggest a proposed (section,item) index path and drop operation. These values are in/out parameters and can be changed by the delegate to retarget the drop operation. The collection view will propose NSCollectionViewDropOn when the dragging location is closer to the middle of the item than either of its edges. Otherwise, it will propose NSCollectionViewDropBefore. You may override this default behavior by changing proposedDropOperation or proposedDropIndexPath. This method must return a value that indicates which dragging operation the data source will perform. It must return something other than NSDragOperationNone to accept the drop.
 | 
			
		||||
 | 
			
		||||
Note: to receive drag messages, you must first send -registerForDraggedTypes: to the collection view with the drag types you want to support (typically this is done in -awakeFromNib). You must implement this method for your collection view to be a drag destination.
 | 
			
		||||
 | 
			
		||||
Multi-image drag and drop: You can set draggingFormation, animatesToDestination, numberOfValidItemsForDrop within this method.
 | 
			
		||||
*/
 | 
			
		||||
- (NSDragOperation)collectionView:(NSCollectionView *)collectionView validateDrop:(id <NSDraggingInfo>)draggingInfo proposedIndexPath:(NSIndexPath * _Nonnull * _Nonnull)proposedDropIndexPath dropOperation:(NSCollectionViewDropOperation *)proposedDropOperation API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Old Form (Single Section Only) */
 | 
			
		||||
- (NSDragOperation)collectionView:(NSCollectionView *)collectionView validateDrop:(id <NSDraggingInfo>)draggingInfo proposedIndex:(NSInteger *)proposedDropIndex dropOperation:(NSCollectionViewDropOperation *)proposedDropOperation API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* This method is called when the mouse is released over a collection view that previously decided to allow a drop via the above validateDrop method. At this time, the delegate should incorporate the data from the dragging pasteboard and update the collection view's contents. You must implement this method for your collection view to be a drag destination.
 | 
			
		||||
 | 
			
		||||
Multi-image drag and drop: If draggingInfo.animatesToDestination is set to YES, you should enumerate and update the dragging items with the proper image components and frames so that they dragged images animate to the proper locations.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)collectionView:(NSCollectionView *)collectionView acceptDrop:(id <NSDraggingInfo>)draggingInfo indexPath:(NSIndexPath *)indexPath dropOperation:(NSCollectionViewDropOperation)dropOperation API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Old Form (Single Section Only) */
 | 
			
		||||
- (BOOL)collectionView:(NSCollectionView *)collectionView acceptDrop:(id <NSDraggingInfo>)draggingInfo index:(NSInteger)index dropOperation:(NSCollectionViewDropOperation)dropOperation API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Multi-image drag and drop */
 | 
			
		||||
 | 
			
		||||
/* Dragging Source Support - Required for multi-image drag and drop. Return a custom object that implements NSPasteboardWriting (or simply use NSPasteboardItem), or nil to prevent dragging for the item. For each valid item returned, NSCollectionView will create an NSDraggingItem with the draggingFrame equal to the frame of the item view at the given index path and components from -[NSCollectionViewItem draggingItem]. If this method is implemented, then -collectionView:writeItemsAtIndexPaths:toPasteboard: and -collectionView:draggingImageForItemsAtIndexPaths:withEvent:offset: will not be called.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable id <NSPasteboardWriting>)collectionView:(NSCollectionView *)collectionView pasteboardWriterForItemAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Old Form (Single Section Only) */
 | 
			
		||||
- (nullable id <NSPasteboardWriting>)collectionView:(NSCollectionView *)collectionView pasteboardWriterForItemAtIndex:(NSUInteger)index;
 | 
			
		||||
 | 
			
		||||
/* Dragging Source Support - Optional. Implement this method to know when the dragging session is about to begin and to potentially modify the dragging session.
 | 
			
		||||
*/
 | 
			
		||||
- (void)collectionView:(NSCollectionView *)collectionView draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint forItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Old Form (Single Section Only) */
 | 
			
		||||
- (void)collectionView:(NSCollectionView *)collectionView draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint forItemsAtIndexes:(NSIndexSet *)indexes;
 | 
			
		||||
 | 
			
		||||
/* Dragging Source Support - Optional. Implement this method to know when the dragging session has ended. This delegate method can be used to know when the dragging source operation ended at a specific location, such as the trash (by checking for an operation of NSDragOperationDelete).
 | 
			
		||||
*/
 | 
			
		||||
- (void)collectionView:(NSCollectionView *)collectionView draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint dragOperation:(NSDragOperation)operation;
 | 
			
		||||
 | 
			
		||||
/* Dragging Destination Support - Required for multi-image drag and drop. Implement this method to update dragging items as they are dragged over the view. Typically this will involve calling [draggingInfo enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:] and setting the draggingItem's imageComponentsProvider to a proper image based on the NSDraggingItem's -item value.
 | 
			
		||||
*/
 | 
			
		||||
- (void)collectionView:(NSCollectionView *)collectionView updateDraggingItemsForDrag:(id <NSDraggingInfo>)draggingInfo;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Selection and Highlighting ***
 | 
			
		||||
 | 
			
		||||
/* Sent during interactive selection or dragging, to inform the delegate that the CollectionView would like to change the "highlightState" property of the items at the specified "indexPaths" to the specified "highlightState".  In addition to optionally reacting to the proposed change, you can approve it (by returning "indexPaths" as-is), or selectively refuse some or all of the proposed highlightState changes (by returning a modified autoreleased mutableCopy of indexPaths, or an empty indexPaths instance).  Refusing a proposed highlightState change for an item will suppress the associated action for that item (selection change or eligibility to be a drop target).
 | 
			
		||||
*/
 | 
			
		||||
- (NSSet<NSIndexPath *> *)collectionView:(NSCollectionView *)collectionView shouldChangeItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths toHighlightState:(NSCollectionViewItemHighlightState)highlightState API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Sent during interactive selection or dragging, to inform the delegate that the CollectionView has changed the "highlightState" property of the items at the specified "indexPaths" to the specified "highlightState". */
 | 
			
		||||
- (void)collectionView:(NSCollectionView *)collectionView didChangeItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths toHighlightState:(NSCollectionViewItemHighlightState)highlightState API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Sent during interactive selection, to inform the delegate that the CollectionView would like to select the items at the specified "indexPaths".  In addition to optionally reacting to the proposed change, you can approve it (by returning "indexPaths" as-is), or selectively refuse some or all of the proposed selection changes (by returning a modified autoreleased mutableCopy of indexPaths, or an empty indexPaths instance).
 | 
			
		||||
*/
 | 
			
		||||
- (NSSet<NSIndexPath *> *)collectionView:(NSCollectionView *)collectionView shouldSelectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Sent during interactive selection, to inform the delegate that the CollectionView would like to de-select the items at the specified "indexPaths".  In addition to optionally reacting to the proposed change, you can approve it (by returning "indexPaths" as-is), or selectively refuse some or all of the proposed selection changes (by returning a modified autoreleased mutableCopy of indexPaths, or an empty indexPaths instance). */
 | 
			
		||||
- (NSSet<NSIndexPath *> *)collectionView:(NSCollectionView *)collectionView shouldDeselectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Sent at the end of interactive selection, to inform the delegate that the CollectionView has selected the items at the specified "indexPaths".
 | 
			
		||||
*/
 | 
			
		||||
- (void)collectionView:(NSCollectionView *)collectionView didSelectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Sent at the end of interactive selection, to inform the delegate that the CollectionView has de-selected the items at the specified "indexPaths".
 | 
			
		||||
*/
 | 
			
		||||
- (void)collectionView:(NSCollectionView *)collectionView didDeselectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Display Notification ***
 | 
			
		||||
 | 
			
		||||
/* Sent to notify the delegate that the CollectionView is about to add an NSCollectionViewItem.  The indexPath identifies the object that the item represents.
 | 
			
		||||
*/
 | 
			
		||||
- (void)collectionView:(NSCollectionView *)collectionView willDisplayItem:(NSCollectionViewItem *)item forRepresentedObjectAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Sent to notify the delegate that the CollectionView is about to add a supplementary view (e.g. a section header or footer view).  Each NSCollectionViewLayout class defines its own possible values and associated meanings for "elementKind".  (For example, NSCollectionViewFlowLayout declares NSCollectionElementKindSectionHeader and NSCollectionElementKindSectionFooter.)
 | 
			
		||||
*/
 | 
			
		||||
- (void)collectionView:(NSCollectionView *)collectionView willDisplaySupplementaryView:(NSView *)view forElementKind:(NSCollectionViewSupplementaryElementKind)elementKind atIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Sent to notify the delegate that the CollectionView is no longer displaying the given NSCollectionViewItem instance.  This happens when the model changes, or when an item is scrolled out of view.  You should perform any actions necessary to help decommission the item (such as releasing expensive resources).  The CollectionView may retain the item instance and later reuse it to represent the same or a different model object.
 | 
			
		||||
*/
 | 
			
		||||
- (void)collectionView:(NSCollectionView *)collectionView didEndDisplayingItem:(NSCollectionViewItem *)item forRepresentedObjectAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Sent to notify the delegate that the CollectionView is no longer displaying the given supplementary view. This happens when the model changes, or when a supplementary view is scrolled out of view. You should perform any actions necessary to help decommission the view (such as releasing expensive resources). The CollectionView may retain the view and later reuse it. */
 | 
			
		||||
- (void)collectionView:(NSCollectionView *)collectionView didEndDisplayingSupplementaryView:(NSView *)view forElementOfKind:(NSCollectionViewSupplementaryElementKind)elementKind atIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Layout Transition Support ***
 | 
			
		||||
 | 
			
		||||
/* Sent when the CollectionView switches to a different layout, to allow the delegate to provide a custom transition if desired.
 | 
			
		||||
*/
 | 
			
		||||
- (NSCollectionViewTransitionLayout *)collectionView:(NSCollectionView *)collectionView transitionLayoutForOldLayout:(NSCollectionViewLayout *)fromLayout newLayout:(NSCollectionViewLayout *)toLayout API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
@interface NSIndexPath (NSCollectionViewAdditions)
 | 
			
		||||
 | 
			
		||||
+ (NSIndexPath *)indexPathForItem:(NSInteger)item inSection:(NSInteger)section API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSInteger item API_AVAILABLE(macos(10.11));
 | 
			
		||||
@property (readonly) NSInteger section API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
#endif // !TARGET_OS_IPHONE
 | 
			
		||||
 | 
			
		||||
@interface NSSet (NSCollectionViewAdditions)
 | 
			
		||||
 | 
			
		||||
/* Creates and returns a set that contains a single given NSIndexPath.
 | 
			
		||||
 */
 | 
			
		||||
+ (instancetype)setWithCollectionViewIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Creates and returns a set containing a uniqued collection of the NSIndexPaths contained in a given array.
 | 
			
		||||
 */
 | 
			
		||||
+ (instancetype)setWithCollectionViewIndexPaths:(NSArray<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Executes the given block for each NSIndexPath in the set.  The index paths are enumerated in the order defined by NSIndexPath's -compare: method.  For CollectionView item index paths, this means all index paths in section 0, in ascending order, followed by all index paths in section 1, and so on.  You may pass the NSEnumerationReverse option to enumerate in the reverse order.  Set *stop = YES if desired, to halt the enumeration early.  Note that the given indexPath is not guaranteed to survive return from the block invocation, so if you wish to pass it outside the block, you must make a -copy (and later -release or -autorelease, if not using ARC).
 | 
			
		||||
 */
 | 
			
		||||
- (void)enumerateIndexPathsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (NS_NOESCAPE ^)(NSIndexPath *indexPath, BOOL *stop))block API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSCollectionView (NSDeprecated)
 | 
			
		||||
 | 
			
		||||
/* Invoked by a dataSource-less NSCollectionView when it needs a new item to represent the given model "object" (which is presumed to be a member of the CollectionView's "content" array).  Instantiates and returns a non-autoreleased item whose "representedObject" has been set to point to the given "object".  NSCollectionView's implementation of this method makes a copy of the CollectionView's itemPrototype (raising an exception if itemPrototype is nil).  You can override this method to customize the returned item or its view subtree however you wish, calling up to super first to obtain it.  Or, you can replace super's implementation entirely, to instantiate whatever kind of item you wish, potentially based on the type or properties of the given model "object".  The item returned from this factory method should NOT be autoreleased.
 | 
			
		||||
 | 
			
		||||
   It is considered a programming error to send this message to an NSCollectionView that has a dataSource; an exception will be raised.  Use -makeItemWithIdentifier:forIndexPath: instead, from the dataSource's -collectionView:itemForRepresentedObjectAtIndexPath: method.
 | 
			
		||||
 */
 | 
			
		||||
- (NSCollectionViewItem *)newItemForRepresentedObject:(id)object API_DEPRECATED("Use -[NSCollectionViewDataSource collectionView:itemForRepresentedObjectAtIndexPath:] instead", macos(10.5,10.14));
 | 
			
		||||
 | 
			
		||||
/* A prototype NSCollectionViewItem that a dataSource-less NSCollectionView should clone to produce new items.  When not using a dataSource, you must either specify an itemPrototype, or override -newItemForRepresentedObject:, for the CollectionView to be able to create and display items.
 | 
			
		||||
 | 
			
		||||
   It is considered a programming error to send this message to an NSCollectionView that has a dataSource; an exception will be raised.
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, strong) NSCollectionViewItem *itemPrototype API_DEPRECATED("Use -registerNib:forItemWithIdentifier: or -registerClass:forItemWithIdentifier: instead.", macos(10.5,10.14));
 | 
			
		||||
 | 
			
		||||
/* The following properties pertain only to NSCollectionViewGridLayout.  When you set collectionViewLayout to point to an instance of this class (or a subclass), these NSCollectionView properties take on the corresponding property values of the NSCollectionViewGridLayout.  When collectionViewLayout points to any other kind of layout object, these properties remember the values they are given, but they don't affect item layout or display.  When targeting OS X 10.11 and later, it's recommended that you reference the corresponding NSCollectionViewGridLayout properties instead.
 | 
			
		||||
 */
 | 
			
		||||
@property NSUInteger maxNumberOfRows API_DEPRECATED("Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its maximumNumberOfRows instead", macos(10.5,10.14)); // default: 0, which means no limit
 | 
			
		||||
@property NSUInteger maxNumberOfColumns API_DEPRECATED("Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its maximumNumberOfColumns instead", macos(10.5,10.14)); // default: 0, which means no limit
 | 
			
		||||
@property NSSize minItemSize API_DEPRECATED("Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its minimumItemSize instead", macos(10.5,10.14)); // default: (0; 0)
 | 
			
		||||
@property NSSize maxItemSize API_DEPRECATED("Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its maximumItemSize instead", macos(10.5,10.14)); // default: (0; 0), which means no limit
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,617 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSCollectionViewCompositionalLayout.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 2019-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <TargetConditionals.h>
 | 
			
		||||
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSCollectionViewLayout.h>
 | 
			
		||||
#import <AppKit/NSCollectionViewFlowLayout.h> // for NSCollectionViewScrollDirection
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
@protocol NSCollectionLayoutEnvironment;
 | 
			
		||||
@protocol NSCollectionLayoutContainer;
 | 
			
		||||
@protocol NSCollectionLayoutVisibleItem;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSCollectionLayoutSection;
 | 
			
		||||
@class NSCollectionLayoutGroup;
 | 
			
		||||
@class NSCollectionLayoutItem;
 | 
			
		||||
@class NSCollectionLayoutSupplementaryItem;
 | 
			
		||||
@class NSCollectionLayoutBoundarySupplementaryItem;
 | 
			
		||||
@class NSCollectionLayoutDecorationItem;
 | 
			
		||||
 | 
			
		||||
@class NSCollectionLayoutSize;
 | 
			
		||||
@class NSCollectionLayoutDimension;
 | 
			
		||||
@class NSCollectionLayoutSpacing;
 | 
			
		||||
@class NSCollectionLayoutEdgeSpacing;
 | 
			
		||||
@class NSCollectionLayoutAnchor;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* These geometry type declarations are being relocated to Foundation/NSGeometry.h */
 | 
			
		||||
 | 
			
		||||
#ifndef FOUNDATION_HAS_DIRECTIONAL_GEOMETRY
 | 
			
		||||
 | 
			
		||||
/* Edge specification that should be interpreted according to the user interface layout direction.
 | 
			
		||||
 */
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSDirectionalRectEdge) {
 | 
			
		||||
    NSDirectionalRectEdgeNone       = 0,
 | 
			
		||||
    NSDirectionalRectEdgeTop        = 1 << 0,
 | 
			
		||||
    NSDirectionalRectEdgeLeading    = 1 << 1,
 | 
			
		||||
    NSDirectionalRectEdgeBottom     = 1 << 2,
 | 
			
		||||
    NSDirectionalRectEdgeTrailing   = 1 << 3,
 | 
			
		||||
    NSDirectionalRectEdgeAll        = NSDirectionalRectEdgeTop | NSDirectionalRectEdgeLeading | NSDirectionalRectEdgeBottom | NSDirectionalRectEdgeTrailing
 | 
			
		||||
} API_AVAILABLE(macos(10.15));
 | 
			
		||||
 | 
			
		||||
/* Specifies edge insets that should be interpreted according to the user interface layout direction.  Specify positive values to inset, negative values to outset.
 | 
			
		||||
 */
 | 
			
		||||
typedef struct __attribute__((objc_boxable)) NSDirectionalEdgeInsets {
 | 
			
		||||
    CGFloat top;
 | 
			
		||||
    CGFloat leading;
 | 
			
		||||
    CGFloat bottom;
 | 
			
		||||
    CGFloat trailing;
 | 
			
		||||
} NSDirectionalEdgeInsets API_AVAILABLE(macos(10.15));
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN const NSDirectionalEdgeInsets NSDirectionalEdgeInsetsZero API_AVAILABLE(macos(10.15));
 | 
			
		||||
 | 
			
		||||
/* Alignment specification that should be interpreted according to the user interface layout direction.
 | 
			
		||||
 */
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSRectAlignment) {
 | 
			
		||||
    NSRectAlignmentNone = 0,
 | 
			
		||||
    NSRectAlignmentTop,
 | 
			
		||||
    NSRectAlignmentTopLeading,
 | 
			
		||||
    NSRectAlignmentLeading,
 | 
			
		||||
    NSRectAlignmentBottomLeading,
 | 
			
		||||
    NSRectAlignmentBottom,
 | 
			
		||||
    NSRectAlignmentBottomTrailing,
 | 
			
		||||
    NSRectAlignmentTrailing,
 | 
			
		||||
    NSRectAlignmentTopTrailing,
 | 
			
		||||
} API_AVAILABLE(macos(10.15));
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSDirectionalEdgeInsets NSDirectionalEdgeInsetsMake(CGFloat top, CGFloat leading, CGFloat bottom, CGFloat trailing) API_AVAILABLE(macos(10.15)) NS_SWIFT_UNAVAILABLE("Use 'NSDirectionalEdgeInsets()' instead") {
 | 
			
		||||
    NSDirectionalEdgeInsets insets = {top, leading, bottom, trailing};
 | 
			
		||||
    return insets;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* End temporary declarations */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@interface NSCollectionViewCompositionalLayoutConfiguration : NSObject<NSCopying>
 | 
			
		||||
@property NSCollectionViewScrollDirection scrollDirection;
 | 
			
		||||
@property CGFloat interSectionSpacing;
 | 
			
		||||
@property(copy) NSArray<NSCollectionLayoutBoundarySupplementaryItem*> *boundarySupplementaryItems;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
typedef NSCollectionLayoutSection * _Nullable (^NSCollectionViewCompositionalLayoutSectionProvider)(NSInteger section, id<NSCollectionLayoutEnvironment>);
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@interface NSCollectionViewCompositionalLayout : NSCollectionViewLayout
 | 
			
		||||
- (instancetype)initWithSection:(NSCollectionLayoutSection*)section;
 | 
			
		||||
- (instancetype)initWithSection:(NSCollectionLayoutSection*)section configuration:(NSCollectionViewCompositionalLayoutConfiguration*)configuration;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithSectionProvider:(NSCollectionViewCompositionalLayoutSectionProvider)sectionProvider;
 | 
			
		||||
- (instancetype)initWithSectionProvider:(NSCollectionViewCompositionalLayoutSectionProvider)sectionProvider configuration:(NSCollectionViewCompositionalLayoutConfiguration*)configuration;
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
+ (instancetype)new NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
// Setting this property will invalidate the layout immediately to affect any changes
 | 
			
		||||
//    Note: any changes made to properites directly will have no effect.
 | 
			
		||||
@property(copy) NSCollectionViewCompositionalLayoutConfiguration *configuration;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger,NSCollectionLayoutSectionOrthogonalScrollingBehavior) {
 | 
			
		||||
    // default behavior. Section will layout along main layout axis (i.e. configuration.scrollDirection)
 | 
			
		||||
    NSCollectionLayoutSectionOrthogonalScrollingBehaviorNone,
 | 
			
		||||
    
 | 
			
		||||
    // NOTE: For each of the remaining cases, the section content will layout orthogonal to the main layout axis (e.g. main layout axis == .vertical, section will scroll in .horizontal axis)
 | 
			
		||||
    
 | 
			
		||||
    // Standard scroll view behavior
 | 
			
		||||
    NSCollectionLayoutSectionOrthogonalScrollingBehaviorContinuous,
 | 
			
		||||
    
 | 
			
		||||
    // Scrolling will come to rest on the leading edge of a group boundary
 | 
			
		||||
    NSCollectionLayoutSectionOrthogonalScrollingBehaviorContinuousGroupLeadingBoundary,
 | 
			
		||||
    
 | 
			
		||||
    // Standard scroll view paging behavior with page size == extent of the collection view's bounds
 | 
			
		||||
    NSCollectionLayoutSectionOrthogonalScrollingBehaviorPaging,
 | 
			
		||||
    
 | 
			
		||||
    // Fractional size paging behavior determined by the sections layout group's dimension
 | 
			
		||||
    NSCollectionLayoutSectionOrthogonalScrollingBehaviorGroupPaging,
 | 
			
		||||
    
 | 
			
		||||
    // Same of group paging with additional leading and trailing content insets to center each group's contents along the orthogonal axis
 | 
			
		||||
    NSCollectionLayoutSectionOrthogonalScrollingBehaviorGroupPagingCentered,
 | 
			
		||||
} API_AVAILABLE(macos(10.15));
 | 
			
		||||
 | 
			
		||||
typedef void (^NSCollectionLayoutSectionVisibleItemsInvalidationHandler)(NSArray<id<NSCollectionLayoutVisibleItem>> *visibleItems, NSPoint contentOffset, id<NSCollectionLayoutEnvironment> layoutEnvironment);
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@interface NSCollectionLayoutSection : NSObject<NSCopying>
 | 
			
		||||
+ (instancetype)sectionWithGroup:(NSCollectionLayoutGroup*)group;
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
+ (instancetype)new NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
@property NSDirectionalEdgeInsets contentInsets;
 | 
			
		||||
@property CGFloat interGroupSpacing;
 | 
			
		||||
 | 
			
		||||
// default is .none
 | 
			
		||||
@property NSCollectionLayoutSectionOrthogonalScrollingBehavior orthogonalScrollingBehavior;
 | 
			
		||||
 | 
			
		||||
// Supplementaries associated with the boundary edges of the section
 | 
			
		||||
@property(copy) NSArray<NSCollectionLayoutBoundarySupplementaryItem*> *boundarySupplementaryItems;
 | 
			
		||||
 | 
			
		||||
// by default, section supplementaries will follow any section-specific contentInsets
 | 
			
		||||
@property BOOL supplementariesFollowContentInsets;
 | 
			
		||||
 | 
			
		||||
// Called for each layout pass to allow modification of item properties right before they are displayed.
 | 
			
		||||
@property(copy,nullable) NSCollectionLayoutSectionVisibleItemsInvalidationHandler visibleItemsInvalidationHandler;
 | 
			
		||||
 | 
			
		||||
// decoration views anchored to the section's geometry (e.g. background decoration view)
 | 
			
		||||
@property(copy) NSArray<NSCollectionLayoutDecorationItem*> *decorationItems;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@interface NSCollectionLayoutItem : NSObject<NSCopying>
 | 
			
		||||
+ (instancetype)itemWithLayoutSize:(NSCollectionLayoutSize*)layoutSize;
 | 
			
		||||
+ (instancetype)itemWithLayoutSize:(NSCollectionLayoutSize*)layoutSize supplementaryItems:(NSArray<NSCollectionLayoutSupplementaryItem*>*)supplementaryItems;
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
+ (instancetype)new NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
//                       +---------------------+
 | 
			
		||||
//   +-------------+<----|Specified layout size|
 | 
			
		||||
//   |             |     +---------------------+
 | 
			
		||||
//   |  +-------+  |     +--------------------------+
 | 
			
		||||
//   |  |~~~~~~~|  |     |Final size (after         |
 | 
			
		||||
//   |  |~~~~~~~|<-+-----|contentInsets are applied)|
 | 
			
		||||
//   |  +-------+  |     +--------------------------+
 | 
			
		||||
//   |             |
 | 
			
		||||
//   +-------------+
 | 
			
		||||
//
 | 
			
		||||
//  Use contentInsets on an item to adjust the final size of the item after layout is computed.
 | 
			
		||||
//    useful for grid style layouts to apply even spacing around each the edges of each item.
 | 
			
		||||
//
 | 
			
		||||
//  Note: contentInsets are ignored for items with .estimated dimension(s)
 | 
			
		||||
 | 
			
		||||
@property NSDirectionalEdgeInsets contentInsets;
 | 
			
		||||
 | 
			
		||||
//                     +--------+
 | 
			
		||||
//                     |  Top   |
 | 
			
		||||
//                     +--------+
 | 
			
		||||
//                          |
 | 
			
		||||
//                          |
 | 
			
		||||
//                  +-------+--------------------------+
 | 
			
		||||
//                  |       v                          |
 | 
			
		||||
//                  |    +------+                      |
 | 
			
		||||
//   +--------+     |    |~~~~~~|        +--------+    |
 | 
			
		||||
//   |Leading |-----+->  |~~~~~~| <------|Trailing|    |
 | 
			
		||||
//   +--------+     |    |~~~~~~|        +--------+    |
 | 
			
		||||
//                  |    +------+                      |
 | 
			
		||||
//                  |        ^                         |
 | 
			
		||||
//                  +--------+-------------------------+
 | 
			
		||||
//                           |
 | 
			
		||||
//                           |
 | 
			
		||||
//                      +--------+
 | 
			
		||||
//                      | Bottom |
 | 
			
		||||
//                      +--------+
 | 
			
		||||
//
 | 
			
		||||
//  Specifies additional space required surrounding and item when laying out.
 | 
			
		||||
//  Flexible spacing can be used to apportion remaining space after items are layed out to
 | 
			
		||||
//    evenly align items among available layout space.
 | 
			
		||||
 | 
			
		||||
@property(copy,nullable) NSCollectionLayoutEdgeSpacing *edgeSpacing;
 | 
			
		||||
 | 
			
		||||
@property(readonly) NSCollectionLayoutSize *layoutSize;
 | 
			
		||||
@property(readonly) NSArray<NSCollectionLayoutSupplementaryItem*> *supplementaryItems;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@interface NSCollectionLayoutGroupCustomItem : NSObject<NSCopying>
 | 
			
		||||
+ (instancetype)customItemWithFrame:(NSRect)frame;
 | 
			
		||||
+ (instancetype)customItemWithFrame:(NSRect)frame zIndex:(NSInteger)zIndex;
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
+ (instancetype)new NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
@property(readonly) NSRect frame;
 | 
			
		||||
@property(readonly) NSInteger zIndex;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
typedef NSArray<NSCollectionLayoutGroupCustomItem*> * _Nonnull(^NSCollectionLayoutGroupCustomItemProvider)(id<NSCollectionLayoutEnvironment> layoutEnvironment);
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@interface NSCollectionLayoutGroup : NSCollectionLayoutItem<NSCopying>
 | 
			
		||||
 | 
			
		||||
// Specifies a group that will have N items equally sized along the horizontal axis. use interItemSpacing to insert space between items
 | 
			
		||||
//
 | 
			
		||||
//   +------+--+------+--+------+
 | 
			
		||||
//   |~~~~~~|  |~~~~~~|  |~~~~~~|
 | 
			
		||||
//   |~~~~~~|  |~~~~~~|  |~~~~~~|
 | 
			
		||||
//   |~~~~~~|  |~~~~~~|  |~~~~~~|
 | 
			
		||||
//   +------+--+------+--+------+
 | 
			
		||||
//            ^        ^
 | 
			
		||||
//            |        |
 | 
			
		||||
//    +-----------------------+
 | 
			
		||||
//    |  Inter Item Spacing   |
 | 
			
		||||
//    +-----------------------+
 | 
			
		||||
//
 | 
			
		||||
+ (instancetype)horizontalGroupWithLayoutSize:(NSCollectionLayoutSize*)layoutSize subitem:(NSCollectionLayoutItem*)subitem count:(NSInteger)count;
 | 
			
		||||
 | 
			
		||||
// Specifies a group that will repeat items until available horizontal space is exhausted.
 | 
			
		||||
//   note: any remaining space after laying out items can be apportioned among flexible interItemSpacing defintions
 | 
			
		||||
+ (instancetype)horizontalGroupWithLayoutSize:(NSCollectionLayoutSize*)layoutSize subitems:(NSArray<NSCollectionLayoutItem*>*)subitems;
 | 
			
		||||
 | 
			
		||||
// Specifies a group that will have N items equally sized along the vertical axis. use interItemSpacing to insert space between items
 | 
			
		||||
//   +------+
 | 
			
		||||
//   |~~~~~~|
 | 
			
		||||
//   |~~~~~~|
 | 
			
		||||
//   |~~~~~~|
 | 
			
		||||
//   +------+
 | 
			
		||||
//   |      |<--+
 | 
			
		||||
//   +------+   |
 | 
			
		||||
//   |~~~~~~|   |    +-----------------------+
 | 
			
		||||
//   |~~~~~~|   +----|  Inter Item Spacing   |
 | 
			
		||||
//   |~~~~~~|   |    +-----------------------+
 | 
			
		||||
//   +------+   |
 | 
			
		||||
//   |      |<--+
 | 
			
		||||
//   +------+
 | 
			
		||||
//   |~~~~~~|
 | 
			
		||||
//   |~~~~~~|
 | 
			
		||||
//   |~~~~~~|
 | 
			
		||||
//   +------+
 | 
			
		||||
//
 | 
			
		||||
+ (instancetype)verticalGroupWithLayoutSize:(NSCollectionLayoutSize*)layoutSize subitem:(NSCollectionLayoutItem*)subitem count:(NSInteger)count;
 | 
			
		||||
 | 
			
		||||
// Specifies a group that will repeat items until available vertical space is exhausted.
 | 
			
		||||
//   note: any remaining space after laying out items can be apportioned among flexible interItemSpacing defintions
 | 
			
		||||
+ (instancetype)verticalGroupWithLayoutSize:(NSCollectionLayoutSize*)layoutSize subitems:(NSArray<NSCollectionLayoutItem*>*)subitems;
 | 
			
		||||
 | 
			
		||||
// Specifies a custom group with client-specified frames.
 | 
			
		||||
//   During layout, the itemProvider will be called with the group's current geometry provided via the NSCollectionLayoutEnvironment supplied.
 | 
			
		||||
//   The coordinate space for returned frames should be {0,0} relative to this group's geometry.
 | 
			
		||||
//   Custom groups can be nested arbitrarily inside other groups.
 | 
			
		||||
+ (instancetype)customGroupWithLayoutSize:(NSCollectionLayoutSize*)layoutSize itemProvider:(NSCollectionLayoutGroupCustomItemProvider)itemProvider;
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
+ (instancetype)new NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
// Supplementary items are "anchored" to the group's geometry.
 | 
			
		||||
@property(copy) NSArray<NSCollectionLayoutSupplementaryItem*> *supplementaryItems;
 | 
			
		||||
 | 
			
		||||
// Supplies additional spacing between items along the layout axis of the group
 | 
			
		||||
@property(copy,nullable) NSCollectionLayoutSpacing *interItemSpacing;
 | 
			
		||||
 | 
			
		||||
@property(readonly) NSArray<NSCollectionLayoutItem*> *subitems;
 | 
			
		||||
 | 
			
		||||
// for visual debugging; will print an ASCII art rendering to console
 | 
			
		||||
- (NSString*)visualDescription;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@interface NSCollectionLayoutDimension : NSObject<NSCopying>
 | 
			
		||||
// dimension is computed as a fraction of the width of the containing group
 | 
			
		||||
+ (instancetype)fractionalWidthDimension:(CGFloat)fractionalWidth;
 | 
			
		||||
 | 
			
		||||
// dimension is computed as a fraction of the height of the containing group
 | 
			
		||||
+ (instancetype)fractionalHeightDimension:(CGFloat)fractionalHeight;
 | 
			
		||||
 | 
			
		||||
// dimension with an absolute point value
 | 
			
		||||
+ (instancetype)absoluteDimension:(CGFloat)absoluteDimension;
 | 
			
		||||
 | 
			
		||||
// dimension is estimated with a point value. Actual size will be determined when the content is rendered.
 | 
			
		||||
+ (instancetype)estimatedDimension:(CGFloat)estimatedDimension;
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
+ (instancetype)new NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
@property(readonly) BOOL isFractionalWidth;
 | 
			
		||||
@property(readonly) BOOL isFractionalHeight;
 | 
			
		||||
@property(readonly) BOOL isAbsolute;
 | 
			
		||||
@property(readonly) BOOL isEstimated;
 | 
			
		||||
@property(readonly) CGFloat dimension;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@interface NSCollectionLayoutSize : NSObject<NSCopying>
 | 
			
		||||
+ (instancetype)sizeWithWidthDimension:(NSCollectionLayoutDimension*)width heightDimension:(NSCollectionLayoutDimension*)height;
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
+ (instancetype)new NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
@property(readonly) NSCollectionLayoutDimension *widthDimension;
 | 
			
		||||
@property(readonly) NSCollectionLayoutDimension *heightDimension;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@interface NSCollectionLayoutSpacing : NSObject<NSCopying>
 | 
			
		||||
+ (instancetype)flexibleSpacing:(CGFloat)flexibleSpacing;  // i.e. >=
 | 
			
		||||
+ (instancetype)fixedSpacing:(CGFloat)fixedSpacing;        // i.e. ==
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
+ (instancetype)new NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
@property(readonly) CGFloat spacing;
 | 
			
		||||
@property(readonly) BOOL isFlexibleSpacing;
 | 
			
		||||
@property(readonly) BOOL isFixedSpacing;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@interface NSCollectionLayoutEdgeSpacing : NSObject<NSCopying>
 | 
			
		||||
 | 
			
		||||
// Edge spacing specifies additional outsets around items required when performing layout.
 | 
			
		||||
//   Edges may be omitted as-needed
 | 
			
		||||
//
 | 
			
		||||
//    +-----------------+--------+-----------------+------+-----------------+
 | 
			
		||||
//    |~~~~~~~~~~~~~~~~~|        |~~~~~~~~~~~~~~~~~|      |~~~~~~~~~~~~~~~~~|
 | 
			
		||||
//    |~~~~~~~~~~~~~~~~~|        |~~~~~~~~~~~~~~~~~|      |~~~~~~~~~~~~~~~~~|
 | 
			
		||||
//    |~~~~~~~~~~~~~~~~~|        |~~~~~~~~~~~~~~~~~|      |~~~~~~~~~~~~~~~~~|
 | 
			
		||||
//    |~~~~~~~~~~~~~~~~~|        |~~~~~~~~~~~~~~~~~|      |~~~~~~~~~~~~~~~~~|
 | 
			
		||||
//    |~~~~~~~~~~~~~~~~~|        |~~~~~~~~~~~~~~~~~|      |~~~~~~~~~~~~~~~~~|
 | 
			
		||||
//    |~~~~~~~~~~~~~~~~~|        |~~~~~~~~~~~~~~~~~|      |~~~~~~~~~~~~~~~~~|
 | 
			
		||||
//    |~~~~~~~~~~~~~~~~~|        |~~~~~~~~~~~~~~~~~|      |~~~~~~~~~~~~~~~~~|
 | 
			
		||||
//    |~~~~~~~~~~~~~~~~~|        |~~~~~~~~~~~~~~~~~|      |~~~~~~~~~~~~~~~~~|
 | 
			
		||||
//    |~~~~~~~~~~~~~~~~~|        |~~~~~~~~~~~~~~~~~|      |~~~~~~~~~~~~~~~~~|
 | 
			
		||||
//    |~~~~~~~~~~~~~~~~~|        |~~~~~~~~~~~~~~~~~|      |~~~~~~~~~~~~~~~~~|
 | 
			
		||||
//    +-----------------+        +-----------------+      +-----------------+
 | 
			
		||||
//    |                                                                     |
 | 
			
		||||
//    |        ^                         ^                          ^       |
 | 
			
		||||
//    +--------+-------------------------+--------------------------+-------+
 | 
			
		||||
//             |                         |                          |
 | 
			
		||||
//             |                         |                          |
 | 
			
		||||
//   +---------+-------------------------+--------------------------+--------------------------+
 | 
			
		||||
//   |NSCollectionLayoutEdgeSpacing(leading:nil, top: nil, bottom:.flexible(0.0), trailing:nil)|
 | 
			
		||||
//   |                                                                                         |
 | 
			
		||||
//   |*forces items to align to the top of their group's geometry                              |
 | 
			
		||||
//   +-----------------------------------------------------------------------------------------+
 | 
			
		||||
 | 
			
		||||
+ (instancetype)spacingForLeading:(nullable NSCollectionLayoutSpacing *)leading
 | 
			
		||||
                              top:(nullable NSCollectionLayoutSpacing *)top
 | 
			
		||||
                         trailing:(nullable NSCollectionLayoutSpacing *)trailing
 | 
			
		||||
                           bottom:(nullable NSCollectionLayoutSpacing *)bottom;
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
+ (instancetype)new NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
@property(readonly,nullable) NSCollectionLayoutSpacing *leading;
 | 
			
		||||
@property(readonly,nullable) NSCollectionLayoutSpacing *top;
 | 
			
		||||
@property(readonly,nullable) NSCollectionLayoutSpacing *trailing;
 | 
			
		||||
@property(readonly,nullable) NSCollectionLayoutSpacing *bottom;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@interface NSCollectionLayoutSupplementaryItem : NSCollectionLayoutItem<NSCopying>
 | 
			
		||||
 | 
			
		||||
//  Supplementary items are positioned (i.e. anchored) to coordinate spaces throughout the layout
 | 
			
		||||
//    In this example, a supplementary is anchored to the top+trailing edge of a cell.
 | 
			
		||||
//    Supplementary items can be anchored to items (and groups, since a group is-a item)
 | 
			
		||||
//    Boundary supplementary items can be anchored to sections and the global layout
 | 
			
		||||
//
 | 
			
		||||
//                                +-----+       +------------------------------------------+
 | 
			
		||||
//                                |~~~~~|       | edges: [.top,.trailing]                  |
 | 
			
		||||
//   +----------------------------+~~~~~|<------+ fractionalOffset: NSPoint(x:0.5,y:-0.5)  |
 | 
			
		||||
//   |                            |~~~~~|       +------------------------------------------+
 | 
			
		||||
//   |                            +--+--+
 | 
			
		||||
//   |                               |
 | 
			
		||||
//   |                               |
 | 
			
		||||
//   |                               |
 | 
			
		||||
//   |                               |
 | 
			
		||||
//   +-------------------------------+
 | 
			
		||||
//
 | 
			
		||||
//  Container anchors are used to specify positioning of an item within the host geometry (e.g. item, group, section)
 | 
			
		||||
 | 
			
		||||
+ (instancetype)supplementaryItemWithLayoutSize:(NSCollectionLayoutSize*)layoutSize elementKind:(NSString*)elementKind containerAnchor:(NSCollectionLayoutAnchor*)containerAnchor;
 | 
			
		||||
 | 
			
		||||
//                                                     +----------------------------------------------------+
 | 
			
		||||
//                                     +-----+         |* Container Anchor                                  |
 | 
			
		||||
//                                     |~~~~~|         |edges: [.top,.trailing] offset: NSPoint(x:10,y:-10) |
 | 
			
		||||
//                                     |~~~~~|<--------|                                                    |
 | 
			
		||||
//                                     |~~~~~|         |* Item Anchor:                                      |
 | 
			
		||||
//                                     +-----+         |edges: [.bottom, .leading]                          |
 | 
			
		||||
//   +-------------------------------+                 +----------------------------------------------------+
 | 
			
		||||
//   |                               |
 | 
			
		||||
//   |                               |
 | 
			
		||||
//   |                               |
 | 
			
		||||
//   |                               |
 | 
			
		||||
//   |                               |
 | 
			
		||||
//   |                               |
 | 
			
		||||
//   +-------------------------------+
 | 
			
		||||
//
 | 
			
		||||
//   Combine a container anchor with an item anchor for fine-grained positioning.
 | 
			
		||||
//     Optionally add an offset for additional refinement.
 | 
			
		||||
 | 
			
		||||
+ (instancetype)supplementaryItemWithLayoutSize:(NSCollectionLayoutSize*)layoutSize elementKind:(NSString*)elementKind containerAnchor:(NSCollectionLayoutAnchor*)containerAnchor itemAnchor:(NSCollectionLayoutAnchor*)itemAnchor;
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
+ (instancetype)new NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
@property NSInteger zIndex;
 | 
			
		||||
 | 
			
		||||
@property(readonly) NSString *elementKind;
 | 
			
		||||
@property(readonly) NSCollectionLayoutAnchor *containerAnchor;
 | 
			
		||||
@property(readonly,nullable) NSCollectionLayoutAnchor *itemAnchor;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@interface NSCollectionLayoutBoundarySupplementaryItem : NSCollectionLayoutSupplementaryItem<NSCopying>
 | 
			
		||||
 | 
			
		||||
// Specify the alignment of the supplementary relative the containing geometry's coordinate space to
 | 
			
		||||
// position the boundary supplementary item.
 | 
			
		||||
//
 | 
			
		||||
//                                            +------------------------------------------+
 | 
			
		||||
//   +----------------------+                 |Boundary Supplementary Item               |
 | 
			
		||||
//   |                      |<----------------|* alignment: [.top, .leading]             |
 | 
			
		||||
//   +----------------------+                 |* absoluteOffset: NSPoint(x:0.0, y:-10.0) |
 | 
			
		||||
//                                            +------------------------------------------+
 | 
			
		||||
//   +----------------------------------+
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   |                                  |      +--------------------------------+
 | 
			
		||||
//   |                                  |<-----|        Section Geometry        |
 | 
			
		||||
//   |                                  |      +--------------------------------+
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   +----------------------------------+
 | 
			
		||||
 | 
			
		||||
+ (instancetype)boundarySupplementaryItemWithLayoutSize:(NSCollectionLayoutSize*)layoutSize elementKind:(NSString*)elementKind alignment:(NSRectAlignment)alignment;
 | 
			
		||||
+ (instancetype)boundarySupplementaryItemWithLayoutSize:(NSCollectionLayoutSize*)layoutSize elementKind:(NSString*)elementKind alignment:(NSRectAlignment)alignment absoluteOffset:(NSPoint)absoluteOffset;
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
+ (instancetype)new NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
// Default is YES. This will automatically extend the content area of the host geometry (e.g. section)
 | 
			
		||||
//   For .estimated sized supplementary items, this allows automatic adjustment of the layout. (e.g. dynamic text)
 | 
			
		||||
@property BOOL extendsBoundary;
 | 
			
		||||
 | 
			
		||||
// Default is NO. Specify YES to keep the supplementary visible while any portion of the host geometry (e.g. section) is visible.
 | 
			
		||||
//   Occlusion disambiguation between other supplementaries will be managed automatically (e.g. section header + footer both pinned)
 | 
			
		||||
@property BOOL pinToVisibleBounds;
 | 
			
		||||
 | 
			
		||||
@property(readonly) NSRectAlignment alignment;
 | 
			
		||||
@property(readonly) NSPoint offset;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@interface NSCollectionLayoutDecorationItem : NSCollectionLayoutItem<NSCopying>
 | 
			
		||||
 | 
			
		||||
// Useful for setting a background decoration view behind a section's content area.
 | 
			
		||||
//
 | 
			
		||||
// contentInset can also be applied as-needed.
 | 
			
		||||
// Register the elementKind with the layout instance to associate with your custom view class/nib
 | 
			
		||||
//
 | 
			
		||||
//   +----------------------------------+
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   |  +----------------------------+  |      +--------------------------------+
 | 
			
		||||
//   |  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~|  |      |Background Decoration Item      |
 | 
			
		||||
//   |  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~<--+------|* contentInsets applied         |
 | 
			
		||||
//   |  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~|  |      +--------------------------------+
 | 
			
		||||
//   |  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~|  |
 | 
			
		||||
//   |  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~|  |
 | 
			
		||||
//   |  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~|  |
 | 
			
		||||
//   |  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~|  |      +--------------------------------+
 | 
			
		||||
//   |  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~|  |<-----|        Section Geometry        |
 | 
			
		||||
//   |  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~|  |      +--------------------------------+
 | 
			
		||||
//   |  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~|  |
 | 
			
		||||
//   |  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~|  |
 | 
			
		||||
//   |  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~|  |
 | 
			
		||||
//   |  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~|  |
 | 
			
		||||
//   |  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~|  |
 | 
			
		||||
//   |  +----------------------------+  |
 | 
			
		||||
//   |                                  |
 | 
			
		||||
//   +----------------------------------+
 | 
			
		||||
 | 
			
		||||
+ (instancetype)backgroundDecorationItemWithElementKind:(NSString*)elementKind;
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
+ (instancetype)new NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
@property NSInteger zIndex;      // default is 0; all other section items will be automatically be promoted to zIndex=1
 | 
			
		||||
 | 
			
		||||
@property(readonly) NSString *elementKind;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@interface NSCollectionLayoutAnchor : NSObject<NSCopying>
 | 
			
		||||
 | 
			
		||||
//                       +------------------+  +------+   +------------------+
 | 
			
		||||
//                       | [.top, .leading] |  |[.top]|   | [.top,.trailing] |
 | 
			
		||||
//                       +--+---------------+  +---+--+   +---------------+--+
 | 
			
		||||
//                          |                      |                      |
 | 
			
		||||
//                          v                      v                      v
 | 
			
		||||
//                       +-----+----------------+-----+----------------+-----+
 | 
			
		||||
//                       |~~~~~|                |~~~~~|                |~~~~~|
 | 
			
		||||
//                       |~~~~~|                |~~~~~|                |~~~~~|
 | 
			
		||||
//                       +-----+                +-----+                +-----+
 | 
			
		||||
//                       |                                                   |
 | 
			
		||||
//                       +-----+                                       +-----+
 | 
			
		||||
//   +--------------+    |~~~~~|                                       |~~~~~|    +-------------+
 | 
			
		||||
//   |  [.leading]  |--->|~~~~~|                                       |~~~~~|<---| [.trailing] |
 | 
			
		||||
//   +--------------+    +-----+                                       +-----+    +-------------+
 | 
			
		||||
//                       |                                                   |
 | 
			
		||||
//                       +-----+                +-----+                +-----+
 | 
			
		||||
//                       |~~~~~|                |~~~~~|                |~~~~~|
 | 
			
		||||
//                       |~~~~~|                |~~~~~|                |~~~~~|
 | 
			
		||||
//                       +-----+----------------+-----+----------------+-----+
 | 
			
		||||
//                          ^                      ^                      ^
 | 
			
		||||
//                          |                      |                      |
 | 
			
		||||
//                      +---+---------------+ +----+----+  +--------------+----+
 | 
			
		||||
//                      |[.bottom, .leading]| |[.bottom]|  |[.bottom,.trailing]|
 | 
			
		||||
//                      +-------------------+ +---------+  +-------------------+
 | 
			
		||||
//
 | 
			
		||||
// Edges are specified as shown above.
 | 
			
		||||
 | 
			
		||||
+ (instancetype)layoutAnchorWithEdges:(NSDirectionalRectEdge)edges;
 | 
			
		||||
 | 
			
		||||
//                                +-----+       +------------------------------------+
 | 
			
		||||
//                                |~~~~~|       |      edges: [.top,.trailing]       |
 | 
			
		||||
//   +----------------------------+~~~~~|<------+ unitOffset: NSPoint(x:0.5,y:-0.5)  |
 | 
			
		||||
//   |                            |~~~~~|       +------------------------------------+
 | 
			
		||||
//   |                            +--+--+
 | 
			
		||||
//   |                               |
 | 
			
		||||
//   |                               |
 | 
			
		||||
//   |                               |
 | 
			
		||||
//   |                               |
 | 
			
		||||
//   +-------------------------------+
 | 
			
		||||
//
 | 
			
		||||
// To specify additional offsets, combine edges with absoluteOffset or unitOffset.
 | 
			
		||||
 | 
			
		||||
+ (instancetype)layoutAnchorWithEdges:(NSDirectionalRectEdge)edges absoluteOffset:(NSPoint)absoluteOffset;
 | 
			
		||||
+ (instancetype)layoutAnchorWithEdges:(NSDirectionalRectEdge)edges fractionalOffset:(NSPoint)fractionalOffset;
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
+ (instancetype)new NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
@property(readonly) NSDirectionalRectEdge edges;
 | 
			
		||||
@property(readonly) NSPoint offset;
 | 
			
		||||
@property(readonly) BOOL isAbsoluteOffset;
 | 
			
		||||
@property(readonly) BOOL isFractionalOffset;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@protocol NSCollectionLayoutContainer<NSObject>
 | 
			
		||||
@property(readonly) NSSize contentSize;                               // resolved size of container (before any insets are applied)
 | 
			
		||||
@property(readonly) NSSize effectiveContentSize;                      // after insets are applied
 | 
			
		||||
@property(readonly) NSDirectionalEdgeInsets contentInsets;            // values < 1.0 are interpreted as fractional values (e.g. leading:0.15 == 15% width)
 | 
			
		||||
@property(readonly) NSDirectionalEdgeInsets effectiveContentInsets;   // resolved value after resolving any unit values
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@protocol NSCollectionLayoutEnvironment<NSObject>
 | 
			
		||||
@property(readonly) id<NSCollectionLayoutContainer> container;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@protocol NSCollectionLayoutVisibleItem<NSObject>
 | 
			
		||||
@property CGFloat alpha;
 | 
			
		||||
@property NSInteger zIndex;
 | 
			
		||||
@property(getter=isHidden) BOOL hidden;
 | 
			
		||||
@property NSPoint center;
 | 
			
		||||
 | 
			
		||||
@property(readonly) NSString *name;
 | 
			
		||||
@property(readonly) NSIndexPath *indexPath;
 | 
			
		||||
@property(readonly) NSRect frame;
 | 
			
		||||
@property(readonly) NSRect bounds;
 | 
			
		||||
@property(readonly) NSCollectionElementCategory representedElementCategory;
 | 
			
		||||
@property(readonly,nullable) NSString *representedElementKind;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -0,0 +1,78 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSCollectionViewFlowLayout.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 2015-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSCollectionView.h>
 | 
			
		||||
#import <AppKit/NSCollectionViewLayout.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSCollectionViewScrollDirection) {
 | 
			
		||||
    NSCollectionViewScrollDirectionVertical,
 | 
			
		||||
    NSCollectionViewScrollDirectionHorizontal
 | 
			
		||||
} API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSCollectionViewSupplementaryElementKind const NSCollectionElementKindSectionHeader API_AVAILABLE(macos(10.11));
 | 
			
		||||
APPKIT_EXTERN NSCollectionViewSupplementaryElementKind const NSCollectionElementKindSectionFooter API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.11))
 | 
			
		||||
@interface NSCollectionViewFlowLayoutInvalidationContext : NSCollectionViewLayoutInvalidationContext
 | 
			
		||||
 | 
			
		||||
@property BOOL invalidateFlowLayoutDelegateMetrics; // if set to NO, flow layout will not requery the collection view delegate for size information etc.
 | 
			
		||||
@property BOOL invalidateFlowLayoutAttributes; // if set to NO, flow layout will keep all layout information, effectively not invalidating - useful for a subclass which invalidates only a piece of itself
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSCollectionViewDelegateFlowLayout <NSCollectionViewDelegate>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
- (NSSize)collectionView:(NSCollectionView *)collectionView layout:(NSCollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
 | 
			
		||||
- (NSEdgeInsets)collectionView:(NSCollectionView *)collectionView layout:(NSCollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section;
 | 
			
		||||
- (CGFloat)collectionView:(NSCollectionView *)collectionView layout:(NSCollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section;
 | 
			
		||||
- (CGFloat)collectionView:(NSCollectionView *)collectionView layout:(NSCollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section;
 | 
			
		||||
- (NSSize)collectionView:(NSCollectionView *)collectionView layout:(NSCollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section;
 | 
			
		||||
- (NSSize)collectionView:(NSCollectionView *)collectionView layout:(NSCollectionViewLayout*)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.11))
 | 
			
		||||
@interface NSCollectionViewFlowLayout : NSCollectionViewLayout
 | 
			
		||||
 | 
			
		||||
@property CGFloat minimumLineSpacing;
 | 
			
		||||
@property CGFloat minimumInteritemSpacing;
 | 
			
		||||
@property NSSize itemSize;
 | 
			
		||||
@property NSSize estimatedItemSize; // defaults to NSZeroSize - setting a non-zero size enables cells that self-size via -preferredLayoutAttributesFittingAttributes:
 | 
			
		||||
@property NSCollectionViewScrollDirection scrollDirection; // default is NSCollectionViewScrollDirectionVertical
 | 
			
		||||
@property NSSize headerReferenceSize;
 | 
			
		||||
@property NSSize footerReferenceSize;
 | 
			
		||||
@property NSEdgeInsets sectionInset;
 | 
			
		||||
 | 
			
		||||
/* Set these properties to YES to get headers that pin to the top of the visible area and footers that pin to the bottom while scrolling.  Archived with the layout's other persistent properties.  Enabling this feature may affect the parenting of header and footer views.
 | 
			
		||||
*/
 | 
			
		||||
@property BOOL sectionHeadersPinToVisibleBounds API_AVAILABLE(macos(10.12));
 | 
			
		||||
@property BOOL sectionFootersPinToVisibleBounds API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Section Collapse ***
 | 
			
		||||
 | 
			
		||||
/* Returns YES if the specified section is currently collapsed; NO if not, or if there is no such section.  Defaults to NO.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)sectionAtIndexIsCollapsed:(NSUInteger)sectionIndex API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/* Collapses the specified section to a single row, if it is not already collapsed.
 | 
			
		||||
*/
 | 
			
		||||
- (void)collapseSectionAtIndex:(NSUInteger)sectionIndex API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/* Un-collapses the specified section, if it is currently collapsed.
 | 
			
		||||
*/
 | 
			
		||||
- (void)expandSectionAtIndex:(NSUInteger)sectionIndex API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,67 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSCollectionViewGridLayout.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 2015-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSCollectionViewLayout.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
@class NSColor;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
/* NSCollectionView's default "Grid" layout, which matches NSCollectionView's layout behavior on OS X 10.5 through 10.10.  When you create a new NSCollectionView, its collectionViewLayout property defaults to an instance of NSCollectionViewGridLayout.
 | 
			
		||||
*/
 | 
			
		||||
API_AVAILABLE(macos(10.11))
 | 
			
		||||
@interface NSCollectionViewGridLayout : NSCollectionViewLayout
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Margins and Inter-Item Spacing ***
 | 
			
		||||
 | 
			
		||||
/* The amount of empty space to leave between the edges of the CollectionView's frame and the items within it.  Items will be laid out in the rectangle that remains after margins have been subtracted.  Defaults to NSEdgeInsetsZero.
 | 
			
		||||
*/
 | 
			
		||||
@property NSEdgeInsets margins;
 | 
			
		||||
 | 
			
		||||
/* For a vertically scrolling grid, this value represents the minimum spacing between items in the same row.  For a horizontally scrolling grid, this value represents the minimum spacing between items in the same column. This spacing is used to compute how many items can fit in a single line, but after the number of items is determined, the actual spacing may possibly be adjusted upward.  Defaults to 0 for a Grid layout.
 | 
			
		||||
*/
 | 
			
		||||
@property CGFloat minimumInteritemSpacing;
 | 
			
		||||
 | 
			
		||||
/* For a vertically scrolling grid, this value represents the minimum spacing between successive rows.  For a horizontally scrolling grid, this value represents the minimum spacing between successive columns.  This spacing is not applied to the space between the header and the first line or between the last line and the footer.  Defaults to 0 for a Grid layout.
 | 
			
		||||
*/
 | 
			
		||||
@property CGFloat minimumLineSpacing;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Grid Parameters ***
 | 
			
		||||
 | 
			
		||||
/* The largest number of item rows to attempt to fit in the CollectionView's visible area (if enclosed in a ScrollView).  Defaults to 0, which is interpreted to mean there should be no limit other than minimumItemSize.height.
 | 
			
		||||
*/
 | 
			
		||||
@property NSUInteger maximumNumberOfRows;
 | 
			
		||||
 | 
			
		||||
/* The largest number of item columns to attempt to fit in the CollectionView's visible area (if enclosed in a ScrollView).  Defaults to 0, which is interpreted to mean there should be no limit other than minimumItemSize.width.
 | 
			
		||||
*/
 | 
			
		||||
@property NSUInteger maximumNumberOfColumns;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Item Size Limits ***
 | 
			
		||||
 | 
			
		||||
/* The smallest allowed dimensions for an item's root view.  Defaults to NSZeroSize, which makes the layout attempt to infer minimum dimensions from the provided itemPrototype's view's frame size.
 | 
			
		||||
*/
 | 
			
		||||
@property NSSize minimumItemSize;
 | 
			
		||||
 | 
			
		||||
/* The largest allowed dimensions for an item's root view.  Defaults to NSZeroSize, which makes the layout attempt to infer maximum dimensions from the provided itemPrototype's view's frame size.
 | 
			
		||||
*/
 | 
			
		||||
@property NSSize maximumItemSize;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Background Appearance ***
 | 
			
		||||
 | 
			
		||||
/* The colors with which to fill the background.  Defaults to nil.  Setting this to nil causes a default background color to be used.  Setting it to an empty array causes the CollectionView to draw no background fill.  Setting it to a single-NSColor array causes the entire CollectionView to be drawn with the given background fill color.  For CollectionViews using the old, pre-10.11 API: Setting it to an array of (N >= 2) colors causes the CollectionView to use them in sequence, applying color (index % N) behind the item at "index”.  For new, 10.11-and-later NSCollectionViews, colors after the first are ignored.
 | 
			
		||||
*/
 | 
			
		||||
@property (null_resettable, copy) NSArray<NSColor *> *backgroundColors;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,188 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSCollectionViewLayout.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 2015-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <AppKit/NSCollectionView.h>
 | 
			
		||||
 | 
			
		||||
/* The NSCollectionViewLayout class is provided as an abstract class for subclassing to define custom collection layouts.  Defining a custom layout is an advanced operation intended for applications with complex needs.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSCollectionElementCategory) {
 | 
			
		||||
    NSCollectionElementCategoryItem,
 | 
			
		||||
    NSCollectionElementCategorySupplementaryView,
 | 
			
		||||
    NSCollectionElementCategoryDecorationView,
 | 
			
		||||
    NSCollectionElementCategoryInterItemGap
 | 
			
		||||
} API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
@class NSIndexPath;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSCollectionViewDecorationElementKind NS_SWIFT_BRIDGED_TYPEDEF;
 | 
			
		||||
 | 
			
		||||
/* The elementKind that NSCollectionView uses to identify an inter-item gap, when the proposedDropOperation is NSCollectionViewDropBefore.  A client can customize the default look of the inter-item gap drop target indicator by registering a supplementary view nib or class for this elementKind.  If your -collectionView:validateDrop:proposedIndexPath:dropOperation: method disallows NSCollectionViewDropBefore operations, the CollectionView won't show this indicator.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN NSCollectionViewSupplementaryElementKind const NSCollectionElementKindInterItemGapIndicator API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
@class NSCollectionViewLayoutAttributes;
 | 
			
		||||
@class NSCollectionView;
 | 
			
		||||
@class NSNib;
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.11))
 | 
			
		||||
@interface NSCollectionViewLayoutAttributes : NSObject <NSCopying>
 | 
			
		||||
 | 
			
		||||
@property NSRect frame;
 | 
			
		||||
@property NSSize size;
 | 
			
		||||
@property CGFloat alpha;
 | 
			
		||||
@property NSInteger zIndex; // default is 0
 | 
			
		||||
@property (getter=isHidden) BOOL hidden; // As an optimization, NSCollectionView might not create a view for items whose hidden attribute is YES
 | 
			
		||||
@property (nullable, strong) NSIndexPath *indexPath;
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSCollectionElementCategory representedElementCategory;
 | 
			
		||||
@property (nullable, readonly) NSString *representedElementKind; // nil when representedElementCategory is NSCollectionElementCategoryItem. NSCollectionViewSupplementaryElementKind when representedElementCategory is NSCollectionElementCategorySupplementaryView or NSCollectionElementCategoryInterItemGap. NSCollectionViewDecorationElementKind when representedElementCategory is NSCollectionElementCategoryDecorationView.
 | 
			
		||||
 | 
			
		||||
+ (instancetype)layoutAttributesForItemWithIndexPath:(NSIndexPath *)indexPath;
 | 
			
		||||
+ (instancetype)layoutAttributesForInterItemGapBeforeIndexPath:(NSIndexPath *)indexPath;
 | 
			
		||||
+ (instancetype)layoutAttributesForSupplementaryViewOfKind:(NSCollectionViewSupplementaryElementKind)elementKind withIndexPath:(NSIndexPath *)indexPath;
 | 
			
		||||
+ (instancetype)layoutAttributesForDecorationViewOfKind:(NSCollectionViewDecorationElementKind)decorationViewKind withIndexPath:(NSIndexPath*)indexPath;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSCollectionUpdateAction) {
 | 
			
		||||
    NSCollectionUpdateActionInsert,
 | 
			
		||||
    NSCollectionUpdateActionDelete,
 | 
			
		||||
    NSCollectionUpdateActionReload,
 | 
			
		||||
    NSCollectionUpdateActionMove,
 | 
			
		||||
    NSCollectionUpdateActionNone
 | 
			
		||||
} API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.11))
 | 
			
		||||
@interface NSCollectionViewUpdateItem : NSObject
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly) NSIndexPath *indexPathBeforeUpdate; // nil for NSCollectionUpdateActionInsert
 | 
			
		||||
@property (nullable, readonly) NSIndexPath *indexPathAfterUpdate; // nil for NSCollectionUpdateActionDelete
 | 
			
		||||
@property (readonly) NSCollectionUpdateAction updateAction;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.11))
 | 
			
		||||
@interface NSCollectionViewLayoutInvalidationContext : NSObject
 | 
			
		||||
 | 
			
		||||
@property (readonly) BOOL invalidateEverything; // set to YES when invalidation occurs because the collection view is sent -reloadData
 | 
			
		||||
@property (readonly) BOOL invalidateDataSourceCounts; // if YES, the layout should requery section and item counts from the collection view - set to YES when the collection view is sent -reloadData and when items are inserted or deleted
 | 
			
		||||
 | 
			
		||||
- (void)invalidateItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths;
 | 
			
		||||
- (void)invalidateSupplementaryElementsOfKind:(NSCollectionViewSupplementaryElementKind)elementKind atIndexPaths:(NSSet<NSIndexPath *> *)indexPaths;
 | 
			
		||||
- (void)invalidateDecorationElementsOfKind:(NSCollectionViewDecorationElementKind)elementKind atIndexPaths:(NSSet<NSIndexPath *> *)indexPaths;
 | 
			
		||||
@property (nullable, readonly) NSSet<NSIndexPath *> *invalidatedItemIndexPaths;
 | 
			
		||||
@property (nullable, readonly) NSDictionary<NSCollectionViewSupplementaryElementKind, NSSet<NSIndexPath *> *> *invalidatedSupplementaryIndexPaths; // keys are element kind strings - values are NSSet<NSIndexPath *>
 | 
			
		||||
@property (nullable, readonly) NSDictionary<NSCollectionViewDecorationElementKind, NSSet<NSIndexPath *> *> *invalidatedDecorationIndexPaths; // keys are element kind strings - values are NSSet<NSIndexPath *>
 | 
			
		||||
 | 
			
		||||
@property NSPoint contentOffsetAdjustment; // delta to be applied to the collection view's current contentOffset - default is NSZeroPoint
 | 
			
		||||
@property NSSize contentSizeAdjustment; // delta to be applied to the current content size - default is NSZeroSize
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* The NSCollectionViewLayout class is provided as an abstract class for subclassing to define custom collection layouts.  Defining a custom layout is an advanced operation intended for applications with complex needs.
 | 
			
		||||
*/
 | 
			
		||||
API_AVAILABLE(macos(10.11))
 | 
			
		||||
@interface NSCollectionViewLayout : NSObject <NSCoding>
 | 
			
		||||
 | 
			
		||||
/* Methods in this class are meant to be overridden and will be called by its collection view to gather layout information.  To get the truth on the current state of the collection view, call methods on NSCollectionView rather than these.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, weak) NSCollectionView *collectionView;
 | 
			
		||||
 | 
			
		||||
/* Call -invalidateLayout to indicate that the collection view needs to requery the layout information.  Subclasses must always call super if they override.
 | 
			
		||||
*/
 | 
			
		||||
- (void)invalidateLayout;
 | 
			
		||||
- (void)invalidateLayoutWithContext:(NSCollectionViewLayoutInvalidationContext *)context;
 | 
			
		||||
 | 
			
		||||
- (void)registerClass:(nullable Class)viewClass forDecorationViewOfKind:(NSCollectionViewDecorationElementKind)elementKind;
 | 
			
		||||
- (void)registerNib:(nullable NSNib *)nib forDecorationViewOfKind:(NSCollectionViewDecorationElementKind)elementKind;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSCollectionViewLayout (NSSubclassingHooks)
 | 
			
		||||
 | 
			
		||||
@property (class, readonly) Class layoutAttributesClass; // override this method to provide a custom class to be used when instantiating instances of NSCollectionViewLayoutAttributes
 | 
			
		||||
 | 
			
		||||
@property (class, readonly) Class invalidationContextClass; // override this method to provide a custom class to be used for invalidation contexts
 | 
			
		||||
 | 
			
		||||
/* The collection view calls -prepareLayout once at its first layout as the first message to the layout instance.  The collection view calls -prepareLayout again after layout is invalidated and before requerying the layout information.  Subclasses should always call super if they override.
 | 
			
		||||
*/
 | 
			
		||||
- (void)prepareLayout;
 | 
			
		||||
 | 
			
		||||
/* NSCollectionView calls these four methods to determine the layout information.  Implement -layoutAttributesForElementsInRect: to return layout attributes for for supplementary or decoration views, or to perform layout in an as-needed-on-screen fashion. Additionally, all layout subclasses should implement -layoutAttributesForItemAtIndexPath: to return layout attributes instances on demand for specific index paths.  If the layout supports any supplementary or decoration view types, it should also implement the respective atIndexPath: methods for those types.
 | 
			
		||||
*/
 | 
			
		||||
- (NSArray<__kindof NSCollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(NSRect)rect; // return an array layout attributes instances for all the views in the given rect
 | 
			
		||||
- (nullable NSCollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath;
 | 
			
		||||
- (nullable NSCollectionViewLayoutAttributes *)layoutAttributesForSupplementaryViewOfKind:(NSCollectionViewSupplementaryElementKind)elementKind atIndexPath:(NSIndexPath *)indexPath;
 | 
			
		||||
- (nullable NSCollectionViewLayoutAttributes *)layoutAttributesForDecorationViewOfKind:(NSCollectionViewDecorationElementKind)elementKind atIndexPath:(NSIndexPath *)indexPath;
 | 
			
		||||
 | 
			
		||||
/* Returns an NSCollectionViewLayoutAttributes instance that identifies an appropriate proposed drop target from the given hover point.  If the point is between items, the returned layout attributes may describe an inter-item gap, which is distinguished by having a representedElementCategory of NSCollectionElementCategoryInterItemGap, and a representedElementKind of NSCollectionElementKindInterItemGapIndicator.  Its "frame" provides a bounding box for the gap, that will be used to position and size a drop target indicator, and its "indexPath" identifies the proposed "insert before" position.  The frame might not contain the given point, if the insertion indicator should lie elsewhere.  (For example, when a vertical Flow layout hit-tests a gap between rows, it may suggest an insertion gap to the left of the lower row's first item.)  Subclasses should override this method to return appropriate results based on their knowledge of the particular layout.  This method should return nil if no suitable drop target can be inferred from the given point.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSCollectionViewLayoutAttributes *)layoutAttributesForDropTargetAtPoint:(NSPoint)pointInCollectionView;
 | 
			
		||||
 | 
			
		||||
/* Returns an NSCollectionViewLayoutAttributes instance that describes the inter-item gap preceding the given item indexPath.  You may pass an indexPath whose "item" index equals the number of items in the section, to request a description of the gap after the last item.  The result has a representedElementCategory of NSCollectionElementCategoryInterItemGap, and a representedElementKind of NSCollectionElementKindInterItemGapIndicator.  Subclasses should override this method to return appropriate results based on their knowledge of the particular layout.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSCollectionViewLayoutAttributes *)layoutAttributesForInterItemGapBeforeIndexPath:(NSIndexPath *)indexPath;
 | 
			
		||||
 | 
			
		||||
- (BOOL)shouldInvalidateLayoutForBoundsChange:(NSRect)newBounds; // return YES to cause the collection view to requery the layout for geometry information
 | 
			
		||||
- (NSCollectionViewLayoutInvalidationContext *)invalidationContextForBoundsChange:(NSRect)newBounds;
 | 
			
		||||
 | 
			
		||||
- (BOOL)shouldInvalidateLayoutForPreferredLayoutAttributes:(NSCollectionViewLayoutAttributes *)preferredAttributes withOriginalAttributes:(NSCollectionViewLayoutAttributes *)originalAttributes;
 | 
			
		||||
- (NSCollectionViewLayoutInvalidationContext *)invalidationContextForPreferredLayoutAttributes:(NSCollectionViewLayoutAttributes *)preferredAttributes withOriginalAttributes:(NSCollectionViewLayoutAttributes *)originalAttributes;
 | 
			
		||||
 | 
			
		||||
- (NSPoint)targetContentOffsetForProposedContentOffset:(NSPoint)proposedContentOffset withScrollingVelocity:(NSPoint)velocity; // return a point at which to rest after scrolling - for layouts that want snap-to-point scrolling behavior
 | 
			
		||||
- (NSPoint)targetContentOffsetForProposedContentOffset:(NSPoint)proposedContentOffset; // a layout can return the content offset to be applied during transition or update animations
 | 
			
		||||
 | 
			
		||||
@property(readonly) NSSize collectionViewContentSize; // Subclasses must implement a collectionViewContentSize getter that returns the width and height of the collection view’s content. These values represent the width and height of all the content, not just the content that is currently visible. The collection view uses this information to configure its own content size to facilitate scrolling.
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSCollectionViewLayout (NSUpdateSupportHooks)
 | 
			
		||||
 | 
			
		||||
// This method is called when there is an update with deletes/inserts to the collection view.
 | 
			
		||||
// It will be called prior to calling the initial/final layout attribute methods below to give the layout an opportunity to do batch computations for the insertion and deletion layout attributes.
 | 
			
		||||
// The updateItems parameter is an array of NSCollectionViewUpdateItem instances for each element that is moving to a new index path.
 | 
			
		||||
- (void)prepareForCollectionViewUpdates:(NSArray<NSCollectionViewUpdateItem *> *)updateItems;
 | 
			
		||||
- (void)finalizeCollectionViewUpdates; // called inside an animation block after the update
 | 
			
		||||
 | 
			
		||||
- (void)prepareForAnimatedBoundsChange:(NSRect)oldBounds; // NSCollectionView calls this when its bounds have changed inside an animation block before displaying items in its new bounds
 | 
			
		||||
- (void)finalizeAnimatedBoundsChange; // also called inside the animation block
 | 
			
		||||
 | 
			
		||||
// NSCollectionView calls this when prior the layout transition animation on the incoming and outgoing layout
 | 
			
		||||
- (void)prepareForTransitionToLayout:(NSCollectionViewLayout *)newLayout;
 | 
			
		||||
- (void)prepareForTransitionFromLayout:(NSCollectionViewLayout *)oldLayout;
 | 
			
		||||
- (void)finalizeLayoutTransition;  // called inside an animation block after the transition
 | 
			
		||||
 | 
			
		||||
// This set of methods is called when the collection view undergoes an animated transition such as a batch update block or an animated bounds change.
 | 
			
		||||
// For each element on screen before the invalidation, finalLayoutAttributesForDisappearingXXX will be called and an animation setup from what is on screen to those final attributes.
 | 
			
		||||
// For each element on screen after the invalidation, initialLayoutAttributesForAppearingXXX will be called an an animation setup from those initial attributes to what ends up on screen.
 | 
			
		||||
- (nullable NSCollectionViewLayoutAttributes *)initialLayoutAttributesForAppearingItemAtIndexPath:(NSIndexPath *)itemIndexPath;
 | 
			
		||||
- (nullable NSCollectionViewLayoutAttributes *)finalLayoutAttributesForDisappearingItemAtIndexPath:(NSIndexPath *)itemIndexPath;
 | 
			
		||||
- (nullable NSCollectionViewLayoutAttributes *)initialLayoutAttributesForAppearingSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)elementKind atIndexPath:(NSIndexPath *)elementIndexPath;
 | 
			
		||||
- (nullable NSCollectionViewLayoutAttributes *)finalLayoutAttributesForDisappearingSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)elementKind atIndexPath:(NSIndexPath *)elementIndexPath;
 | 
			
		||||
- (nullable NSCollectionViewLayoutAttributes *)initialLayoutAttributesForAppearingDecorationElementOfKind:(NSCollectionViewDecorationElementKind)elementKind atIndexPath:(NSIndexPath *)decorationIndexPath;
 | 
			
		||||
- (nullable NSCollectionViewLayoutAttributes *)finalLayoutAttributesForDisappearingDecorationElementOfKind:(NSCollectionViewDecorationElementKind)elementKind atIndexPath:(NSIndexPath *)decorationIndexPath;
 | 
			
		||||
 | 
			
		||||
// These methods are called by collection view during an update block.
 | 
			
		||||
// Return an array of index paths to indicate views that the layout is deleting or inserting in response to the update.
 | 
			
		||||
- (NSSet<NSIndexPath *> *)indexPathsToDeleteForSupplementaryViewOfKind:(NSCollectionViewSupplementaryElementKind)elementKind;
 | 
			
		||||
- (NSSet<NSIndexPath *> *)indexPathsToDeleteForDecorationViewOfKind:(NSCollectionViewDecorationElementKind)elementKind;
 | 
			
		||||
- (NSSet<NSIndexPath *> *)indexPathsToInsertForSupplementaryViewOfKind:(NSCollectionViewSupplementaryElementKind)elementKind;
 | 
			
		||||
- (NSSet<NSIndexPath *> *)indexPathsToInsertForDecorationViewOfKind:(NSCollectionViewDecorationElementKind)elementKind;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,32 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSCollectionViewTransitionLayout.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 2015-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSCollectionViewLayout.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSCollectionViewTransitionLayoutAnimatedKey NS_SWIFT_BRIDGED_TYPEDEF;
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.11))
 | 
			
		||||
@interface NSCollectionViewTransitionLayout : NSCollectionViewLayout
 | 
			
		||||
 | 
			
		||||
@property (assign) CGFloat transitionProgress;
 | 
			
		||||
@property (readonly) NSCollectionViewLayout *currentLayout;
 | 
			
		||||
@property (readonly) NSCollectionViewLayout *nextLayout;
 | 
			
		||||
 | 
			
		||||
// Designated initializer
 | 
			
		||||
- (instancetype)initWithCurrentLayout:(NSCollectionViewLayout *)currentLayout nextLayout:(NSCollectionViewLayout *)newLayout;
 | 
			
		||||
 | 
			
		||||
- (void)updateValue:(CGFloat)value forAnimatedKey:(NSCollectionViewTransitionLayoutAnimatedKey)key;
 | 
			
		||||
- (CGFloat)valueForAnimatedKey:(NSCollectionViewTransitionLayoutAnimatedKey)key;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,444 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSColor.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* NSColors store colors. Often the only NSColor message you send is the "set" method, which makes the receiver the current color in the drawing context. There is usually no need to dive in and get the individual components (for instance, red, green, blue) that make up a color.
 | 
			
		||||
 | 
			
		||||
 There are three types of NSColors: Component based, pattern, and catalog.  Different types of NSColors provide different ways of getting at the values that define the colors:
 | 
			
		||||
 
 | 
			
		||||
     NSColorTypeComponentBased  Colors which have a color space (specified as NSColorSpace) and appropriate number of CGFloat components.
 | 
			
		||||
     NSColorTypePattern         Colors that draw a pattern, specified as an NSImage.
 | 
			
		||||
     NSColorTypeCatalog         Color with a catalog name and a color name. These colors can be dynamic and have multiple underlying color values.
 | 
			
		||||
                                Calling set will choose the right underlying implementation.
 | 
			
		||||
 | 
			
		||||
 It's illegal to ask a color for components or other information that are not valid for the color's type. If you need to ask a color for a certain set of components, use methods such as colorUsingType: or colorUsingColorSpace: to first convert the color, and assuming you do not get back nil, then ask for the appropriate component.  If the color is already the specified type or in the specified color space, you get the same color back; otherwise a conversion occurs.
 | 
			
		||||
 
 | 
			
		||||
 So, to get the colorSpace of an arbitrary color whose type you don't know:
 | 
			
		||||
 
 | 
			
		||||
    NSColorSpace *colorSpace = [color colorUsingType:NSColorTypeComponentBased].colorSpace;
 | 
			
		||||
 
 | 
			
		||||
 To get the sRGB red component of a color:
 | 
			
		||||
 
 | 
			
		||||
    NSColor *sRGBColor = color.colorUsingColorSpace(NSColorSpace.sRGBColorSpace);
 | 
			
		||||
    CGFloat red = sRGBColor ? sRGBColor.redComponent : someFallBackValue;
 | 
			
		||||
 
 | 
			
		||||
 From the above example it's important to note that the explicitly named component accessors such as redComponent, cyanComponent, whiteComponent don't work on all component based colors.  For example, only component-based colors whose color space has an RGB model will respond to red/blue/greenComponent, so hence the conversion above. Instead of doing a conversion, you could also validate the color you have with something like:
 | 
			
		||||
 
 | 
			
		||||
    if ((color.type == NSColorTypeComponentBased) && (color.colorSpace.colorSpaceModel == NSColorSpaceModelRGB)) red = color.redComponent;
 | 
			
		||||
 
 | 
			
		||||
 But very often doing a conversion is a better approach since it will let you extract the value you want from any color, as long as conversion is possible.
 | 
			
		||||
 
 | 
			
		||||
 All colors have an alphaComponent property, which defines opacity (1.0 == full opacity).  For some color types 1.0 is the only valid value.
 | 
			
		||||
 
 | 
			
		||||
 Note that prior to 10.13, NSColor used its colorSpaceName property to distinguish different types of colors, rather than type. The name colorSpaceName is a bit misleading since the value doesn't literally correspond to the name of an NSColorSpace. Like type, colors with different colorSpaceName values provide different ways of getting at the components:  NSNamedColorSpace corresponds to NSColorTypeCatalog, NSPatternColorSpace corresponds to NSColorTypePattern, and NSCustomColorSpace corresponds to NSColorTypeComponentBased. There are five other colorSpaceName values which all also correspond to color type of NSColorTypeComponentBased: NSDeviceWhiteColorSpace, NSCalibratedWhiteColorSpace, NSDeviceRGBColorSpace, NSCalibratedRGBColorSpace, NSDeviceCMYKColorSpace.  In new code where possible use type instead of colorSpaceName.
 | 
			
		||||
 | 
			
		||||
 Subclassers of NSColor need to implement the methods type, set, setFill, setStroke, the accessors appropriate for the color's type, and the NSCoding protocol. In code that needs to run prior to 10.13, colorSpaceName should also be implemented.  Some other methods such as colorWithAlphaComponent:, isEqual:, colorUsingType:, colorUsingColorSpaceName:, and CGColor may also be implemented if needed. If isEqual: is overridden, so should hash (because if [a isEqual:b] then [a hash] == [b hash]). Mutable subclassers (if any) should also implement copyWithZone: to a true copy.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <AppKit/NSApplication.h>
 | 
			
		||||
#import <AppKit/NSCell.h>
 | 
			
		||||
#import <AppKit/NSColorList.h>
 | 
			
		||||
#import <AppKit/NSPasteboard.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <CoreImage/CIColor.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSImage, NSColorSpace, NSAppearance;
 | 
			
		||||
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumberWithPatternColorLeakFix = 641.0;
 | 
			
		||||
 | 
			
		||||
/* Enum to distinguish types of colors. The color type of a color determines which properties are valid for that color; it's an exception-raising error to use properties that are not valid for a color.
 | 
			
		||||
 */
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSColorType) {
 | 
			
		||||
    NSColorTypeComponentBased,  // Colors with colorSpace, and floating point color components
 | 
			
		||||
    NSColorTypePattern,         // Colors with patternImage
 | 
			
		||||
    NSColorTypeCatalog          // Colors with catalogNameComponent and colorNameComponent; these colors may have device and appearance specific representations
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSColorSystemEffect) {
 | 
			
		||||
    NSColorSystemEffectNone,
 | 
			
		||||
    NSColorSystemEffectPressed,
 | 
			
		||||
    NSColorSystemEffectDeepPressed,
 | 
			
		||||
    NSColorSystemEffectDisabled,
 | 
			
		||||
    NSColorSystemEffectRollover,
 | 
			
		||||
} API_AVAILABLE(macos(10.14));
 | 
			
		||||
 | 
			
		||||
@interface NSColor : NSObject <NSCopying, NSSecureCoding, NSPasteboardReading, NSPasteboardWriting>
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Create component-based colors with arbitrary colorspace. The colorspace should be component-based, and the number of components in the provided array should match the number dictated by the specified colorspace, plus one for alpha (supply 1.0 for opaque colors); otherwise an exception will be raised.
 | 
			
		||||
*/
 | 
			
		||||
+ (NSColor *)colorWithColorSpace:(NSColorSpace *)space components:(const CGFloat *)components count:(NSInteger)numberOfComponents;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Create component-based colors in the sRGB, GenericGamma22Gray, or P3 colorspaces.
 | 
			
		||||
*/
 | 
			
		||||
+ (NSColor *)colorWithSRGBRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha  API_AVAILABLE(macos(10.7));
 | 
			
		||||
+ (NSColor *)colorWithGenericGamma22White:(CGFloat)white alpha:(CGFloat)alpha  API_AVAILABLE(macos(10.7));
 | 
			
		||||
+ (NSColor *)colorWithDisplayP3Red:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Create component-based colors that are compatible with sRGB colorspace; these methods are effectively same as colorWithSRGBRed:... or colorWithGenericGamma22White:..., but provided for easier reuse of code that uses UIColor on iOS.  If red, green, blue, or saturation, brightness, or white values are outside of the 0..1 range, these will create colors in the extended sRGB (or for colorWithWhite:alpha:, extendedGenericGamma22GrayColorSpace) color spaces. This behavior is compatible with iOS UIColor.
 | 
			
		||||
 */
 | 
			
		||||
+ (NSColor *)colorWithWhite:(CGFloat)white alpha:(CGFloat)alpha API_AVAILABLE(macos(10.9));
 | 
			
		||||
+ (NSColor *)colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha API_AVAILABLE(macos(10.9));
 | 
			
		||||
+ (NSColor *)colorWithHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Create a RGB-based color using HSB component values. An exception will be raised if the color model of the provided color space is not RGB.
 | 
			
		||||
 */
 | 
			
		||||
+ (NSColor *)colorWithColorSpace:(NSColorSpace *)space hue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Look up and return catalog colors from standard color catalogs, or from NSColorList whose name matches the specified catalog name.
 | 
			
		||||
 */
 | 
			
		||||
+ (nullable NSColor *)colorWithCatalogName:(NSColorListName)listName colorName:(NSColorName)colorName;
 | 
			
		||||
 | 
			
		||||
/* Create catalog colors from values stored with the given name in the Asset Catalog of the specified bundle.  To look in the main bundle, use the method without the bundle argument, or specify a nil bundle argument.
 | 
			
		||||
 */
 | 
			
		||||
+ (nullable NSColor *)colorNamed:(NSColorName)name bundle:(nullable NSBundle *)bundle API_AVAILABLE(macos(10.13));
 | 
			
		||||
+ (nullable NSColor *)colorNamed:(NSColorName)name API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
/* Create a dynamic catalog color with a provider that is used to lazily resolve the exact color value.
 | 
			
		||||
 *
 | 
			
		||||
 * When methods are called on this color that need color component values, the provider is called with +NSAppearance.currentAppearance. The provider can use the appearance to return another color to be used for drawing. As much as possible, use the given appearance to make that decision, not other state.
 | 
			
		||||
 * The `colorName` should be universally unique and equates to the identity of the color, if nil is provided a unique name will be generated.
 | 
			
		||||
 * The name and the Aqua appearance color fallback will be encoded as part of the color. The decoded color is also able to 'join' to a color that gets registered with the same name and become dynamic again.
 | 
			
		||||
 */
 | 
			
		||||
+ (NSColor *)colorWithName:(nullable NSColorName)colorName dynamicProvider:(NSColor * (^)(NSAppearance *))dynamicProvider API_AVAILABLE(macos(10.15));
 | 
			
		||||
 | 
			
		||||
/* Create component-based colors in various device color spaces.
 | 
			
		||||
 */
 | 
			
		||||
+ (NSColor *)colorWithDeviceWhite:(CGFloat)white alpha:(CGFloat)alpha;
 | 
			
		||||
+ (NSColor *)colorWithDeviceRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha;
 | 
			
		||||
+ (NSColor *)colorWithDeviceHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha;
 | 
			
		||||
+ (NSColor *)colorWithDeviceCyan:(CGFloat)cyan magenta:(CGFloat)magenta yellow:(CGFloat)yellow black:(CGFloat)black alpha:(CGFloat)alpha;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Create component-based colors in NSCalibratedWhiteColorSpace or NSCalibratedRGBColorSpace color spaces. In general it's best to avoid these methods, since sRGB or P3 colors are preferred over the calibrated (aka "generic") color spaces.
 | 
			
		||||
 */
 | 
			
		||||
+ (NSColor *)colorWithCalibratedWhite:(CGFloat)white alpha:(CGFloat)alpha;
 | 
			
		||||
+ (NSColor *)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha;
 | 
			
		||||
+ (NSColor *)colorWithCalibratedHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Create pattern colors that paint with the specified image.
 | 
			
		||||
 */
 | 
			
		||||
+ (NSColor *)colorWithPatternImage:(NSImage *)image;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Return the type of the color, which in turn determines which accessors are valid for this color. It's an exception-raising error to use properties that are not valid for a color; so, before using a given accessor on a color, call colorUsingType: to convert the color to the appropriate type. Or, if wanting to use colorSpace-specific accessors such as redComponent, convert to the desired colorSpace with colorUsingColorSpace:.
 | 
			
		||||
 
 | 
			
		||||
 Note that as of macOS 10.13, the new APIs type and colorUsingType: replace colorSpaceName and colorUsingColorSpaceName: as the funnel APIs for determining the type of color.  In code destined to run on 10.13 and newer systems, subclassers are encouraged to implement these two rather than the older colorSpaceName based methods.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) NSColorType type API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
/* Convert the color to a color of different type; return nil if conversion is not possible.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSColor *)colorUsingType:(NSColorType)type API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* colorUsingColorSpace: will convert existing color to a new color space, if the receiver can be represented as a component-based color.  This method will return the receiver if its colorspace is already the same as the one specified.  Will return nil if conversion is not possible.
 | 
			
		||||
 
 | 
			
		||||
 This method is highly recommended before using any specialized component accessors such as redComponent, cyanComponent, etc, since these will raise an exception if the color is not in an appropriate color space.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSColor *)colorUsingColorSpace:(NSColorSpace *)space;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Some convenience methods to create standard colors, typically should not be used for display in user interface elements. Do not make any assumptions about the actual color spaces used: For applications built against the 10.13 SDK these return colors in the sRGB or genericGamma22GrayColorSpace color spaces, while in older apps they use calibrated color spaces.
 | 
			
		||||
 */
 | 
			
		||||
@property (class, strong, readonly) NSColor *blackColor;        /* 0.0 white */
 | 
			
		||||
@property (class, strong, readonly) NSColor *darkGrayColor;     /* 0.333 white */
 | 
			
		||||
@property (class, strong, readonly) NSColor *lightGrayColor;    /* 0.667 white */
 | 
			
		||||
@property (class, strong, readonly) NSColor *whiteColor;        /* 1.0 white */
 | 
			
		||||
@property (class, strong, readonly) NSColor *grayColor;         /* 0.5 white */
 | 
			
		||||
@property (class, strong, readonly) NSColor *redColor;          /* 1.0, 0.0, 0.0 RGB */
 | 
			
		||||
@property (class, strong, readonly) NSColor *greenColor;        /* 0.0, 1.0, 0.0 RGB */
 | 
			
		||||
@property (class, strong, readonly) NSColor *blueColor;         /* 0.0, 0.0, 1.0 RGB */
 | 
			
		||||
@property (class, strong, readonly) NSColor *cyanColor;         /* 0.0, 1.0, 1.0 RGB */
 | 
			
		||||
@property (class, strong, readonly) NSColor *yellowColor;       /* 1.0, 1.0, 0.0 RGB */
 | 
			
		||||
@property (class, strong, readonly) NSColor *magentaColor;      /* 1.0, 0.0, 1.0 RGB */
 | 
			
		||||
@property (class, strong, readonly) NSColor *orangeColor;       /* 1.0, 0.5, 0.0 RGB */
 | 
			
		||||
@property (class, strong, readonly) NSColor *purpleColor;       /* 0.5, 0.0, 0.5 RGB */
 | 
			
		||||
@property (class, strong, readonly) NSColor *brownColor;        /* 0.6, 0.4, 0.2 RGB */
 | 
			
		||||
@property (class, strong, readonly) NSColor *clearColor;        /* 0.0 white, 0.0 alpha */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* The following are semantic system colors that are used for drawing user interface elements. These colors are implemented as dynamic named colors whose values may vary between releases and between different appearances (such as Aqua vs DarkAqua vs TouchBar). Do not make assumptions about the color spaces or actual colors used.
 | 
			
		||||
 
 | 
			
		||||
 If you do need to extract a CGColor (to use with a layer, say), always do it as lazily/late as possible, and update it whenever needed.  If you do need to extract color components, always convert to the desired color space first as described at the top of this file.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* Foreground Colors */
 | 
			
		||||
@property (class, strong, readonly) NSColor *labelColor API_AVAILABLE(macos(10.10));           // Foreground color for static text and related elements
 | 
			
		||||
@property (class, strong, readonly) NSColor *secondaryLabelColor API_AVAILABLE(macos(10.10));  // Foreground color for secondary static text and related elements
 | 
			
		||||
@property (class, strong, readonly) NSColor *tertiaryLabelColor API_AVAILABLE(macos(10.10));   // Foreground color for disabled static text and related elements
 | 
			
		||||
@property (class, strong, readonly) NSColor *quaternaryLabelColor API_AVAILABLE(macos(10.10)); // Foreground color for large secondary or disabled static text, separators, large glyphs/icons, etc
 | 
			
		||||
 | 
			
		||||
@property (class, strong, readonly) NSColor *linkColor API_AVAILABLE(macos(10.10));            // Foreground color for standard system links
 | 
			
		||||
@property (class, strong, readonly) NSColor *placeholderTextColor API_AVAILABLE(macos(10.10)); // Foreground color for placeholder text in controls or text views
 | 
			
		||||
@property (class, strong, readonly) NSColor *windowFrameTextColor;                         // Foreground color on window chrome
 | 
			
		||||
@property (class, strong, readonly) NSColor *selectedMenuItemTextColor;                    // Foreground color inside selected menu items. Equivalent to +labelColor in a NSBackgroundStyleEmphasized context.
 | 
			
		||||
@property (class, strong, readonly) NSColor *alternateSelectedControlTextColor;            // Foreground color inside emphasized and selected content: table views rows, collection views, etc. Equivalent to +labelColor in a NSBackgroundStyleEmphasized context.
 | 
			
		||||
@property (class, strong, readonly) NSColor *headerTextColor;                              // Foreground color for header cells in Table/OutlineView
 | 
			
		||||
@property (class, strong, readonly) NSColor *separatorColor API_AVAILABLE(macos(10.14));       // Foreground used for separators between sections of content. Not appropriate for use as split view or window chrome dividers.
 | 
			
		||||
@property (class, strong, readonly) NSColor *gridColor;                                    // Grids in controls
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Background Colors */
 | 
			
		||||
@property (class, strong, readonly) NSColor *windowBackgroundColor;                        // Background for windows. This should not be used for drawing, and NSVisualEffectMaterialWindowBackground should be used instead.
 | 
			
		||||
@property (class, strong, readonly) NSColor *underPageBackgroundColor API_AVAILABLE(macos(10.8)); // Background areas revealed behind documents. This should not be used for drawing, and NSVisualEffectMaterialUnderPageBackground should be used instead.
 | 
			
		||||
@property (class, strong, readonly) NSColor *controlBackgroundColor;                       // Background for content areas: scroll views, table views, collection views. This should not be used for drawing, and NSVisualEffectMaterialContentBackground should be used instead.
 | 
			
		||||
@property (class, strong, readonly) NSColor *selectedContentBackgroundColor API_AVAILABLE(macos(10.14)); // The background color of selected and emphasized (focused) content: table views rows, collection views, etc. Alias for +alternateSelectedControlColor
 | 
			
		||||
@property (class, strong, readonly) NSColor *unemphasizedSelectedContentBackgroundColor API_AVAILABLE(macos(10.14)); // The background color of selected and unemphasized content: table views rows, collection views, etc. Alias for +secondarySelectedControlColor
 | 
			
		||||
@property (class, strong, readonly) NSArray<NSColor *> *alternatingContentBackgroundColors API_AVAILABLE(macos(10.14)); // The background colors for alternating content items: such as table view rows, collection view items. Alias for +controlAlternatingRowBackgroundColors
 | 
			
		||||
@property (class, strong, readonly) NSColor *findHighlightColor API_AVAILABLE(macos(10.13));   // Background color of find indicators: the bubbles that show inline search result hits
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Text Colors */
 | 
			
		||||
@property (class, strong, readonly) NSColor *textColor;                                    // Document text
 | 
			
		||||
@property (class, strong, readonly) NSColor *textBackgroundColor;                          // Document text background
 | 
			
		||||
 | 
			
		||||
@property (class, strong, readonly) NSColor *selectedTextColor;                            // Selected document text
 | 
			
		||||
@property (class, strong, readonly) NSColor *selectedTextBackgroundColor;                  // Selected document text background
 | 
			
		||||
@property (class, strong, readonly) NSColor *unemphasizedSelectedTextBackgroundColor API_AVAILABLE(macos(10.14)); // The background for unemphasized text selection (e.g. when the associated control/view/window is not key)
 | 
			
		||||
@property (class, strong, readonly) NSColor *unemphasizedSelectedTextColor API_AVAILABLE(macos(10.14)); // The foreground for unemphasized text selection (e.g. when the associated control/view/window is not key)
 | 
			
		||||
 | 
			
		||||
/* Control Colors */
 | 
			
		||||
@property (class, strong, readonly) NSColor *controlColor;                                 // Approximate background for the color of control faces (such as buttons).
 | 
			
		||||
@property (class, strong, readonly) NSColor *controlTextColor;                             // Text on controls
 | 
			
		||||
@property (class, strong, readonly) NSColor *selectedControlColor;                         // Control face for selected controls
 | 
			
		||||
@property (class, strong, readonly) NSColor *selectedControlTextColor;                     // Text on selected controls
 | 
			
		||||
@property (class, strong, readonly) NSColor *disabledControlTextColor;                     // Text on disabled controls
 | 
			
		||||
@property (class, strong, readonly) NSColor *keyboardFocusIndicatorColor;                  // Keyboard focus ring around controls
 | 
			
		||||
 | 
			
		||||
@property (class, strong, readonly) NSColor *scrubberTexturedBackgroundColor API_AVAILABLE(macos(10.12.2)); // Patterned background color for use in NSScrubber
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Some colors that are used by system elements and applications. Like the above dynamic system colors, these return named colors whose values may vary between different appearances and releases.  Do not make assumptions about the color spaces or actual colors used.
 | 
			
		||||
 */
 | 
			
		||||
@property (class, strong, readonly) NSColor *systemRedColor API_AVAILABLE(macos(10.10));
 | 
			
		||||
@property (class, strong, readonly) NSColor *systemGreenColor API_AVAILABLE(macos(10.10));
 | 
			
		||||
@property (class, strong, readonly) NSColor *systemBlueColor API_AVAILABLE(macos(10.10));
 | 
			
		||||
@property (class, strong, readonly) NSColor *systemOrangeColor API_AVAILABLE(macos(10.10));
 | 
			
		||||
@property (class, strong, readonly) NSColor *systemYellowColor API_AVAILABLE(macos(10.10));
 | 
			
		||||
@property (class, strong, readonly) NSColor *systemBrownColor API_AVAILABLE(macos(10.10));
 | 
			
		||||
@property (class, strong, readonly) NSColor *systemPinkColor API_AVAILABLE(macos(10.10));
 | 
			
		||||
@property (class, strong, readonly) NSColor *systemPurpleColor API_AVAILABLE(macos(10.10));
 | 
			
		||||
@property (class, strong, readonly) NSColor *systemGrayColor API_AVAILABLE(macos(10.10));
 | 
			
		||||
@property (class, strong, readonly) NSColor *systemTealColor API_AVAILABLE(macos(10.12));
 | 
			
		||||
@property (class, strong, readonly) NSColor *systemIndigoColor API_AVAILABLE(macos(10.15));
 | 
			
		||||
@property (class, strong, readonly) NSColor *systemMintColor API_AVAILABLE(macos(10.12));
 | 
			
		||||
@property (class, strong, readonly) NSColor *systemCyanColor API_AVAILABLE(macos(12.0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*! A dynamic color that reflects the user's current preferred accent color. This color automatically updates when the accent color preference changes. Do not make assumptions about the color space of this color, which may change across releases. */
 | 
			
		||||
@property (class, strong, readonly) NSColor *controlAccentColor API_AVAILABLE(macos(10.14));
 | 
			
		||||
 | 
			
		||||
@property (class, readonly) NSControlTint currentControlTint;   // returns current system control tint
 | 
			
		||||
+ (NSColor *)colorForControlTint:(NSControlTint)controlTint API_DEPRECATED("NSControlTint does not describe the full range of available control accent colors. Use +[NSColor controlAccentColor] instead.", macos(10.0, 11.0));
 | 
			
		||||
 | 
			
		||||
@property (class, strong, readonly) NSColor *highlightColor; // Highlight color for UI elements (this is abstract and defines the color all highlights tend toward)
 | 
			
		||||
@property (class, strong, readonly) NSColor *shadowColor;    // Shadow color for UI elements (this is abstract and defines the color all shadows tend toward)
 | 
			
		||||
- (nullable NSColor *)highlightWithLevel:(CGFloat)val;       // val = 0 => receiver, val = 1 => highlightColor
 | 
			
		||||
- (nullable NSColor *)shadowWithLevel:(CGFloat)val;          // val = 0 => receiver, val = 1 => shadowColor
 | 
			
		||||
 | 
			
		||||
/// Returns a color representing the base color with a system defined effect applied to it. This color is safe to create before draw time, as the resolution of the final color only happens when being `-set`, retrieving its `CGColor`, resolving with `-colorWithType:`, etc. The return color type is `.named`.
 | 
			
		||||
- (NSColor *)colorWithSystemEffect:(NSColorSystemEffect)systemEffect API_AVAILABLE(macos(10.14));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Set the color: Sets the fill and stroke colors in the current drawing context. If the color doesn't know about alpha, it's set to 1.0. Should be implemented by subclassers.
 | 
			
		||||
*/
 | 
			
		||||
- (void)set;
 | 
			
		||||
 | 
			
		||||
/* Set the fill or stroke colors individually. These should be implemented by subclassers.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setFill;
 | 
			
		||||
- (void)setStroke;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Blend using the NSCalibratedRGB color space. Both colors are converted into the calibrated RGB color space, and they are blended by taking fraction of color and 1 - fraction of the receiver. The result is in the calibrated RGB color space. If the colors cannot be converted into the calibrated RGB color space the blending fails and nil is returned.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSColor *)blendedColorWithFraction:(CGFloat)fraction ofColor:(NSColor *)color;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Returns a color in the same color space as the receiver with the specified alpha component. The abstract implementation of this method returns the receiver if alpha is 1.0, otherwise it returns nil; subclassers who have explicit opacity components override this method to actually return a color with the specified alpha.
 | 
			
		||||
*/
 | 
			
		||||
- (NSColor *)colorWithAlphaComponent:(CGFloat)alpha;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*** Methods to get various components of colors. Not all of the methods apply to all colors; if called, they raise. ***/
 | 
			
		||||
 | 
			
		||||
/* Get the catalog and color name of standard colors from catalogs. Valid only on colors whose type is NSColorTypeCatalog. These colors are special colors which can have different device or appearance specific underlying colors.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSColorListName catalogNameComponent;
 | 
			
		||||
@property (readonly, copy) NSColorName colorNameComponent;
 | 
			
		||||
 | 
			
		||||
/* Return localized versions of the above.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSString *localizedCatalogNameComponent;
 | 
			
		||||
@property (readonly, copy) NSString *localizedColorNameComponent;
 | 
			
		||||
 | 
			
		||||
/* Get the red, green, or blue components of NSColorTypeComponentBased colors whose colorSpace model is RGB.  Raise for other types of colors.  To call these safely on unknown colors, you can use code like:
 | 
			
		||||
 
 | 
			
		||||
    NSColor *sRGBColor = color.colorUsingColorSpace(NSColorSpace.sRGBColorSpace);
 | 
			
		||||
    CGFloat red = sRGBColor ? sRGBColor.redComponent : someFallBackValue;
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) CGFloat redComponent;          // Valid only on component based colors whose colorSpace model is NSColorSpaceModelRGB.
 | 
			
		||||
@property (readonly) CGFloat greenComponent;        // Valid only on component based colors whose colorSpace model is NSColorSpaceModelRGB.
 | 
			
		||||
@property (readonly) CGFloat blueComponent;         // Valid only on component based colors whose colorSpace model is NSColorSpaceModelRGB.
 | 
			
		||||
- (void)getRed:(nullable CGFloat *)red green:(nullable CGFloat *)green blue:(nullable CGFloat *)blue alpha:(nullable CGFloat *)alpha;           // Valid only on component based colors whose colorSpace model is NSColorSpaceModelRGB.
 | 
			
		||||
 | 
			
		||||
/* Get the components of NSCalibratedRGB or NSDeviceRGB colors as hue, saturation, or brightness.  Raise for other types of colors.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) CGFloat hueComponent;          // Valid only on component based colors whose colorSpace model is NSColorSpaceModelRGB.
 | 
			
		||||
@property (readonly) CGFloat saturationComponent;   // Valid only on component based colors whose colorSpace model is NSColorSpaceModelRGB.
 | 
			
		||||
@property (readonly) CGFloat brightnessComponent;   // Valid only on component based colors whose colorSpace model is NSColorSpaceModelRGB.
 | 
			
		||||
- (void)getHue:(nullable CGFloat *)hue saturation:(nullable CGFloat *)saturation brightness:(nullable CGFloat *)brightness alpha:(nullable CGFloat *)alpha;     // Valid only on component based colors whose colorSpace model is NSColorSpaceModelRGB.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Get the white component of NSCalibratedWhite or NSDeviceWhite colors, or NSCustomColorSpace colors with color spaces with grayscale model.  Raise for other types of colors.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) CGFloat whiteComponent;        // Valid only on component based colors whose colorSpace model is NSColorSpaceModelGray.
 | 
			
		||||
- (void)getWhite:(nullable CGFloat *)white alpha:(nullable CGFloat *)alpha;     // Valid only on component based colors whose colorSpace model is NSColorSpaceModelGray.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Get the CMYK components of NSDeviceCMYK colors, or NSCustomColorSpace colors with color spaces with CMYK model.   Raise for other types of colors.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) CGFloat cyanComponent;         // Valid only on component based colors whose colorSpace model is NSColorSpaceModelCMYK.
 | 
			
		||||
@property (readonly) CGFloat magentaComponent;      // Valid only on component based colors whose colorSpace model is NSColorSpaceModelCMYK.
 | 
			
		||||
@property (readonly) CGFloat yellowComponent;       // Valid only on component based colors whose colorSpace model is NSColorSpaceModelCMYK.
 | 
			
		||||
@property (readonly) CGFloat blackComponent;        // Valid only on component based colors whose colorSpace model is NSColorSpaceModelCMYK.
 | 
			
		||||
- (void)getCyan:(nullable CGFloat *)cyan magenta:(nullable CGFloat *)magenta yellow:(nullable CGFloat *)yellow black:(nullable CGFloat *)black alpha:(nullable CGFloat *)alpha;         // Valid only on component based colors whose colorSpace model is NSColorSpaceModelCMYK.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* In colors with type == NSColorTypeComponentBased, return the colorspace and individual floating point components, including alpha.  Like other colorspace-specific methods these will raise exceptions on other color types.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, strong) NSColorSpace *colorSpace;
 | 
			
		||||
@property (readonly) NSInteger numberOfComponents;
 | 
			
		||||
- (void)getComponents:(CGFloat *)components;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Return the image used for the pattern color. Will raise exception for colors other than type == NSColorTypePattern.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly, strong) NSImage *patternImage;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Get the alpha component. Valid on all colors; for colors which do not have alpha components, this will return 1.0 (opaque).
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) CGFloat alphaComponent;
 | 
			
		||||
 | 
			
		||||
/* Pasteboard methods
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSColor *)colorFromPasteboard:(NSPasteboard *)pasteBoard;
 | 
			
		||||
- (void)writeToPasteboard:(NSPasteboard *)pasteBoard;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Draws the color and adorns it to indicate the type of color. Used by colorwells, swatches, and other UI objects that need to display colors. Implementation in NSColor simply draws the color (with an indication of transparency if the color isn't fully opaque); subclassers can draw more stuff as they see fit.
 | 
			
		||||
*/
 | 
			
		||||
- (void)drawSwatchInRect:(NSRect)rect;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Convert to and from CGColorRef.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSColor *)colorWithCGColor:(CGColorRef)cgColor API_AVAILABLE(macos(10.8));          // May return nil
 | 
			
		||||
@property (readonly) CGColorRef CGColor NS_RETURNS_INNER_POINTER API_AVAILABLE(macos(10.8));    // Returns an autoreleased CGColor. This will never be NULL, although the return value may be an approximation in some cases, so there isn't guaranteed round-trip fidelity.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Global flag for determining whether an application supports alpha.  This flag is consulted when an application imports alpha (through color dragging, for instance). The value of this flag also determines whether the color panel has an opacity slider. This value is YES by default, indicating that the opacity components of imported colors will be set to 1.0. If an application wants alpha, it can either set the "NSIgnoreAlpha" default to NO or call the set method below.
 | 
			
		||||
 | 
			
		||||
This method provides a global approach to removing alpha which might not always be appropriate. Applications which need to import alpha sometimes should set this flag to NO and explicitly make colors opaque in cases where it matters to them.
 | 
			
		||||
*/
 | 
			
		||||
@property (class) BOOL ignoresAlpha;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSColor (NSDeprecated)
 | 
			
		||||
 | 
			
		||||
/// Historically used as the inner border highlight color for beveled buttons. No longer used.
 | 
			
		||||
@property (class, strong, readonly) NSColor *controlHighlightColor API_DEPRECATED("Use a color that matches the semantics being used, such as `separatorColor`", macos(10.0, 11.0));
 | 
			
		||||
/// Historically used as the outer border highlight color for beveled buttons. No longer used.
 | 
			
		||||
@property (class, strong, readonly) NSColor *controlLightHighlightColor API_DEPRECATED("Use a color that matches the semantics being used, such as `separatorColor`", macos(10.0, 11.0));
 | 
			
		||||
/// Historically used as the inner border shadow color for beveled buttons. No longer used.
 | 
			
		||||
@property (class, strong, readonly) NSColor *controlShadowColor API_DEPRECATED("Use a color that matches the semantics being used, such as `separatorColor`", macos(10.0, 11.0));
 | 
			
		||||
/// Historically used as the outer border shadow color for beveled buttons. No longer used.
 | 
			
		||||
@property (class, strong, readonly) NSColor *controlDarkShadowColor API_DEPRECATED("Use a color that matches the semantics being used, such as `separatorColor`", macos(10.0, 11.0));
 | 
			
		||||
 | 
			
		||||
/// Historically used as the color of scroll bars. No longer used.
 | 
			
		||||
@property (class, strong, readonly) NSColor *scrollBarColor API_DEPRECATED("Use NSScroller instead", macos(10.0, 11.0));
 | 
			
		||||
/// Historically used as the color of scroll bar knobs. No longer used.
 | 
			
		||||
@property (class, strong, readonly) NSColor *knobColor API_DEPRECATED("Use NSScroller instead", macos(10.0, 11.0));
 | 
			
		||||
/// Historically used as the color of scroll bar knobs being dragged. No longer used.
 | 
			
		||||
@property (class, strong, readonly) NSColor *selectedKnobColor API_DEPRECATED("Use NSScroller instead", macos(10.0, 11.0));
 | 
			
		||||
 | 
			
		||||
/// Historically used as the color of the window chrome, which is no longer able to be represented by a color. No longer used.
 | 
			
		||||
@property (class, strong, readonly) NSColor *windowFrameColor API_DEPRECATED("Use NSVisualEffectMaterialTitlebar", macos(10.0, 11.0));
 | 
			
		||||
/// Historically used as the color of selected menu items, which is no longer a color but a tinted blur effect. No longer used.
 | 
			
		||||
@property (class, strong, readonly) NSColor *selectedMenuItemColor API_DEPRECATED("Use NSVisualEffectMaterialSelection", macos(10.0, 11.0));
 | 
			
		||||
/// Historically used as the color of table headers, which is no longer a color but a tinted blur effect.
 | 
			
		||||
@property (class, strong, readonly) NSColor *headerColor API_DEPRECATED("Use NSVisualEffectMaterialHeaderView", macos(10.0, 11.0));
 | 
			
		||||
 | 
			
		||||
/// The background color of selected content or text that is unemphasized. Older alias for +unemphasizedSelectedContentBackgroundColor and +unemphasizedSelectedTextBackgroundColor
 | 
			
		||||
@property (class, strong, readonly) NSColor *secondarySelectedControlColor API_DEPRECATED_WITH_REPLACEMENT("unemphasizedSelectedContentBackgroundColor", macos(10.1, 11.0));
 | 
			
		||||
/// The background color of selected and emphasized (focused) content: table views rows, collection views, etc. Older alias for +selectedContentBackgroundColor
 | 
			
		||||
@property (class, strong, readonly) NSColor *alternateSelectedControlColor API_DEPRECATED_WITH_REPLACEMENT("selectedContentBackgroundColor", macos(10.2, 11.0));
 | 
			
		||||
/// The background colors for alternating content items: such as table view rows, collection view items. Older alias for +alternatingContentBackgroundColors
 | 
			
		||||
@property (class, strong, readonly) NSArray<NSColor *> *controlAlternatingRowBackgroundColors API_DEPRECATED_WITH_REPLACEMENT("alternatingContentBackgroundColors", macos(10.3, 11.0));
 | 
			
		||||
 | 
			
		||||
/* Get the color space name of the color. Note that here "color space name" doesn't refer to the name of an NSColorSpace, but rather an older way to distinguish the color type of different types of colors, as described at the top of this file. Should be implemented by subclassers for code destined to run on 10.12 or earlier. Newer code can choose to implement type instead.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly, copy) NSColorSpaceName colorSpaceName API_DEPRECATED("Use -type and NSColorType instead", macos(10.0,10.14));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Convert the color to a color of another color space name. This may return nil if the specified conversion cannot be done. The abstract implementation of this method returns the receiver if the specified name matches that of the receiver; otherwise it returns nil. Subclassers who can convert themselves to other color space names override this method to do something better.
 | 
			
		||||
 | 
			
		||||
 The device description argument allows the color to specialize itself for the given device.  Device descriptions can be obtained from windows, screens, and printers with the "deviceDescription" method.
 | 
			
		||||
 | 
			
		||||
 If device is nil then the current device (as obtained from the currently lockFocus'ed view's window or, if printing, the current printer) is used. The method without the device: argument passes nil for the device.
 | 
			
		||||
 | 
			
		||||
 If colorSpaceName is nil, then the most appropriate color space is used.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSColor *)colorUsingColorSpaceName:(nullable NSColorSpaceName)name device:(nullable NSDictionary<NSDeviceDescriptionKey, id> *)deviceDescription API_DEPRECATED("Use -colorUsingType: or -colorUsingColorSpace: instead", macos(10.0,10.14));
 | 
			
		||||
- (nullable NSColor *)colorUsingColorSpaceName:(NSColorSpaceName)name API_DEPRECATED("Use -colorUsingType: or -colorUsingColorSpace: instead", macos(10.0,10.14));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSColor (NSQuartzCoreAdditions)
 | 
			
		||||
+ (NSColor *)colorWithCIColor:(CIColor *)color;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface CIColor (NSAppKitAdditions)
 | 
			
		||||
- (nullable instancetype)initWithColor:(NSColor *)color;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSCoder(NSAppKitColorExtensions)
 | 
			
		||||
 | 
			
		||||
/* To decode NXColors... Will return nil if the archived color was "invalid" (written out by the kit in a few instances). Otherwise returns autoreleased NSColor. Can't write NSColors as NXColors, so we have no corresponding encode method.
 | 
			
		||||
*/
 | 
			
		||||
- (null_unspecified NSColor *)decodeNXColor API_DEPRECATED("", macos(10.0,10.9));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSSystemColorsDidChangeNotification;
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,93 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSColorList.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* An NSColorList is an ordered list of NSColors, identified by keys. These keys are used to identify the colors in the list and are used to display the color to the user in the color panel. Note that the key is only used in identifying a color in a color list; it has nothing to do with the contents of the color, unless, of course the color list was set up in such a way that the keys matched the color names.
 | 
			
		||||
 | 
			
		||||
Instances of NSColorList are created for all user-created color lists (those in the color panel) and various color catalogs available on the system.
 | 
			
		||||
 | 
			
		||||
NSColorLists post "NSColorListDidChangeNotification" when changed.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSNotification.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <CoreFoundation/CFDictionary.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSColorListName NS_SWIFT_BRIDGED_TYPEDEF;
 | 
			
		||||
typedef NSString * NSColorName NS_SWIFT_BRIDGED_TYPEDEF;
 | 
			
		||||
 | 
			
		||||
@class NSColor, NSBundle;
 | 
			
		||||
 | 
			
		||||
@interface NSColorList : NSObject <NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
/* Returns all color lists in the user's color list path, including those added at runtime. Creating a named color list and saving with writeToFile:nil will add it to this list; removeFile will remove it from this list. (That is what happens as the user creates and destroys color lists in the color panel.)
 | 
			
		||||
*/
 | 
			
		||||
@property (class, readonly, copy) NSArray<NSColorList *> *availableColorLists;
 | 
			
		||||
 | 
			
		||||
/* Returns the named color list from availableColorLists
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSColorList *)colorListNamed:(NSColorListName)name;
 | 
			
		||||
 | 
			
		||||
/* Creates a color list; specify @"" if you don't want a name. NOTE that this does not add the color list to availableColorLists until the color list is saved into the user's path with writeToFile:nil.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)initWithName:(NSColorListName)name;
 | 
			
		||||
- (nullable instancetype)initWithName:(NSColorListName)name fromFile:(nullable NSString *)path;	/* Load initial contents */
 | 
			
		||||
 | 
			
		||||
/* Name of the color list
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSColorListName name;
 | 
			
		||||
 | 
			
		||||
/* If key already exists, sets the corresponding color. Otherwise inserts the color at the end.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setColor:(NSColor *)color forKey:(NSColorName)key;
 | 
			
		||||
 | 
			
		||||
/* Inserts color at the specified location. If a color by the same key is already in the list but at a different location it is removed from there.
 | 
			
		||||
*/
 | 
			
		||||
- (void)insertColor:(NSColor *)color key:(NSColorName)key atIndex:(NSUInteger)loc;
 | 
			
		||||
 | 
			
		||||
/* No-op if key doesn't exist.
 | 
			
		||||
*/
 | 
			
		||||
- (void)removeColorWithKey:(NSColorName)key;
 | 
			
		||||
 | 
			
		||||
/* Returns nil if key doesn't exist.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSColor *)colorWithKey:(NSColorName)key;
 | 
			
		||||
 | 
			
		||||
/* Use this array to get count of colors and enumerate them according to the ordering specified when inserting.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSArray<NSColorName> *allKeys;
 | 
			
		||||
 | 
			
		||||
/* Depends on the source of the colorlist file
 | 
			
		||||
*/
 | 
			
		||||
@property (getter=isEditable, readonly) BOOL editable;
 | 
			
		||||
 | 
			
		||||
/* Save the color list using secure keyed archive format. Specify nil to save to the user's private colorlists directory (and also update availableColorLists), using the name of the color list.
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)writeToURL:(nullable NSURL *)url error:(NSError **)errPtr API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Save the color list using unkeyed archive format. Specify nil to save to the user's private colorlists directory (and also update availableColorLists), using the name of the color list.
 | 
			
		||||
 
 | 
			
		||||
   Use of the unkeyed archive format (and hence this API) is discouraged since it cannot represent some colors (including custom colorspace based ones) without loss. Use writeToURL:error: instead.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)writeToFile:(nullable NSString *)path API_DEPRECATED("Use -writeToURL:error: instead", macos(10.0,10.14));
 | 
			
		||||
 | 
			
		||||
/* If the color list is in the user's private colorlists directory, removes the corresponding file and the color list from availableColorLists. If there are no outstanding references to the color list this might deallocate the object as well.
 | 
			
		||||
*/
 | 
			
		||||
- (void)removeFile;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* Notifications */
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSColorListDidChangeNotification;
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,94 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSColorPanel.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSPanel.h>
 | 
			
		||||
#import <AppKit/NSApplication.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSColorList, NSMutableArray;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSColorPanelMode) {
 | 
			
		||||
    /* If the color panel is not displaying a mode, the NSColorPanelModeNone will be returned */
 | 
			
		||||
    NSColorPanelModeNone API_AVAILABLE(macos(10.5)) = -1,
 | 
			
		||||
    NSColorPanelModeGray            = 0,
 | 
			
		||||
    NSColorPanelModeRGB             = 1,
 | 
			
		||||
    NSColorPanelModeCMYK            = 2,
 | 
			
		||||
    NSColorPanelModeHSB             = 3,
 | 
			
		||||
    NSColorPanelModeCustomPalette   = 4,
 | 
			
		||||
    NSColorPanelModeColorList       = 5,
 | 
			
		||||
    NSColorPanelModeWheel           = 6,
 | 
			
		||||
    NSColorPanelModeCrayon          = 7
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSColorPanelOptions) {
 | 
			
		||||
    NSColorPanelGrayModeMask		= 0x00000001,
 | 
			
		||||
    NSColorPanelRGBModeMask		= 0x00000002,
 | 
			
		||||
    NSColorPanelCMYKModeMask		= 0x00000004,
 | 
			
		||||
    NSColorPanelHSBModeMask		= 0x00000008,
 | 
			
		||||
    NSColorPanelCustomPaletteModeMask	= 0x00000010,
 | 
			
		||||
    NSColorPanelColorListModeMask	= 0x00000020,
 | 
			
		||||
    NSColorPanelWheelModeMask		= 0x00000040,
 | 
			
		||||
    NSColorPanelCrayonModeMask		= 0x00000080,
 | 
			
		||||
    NSColorPanelAllModesMask		= 0x0000ffff
 | 
			
		||||
};
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@interface NSColorPanel : NSPanel
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, strong) NSColorPanel *sharedColorPanel;
 | 
			
		||||
@property (class, readonly) BOOL sharedColorPanelExists;
 | 
			
		||||
+ (BOOL)dragColor:(NSColor *)color withEvent:(NSEvent *)event fromView:(NSView *)sourceView;
 | 
			
		||||
+ (void)setPickerMask:(NSColorPanelOptions)mask;
 | 
			
		||||
+ (void)setPickerMode:(NSColorPanelMode)mode;
 | 
			
		||||
 | 
			
		||||
@property (nullable, strong) NSView *accessoryView;
 | 
			
		||||
@property (getter=isContinuous) BOOL continuous;
 | 
			
		||||
@property BOOL showsAlpha;
 | 
			
		||||
@property NSColorPanelMode mode;
 | 
			
		||||
@property (copy) NSColor *color;
 | 
			
		||||
@property (readonly) CGFloat alpha;
 | 
			
		||||
- (void)setAction:(nullable SEL)selector;
 | 
			
		||||
- (void)setTarget:(nullable id)target;
 | 
			
		||||
- (void)attachColorList:(NSColorList *)colorList;
 | 
			
		||||
- (void)detachColorList:(NSColorList *)colorList;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSApplication(NSColorPanel)
 | 
			
		||||
- (void)orderFrontColorPanel:(nullable id)sender;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSColorChanging <NSObject>
 | 
			
		||||
- (void)changeColor:(nullable NSColorPanel *)sender;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#if __swift__ < 40200
 | 
			
		||||
@interface NSObject(NSColorPanelResponderMethod)
 | 
			
		||||
- (void)changeColor:(nullable id)sender API_DEPRECATED("This is now a method of the NSColorChanging protocol.", macos(10.0, 11.0));
 | 
			
		||||
@end
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Notifications */
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSColorPanelColorDidChangeNotification;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static const NSColorPanelMode NSNoModeColorPanel API_DEPRECATED_WITH_REPLACEMENT("NSColorPanelModeNone", macos(10.5,10.14)) = NSColorPanelModeNone;
 | 
			
		||||
static const NSColorPanelMode NSGrayModeColorPanel API_DEPRECATED_WITH_REPLACEMENT("NSColorPanelModeGray", macos(10.0,10.14)) = NSColorPanelModeGray;
 | 
			
		||||
static const NSColorPanelMode NSRGBModeColorPanel API_DEPRECATED_WITH_REPLACEMENT("NSColorPanelModeRGB", macos(10.0,10.14)) = NSColorPanelModeRGB;
 | 
			
		||||
static const NSColorPanelMode NSCMYKModeColorPanel API_DEPRECATED_WITH_REPLACEMENT("NSColorPanelModeCMYK", macos(10.0,10.14)) = NSColorPanelModeCMYK;
 | 
			
		||||
static const NSColorPanelMode NSHSBModeColorPanel API_DEPRECATED_WITH_REPLACEMENT("NSColorPanelModeHSB", macos(10.0,10.14)) = NSColorPanelModeHSB;
 | 
			
		||||
static const NSColorPanelMode NSCustomPaletteModeColorPanel API_DEPRECATED_WITH_REPLACEMENT("NSColorPanelModeCustomPalette", macos(10.0,10.14)) = NSColorPanelModeCustomPalette;
 | 
			
		||||
static const NSColorPanelMode NSColorListModeColorPanel API_DEPRECATED_WITH_REPLACEMENT("NSColorPanelModeColorList", macos(10.0,10.14)) = NSColorPanelModeColorList;
 | 
			
		||||
static const NSColorPanelMode NSWheelModeColorPanel API_DEPRECATED_WITH_REPLACEMENT("NSColorPanelModeWheel", macos(10.0,10.14)) = NSColorPanelModeWheel;
 | 
			
		||||
static const NSColorPanelMode NSCrayonModeColorPanel API_DEPRECATED_WITH_REPLACEMENT("NSColorPanelModeCrayon", macos(10.0,10.14)) = NSColorPanelModeCrayon;
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,30 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSColorPicker.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSColorPicking.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@interface NSColorPicker : NSObject <NSColorPickingDefault>
 | 
			
		||||
- (nullable instancetype)initWithPickerMask:(NSUInteger)mask colorPanel:(NSColorPanel *)owningColorPanel;
 | 
			
		||||
@property (readonly, strong) NSColorPanel *colorPanel;
 | 
			
		||||
@property (readonly, strong) NSImage *provideNewButtonImage;
 | 
			
		||||
- (void)insertNewButtonImage:(NSImage *)newButtonImage in:(NSButtonCell *)buttonCell;
 | 
			
		||||
- (void)viewSizeChanged:(nullable id)sender;
 | 
			
		||||
- (void)attachColorList:(NSColorList *)colorList;
 | 
			
		||||
- (void)detachColorList:(NSColorList *)colorList;
 | 
			
		||||
- (void)setMode:(NSColorPanelMode)mode;
 | 
			
		||||
// The default implementation of buttonToolTip returns the current classname
 | 
			
		||||
@property (readonly, copy) NSString *buttonToolTip;
 | 
			
		||||
// The default implementation of minContentSize will look at your view's Autosizing behavior and do the right thing based on that.
 | 
			
		||||
@property (readonly) NSSize minContentSize;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,62 @@
 | 
			
		||||
/*
 | 
			
		||||
 NSColorPickerTouchBarItem.h
 | 
			
		||||
 Application Kit
 | 
			
		||||
 Copyright (c) 2016-2021, Apple Inc.
 | 
			
		||||
 All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSTouchBarItem.h>
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_IPHONE
 | 
			
		||||
@class UIImage, UIColor;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@class NSViewController, NSColor, NSImage, NSString, NSColorList, NSColorSpace;
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.12.2), ios(13.0))
 | 
			
		||||
@interface NSColorPickerTouchBarItem : NSTouchBarItem
 | 
			
		||||
 | 
			
		||||
/// Creates a bar item containing a button with the standard color picker icon that invokes the color picker.
 | 
			
		||||
+ (instancetype)colorPickerWithIdentifier:(NSTouchBarItemIdentifier)identifier;
 | 
			
		||||
/// Creates a bar item containing a button with the standard text color picker icon that invokes the color picker. Should be used when the item is used for picking text colors.
 | 
			
		||||
+ (instancetype)textColorPickerWithIdentifier:(NSTouchBarItemIdentifier)identifier;
 | 
			
		||||
/// Creates a bar item containing a button with the standard stroke color picker icon that invokes the color picker. Should be used when the item is used for picking stroke colors.
 | 
			
		||||
+ (instancetype)strokeColorPickerWithIdentifier:(NSTouchBarItemIdentifier)identifier;
 | 
			
		||||
 | 
			
		||||
/// Creates a bar item containing a button with the provided image that invokes the color picker.
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
+ (instancetype)colorPickerWithIdentifier:(NSTouchBarItemIdentifier)identifier buttonImage:(NSImage *)image;
 | 
			
		||||
#else
 | 
			
		||||
+ (instancetype)colorPickerWithIdentifier:(NSTouchBarItemIdentifier)identifier buttonImage:(UIImage *)image API_AVAILABLE(ios(13.0));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/// The selected color of the picker.
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
@property (copy) NSColor *color;
 | 
			
		||||
#else
 | 
			
		||||
@property (copy) UIColor *color API_AVAILABLE(ios(13.0));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/// Whether or not the picker should allow picking a color with non-1.0 alpha. Defaults to `!NSColor.ignoresAlpha`.
 | 
			
		||||
@property BOOL showsAlpha;
 | 
			
		||||
 | 
			
		||||
/// Controls the color spaces that the receiver is able to produce. If a color outside of the allowed spaces are displayed or selected, it will first be converted to the first color space in the array. `nil` signifies any color space is allowed. Empty array is an invalid value and will raise an exception if set. Defaults to `nil`.
 | 
			
		||||
@property (copy, nullable) NSArray<NSColorSpace *> *allowedColorSpaces API_AVAILABLE(macos(10.13)) API_UNAVAILABLE(ios);
 | 
			
		||||
 | 
			
		||||
/// The color list displayed in the list color picker. Defaults to the standard system color list. Setting a custom color list will disable the additional tints/shades that appear on long-press.
 | 
			
		||||
@property (strong, null_resettable) NSColorList *colorList API_UNAVAILABLE(ios);
 | 
			
		||||
 | 
			
		||||
/// The localized string labelling this item during user customization. The default value is the localized string of "Color Picker".
 | 
			
		||||
@property (readwrite, copy, null_resettable) NSString *customizationLabel;
 | 
			
		||||
 | 
			
		||||
@property (weak, nullable) id target;
 | 
			
		||||
@property (nullable) SEL action;
 | 
			
		||||
 | 
			
		||||
/// Enables or disabled the color picker. If it is currently being shown in a popover, it will be dismissed.
 | 
			
		||||
@property (getter=isEnabled) BOOL enabled;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,83 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSColorPicking.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <AppKit/NSColorPanel.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSButtonCell, NSColor, NSColorPanel, NSColorList, NSImage, NSView;
 | 
			
		||||
 | 
			
		||||
@protocol NSColorPickingDefault
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
    The following methods are implemented by the generic base class, NSColorPicker, and only need be implemented (overridden) by the CustomPicker developer if there is a need.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
    initWithPickerMask:colorPanel: allows you to return your custom color picker to the ColorPanel.
 | 
			
		||||
 | 
			
		||||
    "mask" is the mask (if any) passed to the ColorPanel by the +setPickerMask: method.  If your picker supports any of the bits in the mask, return "self", otherwise, return "nil" (default is "self" if not overridden, since if the "setPickerMask" method is never called, the ColorPanel will just start off with the normal picker modes, of which your custom mode will not be a part). This method can be used to turn off some (or all) of your subpickers, if you have any (like sliders). If this method returns "nil", the object will be freed.
 | 
			
		||||
 
 | 
			
		||||
    "owningColorPanel" is the id of the instantiating ColorPanel.  
 | 
			
		||||
 
 | 
			
		||||
    If this method is overridden, the base class' (NSColorPicker's) initFromPickerMask method should be called before any subclass processing. The instance variable "colorPanel" is set in this method.
 | 
			
		||||
 
 | 
			
		||||
    FOR PERFORMANCE, DO NOT LOAD .NIBS, ETC. HERE!! WAIT UNTIL provideNewView: in NSColorPickingCustom!
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithPickerMask:(NSUInteger)mask colorPanel:(NSColorPanel *)owningColorPanel;
 | 
			
		||||
 | 
			
		||||
/* Allows you to return a new image used in the toolbar. By default, you can simply have a .tiff file with the same name as your custom color picker class in the bundle, and will not need to implement this method. 
 | 
			
		||||
*/
 | 
			
		||||
- (NSImage *)provideNewButtonImage;
 | 
			
		||||
- (void)insertNewButtonImage:(NSImage *)newButtonImage in:(NSButtonCell *)buttonCell;
 | 
			
		||||
- (void)viewSizeChanged:(nullable id)sender;
 | 
			
		||||
- (void)alphaControlAddedOrRemoved:(nullable id)sender;
 | 
			
		||||
- (void)attachColorList:(NSColorList *)colorList;
 | 
			
		||||
- (void)detachColorList:(NSColorList *)colorList;
 | 
			
		||||
- (void)setMode:(NSColorPanelMode)mode;   
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* The tooltip to be used for the tool bar button.
 | 
			
		||||
*/
 | 
			
		||||
- (NSString *)buttonToolTip API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* The minimum content size for your picker. The NSColorPanel will not allow resizing smaller than this size. By default, you will not have to do anything if you properly setup the Autosizing attributes in IB for your view. 
 | 
			
		||||
*/
 | 
			
		||||
- (NSSize)minContentSize API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* NSColorPickingCustom MUST be implemented by the CustomPicker, or an error will occur! 
 | 
			
		||||
*/
 | 
			
		||||
@protocol NSColorPickingCustom <NSColorPickingDefault>
 | 
			
		||||
 | 
			
		||||
/* Return NO if "mode" not supported. 
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)supportsMode:(NSColorPanelMode)mode;   
 | 
			
		||||
 | 
			
		||||
/* Return the current mode that your picker is in.
 | 
			
		||||
*/
 | 
			
		||||
- (NSColorPanelMode)currentMode;
 | 
			
		||||
 | 
			
		||||
/* Provide the view for your picker. initialRequest will be YES on very first call. At this point, you should load your nibs.
 | 
			
		||||
*/
 | 
			
		||||
- (NSView *)provideNewView:(BOOL)initialRequest;
 | 
			
		||||
 | 
			
		||||
/* Set your color picker's displayed color to newColor.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setColor:(NSColor *)newColor;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,34 @@
 | 
			
		||||
/*
 | 
			
		||||
 NSColorSampler.h
 | 
			
		||||
 Application Kit
 | 
			
		||||
 Copyright (c) 2018-2021, Apple Inc.
 | 
			
		||||
 All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSColor;
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * Manages a color sampling interface to allow the user to select a color from their screen.
 | 
			
		||||
 */
 | 
			
		||||
NS_CLASS_AVAILABLE_MAC(10_15)
 | 
			
		||||
@interface NSColorSampler : NSObject
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * The primary method for NSColorSampler.
 | 
			
		||||
 *
 | 
			
		||||
 * Begins or attaches to an existing color sampling session which presents UI to the user for selecting a color from their screen. The handler will be called on the main thread when the user completes the session (either by selection, or cancelation). In the event of user-cancellation, `colorSelectionHandler` will be called with `nil`.
 | 
			
		||||
 *
 | 
			
		||||
 * The calling NSColorSampler instance is retained until the sampling session is completed.
 | 
			
		||||
 */
 | 
			
		||||
- (void)showSamplerWithSelectionHandler:(void (^)(NSColor * _Nullable selectedColor))selectionHandler NS_SWIFT_ASYNC_NAME(sample());
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,88 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSColorSpace.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2004-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <ApplicationServices/ApplicationServices.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSData;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSColorSpaceModel) {
 | 
			
		||||
    NSColorSpaceModelUnknown = -1,
 | 
			
		||||
    NSColorSpaceModelGray,
 | 
			
		||||
    NSColorSpaceModelRGB,
 | 
			
		||||
    NSColorSpaceModelCMYK,
 | 
			
		||||
    NSColorSpaceModelLAB,
 | 
			
		||||
    NSColorSpaceModelDeviceN,
 | 
			
		||||
    NSColorSpaceModelIndexed,
 | 
			
		||||
    NSColorSpaceModelPatterned
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@interface NSColorSpace : NSObject <NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithICCProfileData:(NSData *)iccData;
 | 
			
		||||
@property (nullable, readonly, strong) NSData *ICCProfileData;
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithColorSyncProfile:(void * /* ColorSyncProfileRef */)prof;
 | 
			
		||||
@property (nullable, readonly) void * /* ColorSyncProfileRef */colorSyncProfile NS_RETURNS_INNER_POINTER;
 | 
			
		||||
 | 
			
		||||
/* Create NSColorSpace from a CGColorSpace.  Might return nil if the CGColorSpace is one not supported by NSColorSpace. Internally the NSColorSpace might retain or create a new copy of the provided CGColorSpace; do not rely on pointer equality of the CGColorSpace provided to this function, when later queried. Archiving, for instance, might not persist the pointer equality/identity of the CGColorSpace.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable instancetype)initWithCGColorSpace:(CGColorSpaceRef)cgColorSpace  API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Might return NULL if the NSColorSpace space cannot be represented as a CGColorSpace.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly) CGColorSpaceRef CGColorSpace  API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSInteger numberOfColorComponents;		// Does not include alpha
 | 
			
		||||
@property (readonly) NSColorSpaceModel colorSpaceModel;
 | 
			
		||||
@property (nullable, readonly, copy) NSString *localizedName;	// Will return nil if no localized name
 | 
			
		||||
 | 
			
		||||
@property (class, strong, readonly) NSColorSpace *sRGBColorSpace API_AVAILABLE(macos(10.5));
 | 
			
		||||
@property (class, strong, readonly) NSColorSpace *genericGamma22GrayColorSpace API_AVAILABLE(macos(10.6));             // The grayscale color space with gamma 2.2, compatible with sRGB
 | 
			
		||||
 | 
			
		||||
@property (class, strong, readonly) NSColorSpace *extendedSRGBColorSpace API_AVAILABLE(macos(10.12));                  // sRGB compatible color space that allows specifying components beyond the range of [0.0, 1.0]
 | 
			
		||||
@property (class, strong, readonly) NSColorSpace *extendedGenericGamma22GrayColorSpace API_AVAILABLE(macos(10.12));    // sRGB compatible gray color space that allows specifying components beyond the range of [0.0, 1.0]
 | 
			
		||||
 | 
			
		||||
@property (class, strong, readonly) NSColorSpace *displayP3ColorSpace API_AVAILABLE(macos(10.12));     // Standard DCI-P3 primaries, a D65 white point, and the same gamma curve as the sRGB IEC61966-2.1 color space
 | 
			
		||||
 | 
			
		||||
@property (class, strong, readonly) NSColorSpace *adobeRGB1998ColorSpace API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
@property (class, strong, readonly) NSColorSpace *genericRGBColorSpace;		// NSColorSpace corresponding to Cocoa color space name NSCalibratedRGBColorSpace
 | 
			
		||||
@property (class, strong, readonly) NSColorSpace *genericGrayColorSpace;	// NSColorSpace corresponding to Cocoa color space name NSCalibratedWhiteColorSpace
 | 
			
		||||
@property (class, strong, readonly) NSColorSpace *genericCMYKColorSpace;
 | 
			
		||||
@property (class, strong, readonly) NSColorSpace *deviceRGBColorSpace;		// NSColorSpace corresponding to Cocoa color space name NSDeviceRGBColorSpace
 | 
			
		||||
@property (class, strong, readonly) NSColorSpace *deviceGrayColorSpace;		// NSColorSpace corresponding to Cocoa color space name NSDeviceWhiteColorSpace
 | 
			
		||||
@property (class, strong, readonly) NSColorSpace *deviceCMYKColorSpace;		// NSColorSpace corresponding to Cocoa color space name NSDeviceCMYKColorSpace
 | 
			
		||||
 | 
			
		||||
/* Return the list of color spaces available on the system that are displayed by the color panel, in the order they are displayed in the color panel. Doesn't return arbitrary color spaces which may have been created on the fly, or spaces without user displayable names. Pass model==NSUnknownColorSpaceModel to get all color spaces. Empty array is returned if no color spaces are available for the specified model.
 | 
			
		||||
*/
 | 
			
		||||
+ (NSArray<NSColorSpace *> *)availableColorSpacesWithModel:(NSColorSpaceModel)model  API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static const NSColorSpaceModel NSUnknownColorSpaceModel API_DEPRECATED_WITH_REPLACEMENT("NSColorSpaceModelUnknown", macos(10.0,10.14)) = NSColorSpaceModelUnknown;
 | 
			
		||||
static const NSColorSpaceModel NSGrayColorSpaceModel API_DEPRECATED_WITH_REPLACEMENT("NSColorSpaceModelGray", macos(10.0,10.14)) = NSColorSpaceModelGray;
 | 
			
		||||
static const NSColorSpaceModel NSRGBColorSpaceModel API_DEPRECATED_WITH_REPLACEMENT("NSColorSpaceModelRGB", macos(10.0,10.14)) = NSColorSpaceModelRGB;
 | 
			
		||||
static const NSColorSpaceModel NSCMYKColorSpaceModel API_DEPRECATED_WITH_REPLACEMENT("NSColorSpaceModelCMYK", macos(10.0,10.14)) = NSColorSpaceModelCMYK;
 | 
			
		||||
static const NSColorSpaceModel NSLABColorSpaceModel API_DEPRECATED_WITH_REPLACEMENT("NSColorSpaceModelLAB", macos(10.0,10.14)) = NSColorSpaceModelLAB;
 | 
			
		||||
static const NSColorSpaceModel NSDeviceNColorSpaceModel API_DEPRECATED_WITH_REPLACEMENT("NSColorSpaceModelDeviceN", macos(10.0,10.14)) = NSColorSpaceModelDeviceN;
 | 
			
		||||
static const NSColorSpaceModel NSIndexedColorSpaceModel API_DEPRECATED_WITH_REPLACEMENT("NSColorSpaceModelIndexed", macos(10.0,10.14)) = NSColorSpaceModelIndexed;
 | 
			
		||||
static const NSColorSpaceModel NSPatternColorSpaceModel API_DEPRECATED_WITH_REPLACEMENT("NSColorSpaceModelPatterned", macos(10.0,10.14)) = NSColorSpaceModelPatterned;
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,30 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSColorWell.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSControl.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@interface NSColorWell : NSControl
 | 
			
		||||
 | 
			
		||||
- (void)deactivate;
 | 
			
		||||
- (void)activate:(BOOL)exclusive;
 | 
			
		||||
@property (getter=isActive, readonly) BOOL active;
 | 
			
		||||
 | 
			
		||||
- (void)drawWellInside:(NSRect)insideRect;
 | 
			
		||||
 | 
			
		||||
@property (getter=isBordered) BOOL bordered;
 | 
			
		||||
 | 
			
		||||
- (void)takeColorFrom:(nullable id)sender;
 | 
			
		||||
@property (copy) NSColor *color;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,88 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSComboBox.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1996-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <AppKit/NSTextField.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSComboBoxWillPopUpNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSComboBoxWillDismissNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSComboBoxSelectionDidChangeNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSComboBoxSelectionIsChangingNotification;
 | 
			
		||||
 | 
			
		||||
@class NSComboBox;
 | 
			
		||||
 | 
			
		||||
@protocol NSComboBoxDataSource <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
/* These two methods are required when not using bindings */
 | 
			
		||||
- (NSInteger)numberOfItemsInComboBox:(NSComboBox *)comboBox;
 | 
			
		||||
- (nullable id)comboBox:(NSComboBox *)comboBox objectValueForItemAtIndex:(NSInteger)index;
 | 
			
		||||
 | 
			
		||||
- (NSUInteger)comboBox:(NSComboBox *)comboBox indexOfItemWithStringValue:(NSString *)string;
 | 
			
		||||
- (nullable NSString *)comboBox:(NSComboBox *)comboBox completedString:(NSString *)string;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSComboBoxDelegate <NSTextFieldDelegate>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
/* Notifications */
 | 
			
		||||
- (void)comboBoxWillPopUp:(NSNotification *)notification;
 | 
			
		||||
- (void)comboBoxWillDismiss:(NSNotification *)notification;
 | 
			
		||||
- (void)comboBoxSelectionDidChange:(NSNotification *)notification;
 | 
			
		||||
- (void)comboBoxSelectionIsChanging:(NSNotification *)notification;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSComboBox : NSTextField
 | 
			
		||||
 | 
			
		||||
@property BOOL hasVerticalScroller;
 | 
			
		||||
@property NSSize intercellSpacing;
 | 
			
		||||
@property CGFloat itemHeight;
 | 
			
		||||
@property NSInteger numberOfVisibleItems;
 | 
			
		||||
 | 
			
		||||
@property (getter=isButtonBordered) BOOL buttonBordered;
 | 
			
		||||
 | 
			
		||||
- (void)reloadData;
 | 
			
		||||
- (void)noteNumberOfItemsChanged;
 | 
			
		||||
 | 
			
		||||
@property BOOL usesDataSource;
 | 
			
		||||
 | 
			
		||||
- (void)scrollItemAtIndexToTop:(NSInteger)index;
 | 
			
		||||
- (void)scrollItemAtIndexToVisible:(NSInteger)index;
 | 
			
		||||
 | 
			
		||||
- (void)selectItemAtIndex:(NSInteger)index;
 | 
			
		||||
- (void)deselectItemAtIndex:(NSInteger)index;
 | 
			
		||||
@property (readonly) NSInteger indexOfSelectedItem;
 | 
			
		||||
@property (readonly) NSInteger numberOfItems;
 | 
			
		||||
 | 
			
		||||
@property BOOL completes;
 | 
			
		||||
 | 
			
		||||
@property (nullable, weak) id<NSComboBoxDelegate> delegate;
 | 
			
		||||
 | 
			
		||||
/* The dataSource will only be used when usesDataSource is YES */
 | 
			
		||||
@property (nullable, assign) id<NSComboBoxDataSource> dataSource;
 | 
			
		||||
 | 
			
		||||
/* These methods can only be used when usesDataSource is NO */
 | 
			
		||||
- (void)addItemWithObjectValue:(id)object;
 | 
			
		||||
- (void)addItemsWithObjectValues:(NSArray *)objects;
 | 
			
		||||
- (void)insertItemWithObjectValue:(id)object atIndex:(NSInteger)index;
 | 
			
		||||
- (void)removeItemWithObjectValue:(id)object;
 | 
			
		||||
- (void)removeItemAtIndex:(NSInteger)index;
 | 
			
		||||
- (void)removeAllItems;
 | 
			
		||||
- (void)selectItemWithObjectValue:(nullable id)object;
 | 
			
		||||
- (id)itemObjectValueAtIndex:(NSInteger)index;
 | 
			
		||||
@property (nullable, readonly, strong) id objectValueOfSelectedItem;
 | 
			
		||||
- (NSInteger)indexOfItemWithObjectValue:(id)object;
 | 
			
		||||
@property (readonly, copy) NSArray *objectValues;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,72 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSComboBoxCell.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1996-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <AppKit/NSTextFieldCell.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSButtonCell, NSTableView;
 | 
			
		||||
@protocol NSComboBoxCellDataSource;
 | 
			
		||||
 | 
			
		||||
@interface NSComboBoxCell : NSTextFieldCell
 | 
			
		||||
 | 
			
		||||
@property BOOL hasVerticalScroller;
 | 
			
		||||
@property NSSize intercellSpacing; 
 | 
			
		||||
@property CGFloat itemHeight;
 | 
			
		||||
@property NSInteger numberOfVisibleItems;
 | 
			
		||||
 | 
			
		||||
@property (getter=isButtonBordered) BOOL buttonBordered;
 | 
			
		||||
 | 
			
		||||
- (void)reloadData;
 | 
			
		||||
- (void)noteNumberOfItemsChanged;
 | 
			
		||||
 | 
			
		||||
@property BOOL usesDataSource;
 | 
			
		||||
 | 
			
		||||
- (void)scrollItemAtIndexToTop:(NSInteger)index;
 | 
			
		||||
- (void)scrollItemAtIndexToVisible:(NSInteger)index;
 | 
			
		||||
 | 
			
		||||
- (void)selectItemAtIndex:(NSInteger)index;
 | 
			
		||||
- (void)deselectItemAtIndex:(NSInteger)index;
 | 
			
		||||
@property (readonly) NSInteger indexOfSelectedItem;
 | 
			
		||||
@property (readonly) NSInteger numberOfItems;
 | 
			
		||||
 | 
			
		||||
@property BOOL completes;
 | 
			
		||||
- (nullable NSString *)completedString:(NSString *)string;
 | 
			
		||||
 | 
			
		||||
/* These two methods can only be used when usesDataSource is YES */
 | 
			
		||||
@property (nullable, assign) id<NSComboBoxCellDataSource> dataSource;
 | 
			
		||||
 | 
			
		||||
/* These methods can only be used when usesDataSource is NO */
 | 
			
		||||
- (void)addItemWithObjectValue:(id)object;
 | 
			
		||||
- (void)addItemsWithObjectValues:(NSArray *)objects;
 | 
			
		||||
- (void)insertItemWithObjectValue:(id)object atIndex:(NSInteger)index;
 | 
			
		||||
- (void)removeItemWithObjectValue:(id)object;
 | 
			
		||||
- (void)removeItemAtIndex:(NSInteger)index;
 | 
			
		||||
- (void)removeAllItems;
 | 
			
		||||
- (void)selectItemWithObjectValue:(nullable id)object;
 | 
			
		||||
- (id)itemObjectValueAtIndex:(NSInteger)index;
 | 
			
		||||
@property (nullable, readonly, strong) id objectValueOfSelectedItem;
 | 
			
		||||
- (NSInteger)indexOfItemWithObjectValue:(id)object;
 | 
			
		||||
@property (readonly, copy) NSArray *objectValues;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSComboBoxCellDataSource <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
/* These two methods are required when not using bindings */
 | 
			
		||||
- (NSInteger)numberOfItemsInComboBoxCell:(NSComboBoxCell *)comboBoxCell;
 | 
			
		||||
- (id)comboBoxCell:(NSComboBoxCell *)comboBoxCell objectValueForItemAtIndex:(NSInteger)index;
 | 
			
		||||
 | 
			
		||||
- (NSUInteger)comboBoxCell:(NSComboBoxCell *)comboBoxCell indexOfItemWithStringValue:(NSString *)string;
 | 
			
		||||
- (nullable NSString *)comboBoxCell:(NSComboBoxCell *)comboBoxCell completedString:(NSString *)uncompletedString; 
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,154 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSControl.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <AppKit/NSView.h>
 | 
			
		||||
#import <AppKit/NSText.h>
 | 
			
		||||
#import <AppKit/NSCell.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSCell, NSFont, NSTextView, NSNotification, NSAttributedString, NSFormatter;
 | 
			
		||||
 | 
			
		||||
@interface NSControl : NSView
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithFrame:(NSRect)frameRect NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@property (nullable, weak) id target; // Target is weak for zeroing-weak compatible objects in apps linked on 10.10 or later. Otherwise the behavior of this property is 'assign’.
 | 
			
		||||
@property (nullable) SEL action;
 | 
			
		||||
@property NSInteger tag;
 | 
			
		||||
@property BOOL ignoresMultiClick;
 | 
			
		||||
@property (getter=isContinuous) BOOL continuous;
 | 
			
		||||
@property (getter=isEnabled) BOOL enabled;
 | 
			
		||||
@property BOOL refusesFirstResponder;
 | 
			
		||||
@property (getter=isHighlighted) BOOL highlighted API_AVAILABLE(macos(10.10));
 | 
			
		||||
@property NSControlSize controlSize API_AVAILABLE(macos(10.10));
 | 
			
		||||
@property (nullable, strong) __kindof NSFormatter *formatter;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) id  /* id<NSCopying> */ objectValue;
 | 
			
		||||
@property (copy) NSString *stringValue;
 | 
			
		||||
@property (copy) NSAttributedString *attributedStringValue;
 | 
			
		||||
@property int intValue;
 | 
			
		||||
@property NSInteger integerValue;
 | 
			
		||||
@property float floatValue;
 | 
			
		||||
@property double doubleValue;
 | 
			
		||||
 | 
			
		||||
- (NSSize)sizeThatFits:(NSSize)size API_AVAILABLE(macos(10.10));
 | 
			
		||||
- (void)sizeToFit;
 | 
			
		||||
 | 
			
		||||
- (NSInteger)sendActionOn:(NSEventMask)mask;
 | 
			
		||||
 | 
			
		||||
- (BOOL)sendAction:(nullable SEL)action to:(nullable id)target;
 | 
			
		||||
- (void)takeIntValueFrom:(nullable id)sender;
 | 
			
		||||
- (void)takeFloatValueFrom:(nullable id)sender;
 | 
			
		||||
- (void)takeDoubleValueFrom:(nullable id)sender;
 | 
			
		||||
- (void)takeStringValueFrom:(nullable id)sender;
 | 
			
		||||
- (void)takeObjectValueFrom:(nullable id)sender;
 | 
			
		||||
- (void)takeIntegerValueFrom:(nullable id)sender API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
- (void)mouseDown:(NSEvent *)event;
 | 
			
		||||
- (void)performClick:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
/* The following methods apply only to controls with apparent textual content of some sort (buttons with labels, textfields, etc.).
 | 
			
		||||
 */
 | 
			
		||||
@property (nullable, copy) NSFont *font;
 | 
			
		||||
 | 
			
		||||
@property BOOL usesSingleLineMode API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
@property NSLineBreakMode lineBreakMode API_AVAILABLE(macos(10.10));
 | 
			
		||||
@property NSTextAlignment alignment;
 | 
			
		||||
@property NSWritingDirection baseWritingDirection;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Gets and sets the ability for expansion tool tips to be shown or not. Expansion tooltips are automatically shown when the cell can not show the full content. This is controlled by the NSCell API expansionFrameWithFrame:inView: and is drawn by drawWithExpansionFrame:inView:. The default value is NO.
 | 
			
		||||
    This value is encoded along with the control. In general, it is recommended to turn this on for NSTextFields in a View Based NSTableView.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL allowsExpansionToolTips API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
/*  Allows the control to return an expansion tool tip frame if contentFrame is too small for the entire contents in the view. When the mouse is hovered over the text in certain controls, the full contents will be shown in a special floating tool tip view. If the frame is not too small, return an empty rect, and no expansion tool tip view will be shown. By default, NSControl returns NSZeroRect, while some subclasses (such as NSTextField) will return the proper frame when required.
 | 
			
		||||
 */
 | 
			
		||||
- (NSRect)expansionFrameWithFrame:(NSRect)contentFrame API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
/* Allows the control to perform custom expansion tool tip drawing. Note that the view may be different from the original view that the text appeared in.
 | 
			
		||||
 */
 | 
			
		||||
- (void)drawWithExpansionFrame:(NSRect)contentFrame inView:(NSView *)view API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* The following category applies only to controls with editable text, like NSTextField.
 | 
			
		||||
 */
 | 
			
		||||
@interface NSControl(NSControlEditableTextMethods)
 | 
			
		||||
- (nullable NSText *)currentEditor;
 | 
			
		||||
- (BOOL)abortEditing;
 | 
			
		||||
- (void)validateEditing;
 | 
			
		||||
 | 
			
		||||
- (void)editWithFrame:(NSRect)rect editor:(NSText *)textObj delegate:(nullable id)delegate event:(NSEvent *)event API_AVAILABLE(macos(10.10));
 | 
			
		||||
- (void)selectWithFrame:(NSRect)rect editor:(NSText *)textObj delegate:(nullable id)delegate start:(NSInteger)selStart length:(NSInteger)selLength API_AVAILABLE(macos(10.10));
 | 
			
		||||
- (void)endEditing:(NSText *)textObj API_AVAILABLE(macos(10.10));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSControlTextEditingDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
- (void)controlTextDidBeginEditing:(NSNotification *)obj;
 | 
			
		||||
- (void)controlTextDidEndEditing:(NSNotification *)obj;
 | 
			
		||||
- (void)controlTextDidChange:(NSNotification *)obj;
 | 
			
		||||
 | 
			
		||||
// These delegate and notification methods are sent from NSControl subclasses that allow text editing such as NSTextField and NSMatrix.  The classes that need to send these have delegates.  NSControl does not.
 | 
			
		||||
- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor;
 | 
			
		||||
- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
 | 
			
		||||
- (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(nullable NSString *)error;
 | 
			
		||||
- (void)control:(NSControl *)control didFailToValidatePartialString:(NSString *)string errorDescription:(nullable NSString *)error;
 | 
			
		||||
- (BOOL)control:(NSControl *)control isValidObject:(nullable id)obj;
 | 
			
		||||
 | 
			
		||||
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector;
 | 
			
		||||
- (NSArray<NSString *> *)control:(NSControl *)control textView:(NSTextView *)textView completions:(NSArray<NSString *> *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger *)index;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
                                                                    // userInfo keys:
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSControlTextDidBeginEditingNotification;	//	@"NSFieldEditor"
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSControlTextDidEndEditingNotification;	//	@"NSFieldEditor"
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSControlTextDidChangeNotification;		//	@"NSFieldEditor"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSControl (NSDeprecated)
 | 
			
		||||
 | 
			
		||||
// Use formatters instead.  See -[NSControl formatter] and -[NSControl setFormatter:].
 | 
			
		||||
- (void)setFloatingPointFormat:(BOOL)autoRange left:(NSUInteger)leftDigits right:(NSUInteger)rightDigits API_DEPRECATED("", macos(10.0,10.0));
 | 
			
		||||
 | 
			
		||||
@property (class, nullable) Class cellClass;
 | 
			
		||||
 | 
			
		||||
@property (nullable, strong) __kindof NSCell *cell;
 | 
			
		||||
 | 
			
		||||
- (nullable __kindof NSCell *)selectedCell;
 | 
			
		||||
- (NSInteger)selectedTag;
 | 
			
		||||
 | 
			
		||||
- (void)setNeedsDisplay API_DEPRECATED("Set the needsDisplay property to YES instead", macos(10.0,10.14));
 | 
			
		||||
- (void)calcSize API_DEPRECATED("Override -layout instead. This method should never be called", macos(10.0,10.14));
 | 
			
		||||
 | 
			
		||||
- (void)updateCell:(NSCell *)cell;
 | 
			
		||||
- (void)updateCellInside:(NSCell *)cell;
 | 
			
		||||
- (void)drawCellInside:(NSCell *)cell;
 | 
			
		||||
- (void)drawCell:(NSCell *)cell;
 | 
			
		||||
- (void)selectCell:(NSCell *)cell;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#if __swift__ < 40200
 | 
			
		||||
@interface NSObject(NSControlSubclassNotifications)
 | 
			
		||||
- (void)controlTextDidBeginEditing:(NSNotification *)obj API_DEPRECATED("This is now an optional method of the NSControlTextEditingDelegate protocol.", macos(10.0, 11.0));
 | 
			
		||||
- (void)controlTextDidEndEditing:(NSNotification *)obj API_DEPRECATED("This is now an optional method of the NSControlTextEditingDelegate protocol.", macos(10.0, 11.0));
 | 
			
		||||
- (void)controlTextDidChange:(NSNotification *)obj API_DEPRECATED("This is now an optional method of the NSControlTextEditingDelegate protocol.", macos(10.0, 11.0));
 | 
			
		||||
@end
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,33 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSController.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2002-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSKeyValueBinding.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <CoreFoundation/CoreFoundation.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSMutableArray, NSMutableDictionary, NSMutableSet;
 | 
			
		||||
 | 
			
		||||
@interface NSController : NSObject <NSCoding, NSEditor, NSEditorRegistration>
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (void)objectDidBeginEditing:(id<NSEditor>)editor;
 | 
			
		||||
- (void)objectDidEndEditing:(id<NSEditor>)editor;
 | 
			
		||||
- (void)discardEditing;
 | 
			
		||||
- (BOOL)commitEditing;
 | 
			
		||||
- (void)commitEditingWithDelegate:(nullable id)delegate didCommitSelector:(nullable SEL)didCommitSelector contextInfo:(nullable void *)contextInfo;
 | 
			
		||||
@property (getter=isEditing, readonly) BOOL editing;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,92 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSCursor.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <AppKit/NSApplication.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
@class NSColor, NSEvent, NSImage;
 | 
			
		||||
#if TARGET_OS_IPHONE
 | 
			
		||||
@class UIImage;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.0), ios(13.0))
 | 
			
		||||
@interface NSCursor : NSObject <NSCoding>
 | 
			
		||||
 | 
			
		||||
/* Returns the application's current cursor. This is not necessarily the cursor that is currently being displayed on the system. If you need the currently displayed cursor, use currentSystemCursor.
 | 
			
		||||
*/
 | 
			
		||||
@property (class, readonly, strong) NSCursor *currentCursor;
 | 
			
		||||
 | 
			
		||||
/* Returns an NSCursor whose image and hot spot match those of the cursor that is currently being displayed on the system, regardless of which application set that cursor. For example, this allows an inactive application to examine the image and hot spot of a cursor set by the active application. This API doesn't care whether the cursor is hidden; it will return an NSCursor whose image matches the cursor you would see if it were visible.
 | 
			
		||||
 
 | 
			
		||||
 Only the cursor image and hot spot are replicated in the returned NSCursor. Other properties (such as isSetOnMouseExited and isSetOnMouseEntered) will not necessarily be accurate.
 | 
			
		||||
 
 | 
			
		||||
 This method returns nil if the currently displayed cursor could not be fetched.
 | 
			
		||||
 */
 | 
			
		||||
@property (class, readonly, nullable, strong) NSCursor *currentSystemCursor API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, strong) NSCursor *arrowCursor;
 | 
			
		||||
@property (class, readonly, strong) NSCursor *IBeamCursor;
 | 
			
		||||
@property (class, readonly, strong) NSCursor *pointingHandCursor;
 | 
			
		||||
@property (class, readonly, strong) NSCursor *closedHandCursor;
 | 
			
		||||
@property (class, readonly, strong) NSCursor *openHandCursor;
 | 
			
		||||
@property (class, readonly, strong) NSCursor *resizeLeftCursor;
 | 
			
		||||
@property (class, readonly, strong) NSCursor *resizeRightCursor;
 | 
			
		||||
@property (class, readonly, strong) NSCursor *resizeLeftRightCursor;
 | 
			
		||||
@property (class, readonly, strong) NSCursor *resizeUpCursor;
 | 
			
		||||
@property (class, readonly, strong) NSCursor *resizeDownCursor;
 | 
			
		||||
@property (class, readonly, strong) NSCursor *resizeUpDownCursor;
 | 
			
		||||
@property (class, readonly, strong) NSCursor *crosshairCursor;
 | 
			
		||||
@property (class, readonly, strong) NSCursor *disappearingItemCursor;
 | 
			
		||||
@property (class, readonly, strong) NSCursor *operationNotAllowedCursor API_AVAILABLE(macos(10.5));
 | 
			
		||||
@property (class, readonly, strong) NSCursor *dragLinkCursor API_AVAILABLE(macos(10.6));
 | 
			
		||||
@property (class, readonly, strong) NSCursor *dragCopyCursor API_AVAILABLE(macos(10.6));
 | 
			
		||||
@property (class, readonly, strong) NSCursor *contextualMenuCursor API_AVAILABLE(macos(10.6));
 | 
			
		||||
@property (class, readonly, strong) NSCursor *IBeamCursorForVerticalLayout API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
- (instancetype)initWithImage:(NSImage *)newImage hotSpot:(NSPoint)point NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
#else
 | 
			
		||||
- (instancetype)initWithImage:(UIImage *)newImage hotSpot:(NSPoint)point NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
#endif
 | 
			
		||||
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
+ (void)hide;
 | 
			
		||||
+ (void)unhide;
 | 
			
		||||
+ (void)setHiddenUntilMouseMoves:(BOOL)flag;
 | 
			
		||||
+ (void)pop;
 | 
			
		||||
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
@property (readonly, strong) NSImage *image;
 | 
			
		||||
#else
 | 
			
		||||
@property (readonly, strong) UIImage *image;
 | 
			
		||||
#endif
 | 
			
		||||
@property (readonly) NSPoint hotSpot;
 | 
			
		||||
 | 
			
		||||
- (void)push;
 | 
			
		||||
- (void)pop;
 | 
			
		||||
- (void)set;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumberWithCursorSizeSupport = 682.0;
 | 
			
		||||
@interface NSCursor (NSDeprecated)
 | 
			
		||||
- (instancetype)initWithImage:(NSImage *)newImage foregroundColorHint:(nullable NSColor *)fg backgroundColorHint:(nullable NSColor *)bg hotSpot:(NSPoint)hotSpot API_DEPRECATED("Color hints are ignored. Use -initWithImage:hotSpot: instead", macos(10.0,10.12));
 | 
			
		||||
- (void)setOnMouseExited:(BOOL)flag API_DEPRECATED("setOnMouseExited is unused and should not be called", macos(10.0,10.13));
 | 
			
		||||
- (void)setOnMouseEntered:(BOOL)flag API_DEPRECATED("setOnMouseEntered is unused and should not be called", macos(10.0,10.13));
 | 
			
		||||
@property (getter=isSetOnMouseExited, readonly) BOOL setOnMouseExited API_DEPRECATED("isSetOnMouseExited is unused", macos(10.0,10.13));
 | 
			
		||||
@property (getter=isSetOnMouseEntered, readonly) BOOL setOnMouseEntered API_DEPRECATED("isSetOnMouseEntered is unused", macos(10.0,10.13));
 | 
			
		||||
- (void)mouseEntered:(NSEvent *)event API_DEPRECATED("mouseEntered: is unused and should not be called", macos(10.0,10.13));
 | 
			
		||||
- (void)mouseExited:(NSEvent *)event API_DEPRECATED("mouseExited: is unused and should not be called", macos(10.0,10.13));
 | 
			
		||||
@end
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,28 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSCustomImageRep.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSImageRep.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@interface NSCustomImageRep : NSImageRep
 | 
			
		||||
 | 
			
		||||
// Note that the block passed to the below method may be invoked whenever and on whatever thread the image itself is drawn on. Care should be taken to ensure that all state accessed within the drawingHandler block is done so in a thread safe manner.
 | 
			
		||||
- (instancetype)initWithSize:(NSSize)size flipped:(BOOL)drawingHandlerShouldBeCalledWithFlippedContext drawingHandler:(BOOL (^)(NSRect dstRect))drawingHandler API_AVAILABLE(macos(10.8));
 | 
			
		||||
@property (nullable, readonly, copy) BOOL (^drawingHandler)(NSRect) API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithDrawSelector:(SEL)selector delegate:(id)delegate;
 | 
			
		||||
@property (nullable, readonly) SEL drawSelector;
 | 
			
		||||
@property (nullable, readonly, weak) id delegate;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,39 @@
 | 
			
		||||
/*
 | 
			
		||||
 NSCustomTouchBarItem.h
 | 
			
		||||
 Application Kit
 | 
			
		||||
 Copyright (c) 2015-2021, Apple Inc.
 | 
			
		||||
 All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSTouchBarItem.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.12.2))
 | 
			
		||||
@interface NSCustomTouchBarItem : NSTouchBarItem
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    A view to be displayed in the NSTouchBar in the location corresponding to this item.
 | 
			
		||||
    By default, the getter for this property will return this item's view controller's view. If this property is set explicitly, the view controller will be set to nil.
 | 
			
		||||
    This property is archived.
 | 
			
		||||
*/
 | 
			
		||||
@property (readwrite, strong) __kindof NSView *view;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    A view controller whose view is to be displayed in the NSTouchBar in the location corresponding to this item.
 | 
			
		||||
    By default, this property is nil. When set, this item's view property will automatically return the view associated with this view controller.
 | 
			
		||||
    This property is archived.
 | 
			
		||||
*/
 | 
			
		||||
@property (readwrite, strong, nullable) __kindof NSViewController *viewController;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    The localized string labelling this item during user customization. The default value is the empty string. This property is archived.
 | 
			
		||||
*/
 | 
			
		||||
@property (readwrite, copy, null_resettable) NSString *customizationLabel;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,39 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSDataAsset.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2015-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSDataAssetName NS_SWIFT_BRIDGED_TYPEDEF API_AVAILABLE(ios(9.0), macos(10.11), tvos(9.0), watchos(2.0));
 | 
			
		||||
 | 
			
		||||
/* An NSDataAsset instance provides access to a data entry in an asset catalog such as Images.xcassets. Data entries and image entries in asset catalogs do not share the same namespace. For example, if an asset catalog contains an image entry named @"foo" but no data entry named @"foo", [[NSDataAsset alloc] initWithName:@"foo"] will return nil.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(ios(9.0), macos(10.11), tvos(9.0), watchos(2.0)) @interface NSDataAsset : NSObject<NSCopying>
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
/// Equivalent to -initWithName:name bundle:[NSBundle mainBundle];
 | 
			
		||||
- (nullable instancetype)initWithName:(NSDataAssetName)name;
 | 
			
		||||
/// Create a data asset with the given name from the given bundle. Returns nil if the asset was not found.
 | 
			
		||||
- (nullable instancetype)initWithName:(NSDataAssetName)name bundle:(NSBundle *)bundle NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
/// The name used to reference the data asset
 | 
			
		||||
@property (readonly, copy) NSDataAssetName name;
 | 
			
		||||
/// The data for this asset, as stored in the asset catalog
 | 
			
		||||
@property (readonly, copy) NSData *data;
 | 
			
		||||
/// The Uniform Type Identifier for this data object.
 | 
			
		||||
@property (readonly, copy) NSString *typeIdentifier;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
#endif // !TARGET_OS_IPHONE
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,73 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSDatePicker.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2004-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSControl.h>
 | 
			
		||||
#import <AppKit/NSDatePickerCell.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSCalendar, NSLocale, NSTimeZone;
 | 
			
		||||
 | 
			
		||||
@interface NSDatePicker : NSControl
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Appearance Control ***
 | 
			
		||||
 | 
			
		||||
@property NSDatePickerStyle datePickerStyle;
 | 
			
		||||
 | 
			
		||||
@property (getter=isBezeled) BOOL bezeled;
 | 
			
		||||
 | 
			
		||||
@property (getter=isBordered) BOOL bordered;
 | 
			
		||||
 | 
			
		||||
@property BOOL drawsBackground;
 | 
			
		||||
 | 
			
		||||
@property (copy) NSColor *backgroundColor;
 | 
			
		||||
 | 
			
		||||
@property (copy) NSColor *textColor;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Range Mode Control ***
 | 
			
		||||
 | 
			
		||||
@property NSDatePickerMode datePickerMode;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Date Presentation Control ***
 | 
			
		||||
 | 
			
		||||
@property NSDatePickerElementFlags datePickerElements;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSCalendar *calendar;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSLocale *locale;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSTimeZone *timeZone;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Object Value Access ***
 | 
			
		||||
 | 
			
		||||
@property (copy) NSDate *dateValue;
 | 
			
		||||
 | 
			
		||||
@property NSTimeInterval timeInterval;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Constraints on Displayable/Selectable Range ***
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSDate *minDate;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSDate *maxDate;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Calendar Overlay Support ***
 | 
			
		||||
 | 
			
		||||
@property BOOL presentsCalendarOverlay API_AVAILABLE(macos(10.15.4));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Delegate ***
 | 
			
		||||
 | 
			
		||||
@property (nullable, weak) id<NSDatePickerCellDelegate> delegate;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,116 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSDatePickerCell.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2004-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSDate.h>
 | 
			
		||||
#import <AppKit/NSActionCell.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSDatePickerStyle) {
 | 
			
		||||
    NSDatePickerStyleTextFieldAndStepper    = 0,
 | 
			
		||||
    NSDatePickerStyleClockAndCalendar       = 1,
 | 
			
		||||
    NSDatePickerStyleTextField              = 2
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSDatePickerMode) {
 | 
			
		||||
    NSDatePickerModeSingle = 0,
 | 
			
		||||
    NSDatePickerModeRange = 1
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSDatePickerElementFlags) {
 | 
			
		||||
    /* Time Elements */
 | 
			
		||||
    NSDatePickerElementFlagHourMinute       = 0x000c,
 | 
			
		||||
    NSDatePickerElementFlagHourMinuteSecond = 0x000e,
 | 
			
		||||
    NSDatePickerElementFlagTimeZone	    = 0x0010,
 | 
			
		||||
 | 
			
		||||
    /* Date Elements */
 | 
			
		||||
    NSDatePickerElementFlagYearMonth	    = 0x00c0,
 | 
			
		||||
    NSDatePickerElementFlagYearMonthDay	    = 0x00e0,
 | 
			
		||||
    NSDatePickerElementFlagEra		    = 0x0100,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@class NSCalendar, NSLocale, NSTimeZone;
 | 
			
		||||
@protocol NSDatePickerCellDelegate;
 | 
			
		||||
 | 
			
		||||
@interface NSDatePickerCell : NSActionCell
 | 
			
		||||
 | 
			
		||||
- (instancetype)initTextCell:(NSString *)string NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initImageCell:(nullable NSImage *)image NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Appearance Control ***
 | 
			
		||||
 | 
			
		||||
@property NSDatePickerStyle datePickerStyle;
 | 
			
		||||
 | 
			
		||||
@property BOOL drawsBackground;
 | 
			
		||||
 | 
			
		||||
@property (copy) NSColor *backgroundColor;
 | 
			
		||||
 | 
			
		||||
@property (copy) NSColor *textColor;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Range Mode Control ***
 | 
			
		||||
 | 
			
		||||
@property NSDatePickerMode datePickerMode;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Date Presentation Control ***
 | 
			
		||||
 | 
			
		||||
@property NSDatePickerElementFlags datePickerElements;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSCalendar *calendar;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSLocale *locale;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSTimeZone *timeZone;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Object Value Access ***
 | 
			
		||||
 | 
			
		||||
@property (copy) NSDate *dateValue;
 | 
			
		||||
 | 
			
		||||
@property NSTimeInterval timeInterval;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Constraints on Displayable/Selectable Range ***
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSDate *minDate;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSDate *maxDate;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Delegate ***
 | 
			
		||||
 | 
			
		||||
@property (nullable, weak) id<NSDatePickerCellDelegate> delegate;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSDatePickerCellDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
- (void)datePickerCell:(NSDatePickerCell *)datePickerCell validateProposedDateValue:(NSDate * _Nonnull *_Nonnull)proposedDateValue timeInterval:(nullable NSTimeInterval *)proposedTimeInterval;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* Deprecated legacy date picker style constants. Prefer to use NSDatePickerStyle values instead.
 | 
			
		||||
*/
 | 
			
		||||
static const NSDatePickerStyle NSTextFieldAndStepperDatePickerStyle API_DEPRECATED_WITH_REPLACEMENT("NSDatePickerStyleTextFieldAndStepper", macos(10.0, 11.0)) = NSDatePickerStyleTextFieldAndStepper;
 | 
			
		||||
static const NSDatePickerStyle NSClockAndCalendarDatePickerStyle API_DEPRECATED_WITH_REPLACEMENT("NSDatePickerStyleClockAndCalendar", macos(10.0, 11.0)) = NSDatePickerStyleClockAndCalendar;
 | 
			
		||||
static const NSDatePickerStyle NSTextFieldDatePickerStyle API_DEPRECATED_WITH_REPLACEMENT("NSDatePickerStyleTextField", macos(10.0, 11.0)) = NSDatePickerStyleTextField;
 | 
			
		||||
 | 
			
		||||
/* Deprecated legacy date picker mode constants. Prefer to use NSDatePickerMode values instead.
 | 
			
		||||
*/
 | 
			
		||||
static const NSDatePickerMode NSSingleDateMode API_DEPRECATED_WITH_REPLACEMENT("NSDatePickerModeSingle", macos(10.0, 11.0)) = NSDatePickerModeSingle;
 | 
			
		||||
static const NSDatePickerMode NSRangeDateMode API_DEPRECATED_WITH_REPLACEMENT("NSDatePickerModeRange", macos(10.0, 11.0)) = NSDatePickerModeRange;
 | 
			
		||||
 | 
			
		||||
/* Deprecated legacy date picker element flag constants. Prefer to use NSDatePickerElementFlags values instead.
 | 
			
		||||
*/
 | 
			
		||||
static const NSDatePickerElementFlags NSHourMinuteDatePickerElementFlag API_DEPRECATED_WITH_REPLACEMENT("NSDatePickerElementFlagHourMinute", macos(10.0, 11.0)) = NSDatePickerElementFlagHourMinute;
 | 
			
		||||
static const NSDatePickerElementFlags NSHourMinuteSecondDatePickerElementFlag API_DEPRECATED_WITH_REPLACEMENT("NSDatePickerElementFlagHourMinuteSecond", macos(10.0, 11.0)) = NSDatePickerElementFlagHourMinuteSecond;
 | 
			
		||||
static const NSDatePickerElementFlags NSTimeZoneDatePickerElementFlag API_DEPRECATED_WITH_REPLACEMENT("NSDatePickerElementFlagTimeZone", macos(10.0, 11.0)) = NSDatePickerElementFlagTimeZone;
 | 
			
		||||
static const NSDatePickerElementFlags NSYearMonthDatePickerElementFlag API_DEPRECATED_WITH_REPLACEMENT("NSDatePickerElementFlagYearMonth", macos(10.0, 11.0)) = NSDatePickerElementFlagYearMonth;
 | 
			
		||||
static const NSDatePickerElementFlags NSYearMonthDayDatePickerElementFlag API_DEPRECATED_WITH_REPLACEMENT("NSDatePickerElementFlagYearMonthDay", macos(10.0, 11.0)) = NSDatePickerElementFlagYearMonthDay;
 | 
			
		||||
static const NSDatePickerElementFlags NSEraDatePickerElementFlag API_DEPRECATED_WITH_REPLACEMENT("NSDatePickerElementFlagEra", macos(10.0, 11.0)) = NSDatePickerElementFlagEra;
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,54 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSDictionaryController.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2002-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <AppKit/NSArrayController.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
// NSDictionaryController transforms a dictionary into an array of key-value pairs that is displayed like any other array in an NSArrayController. For each key-value pair, the controller distinguishes between the actual "key" and the "localizedKey" (a user readable version of the key - see setLocalizedKeyDictionary:/-localizedKeyDictionary). If no localizedKeyDictionary is specified, the localized keys default to the keys.
 | 
			
		||||
// In general, the dictionary controller's validation logic will prevent duplicate keys (but developers need to turn on "Validates Immediately" for the value bindings of the controls editing keys to run that validation). For insertions of new entries, the controller will enumerate the key by default (so if the initialKey is "key", the inserted keys will be "key", "key1", "key2", and so on). To customize that behavior, override the -newObject method.
 | 
			
		||||
 | 
			
		||||
// This key-value pair object allows controls to be bound, for example, to arrangedObjects.localizedKey, arrangedObjects.key, arrangedObjects.value, and arrangedObjects.explicitlyIncluded of the controller. Mutating a key-value-pair object immediately results in the corresponding change in the content dictionary of the controller.
 | 
			
		||||
API_AVAILABLE(macos(10.11))
 | 
			
		||||
@interface NSDictionaryControllerKeyValuePair : NSObject
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE; // NSDictionaryControllerKeyValuePair instances must be created via -newObject on the NSDictionaryController.
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSString *key;
 | 
			
		||||
@property (nullable, strong) id value;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSString *localizedKey; // The localized key from the NSDictionaryController’s localizedKeyDictionary
 | 
			
		||||
@property (readonly, getter=isExplicitlyIncluded) BOOL explicitlyIncluded; // YES if the key is in the NSDictionaryController’s includedKeys, otherwise NO
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.5))
 | 
			
		||||
@interface NSDictionaryController : NSArrayController
 | 
			
		||||
 | 
			
		||||
- (NSDictionaryControllerKeyValuePair *)newObject;    // overridden from the superclass to create a key-value pair to represent an entry in the content dictionary of the controller; method is invoked for insertions of new key-value pairs as well as transforming existing dictionary entries into key-value pairs for display
 | 
			
		||||
 | 
			
		||||
// Initial key and value are assigned to newly inserted entries. The initial key will be copied, the initial value will be retained when inserted into the dictionary (not copied), and must implement NSCoding if the dictionary controller gets archived.
 | 
			
		||||
@property (copy) NSString *initialKey;
 | 
			
		||||
@property (strong) id initialValue;
 | 
			
		||||
 | 
			
		||||
// Included keys are always represented by a key-value pair in the display array, whether present in the underlying dictionary or not. Excluded keys are always suppressed in the display array.
 | 
			
		||||
@property (copy) NSArray<NSString *> *includedKeys;
 | 
			
		||||
@property (copy) NSArray<NSString *> *excludedKeys;
 | 
			
		||||
 | 
			
		||||
// Localized key dictionary allows to specify a (typically localized) string for each key in the dictionary (the dictionary needs to contain the keys as keys and the localized keys as values).
 | 
			
		||||
@property (copy) NSDictionary<NSString *, NSString *> *localizedKeyDictionary;
 | 
			
		||||
@property (nullable, copy) NSString *localizedKeyTable;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,115 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSDiffableDataSource.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 2019-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <TargetConditionals.h>
 | 
			
		||||
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSCollectionView.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
/* An NSDiffableDataSourceSnapshot represents the complete state of a UI element (e.g. NSCollectionView)
 | 
			
		||||
 | 
			
		||||
   Snapshots can be created in two ways:
 | 
			
		||||
   1. From a connected data source: e.g. `[diffableDataSource snapshot]`
 | 
			
		||||
      This will contain the current state of the UI element.
 | 
			
		||||
 | 
			
		||||
   2. Constructing a new instance: e.g. `[[NSDiffableDataSourceSnapshot<Int,UUID> alloc] init]`
 | 
			
		||||
      This will construct an empty snapshot with no section or item identifiers.
 | 
			
		||||
 | 
			
		||||
   Notes:
 | 
			
		||||
     1. All identifiers must be unique. Section and Item identifiers do not overlap and may contain values that exist in the other (i.e. it is OK
 | 
			
		||||
        to have a section identifier == 1 and an item identifier == 1)
 | 
			
		||||
 | 
			
		||||
     2. If you pass duplicate values in an item or section array (e.g. `-appendItemsWithIdentifiers:`), the system will throw an exception.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.15),ios(13.0),tvos(13.0),watchos(6.0))
 | 
			
		||||
@interface NSDiffableDataSourceSnapshot<SectionIdentifierType,ItemIdentifierType> : NSObject<NSCopying>
 | 
			
		||||
 | 
			
		||||
// structure
 | 
			
		||||
 | 
			
		||||
@property(nonatomic,readonly) NSInteger numberOfItems;
 | 
			
		||||
@property(nonatomic,readonly) NSInteger numberOfSections;
 | 
			
		||||
@property(nonatomic,readonly) NSArray<SectionIdentifierType> *sectionIdentifiers;
 | 
			
		||||
@property(nonatomic,readonly) NSArray<ItemIdentifierType> *itemIdentifiers;
 | 
			
		||||
 | 
			
		||||
- (NSInteger)numberOfItemsInSection:(SectionIdentifierType)sectionIdentifier;
 | 
			
		||||
- (NSArray<ItemIdentifierType> *)itemIdentifiersInSectionWithIdentifier:(SectionIdentifierType)sectionIdentifier;
 | 
			
		||||
- (nullable SectionIdentifierType)sectionIdentifierForSectionContainingItemIdentifier:(ItemIdentifierType)itemIdentifier;
 | 
			
		||||
 | 
			
		||||
- (NSInteger)indexOfItemIdentifier:(ItemIdentifierType)itemIdentifier;             // If item identifier is not present returns NSNotFound
 | 
			
		||||
- (NSInteger)indexOfSectionIdentifier:(SectionIdentifierType)sectionIdentifier;    // If section identifier is not present returns NSNotFound
 | 
			
		||||
 | 
			
		||||
// items operations
 | 
			
		||||
 | 
			
		||||
- (void)appendItemsWithIdentifiers:(NSArray<ItemIdentifierType> *)identifiers;     // convenience: appends into last section
 | 
			
		||||
- (void)appendItemsWithIdentifiers:(NSArray<ItemIdentifierType> *)identifiers intoSectionWithIdentifier:(SectionIdentifierType)sectionIdentifier;
 | 
			
		||||
 | 
			
		||||
- (void)insertItemsWithIdentifiers:(NSArray<ItemIdentifierType> *)identifiers beforeItemWithIdentifier:(ItemIdentifierType)itemIdentifier;
 | 
			
		||||
- (void)insertItemsWithIdentifiers:(NSArray<ItemIdentifierType> *)identifiers afterItemWithIdentifier:(ItemIdentifierType)itemIdentifier;
 | 
			
		||||
 | 
			
		||||
- (void)deleteItemsWithIdentifiers:(NSArray<ItemIdentifierType> *)identifiers;
 | 
			
		||||
- (void)deleteAllItems;
 | 
			
		||||
 | 
			
		||||
- (void)moveItemWithIdentifier:(ItemIdentifierType)fromIdentifier beforeItemWithIdentifier:(ItemIdentifierType)toIdentifier;
 | 
			
		||||
- (void)moveItemWithIdentifier:(ItemIdentifierType)fromIdentifier afterItemWithIdentifier:(ItemIdentifierType)toIdentifier;
 | 
			
		||||
 | 
			
		||||
- (void)reloadItemsWithIdentifiers:(NSArray<ItemIdentifierType>*)identifiers;
 | 
			
		||||
 | 
			
		||||
// section operations
 | 
			
		||||
 | 
			
		||||
- (void)appendSectionsWithIdentifiers:(NSArray*)sectionIdentifiers;
 | 
			
		||||
 | 
			
		||||
- (void)insertSectionsWithIdentifiers:(NSArray<SectionIdentifierType> *)sectionIdentifiers beforeSectionWithIdentifier:(SectionIdentifierType)toSectionIdentifier;
 | 
			
		||||
- (void)insertSectionsWithIdentifiers:(NSArray<SectionIdentifierType> *)sectionIdentifiers afterSectionWithIdentifier:(SectionIdentifierType)toSectionIdentifier;
 | 
			
		||||
 | 
			
		||||
- (void)deleteSectionsWithIdentifiers:(NSArray<SectionIdentifierType> *)sectionIdentifiers;
 | 
			
		||||
 | 
			
		||||
- (void)moveSectionWithIdentifier:(SectionIdentifierType)fromSectionIdentifier beforeSectionWithIdentifier:(SectionIdentifierType)toSectionIdentifier;
 | 
			
		||||
- (void)moveSectionWithIdentifier:(SectionIdentifierType)fromSectionIdentifier afterSectionWithIdentifier:(SectionIdentifierType)toSectionIdentifier;
 | 
			
		||||
 | 
			
		||||
- (void)reloadSectionsWithIdentifiers:(NSArray<SectionIdentifierType>*)sectionIdentifiers;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* NSCollectionViewDiffableDataSource offers an identifier-based interface for providing an NSCollectionView's content.  It automatically performs the inserts, deletes, and moves necessary to transition an NSCollectionView from one model-state snapshot to another.
 | 
			
		||||
*/
 | 
			
		||||
API_AVAILABLE(macos(10.15))
 | 
			
		||||
@interface NSCollectionViewDiffableDataSource<SectionIdentifierType,ItemIdentifierType> : NSObject<NSCollectionViewDataSource>
 | 
			
		||||
 | 
			
		||||
typedef NSCollectionViewItem * _Nullable (^NSCollectionViewDiffableDataSourceItemProvider)(NSCollectionView * _Nonnull, NSIndexPath * _Nonnull, ItemIdentifierType _Nonnull);
 | 
			
		||||
 | 
			
		||||
typedef NSView * _Nullable (^NSCollectionViewDiffableDataSourceSupplementaryViewProvider)(NSCollectionView* _Nonnull, NSString * _Nonnull, NSIndexPath * _Nonnull);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Creates a new NSCollectionViewDiffableDataSource that automatically wires itself up as the given `collectionView`'s `dataSource`.  The data source is initially empty.  To put items into the `collectionView`, you must create an NSDiffableDataSourceSnapshot, add the desired section and item identifiers to the snapshot, and apply the snapshot to the diffable data source.  The required `itemProvider` closure serves the same purpose as NSCollectionViewDataSource `-collectionView:itemForRepresentedObjectAtIndexPath:` method: Its job is to ask the `collectionView` to make an item of the desired type, configure its content and appearance to represent the model object specified by the given identifier and NSIndexPath, and return the configured item.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)initWithCollectionView:(NSCollectionView*)collectionView itemProvider:(NSCollectionViewDiffableDataSourceItemProvider)itemProvider;
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
+ (instancetype)new NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
// Create a mutable "snapshot" of the data source state.
 | 
			
		||||
//   This can be mutated via transactional updates which, when completed, can be "applied" back to a connected data source
 | 
			
		||||
- (NSDiffableDataSourceSnapshot<SectionIdentifierType,ItemIdentifierType>*)snapshot;
 | 
			
		||||
 | 
			
		||||
// Apply a snapshot to the connected data source.
 | 
			
		||||
//   To perform an animated diff of the changes: animatingDifferences == YES
 | 
			
		||||
//   For non-animated update (i.e. reloadData) without the diff overhead: animatingDifferences == NO
 | 
			
		||||
- (void)applySnapshot:(NSDiffableDataSourceSnapshot<SectionIdentifierType,ItemIdentifierType> *)snapshot animatingDifferences:(BOOL)animatingDifferences;
 | 
			
		||||
 | 
			
		||||
// IndexPath <-> item identifier conversion
 | 
			
		||||
- (nullable ItemIdentifierType)itemIdentifierForIndexPath:(NSIndexPath *)indexPath;
 | 
			
		||||
- (nullable NSIndexPath *)indexPathForItemIdentifier:(ItemIdentifierType)identifier;
 | 
			
		||||
 | 
			
		||||
@property(copy,nullable) NSCollectionViewDiffableDataSourceSupplementaryViewProvider supplementaryViewProvider;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -0,0 +1,68 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSDockTile.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2006-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSString.h>
 | 
			
		||||
#import <AppKit/NSApplication.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
static const NSAppKitVersion NSAppKitVersionNumberWithDockTilePlugInSupport = 1001.0;
 | 
			
		||||
 | 
			
		||||
@class NSView;
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.5))
 | 
			
		||||
@interface NSDockTile : NSObject 
 | 
			
		||||
/* get the size of the dock tile, in screen coordinates
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) NSSize size;
 | 
			
		||||
 | 
			
		||||
/* set the content view to view.  view should be height and width resizable.  In order to initiate drawing in view, you must call -[NSDockTile display]. 
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, strong) NSView *contentView;
 | 
			
		||||
 | 
			
		||||
/* cause the dock tile to be redrawn.  The contentView and any subviews will be sent drawRect: messages.
 | 
			
		||||
*/
 | 
			
		||||
- (void)display;
 | 
			
		||||
 | 
			
		||||
/* setShowsApplicationBadge: sets whether or not the dock tile should be badged with the application icon.  Default is YES for NSWindow dock tiles, NO for the NSApplication dock tile.
 | 
			
		||||
*/
 | 
			
		||||
@property BOOL showsApplicationBadge;
 | 
			
		||||
 | 
			
		||||
/* Badge the dock icon with a localized string.  The badge appearance is system defined.  This is often used to show an unread count in the application dock icon.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, copy) NSString *badgeLabel;
 | 
			
		||||
 | 
			
		||||
/* -owner will return NSApp for the application dock tile, or the NSWindow for a mini window dock tile.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, weak) id owner;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@class NSMenu;
 | 
			
		||||
 | 
			
		||||
/* An application may customize its dock tile when not running via a plugin whose principal class implements the NSDockTilePlugIn protocol.  The name of the plugin is indicated by a NSDockTilePlugIn key in the application's Info.plist file.  The plugin is loaded in a system process at login time or when the application tile is added to the Dock.  When the plugin is loaded, the principal class' implementation of -setDockTile: is invoked.  If the principal class implements -dockMenu, -dockMenu is invoked whenever the user causes the application's dock menu to be shown.  When the dock tile is no longer valid (eg. the application has been removed from the dock, -setDockTile: is invoked with a nil NSDockTile.
 | 
			
		||||
*/
 | 
			
		||||
@protocol NSDockTilePlugIn <NSObject>
 | 
			
		||||
 | 
			
		||||
@required
 | 
			
		||||
- (void)setDockTile:(nullable NSDockTile*)dockTile;
 | 
			
		||||
 | 
			
		||||
@optional
 | 
			
		||||
/* The plugin should return a menu whose contents will be inserted in front of the standard Dock tile contents. Note that the plugin must ensure that the menu remains valid until the user is done interacting with the menu, which generally requires that the menu be stored in a property with strong ownership. Specifically, the menu should not be autoreleased; that would allow the menu to be deallocated before the user can interact with it, and will cause menu item selections to be ignored.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSMenu*)dockMenu;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,847 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSDocument.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1997-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSNib.h>
 | 
			
		||||
#import <AppKit/NSNibDeclarations.h>
 | 
			
		||||
#import <AppKit/NSUserInterfaceValidation.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <Foundation/NSFilePresenter.h>
 | 
			
		||||
#import <AppKit/NSMenu.h>
 | 
			
		||||
#import <AppKit/NSPrintInfo.h>
 | 
			
		||||
#import <AppKit/NSKeyValueBinding.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSData, NSDate, NSError, NSFileWrapper, NSMenuItem, NSPageLayout, NSPrintInfo, NSPrintOperation, NSSavePanel, NSSharingService, NSSharingServicePicker, NSUndoManager, NSURL, NSView, NSWindow, NSWindowController;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSDocumentChangeType) {
 | 
			
		||||
 | 
			
		||||
/* The value to pass to -updateChangeCount: to indicate that a single change has been done. For example, NSDocument's built-in undo support uses this whenever a document receives an NSUndoManagerWillCloseUndoGroupNotification from its own undo manager.
 | 
			
		||||
*/
 | 
			
		||||
    NSChangeDone = 0,
 | 
			
		||||
 | 
			
		||||
/* The value to pass to indicate that a single change has been undone. For example, NSDocument's built-in undo support uses this whenever a document receives an NSUndoManagerDidUndoChangeNotification from its own undo manager.
 | 
			
		||||
*/
 | 
			
		||||
    NSChangeUndone = 1,
 | 
			
		||||
 | 
			
		||||
/* The value to pass to indicate that a single change has been redone. For example, NSDocument's built-in undo support uses this whenever a document receives an NSUndoManagerDidRedoChangeNotification from its own undo manager.
 | 
			
		||||
*/
 | 
			
		||||
    NSChangeRedone API_AVAILABLE(macos(10.5)) = 5,
 | 
			
		||||
 | 
			
		||||
/* The value to pass to indicate that the document has been synchronized with its file or file package. For example, both -revertToContentsOfURL:ofType:error: and -saveToURL:ofType:forSaveOperation:completionHandler: may use this when they invoke -updateChangeCount:.
 | 
			
		||||
*/
 | 
			
		||||
    NSChangeCleared = 2,
 | 
			
		||||
 | 
			
		||||
/* The value to pass to indicate that the document has been initialized with the contents of a file or file package other than the one whose location would be returned by -fileURL, and therefore can't possibly be synchronized with its persistent representation. For example, -initForURL:withContentsOfURL:ofType:error: uses this when the two passed-in URLs are not equal to indicate that an autosaved document is being reopened.
 | 
			
		||||
*/
 | 
			
		||||
    NSChangeReadOtherContents = 3,
 | 
			
		||||
 | 
			
		||||
/* The value to pass to indicate that the document's contents have been autosaved. For example, -saveToURL:ofType:forSaveOperation:completionHandler: may use this when it invokes -updateChangeCount:.
 | 
			
		||||
*/
 | 
			
		||||
    NSChangeAutosaved = 4,
 | 
			
		||||
    
 | 
			
		||||
/* Use this mask to indicate that a discardable change has been done. Discardable changes cause the document to be edited. In a locked document, for example, discardable changes may be thrown away instead of prompting the user to save them. Bitwise-or this value with the appropriate kind of change, NSChangeDone, NSChangeUndone, or NSChangeRedone. For example, a discardable change is "NSChangeDone | NSChangeDiscardable".
 | 
			
		||||
*/
 | 
			
		||||
    NSChangeDiscardable API_AVAILABLE(macos(10.7)) = 256
 | 
			
		||||
    
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSSaveOperationType) {
 | 
			
		||||
 | 
			
		||||
/* The overwriting of a document's file or file package with the document's current contents because the user explicitly commanded it.
 | 
			
		||||
*/
 | 
			
		||||
    NSSaveOperation = 0,
 | 
			
		||||
 | 
			
		||||
/* The writing of a document's current contents to a new file or file package, and then making the just-written file or file package the document's current one.
 | 
			
		||||
*/
 | 
			
		||||
    NSSaveAsOperation = 1,
 | 
			
		||||
 | 
			
		||||
/* The writing of a document's current contents to a new file or file package without changing the document's current one.
 | 
			
		||||
*/
 | 
			
		||||
    NSSaveToOperation = 2,
 | 
			
		||||
 | 
			
		||||
/* The overwriting of a document's file or file package with the document's current contents even though the user has not explicitly commanded it.
 | 
			
		||||
*/
 | 
			
		||||
    NSAutosaveInPlaceOperation API_AVAILABLE(macos(10.7)) = 4,
 | 
			
		||||
 | 
			
		||||
/* The writing of a document's current contents to a file or file package that is separate from the document's current one, without changing the document's current one. For an NSDocument subclass that overrides Mac OS 10.7's +autosavesInPlaces to return YES this is only used during autosaving of documents that have never been saved and therefore do not yet have a document file that can be overwritten during autosaving.
 | 
			
		||||
*/
 | 
			
		||||
    NSAutosaveElsewhereOperation API_AVAILABLE(macos(10.7)) = 3,
 | 
			
		||||
    
 | 
			
		||||
/* The writing of a document's current contents to new file or file package even though the user has not explicitly commanded it, and then making the just-written file or file package the document's current one.
 | 
			
		||||
*/
 | 
			
		||||
    NSAutosaveAsOperation API_AVAILABLE(macos(10.8)) = 5,
 | 
			
		||||
    
 | 
			
		||||
/* An old name for NSAutosaveElsewhereOperation that was deprecated in Mac OS 10.7.
 | 
			
		||||
*/
 | 
			
		||||
    NSAutosaveOperation API_DEPRECATED("Use NSAutosaveElsewhereOperation instead", macos(10.4,10.7))= 3
 | 
			
		||||
    
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
NS_SWIFT_UI_ACTOR
 | 
			
		||||
@interface NSDocument : NSObject<NSEditorRegistration, NSFilePresenter, NSMenuItemValidation, NSUserInterfaceValidations>
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Initialization ***
 | 
			
		||||
 | 
			
		||||
/* The designated initializer. It is invoked by each of NSDocument's other initialization methods.
 | 
			
		||||
 | 
			
		||||
You can override this method to perform initialization that must be done both when creating new empty documents and when opening existing documents. Your override must invoke super to initialize private NSDocument instance variables. It must never return nil. If an error can occur during object initialization, check for the error in an override of -initWithType:error:, -initWithContentsOfURL:ofType:error:, or -initForURL:withContentsOfURL:ofType:error:, because those methods can return NSErrors.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Creation ***
 | 
			
		||||
 | 
			
		||||
/* Initialize a new empty document of a specified type, and return it if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why the document could not be initialized. The default implementation of this method just invokes [self init] and [self setFileType:typeName].
 | 
			
		||||
 | 
			
		||||
You can override this method to perform initialization that must be done when creating new documents but should not be done when opening existing documents. Your override should typically invoke super, or at least it must invoke -init, NSDocument's designated initializer, to initialize NSDocument's private instance variables.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable instancetype)initWithType:(NSString *)typeName error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Opening ***
 | 
			
		||||
 | 
			
		||||
/* Return whether instances of the receiving class can concurrently read documents of the specified type. The default implementation of this method returns NO. You can override it to return YES to enable concurrent opening of documents but you must make sure your document reading code can be safely executed concurrently, in non-main threads.
 | 
			
		||||
*/
 | 
			
		||||
+ (BOOL)canConcurrentlyReadDocumentsOfType:(NSString *)typeName API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Initialize a document located by a URL, of a specified type, and return it if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why the document could not be initialized. The default implementation of this method invokes [self init], [self readFromURL:url ofType:typeName error:outError], [self setFileURL:url], [self setFileType:typeName], and [self setFileModificationDate:theModificationDate].
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self initWithContentsOfFile:url ofType:typeName] if -initWithContentsOfFile:ofType: is overridden and the URL uses the "file:" scheme. It still invokes [self setFileModificationDate:theModificationDate] in this situation.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable instancetype)initWithContentsOfURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Reopening after Autosaving ***
 | 
			
		||||
 | 
			
		||||
/* Initialize a document located by a URL, of a specified type, but by reading the contents for the document from another URL, and return it if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why the document could not be initialized. The default implementation of this method invokes [self readFromURL:contentsURL ofType:typeName error:outError], [self setFileURL:urlOrNil], [self setAutosavedContentsFileURL:contentsURL], [self setFileType:typeName], and [self setFileModificationDate:theModificationDate]. It also invokes [self updateChangeCount:NSChangeReadOtherContents] if the two URLs aren't identical, so that -isDocumentEdited will always return YES until the user saves or reverts the document.
 | 
			
		||||
 | 
			
		||||
To ease the adoption of the autosaving feature introduced in Mac OS 10.4, the default implementation of this method invokes [self initWithContentsOfFile:[contentsURL path] ofType:typeName] if -initWithContentsOfFile:ofType: is overridden and the URL uses the "file:" scheme. It still invokes [self setFileModificationDate:theModificationDate] and [self updateChangeCount:NSChangeReadOtherContents] in this situation. It still also invokes [self setFileURL:urlOrNil], to overwrite the incorrect invocation of -setFileName: that the override of -initWithContentsOfFile:ofType: likely did.
 | 
			
		||||
 | 
			
		||||
urlOrNil will be nil if the initializing is being done as part of the reopening of an autosaved document when the autosaved document had never been saved in the first place.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable instancetype)initForURL:(nullable NSURL *)urlOrNil withContentsOfURL:(NSURL *)contentsURL ofType:(NSString *)typeName error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Attributes Applicable to Every Kind of Document ***
 | 
			
		||||
 | 
			
		||||
/* These should all be set at initialization time, but not as part of reading the document, and during NSSaveOperations, NSSaveAsOperations, NSAutosaveInPlaceOperations, and NSAutosaveAsOperations, but not as part of writing the document. Specifically, there should be no need to set these from within an override of a -read... or -write... method.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* The name of the document's format. The set method isn't for _changing_ the document's format, it's just for initially recording the document's format during opening or saving.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, copy) NSString *fileType;
 | 
			
		||||
 | 
			
		||||
/* The location of the document's on-disk representation. The set method doesn't actually rename the document, it's just for recording the document's location during initial opening or saving. The default implementation of -setFileURL: just records the URL so that the default implementation of -fileURL can return it. The default implementation of -fileURL returns whatever was stored by a previous invocation of the default implementation of -setFileURL:.
 | 
			
		||||
 | 
			
		||||
Starting in Mac OS 10.7 the default implementations of these methods are thread safe enough that -setFileURL: being invoked on the main thread while -fileURL is being invoked on a different thread won't cause a crash. If you override one of these methods you must maintain that thread safety because AppKit itself may invoke -fileURL on a non-main thread. (It's still not a good idea to invoke -setFileURL: on a non-main thread though.)
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of -setFileURL: instead invokes [self setFileName:[url path]] if -setFileName: is overridden and the URL is nil or uses the "file:" scheme. Likewise, the default implementation of -fileURL instead invokes -[self fileName] and returns the result as a URL if -fileName is overridden.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, copy) NSURL *fileURL;
 | 
			
		||||
 | 
			
		||||
/* The last known modification date of the document's on-disk representation.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, copy) NSDate *fileModificationDate;
 | 
			
		||||
 | 
			
		||||
/* Whether the document is a draft that the user has not expressed an interest in keeping around. A save panel will be presented when the user closes a draft document. Only documents with non-nil values for [self fileURL] should be considered drafts.
 | 
			
		||||
*/
 | 
			
		||||
@property (getter=isDraft) BOOL draft API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** UI and File Access Serialization ***
 | 
			
		||||
 | 
			
		||||
/* Given a block that will perform work that might result in the presentation of modal UI, wait for any work scheduled by previous invocations of this method to be completed, and then invoke the block. The block is passed another block, the activity completion handler, which must be invoked when the activity is complete. There are two kinds of waiting possible, synchronous and asynchronous. Which one is used is controlled by the waitSynchronously parameter. If the value for that parameter is YES then this method does not return until previous activities are complete and the passed-in block has been invoked. If it is NO then the passed-in block might not be invoked before this method has returned. It might instead be invoked later, on the main thread, after previous activities are complete.
 | 
			
		||||
 | 
			
		||||
This method's primary use is to wait for asynchronous saving, a new feature that was introduced in Mac OS 10.7. With asynchronous saving it is possible for the user to instigate a user interface action that might present modal UI, a sheet for example, when asynchronous saving is about to fail and present an error alert sheet of its own, which would not work. This method solves that problem. If your NSDocument subclass supports asynchronous saving you should invoke this method around the performance of any work that might cause the presentation of modal UI, regardless of whether that work is performed synchronously or asynchronously. Here is a list of NSDocument methods whose default implementations invoke this method because they might present sheets, either to ask the user what to do as they begin their work or because they may fail and present errors to user:
 | 
			
		||||
-revertDocumentToSaved:
 | 
			
		||||
-saveDocumentWithDelegate:didSaveSelector:contextInfo:
 | 
			
		||||
-runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo:
 | 
			
		||||
-saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:
 | 
			
		||||
-canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:
 | 
			
		||||
-duplicateDocumentWithDelegate:didDuplicateSelector:contextInfo:
 | 
			
		||||
-runModalPageLayoutWithPrintInfo:delegate:didRunSelector:contextInfo:
 | 
			
		||||
-printDocumentWithSettings:showPrintPanel:delegate:didPrintSelector:contextInfo:
 | 
			
		||||
-runModalPrintOperation:delegate:didRunSelector:contextInfo:
 | 
			
		||||
More uses of this method may be added to NSDocument in the future.
 | 
			
		||||
 
 | 
			
		||||
This method must be invoked on the main thread. If it is passed YES for waitSynchronously it waits on the main thread, blocking further user interaction with the document. The purpose of blocking the main thread is so the user cannot continue to change the document while an activity is pending. This prevents for example the strange situation where the user chooses to revert the document, reverting does not happen immediately because asynchronous saving is still in progress, the user is able to continue to make changes to the document, and then those changes are immediately discarded when the asynchronous saving is complete and the document is reverted. All of the NSDocument methods listed above pass YES for waitSynchronously.
 | 
			
		||||
 | 
			
		||||
You pass NO for waitSynchronously when the work that is to be done is instigated by the user so indirectly that the work might begin when modal UI is already being presented. For example, here is another method whose default implementation invokes this method, this time passing NO for waitSynchronously:
 | 
			
		||||
-autosaveDocumentWithDelegate:didAutosaveSelector:contextInfo:
 | 
			
		||||
This method might present an error alert but it is typically invoked by a timer. If it passed YES for waitSynchronously, and the timer fired while the user was looking at a sheet presented by a previous activity, blocking of the main thread would prevent the handling of the user interface events necessary to dismiss that sheet and complete that previous activity. Deadlock would result.
 | 
			
		||||
 | 
			
		||||
Whether you make this method wait synchronously or asynchronously to do your work is separate from whether your work is done synchronously or asynchronously. For example, as mentioned above -saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo: passes YES for waitSynchronously when it uses this method, even though the majority of the work it does may be done asynchronously.
 | 
			
		||||
 | 
			
		||||
You should not invoke this method during the invocation of the block passed to -performSynchronousFileAccessUsingBlock:, mentioned down below, or in between the time -performAsynchronousFileAccessUsingBlock:, also mentioned down below, invokes the block passed to it and the time at which the corresponding file access completion handler is invoked. If you do then deadlock can result. In other words, you cannot begin a new activity as part of file access. You can on the other hand invoke -performSynchronousFileAccessUsingBlock: or -performAsynchronousFileAccessUsingBlock: as part of an activity.
 | 
			
		||||
 | 
			
		||||
Some asynchronous activities, like saving, need to do work on the main thread as they are completing. A deadlock would be inevitable if there were no way to interrupt this method's blocking of the main thread. See -continueAsynchronousWorkOnMainThreadUsingBlock: to find out how to interrupt this method's blocking of the main thread.
 | 
			
		||||
*/
 | 
			
		||||
- (void)performActivityWithSynchronousWaiting:(BOOL)waitSynchronously usingBlock:(void (^)(void (^activityCompletionHandler)(void)))block API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* If a block that was passed to -performActivityWithSynchronousWaiting:usingBlock: is being invoked, invoke the passed-in block, having recorded state that makes inner invocations of -performActivityWithSynchronousWaiting:usingBlock: not wait. If this method is invoked outside of an invocation of a block passed to -performActivityWithSynchronousWaiting:usingBlock:, simply invoke the passed-in block.
 | 
			
		||||
 | 
			
		||||
This method is useful when code executed in a block passed to -performActivityWithSynchronousWaiting:usingBlock: may also invoke that method. For example, -saveDocumentWithDelegate:didSaveSelector:contextInfo:, which uses -performActivityWithSynchronousWaiting:usingBlock:, uses this around its invocation of -runModalSavePanelForSaveOperation:delegate:didSaveSelector: or -saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo: because both of those methods also use -performActivityWithSynchronousWaiting:usingBlock:. Without the use of this method that inner invocation of -performActivityWithSynchronousWaiting:usingBlock: would wait forever.
 | 
			
		||||
*/
 | 
			
		||||
- (void)continueActivityUsingBlock:(void (NS_NOESCAPE ^)(void))block API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Invoke the block on the main thread. If the main thread is blocked by an invocation of -performActivityWithSynchronousWaiting:usingBlock: or -performSynchronousFileAccessUsingBlock:, interrupt that blocking to invoke the block, and then resume blocking when the invocation of the block has returned. Invocations of this method always return before the passed-in block is invoked.
 | 
			
		||||
 | 
			
		||||
You can invoke this method when work is being done on a non-main thread and part of the work must be continued on the main thread. For example, -saveToURL:ofType:forSaveOperation:completionHandler: uses this method when it has just completed the actual writing of the file during asynchronous saving and, to finish the saving operation, must invoke -updateChangeCountWithToken:forSaveOperation: and other methods on the main thread.
 | 
			
		||||
 | 
			
		||||
This method can of course be invoked on any thread.
 | 
			
		||||
*/
 | 
			
		||||
- (void)continueAsynchronousWorkOnMainThreadUsingBlock:(void (^)(void))block API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Given a block that will perform file access, wait for any file access scheduled by previous invocations of this method or -performAsynchronousFileAccessUsingBlock: to be complete, and then invoke the block. When the block invocation returns allow the next scheduled file access to to be performed, if any.
 | 
			
		||||
 | 
			
		||||
Like -performActivityWithSynchronousWaiting:usingBlock: this method's primary use is to wait for asynchronous saving, but in contrast with that method it is only for use to wait for the part of an asynchronous saving operation that actually touches the document's file or values in memory that are in some way relative to the document's file. See the comment for -performAsynchronousFileAccessUsingBlock: for an explanation of why this distinction is important.
 | 
			
		||||
 | 
			
		||||
In general you should use this method or -performAsynchronousFileAccessUsingBlock: around code that gets or sets values in memory that only make sense in the context of the document file's current state. For example, NSDocument itself consistently uses this mechanism around invocations of these methods:
 | 
			
		||||
- -fileType, -fileURL, -fileModificationDate, -autosavedContentsFileURL:, and -isDraft, because you can't reliably make decisions based on a file's location, type, modification date, or draft status when it might be being asynchronously moved, renamed, or changed at that moment.
 | 
			
		||||
- -setFileType:, -setFileURL:, -setFileModificationDate:, -setAutosavedContentsFileURL:, and -setDraft:, to make using this mechanism when invoking the previous list of methods meaningful.
 | 
			
		||||
- -isDocumentEdited and -hasUnautosavedChanges, because you can't reliably make decisions based on whether the document's contents in memory have been saved to a file when it might be being asynchronously saved at that moment.
 | 
			
		||||
- -updateChangeCountWithToken:forSaveOperation: and, sometimes, updateChangeCount:, to make using this mechanism when invoking -isDocumentEdited and -hasUnautosavedChanges meaningful.
 | 
			
		||||
- -backupFileURL, since it depends on -fileURL.
 | 
			
		||||
 */
 | 
			
		||||
- (void)performSynchronousFileAccessUsingBlock:(void (NS_NOESCAPE ^)(void))block API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Do the same sort of thing as -performSynchronousFileAccessUsingBlock:, but without ever blocking the main thread, and perhaps not invoking the block until after the method invocation has returned, though still always on the same thread as the method invocation. The block is passed another block, the file access completion handler, which must be invoked when the file access is complete, though it can be invoked from any thread. This method is for use with file access that might begin on one thread but continue on another before it is complete. saveToURL:ofType:forSaveOperation:completionHandler: for for example uses this method instead of -performSynchronousFileAccessUsingBlock: because if it does asynchronous saving then there is no way for it to actually complete all of its file access before returning from the file access block.
 | 
			
		||||
 | 
			
		||||
The distinction between entire activities and the file accessing part of activities established by having both activity performing methods and file access performing methods is worthwhile because sometimes it is valuable to perform file access without any risk of waiting for the user to dismiss a modal panel. For example, NSDocument's implementation of -[NSFilePresenter relinquishPresentedItemToWriter:] uses -performAsynchronousFileAccessUsingBlock: to ensure that the uses of -performSynchronousFileAccessUsingBlock: described above wait while another process is moving, renaming, or changing the file. Using -performActivityWithSynchronousWaiting:usingBlock: instead would not be appropriate because that would introduce the possibility of the other process' writing being blocked until the user has dismissed a sheet that is being presented as part of a previously scheduled activity.
 | 
			
		||||
*/
 | 
			
		||||
- (void)performAsynchronousFileAccessUsingBlock:(void (^)(void (^fileAccessCompletionHandler)(void)))block API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Reverting ***
 | 
			
		||||
 | 
			
		||||
/* The action of the File menu's Revert to Saved item in a document-based application. The default implementation of this method presents a panel giving the user the opportunity to cancel the operation and, and if the user chooses to continue, makes sure that any editor registered using Cocoa Bindings' NSEditorRegistration protocol has discarded its changes and then invokes [self revertToContentsOfURL:[self url] ofType:[self fileType] error:outError]. If that returns NO, it presents the error to the user in an document-modal alert panel.
 | 
			
		||||
 | 
			
		||||
If +autosavesInPlace returns YES and +preservesVersions returns NO, this method throws an exception.
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)revertDocumentToSaved:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
/* Discard all unsaved document modifications and replace the document's contents by reading a file or file package located by a URL, of a specified type, and return YES if successful. If not successful, return NO after setting *outError to an NSError that encapsulates the reason why the document could not be reverted. The default implementation of this method invokes [self readFromURL:url ofType:typeName error:outError], [self setFileModificationDate:theModificationDate], [self updateChangeCount:NSChangeCleared], and, if the document has an undo manager, [[self undoManager] removeAllActions]. It also deletes autosaved contents files when they have become obsolete.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self revertToSavedFromFile:[url path] ofType:typeName] if -revertToSavedFromFile:ofType: is overridden and the URL uses the "file:" scheme. It still invokes [self updateChangeCount:NSChangeCleared] and [[self undoManager] removeAllActions] in this situation (because the default implementation of -revertToSavedFromFile:ofType: does not; -revertDocumentToSaved: used to, but doesn't any longer).
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)revertToContentsOfURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Simple Reading and Writing ***
 | 
			
		||||
 | 
			
		||||
/* Typically you would override one of the next three methods... */
 | 
			
		||||
 | 
			
		||||
/* Set the contents of this document by reading from a file or file package located by a URL, of a specified type, and return YES if successful. If not successful, return NO after setting *outError to an NSError that encapsulates the reason why the document could not be read. The default implementation of this method just creates an NSFileWrapper and invokes [self readFromFileWrapper:theFileWrapper ofType:typeName error:outError].
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self readFromFile:[url path] ofType:typeName] if -readFromFile:ofType: is overridden and the URL uses the "file:" scheme.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)readFromURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
/* Set the contents of this document by reading from a file wrapper of a specified type, and return YES if successful. If not successful, return NO after setting *outError to an NSError that encapsulates the reason why the document could not be read. The default implementation of this method invokes [self readFromData:[fileWrapper regularFileContents] ofType:typeName error:outError].
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self loadFileWrapperRepresentation:fileWrapper ofType:typeName] if -loadFileWrapperRepresentation:ofType: is overridden.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)readFromFileWrapper:(NSFileWrapper *)fileWrapper ofType:(NSString *)typeName error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
/* Set the contents of this document by reading from data of a specified type, and return YES if successful. If not successful, return NO after setting *outError to an NSError that encapsulates the reason why the document could not be read. The default implementation of this method throws an exception because at least one of these three reading methods, or every method that may invoke -readFromURL:ofType:error: (!), must be overridden. 
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self loadDataRepresentation:data ofType:typeName] if -loadDataRepresentation:ofType: is overridden.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
/* Return YES if the document's entire file is loaded into memory, NO otherwise. The default implementation of this method returns YES. You can override this method to return NO if additional data may need to be read from the file. NSDocument may use this value to do things like prevent volume ejection or warn the user when a partially loaded file disappears from the file system.
 | 
			
		||||
 */
 | 
			
		||||
@property (getter=isEntireFileLoaded, readonly) BOOL entireFileLoaded API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* ...and also one of these. */
 | 
			
		||||
 | 
			
		||||
/* Write the contents of this document to a file or file package located by a URL, formatted to a specified type, and return YES if successful. If not successful, return NO after setting *outError to an NSError that encapsulates the reason why the document could not be written. The default implementation of this method just invokes [self fileWrapperOfType:typeName error:outError], invokes [self unblockUserInteraction], and writes the returned file wrapper to disk.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self writeToFile:[url path] ofType:typeName] if -writeToFile:ofType: is overridden and the URL uses the "file:" scheme.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)writeToURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
/* Create and return a file wrapper that contains the contents of this document, formatted to a specified type, or return nil after setting *outError to an NSError that encapsulates the reason why the file wrapper could not be created. The default implementation of this method just invokes [self dataOfType:typeName], makes a file wrapper for that data, and returns the file wrapper.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self fileWrapperRepresentationOfType:typeName] if -fileWrapperRepresentationOfType: is overridden.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSFileWrapper *)fileWrapperOfType:(NSString *)typeName error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
/* Create and return a data object that contains the contents of this document, formatted to a specified type, or return nil after setting *outError to an NSError that encapsulates the reason why the data object could not be created. The default implementation of this method throws an exception because at least one of these three writing methods, or -writeToURL:ofType:saveOperation:originalContentsURL:error:, must be overridden.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self dataRepresentationOfType:typeName] if -dataRepresentationOfType: is overridden.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
/* If -saveToURL:ofType:forSaveOperation:completionHandler: is writing on a non-main thread because -canAsynchronouslyWriteToURL:ofType:forSaveOperation: has returned YES, but is still blocking the main thread, unblock the main thread. Otherwise, do nothing. For example, the default implementation of -fileWrapperOfType:error: invokes this when it has created the NSFileWrapper to return. Assuming that the NSFileWrapper will not be mutated by subsequent user actions, it is effectively a "snapshot" of the document's contents, and once it is created it is safe to resume handling user events on the main thread, even though some of those user events might change the document's contents before the NSFileWrapper has been safely written. You can invoke this method to make asynchronous saving actually asynchronous if you've overridden -writeSafelyToURL:ofType:forSaveOperation:error:, -writeToURL:forSaveOperation:originalContentsURL:error:, or -writeToURL:ofType:error: in such a way that the invocation of this method done by -writeToURL:ofType:error:'s default implementation won't happen during writing.
 | 
			
		||||
*/
 | 
			
		||||
- (void)unblockUserInteraction API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Return YES if autosaving is being done right now but nothing bad would happen if it were to be cancelled, NO otherwise. For example, when periodic autosaving is being done just for crash protection, which doesn't really have to be done all of the time, this method returns YES. When autosaving is being done because the document is being closed this method returns NO.
 | 
			
		||||
 | 
			
		||||
You can use this notion of implicitly cancellable autosaving when implementing a "stop-copying-on-write" model so that your document class' writing code can invoke -unblockUserInteraction relatively quickly during writing on a non-main thread regardless of how much work must actually be done to make the sort of snapshot mentioned in the comment for -unblockUserInteraction. When this method returns YES your writing code can invoke -unblockUserInteraction after having merely recorded the fact that changes to the document model made by the user should first cancel the rest of the writing. Your code that makes changes to the document model then has to actually always do that cancellation first. (This may be a significant amount of work but hopefully less than implementing a copy-on-write model, which is another option for invoking -unblockUserInteraction as quickly as possible.) If your writing code is implicitly cancelled like that it should signal NSCocoaErrorDomain/NSUserCancelledError, the one kind of error that is never actually presented to the user.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) BOOL autosavingIsImplicitlyCancellable API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Advanced Writing ***
 | 
			
		||||
 | 
			
		||||
/* Write the contents of the document to a file or file package located by a URL, formatted to a specified type, for a particular kind of save operation, and return YES if successful. If not successful, return NO after setting *outError to an NSError that encapsulates the reason why the document could not be written. The default implementation of this method:
 | 
			
		||||
    1) Either creates a temporary directory in which the document writing should be done, or renames the old on-disk version of the document, depending on what sort of save operation is being done, whether or not there's already a copy of the document on disk, and the capabilities of the file system to which writing is being done. The details of this are subject to change.
 | 
			
		||||
    2) Invokes -writeToURL:ofType:forSaveOperation:originalContentsURL:error:.
 | 
			
		||||
    3) Invokes -fileAttributesToWriteToURL:ofType:forSaveOperation:originalContentsURL:error: and writes the returned attributes, if any, to the file. Some attributes from the old on-disk version of the document may be copied at the same time, if applicable.
 | 
			
		||||
    4) Moves the just-written file to its final location, or deletes the old on-disk version of the document, and deletes any temporary directories, depending on the same factors listed for step 1.
 | 
			
		||||
 | 
			
		||||
For documents that return NO from +preservesVersions, the default implementation of this method invokes -keepBackupFile for NSSaveOperation to determine whether or not the old on-disk version of the document, if there was one, should be preserved after being renamed. If -keepBackupFile returns YES, or for documents that return YES from +preservesVersions, the default implementation of this method invokes [self backupFileURL] to determine the location for the old on-disk version of the document; if it returns nil, no backup file will be kept.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self writeWithBackupToFile:[url path] ofType:typeName saveOperation:aSaveOperation] if -writeWithBackupToFile:ofType:saveOperation: is overridden and the URL uses the "file:" scheme. The save operation used in this case will never be one of the autosaving ones; NSSaveToOperation will be used instead.
 | 
			
		||||
 | 
			
		||||
This method is responsible for doing document writing in a way that minimizes the danger of leaving the disk to which writing is being done in an inconsistent state in the event of an application crash, system crash, hardware failure, power outage, etc. Because it does several different things, and because the things are likely to change in future releases of Mac OS X, it's probably not a good idea to override this method without invoking super (the same was true of -writeWithBackupToFile:ofType:saveOperation:).
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)writeSafelyToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
/* Write the contents of the document to a file or file package located by a URL, formatted to a specified type, for a particular kind of save operation, and return YES if successful. If not successful, return NO after setting *outError to an NSError that encapsulates the reason why the document could not be written. The default implementation of this method merely invokes [self writeToURL:url ofType:typeName error:outError]. You can override this method instead of one of the methods in the "Simple Reading and Writing" section above if your document writing machinery needs access to the on-disk representation of the document version that is about to be overwritten. url will often not be the same value as [self fileURL]. Other times it will not be the same as the URL for the final save destination. Likewise, absoluteOriginalContentsURL will often not be the same value as [self fileURL], though it will be nil for documents that have never been saved. It will point to nothing if the document's on-disk representation has been deleted.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self writeToFile:[url path] ofType:typeName originalFile:[absoluteOriginalContentsURL path] saveOperation:aSaveOperation] if -writeToFile:ofType:originalFile:saveOperation: is overridden and both URLs use the "file:" scheme. The save operation used in this case will never be one of the autosaving ones; NSSaveToOperation will be used instead.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)writeToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation originalContentsURL:(nullable NSURL *)absoluteOriginalContentsURL error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
/* Given that a file is being saved, return the attributes that should be written to a file or file package located by a URL, formatted to a specified type, for a particular kind of save operation. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why attributes could not be returned. The set of valid file attributes is a subset of those understood by the NSFileManager class. The default implementation of this method returns an empty dictionary for an NSSaveOperation or NSAutosaveInPlaceOperation, or a dictionary with an appropriate NSFileExtensionHidden entry for any other kind of save operation. You can override this method to customize the attributes that are written to document files.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.5 and earlier the default implementation of this method instead returns a dictionary with NSFileHFSCreatorCode and NSFileHFSTypeCode entries that have a value of 0 for NSSaveOperation, in applications linked against Mac OS 10.5 or earlier.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self fileAttributesToWriteToFile:[url path] ofType:typeName saveOperation:aSaveOperation] if -fileAttributesToWriteToFile:ofType:saveOperation: is overridden and the URL uses the "file:" scheme. The save operation used in this case will never be one of the autosaving ones; NSSaveToOperation will be used instead.
 | 
			
		||||
 | 
			
		||||
The default implementation of -[NSDocument writeSafelyToURL:ofType:forSaveOperation:error:] automatically copies important attributes like file permissions, creation date, and Finder info from the old on-disk version of a document to the new one during an NSSaveOperation or NSAutosaveInPlaceOperation. This method is meant to be used just for attributes that need to be written for the first time, for NSSaveAsOperations, NSSaveToOperations, and NSAutosaveAsOperations. Actually, url and absoluteOriginalContentsURL are passed in just for completeness; NSDocument's default implementation for instance doesn't even need to use them.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSDictionary<NSString *, id> *)fileAttributesToWriteToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation originalContentsURL:(nullable NSURL *)absoluteOriginalContentsURL error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
/* Return YES if the old on-disk version of a document that is being overwritten should be preserved during an NSSaveOperation, NO otherwise. The default implementation of this method returns NO. For applications that return YES from +preservesVersions, this method has no effect.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) BOOL keepBackupFile;
 | 
			
		||||
 | 
			
		||||
/* Return the URL that will be used when preserving a backup file during an NSSaveOperation or NSAutosaveInPlaceOperation, or nil if the backup file can't be created or isn't needed.
 | 
			
		||||
 | 
			
		||||
On Mac OS 10.8, document versions can be preserved using a backup file that is stored at the returned URL during safe-saving. Using this backup file for preserving versions is much more efficient because NSDocument is able to use NSFileVersionReplacingByMoving. NSDocument calls this method twice during saving: once before -writeSafelyToURL:ofType:forSaveOperation:error: to check whether NSFileVersionReplacingByMoving will be possible (and to preserve by copying if it's not), and once within that method to discover where to put the backup file.
 | 
			
		||||
 | 
			
		||||
Implementations of -writeSafelyToURL:ofType:forSaveOperation:error: must check the value returned by this method during NSSaveOperations and NSAutosaveInPlaceOperations and, if the URL is non-nil, move the previous contents of the file that would be overwritten to that location. (The default implementation of -writeSafelyToURL:ofType:forSaveOperation:error: does this.) Custom implementations of -writeSafelyToURL:ofType:forSaveOperation:error: can use -[NSFileManager replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error:] with a backup item name of [[self backupFileURL] lastPathComponent] and the NSFileManagerItemReplacementWithoutDeletingBackupItem option to easily create the backup file. If your custom implementation is unable to keep the backup file, you must override this method and return nil to ensure that the document's file gets correctly preserved before it gets overwritten.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method returns a non-nil value based off the value of [self fileURL] only if the document's file needs to be preserved prior to saving, or if +preservesVersions returns NO. Otherwise, it returns nil.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSURL *backupFileURL API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Saving ***
 | 
			
		||||
 | 
			
		||||
/* The action of the File menu's Save item in a document-based application. The default implementation of this method merely invokes [self saveDocumentWithDelegate:nil didSaveSelector:NULL contextInfo:NULL].
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)saveDocument:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
/* The action of the File menu's Save As... item in a document-based application. The default implementation of this method merely invokes [self runModalSavePanelForSaveOperation:NSSaveAsOperation delegate:nil didSaveSelector:NULL contextInfo:NULL].
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)saveDocumentAs:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
/* The action of the File menu's Export... item in a document-based application (actually, the menu item goes by different names in different applications; check the Human Interface Guidelines). The default implementation of this method merely invokes [self runModalSavePanelForSaveOperation:NSSaveToOperation delegate:nil didSaveSelector:NULL contextInfo:NULL].
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)saveDocumentTo:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
/* If a save operation can be performed without further user intervention (at the very least, neither -fileURL nor -fileType return nil), then save the document. Otherwise, present a save panel to the user and then save the document if the user OKs the panel. When saving is completed or has been cancelled, send the message selected by didSaveSelector to the delegate, with the contextInfo as the last argument. The method selected by didSaveSelector must have the same signature as:
 | 
			
		||||
 | 
			
		||||
    - (void)document:(NSDocument *)document didSave:(BOOL)didSaveSuccessfully contextInfo:(void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
The default implementation of this method first makes sure that any editor registered using Cocoa Bindings' NSEditorRegistration protocol has committed its changes, then invokes [self runModalSavePanelForSaveOperation:NSSaveAsOperation delegate:delegate didSaveSelector:didSaveSelector contextInfo:inContextInfo] right away if a save panel must be presented. Otherwise, it may present a panel asking the user to make a decision for any of the following situations:
 | 
			
		||||
    1) The document's file or file package was modified by something other than the current application since it was opened or most recently saved.
 | 
			
		||||
    2) The document's file or file package was moved or renamed since it was opened or most recently saved.
 | 
			
		||||
    3) The document's file or file package was deleted or trashed since it was opened or most recently saved.
 | 
			
		||||
The list of conditions for which NSDocument checks is subject to change. Regardless, the default implementation of this method always invokes either -runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo: or -saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo: unless the user cancels one of the panels it presents.
 | 
			
		||||
*/
 | 
			
		||||
- (void)saveDocumentWithDelegate:(nullable id)delegate didSaveSelector:(nullable SEL)didSaveSelector contextInfo:(nullable void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
/* Present a save panel to the user, then try to save the document if the user OKs the panel. When saving is completed, regardless of success or failure, or has been cancelled, send the message selected by didSaveSelector to the delegate, with the contextInfo as the last argument. The method selected by didSaveSelector must have the same signature as:
 | 
			
		||||
 | 
			
		||||
    - (void)document:(NSDocument *)document didSave:(BOOL)didSaveSuccessfully contextInfo:(void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
The default implementation of this method first makes sure that any editor registered using Cocoa Bindings' NSEditorRegistration protocol has committed its changes, then creates a save panel, adds a standard "file format" accessory view if there is more than one file type for the user to choose from and [self shouldRunSavePanelWithAccessoryView] returns YES, sets various attributes of the panel, invokes [self prepareSavePanel:theSavePanel] to provide an opportunity for customization, then presents the panel. If the user OKs the panel -saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo: is invoked.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self saveToFile:nil saveOperation:saveOperation delegate:delegate didSaveSelector:contextInfo:] if -saveToFile:saveOperation:delegate:didSaveSelector:contextInfo: is overridden, even if the user cancels the panel (because that's what 10.3 did).
 | 
			
		||||
*/
 | 
			
		||||
- (void)runModalSavePanelForSaveOperation:(NSSaveOperationType)saveOperation delegate:(nullable id)delegate didSaveSelector:(nullable SEL)didSaveSelector contextInfo:(nullable void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
/* Return YES if -runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo: should add NSDocument's standard file format accessory view to the save panel, NO otherwise. The default implementation of this method returns YES. You can override this method to prevent NSDocument from adding an accessory view to the save panel so that your application can add its own when -prepareSavePanel is invoked.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) BOOL shouldRunSavePanelWithAccessoryView;
 | 
			
		||||
 | 
			
		||||
/* Given the save panel that -runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo: is about to present to the user, make any final changes before it is presented, and return YES for success. Return NO for failure, to cancel the save operation. The default implementation of this method just returns YES.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)prepareSavePanel:(NSSavePanel *)savePanel;
 | 
			
		||||
 | 
			
		||||
/* Return YES if a save panel has been presented by this document and the user chose to hide the name extension of the file that was selected in that save panel, NO otherwise.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) BOOL fileNameExtensionWasHiddenInLastRunSavePanel;
 | 
			
		||||
 | 
			
		||||
/* If a save panel has been presented by this document, and a choice of file type was presented in that panel, return the name of the file type that the user chose.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSString *fileTypeFromLastRunSavePanel;
 | 
			
		||||
 | 
			
		||||
/* Save the contents of the document to a file or file package located by a URL, formatted to a specified type, for a particular kind of save operation. When saving is completed, regardless of success or failure, send the message selected by didSaveSelector to the delegate, with the contextInfo as the last argument. The method selected by didSaveSelector must have the same signature as:
 | 
			
		||||
 | 
			
		||||
    - (void)document:(NSDocument *)document didSave:(BOOL)didSaveSuccessfully contextInfo:(void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
The default implementation of this method first makes sure that any editor registered using Cocoa Bindings' NSEditorRegistration protocol has committed its changes (except for autosave operations), then invokes [self saveToURL:url ofType:typeName forSaveOperation:saveOperation completionHandler:aCompletionHandler] and, if that completion handler is passed an NSError when it is invoked, presents the error to the user in a document-modal panel before messaging the delegate.
 | 
			
		||||
*/
 | 
			
		||||
- (void)saveToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation delegate:(nullable id)delegate didSaveSelector:(nullable SEL)didSaveSelector contextInfo:(nullable void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
/* Save the contents of the document to a file or file package located by a URL, formatted to a specified type, for a particular kind of save operation, and invoke the passed-in completion handler at some point in the future, perhaps after the method invocation has returned. The completion handler must be invoked on the main thread. If successful, pass a nil error. If not successful, pass an NSError that encapsulates the reason why the document could not be saved.
 | 
			
		||||
 
 | 
			
		||||
 The default implementation of this method invokes [self canAsynchronouslyWriteToURL:url ofType:typeName forSaveOperation:saveOperation]. If writing can't be done concurrently, it invokes [self writeSafelyToURL:url ofType:typeName forSaveOperation:saveOperation error:&anError] on the main thread thread. If writing can be done concurrently, it invokes that method on a different thread, but blocking the main thread until something invokes -unblockUserInteraction. Either way, if -writeSafelyToURL:ofType:forSaveOperation:error: returns YES, it also invokes some combination of -setFileModificationDate:, -setFileType:, -setFileURL:, -updateChangeCount:, and -setAutosavedContentsFileURL:, as appropriate for the kind of save operation, on the main thread. It also updates information that -saveDocumentWithDelegate:didSaveSelector:contextInfo: uses to check for modification, renaming, moving, deleting, and trashing of open documents, and deletes autosaved contents files when they have become obsolete. You can override this method to do things that need to be done before or after any save operation but, because this method does several different things, and because the things are likely to change in future releases of Mac OS X, it's probably not a good idea to override this method without invoking super.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.6 and earlier, the default implementation of this method instead invokes [self saveToURL:url ofType:typeName forSaveOperation:saveOperation error:&anError] if that method is overridden and this one is not, and passes any error to the completion handler.
 | 
			
		||||
*/
 | 
			
		||||
- (void)saveToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation completionHandler:(void (^)(NSError * _Nullable errorOrNil))completionHandler API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Return whether the receiver can concurrently write to a file or file package located by a URL, formatted for a specific type, for a specific kind of save operation. The default implementation of this method returns NO. You are strongly encouraged to override it and make it return YES, after making sure your overrides of -write... methods can be safely invoked on a non-main thread, and making sure that -unblockUserInteraction will be invoked at some appropriate time during writing.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)canAsynchronouslyWriteToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Autosaving ***
 | 
			
		||||
 | 
			
		||||
/* Return YES if saving the user's changes to the document file is probably what they want, or NO after setting *outError to an NSError that encapsulates the reason why it might not be. The default implementation of this method checks for documents that have not been changed in a while ("a while" is subject to change) or are saved in folders where the user typically does not edit documents (the ~/Downloads folder, for example; also subject to change). When it senses one of those cases it returns NO with an NSError that has recovery options like "Duplicate," "Cancel", and "Unlock."
 | 
			
		||||
 | 
			
		||||
In an application that has adopted Mac OS 10.7's new document model by overriding +autosavesInPlace and making it return YES, you can override this method to customize the autosaving safety checking that NSDocument does by default. You can remove NSDocument's default checking by overriding this method and not invoking super. You can add to NSDocument's default checking by invoking super and then doing your own checking if [super checkAutosavingSafetyAndReturnError:] did not signal an error. For example, TextEdit overrides this method to ask the user what to do when opening a document file has been lossy and overwriting that file might therefore be lossy. Other combinations of your override invoking super are possible.
 | 
			
		||||
 | 
			
		||||
When autosaving in place is turned on an NSDocument may invoke this method when it receives notification from its NSUndoManager that the user changed the document, or undid or redid a change. (Or it may not. NSDocument does not invoke this method for scripted changes or after some kinds of reverting.) If an error is returned it presents the error to the user, allowing the user to choose a recovery option. If the error is recovered from then it repeats this until no error is signalled, to make sure that all checks have been done. This means that when you signal an error and the user's choice of recovery option indicates that they have seen and disregarded a safety concern you must record that fact, and not do that particular safety check again. Once all errors are recovered from NSDocument continues on by invoking -updateChangeCount:, which it has done in response to NSUndoManager notifications since Mac OS 10.0. If an error is not recovered from then NSDocument invokes -[NSUndoManager undo] or -[NSUndoManager redo] to roll back the change. So, some of the NSError recovery options you let the user select, like NSDocument's own "Duplicate and "Cancel," should indicate failed recovery and that will cause the document to be unchanged afterward.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)checkAutosavingSafetyAndReturnError:(NSError **)outError API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Schedule periodic autosaving for the purpose of crash protection. The default implementation of this method generally checks to see if autosaving is turned on and if so, and if [self hasUnautosavedChanges] returns YES, schedules an NSTimer to invoke -autosaveDocumentWithDelegate:didAutosaveSelector:contextInfo: in the future. If [self hasUnautosavedChanges] returns NO it will unschedule any previously scheduled timer. It takes care not to cause -autosaveDocumentWithDelegate:didAutosaveSelector:contextInfo: to be invoked before a previous invocation caused by it has finished. The exact timings it uses are complicated and subject to change in future releases of Mac OS X. You can override this method to control when exactly periodic autosaving happens. It is invoked by -updateChangeCount: and -updateChangeCountWithToken:forSaveOperation:.
 | 
			
		||||
*/
 | 
			
		||||
- (void)scheduleAutosaving API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Return YES if the document has changes that have not been autosaved, NO otherwise, as determined by the history of previous invocations of -updateChangeCount:. The default implementation of this method returns NO immediately after invocation of -updateChangeCount:NSChangeCleared or -updateChangeCount:NSChangeAutosaved. It will then return YES if subsequent invocations of -updateChangeCount: have recorded a situation in which the document has changes that have not been autosaved. (-updateChangeCount:NSChangeReadOtherContents has no effect on what the default implementation of this method returns.)
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) BOOL hasUnautosavedChanges;
 | 
			
		||||
 | 
			
		||||
/* Autosave the document's contents if it needs autosaving, and then send the message selected by didAutosaveSelector to the delegate, with the contextInfo as the last argument. The method selected by didAutosaveSelector must have the same signature as:
 | 
			
		||||
 | 
			
		||||
    - (void)document:(NSDocument *)document didAutosave:(BOOL)didAutosaveSuccessfully contextInfo:(void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
If any error occurs while autosaving, it must be reported to the user, typically in a document-modal alert panel, before the delegate is messaged with succeeded:NO.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method simply invokes [self autosaveWithImplicitCancellability:YES completionHandler:aCompletionHandler] and then presents to the user any error that occurs.
 | 
			
		||||
 | 
			
		||||
This method is only invoked by AppKit itself as a result of -scheduleAutosaving being invoked. It is not invoked for any of the purposes of autosaving introduced by Mac OS 10.7's new document model that is triggered by +autosavesInPlace returning YES.
 | 
			
		||||
*/
 | 
			
		||||
- (void)autosaveDocumentWithDelegate:(nullable id)delegate didAutosaveSelector:(nullable SEL)didAutosaveSelector contextInfo:(nullable void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
/* Autosave the document's contents at an appropriate location if it needs autosaving, and invoke the passed-in completion handler at some point in the future, perhaps after the method invocation has returned. The completion handler must be invoked on the main thread. If successful, pass a nil error. If not successful, pass an NSError that encapsulates the reason why the document could not be autosaved. autosavingIsImplicitlyCancellable becomes what -autosavingIsImplicitlyCancellable returns while the autosaving is happening.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method invokes [self hasUnautosavedChanges] and, if that returns YES, figures out where the autosaved document contents should go and invokes [self saveToURL:autosavedDocumentContentsURL ofType:[self autosavingFileType] forSaveOperation:oneOfTheAutosaveOperations completionHandler:aCompletionHandler]. oneOfTheAutosaveOperations will be NSAutosaveAsOperation if the document has been changed with NSChangeDone and the current document should be turned into a draft, NSAutosaveInPlaceOperation if [[self class] autosavesInPlace] returns YES and [self fileURL] returns non-nil, or NSAutosaveElsewhereOperation otherwise. The check of [self fileURL] is because there's no such thing as autosaving "in place" when the document does not yet have a permanent place.
 | 
			
		||||
*/
 | 
			
		||||
- (void)autosaveWithImplicitCancellability:(BOOL)autosavingIsImplicitlyCancellable completionHandler:(void (^)(NSError * _Nullable errorOrNil))completionHandler API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Return YES if the receiving subclass of NSDocument supports Mac OS 10.7 autosaving in place, NO otherwise. The default implementation of this method returns NO. You can override it and return YES to declare your NSDocument subclass' ability to do Mac OS 10.7 autosaving in place. You should not invoke this method to find out whether autosaving in place is actually being done at any particular moment. You should instead use the NSSaveOperationType parameter passed to your overrides of -save... and -write... methods.
 | 
			
		||||
 
 | 
			
		||||
AppKit invokes this method at a variety of times, and not always on the main thread. For example, -autosaveWithImplicitCancellability:completionHandler: invokes this as part of determining whether the autosaving will be an NSAutosaveInPlaceOperation instead of an NSAutosaveElsewhereOperation. For another example, -canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo: and NSDocumentController's machinery for handling unsaved changes at application termination time both invoke this as part of determining whether alerts about unsaved changes should be presented to the user.
 | 
			
		||||
*/
 | 
			
		||||
@property(class, readonly) BOOL autosavesInPlace API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Return YES if the receiving subclass of NSDocument supports Mac OS 10.7 version preservation, NO otherwise. The default implementation of this method returns [self autosavesInPlace]. You can override it and return NO to declare that NSDocument should not preserve old document versions.
 | 
			
		||||
 | 
			
		||||
Returning NO from this method will disable version browsing and -revertDocumentToSaved:, which rely on version preservation when autosaving in place. Returning YES from this method when +autosavesInPlace returns NO will result in undefined behavior.
 | 
			
		||||
 */
 | 
			
		||||
@property(class, readonly) BOOL preservesVersions API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* The action of the Browse Saved Versions menu item in a document-based application. The default implementation causes the document's main window, specified by [self windowForSheet], to enter the Versions browser.
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)browseDocumentVersions:(nullable id)sender API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
/* Whether the receiver is currently displaying the Versions browser. KVO-compliant.
 | 
			
		||||
*/
 | 
			
		||||
@property (getter=isBrowsingVersions, readonly) BOOL browsingVersions API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/* If the receiver is currently displaying the Versions browser, cleanly stop browsing versions (which includes waiting for any animations to complete). Then invoke the completion handler on the main thread.
 | 
			
		||||
*/
 | 
			
		||||
- (void)stopBrowsingVersionsWithCompletionHandler:(void (^ _Nullable)(void))completionHandler API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/* Return YES if the receiving subclass of NSDocument supports Mac OS 10.8 autosaving of drafts, NO otherwise. The default implementation of this method returns YES for applications linked on or after Mac OS 10.8. You can override it and return YES to declare your NSDocument subclass' ability to do Mac OS 10.8 autosaving of drafts. You can also override it and return NO to opt out of this behavior after linking with 10.8. You should not invoke this method to find out whether autosaving of a draft will be done. Instances of subclasses that return YES from this method should be ready to properly handle save operations with NSAutosaveAsOperation.
 | 
			
		||||
 | 
			
		||||
AppKit invokes this method at a variety of times. For example, when -updateChangeCount is called with NSChangeDone (without NSChangeDiscardable), NSDocument will the next autosave to use NSAutosaveAsOperation and return the document into a draft.
 | 
			
		||||
*/
 | 
			
		||||
@property(class, readonly) BOOL autosavesDrafts API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
/* Return the document type that should be used for an autosave operation. The default implementation just returns [self fileType].
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSString *autosavingFileType;
 | 
			
		||||
 | 
			
		||||
/* The location of the most recently autosaved document contents. The default implementation of -setAutosavedContentsFileURL: records the URL and notifies the shared document controller that this document should be autoreopened if the application is quit or crashes before the document is saved. The default implementation of -autosavedContentsFileURL just returns whatever was stored by a previous invocation of the default implementation of -setAutosavedContentsFileURL:.
 | 
			
		||||
 | 
			
		||||
Starting in Mac OS 10.7 the default implementations of these methods are thread safe enough that -setAutosavedContentsFileURL: being invoked on the main thread while -autosavedContentsFileURL is being invoked on a different thread won't cause a crash. If you override one of these methods you must maintain that thread safety because AppKit itself may invoke -autosavedContentsFileURL on a background thread. (It's still not a good idea to invoke -setAutosavedContentsFileURL: on a non-main thread though.)
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, copy) NSURL *autosavedContentsFileURL;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Closing ***
 | 
			
		||||
 | 
			
		||||
/* If there are changes that have not yet been saved to the document's file and saving cannot be done without asking the user first, present a panel to the user informing them that the document is modified and asking if it should be saved. If the user indicates that it should be, then try to save it. When saving is completed, regardless of success or failure, or has been rejected one way or another by the user, send the message selected by shouldCloseSelector to the delegate, with the contextInfo as the last argument. If the document is not modified then just send the message selected by shouldCloseSelector right away. The method selected by shouldCloseSelector must have the same signature as:
 | 
			
		||||
 | 
			
		||||
    - (void)document:(NSDocument *)document shouldClose:(BOOL)shouldClose contextInfo:(void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
The default implementation of this method has two rather different behaviors. If [[self class] autosavesInPlace] returns YES and [self fileURL] returns non-nil then it simply invokes [self autosaveWithImplicitCancellability:NO completionHandler:aCompletionHandler] if [self hasUnautosavedChanges] returns YES after making sure that any editor registered using Cocoa Bindings' NSEditorRegistration protocol has committed its changes. Otherwise it presents a panel giving the user the choice of canceling, discarding changes, or saving. In that case the shouldClose value passed to the delegate will be YES if the document was not modified in the first place, or the user chose to discard modifications, or chose to save and the saving was successful. NO will be passed if the user chose to cancel the operation or saving was unsuccessful. Because -saveDocumentWithDelegate:didSaveSelector:contextInfo: is used, an alert panel will be presented before the delegate is messaged if saving is attempted but does not succeed.
 | 
			
		||||
*/
 | 
			
		||||
- (void)canCloseDocumentWithDelegate:(id)delegate shouldCloseSelector:(nullable SEL)shouldCloseSelector contextInfo:(nullable void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
/* Close the document, discarding any as-yet-unsaved modifications. The default implementation of this method first makes sure that any editor registered using Cocoa Bindings' NSEditorRegistration protocol has discarded its changes, sends each of the document's window controllers a -close message, invokes [[NSDocumentController sharedDocumentController] removeDocument:self], and then invokes [NSFileCoordinator removeFilePresenter:self]. This is typically the method to use to close open documents (instead of just causing them to be deallocated by some other means). It's usually correct to use -canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo: first to make sure that the user's changes have been saved if appropriate.
 | 
			
		||||
*/
 | 
			
		||||
- (void)close;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Duplicating ***
 | 
			
		||||
 | 
			
		||||
/* The action of the File menu's Duplicate item in a document-based application. The default implementation of this method merely invokes [self duplicateDocumentWithDelegate:nil didDuplicateSelector:NULL contextInfo:NULL].
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)duplicateDocument:(nullable id)sender API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Create a new document whose contents are the same as the receiver's and that doesn't yet have a fileURL. When duplicating is completed, regardless of success or failure, or has been rejected one way or another by the user, send the message selected by didDuplicateSelector to the delegate, with the contextInfo as the last argument. The method selected by didDuplicateSelector must have the same signature as:
 | 
			
		||||
 
 | 
			
		||||
 - (void)document:(NSDocument *)document didDuplicate:(BOOL)didDuplicate contextInfo:(void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
The default implementation of this method first makes sure that any editor registered using Cocoa Bindings' NSEditorRegistration protocol has committed its changes, then checks to see if there are recent changes that might have been inadvertent and, if so, presents a panel giving the user the choice of canceling, duplicating, or duplicating then also discarding recent changes. Unless the user cancels duplicating, or if no panel was presented, it then invokes -duplicateAndReturnError:. If the user chose duplicating and discarding it also discards recent changes after duplicating.
 | 
			
		||||
*/
 | 
			
		||||
- (void)duplicateDocumentWithDelegate:(nullable id)delegate didDuplicateSelector:(nullable SEL)didDuplicateSelector contextInfo:(nullable void *)contextInfo API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Create and return a new document whose contents are the same as the receiver and that doesn't yet have a fileURL, and return it if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why the document could not be duplicated.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method first uses -writeSafelyToURL:ofType:forSaveOperation:error: to write the document's current contents to a file located in the same directory that is used for the autosaved contents of untitled documents and with the same sort of name, then invokes [[NSDocumentController sharedDocumentController] duplicateDocumentWithContentsOfURL:newContentsURL copying:NO displayName:aDisplayName error:outError]. The display name parameter is either [self displayName] if self has its own name, the display name of the original document if self is a duplicate, or nil if self is untitled.
 | 
			
		||||
 | 
			
		||||
You can override this method to customize what is done during document duplication, but if your override does not invoke -[NSDocumentController duplicateDocumentWithContentsOfURL:copying:displayName:error:] you must take care to do things that that method does, especially invoking -[NSDocumentController addDocument:] and +[NSFileCoordinator addFilePresenter:].
 | 
			
		||||
*/
 | 
			
		||||
- (nullable __kindof NSDocument *)duplicateAndReturnError:(NSError **)outError API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Renaming ***
 | 
			
		||||
 | 
			
		||||
/* The action of the Rename menu item in a document-based application. The default implementation of this method initiates a renaming session in the window returned by [self windowForSheet].
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)renameDocument:(nullable id)sender API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Moving ***
 | 
			
		||||
 | 
			
		||||
/* The action of the Move to iCloud… menu item in a document-based application. The default implementation of this method presents an alert, asking the user to confirm the move, then invokes -moveToURL:completionHandler: with a URL in the application's default ubiquity container.
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)moveDocumentToUbiquityContainer:(nullable id)sender API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
/* The action of the Move To… menu item in a document-based application. The default implementation of this method merely invokes [self moveDocumentWithCompletionHandler:nil].
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)moveDocument:(nullable id)sender API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
/* Present a move panel to the user, then try to save the document if the user OKs the panel. When moving is completed, regardless of success, failure, or cancellation, invoke the given block.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method first makes sure that any editor registered using Cocoa Binding's NSEditorRegistration protocol has committed its changes if necessary. Then, if [self fileURL] is non-nil, it creates and presents a move panel. If the user OKs the panel, -moveToURL:completionHandler: is invoked. If a file already exists at the location the user chooses, the user will be asked to choose between replacing that file, renaming the current document, or canceling. If [self fileURL] is nil, then this method will instead invoke [self runModalSavePanelForSaveOperation:NSSaveAsOperation delegate:didSaveSelector:contextInfo:].
 | 
			
		||||
*/
 | 
			
		||||
- (void)moveDocumentWithCompletionHandler:(void (^ _Nullable)(BOOL didMove))completionHandler API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
/* Move the document's file to the given URL and invoke the passed-in completion handler at some point in the future, perhaps after the method invocation has returned. The completion handler must be invoked on the main thread. If successful, pass a nil error. If not successful, pass an NSError that encapsulates the reason why the document could not be moved.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method does a coordinated move of the file at [self fileURL] to the given URL, replacing any file that may currently exist at that URL, and invokes -setFileURL: if the operation is successful. If [self fileURL] is nil, then this method will instead invoke [self saveToURL:url ofType:[self fileType] forSaveOperation:NSSaveAsOperation completionHandler:aCompletionHandler].
 | 
			
		||||
*/
 | 
			
		||||
- (void)moveToURL:(NSURL *)url completionHandler:(void (^ _Nullable)(NSError * _Nullable))completionHandler API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Locking ***
 | 
			
		||||
 | 
			
		||||
/* The actions of the Lock and Unlock menu items in a document-based application. The default implementations of these method invoke -lockDocumentWithCompletionHandler: and -unlockDocumentWithCompletionHandler: respectively.
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)lockDocument:(nullable id)sender API_AVAILABLE(macos(10.8));
 | 
			
		||||
- (IBAction)unlockDocument:(nullable id)sender API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
/* Lock the document to prevent the user from making further modifications. When locking is completed, regardless of success or failure, invoke the given block.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method first makes sure that any editor registered using Cocoa Binding's NSEditorRegistration protocol has committed its changes and immediately autosaves the document. If the autosave completes successfully or isn't necessary, this method invokes [self lockWithCompletionHandler:]. When locking succeeds, -isLocked will begin returning YES. Documents that return nil from [self fileURL] cannot be locked.
 | 
			
		||||
*/
 | 
			
		||||
- (void)lockDocumentWithCompletionHandler:(void (^ _Nullable)(BOOL didLock))completionHandler API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
/* Lock the file at [self fileURL] to prevent further modifications. When locking is completed regardless of success or failure, invoke the given block.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method enables the "user immutable" flag on the file at [self fileURL].
 | 
			
		||||
*/
 | 
			
		||||
- (void)lockWithCompletionHandler:(void (^ _Nullable)(NSError * _Nullable))completionHandler API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
/* Unlock the document and allow the user to make modifications to the document. When unlocking is completed, regardless of success or failure, invoke the given block.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method invokes [self unlockWithCompletionHandler:]. This method also disables autosaving safety checking, meaning that -checkAutosavingSafetyAndReturnError: will no longer be invoked on this document. When unlocking succeeds, -isLocked will being returning NO.
 | 
			
		||||
*/
 | 
			
		||||
- (void)unlockDocumentWithCompletionHandler:(void (^ _Nullable)(BOOL didUnlock))completionHandler API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
/* Unlock the file at [self fileURL] to allow modifications. When unlocking is completed, regardless of success of failure, invoke the given block.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method tries to clear the "user immutable" flag and add write permissions (if necessary) to the file at [self fileURL].
 | 
			
		||||
*/
 | 
			
		||||
- (void)unlockWithCompletionHandler:(void (^ _Nullable)(NSError * _Nullable))completionHandler API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
/* Returns YES when it appears the file at [self fileURL] cannot be written to. The conditions that cause this to return YES are subject to change, but may include the lack of write permissions, the "user immutable" flag, a read-only parent directory or volume, a return value of NO from -checkAutosavingSafetyAndReturnError:. You should not override this method.
 | 
			
		||||
*/
 | 
			
		||||
@property (getter=isLocked, readonly) BOOL locked API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Printing ***
 | 
			
		||||
 | 
			
		||||
/* The action of the File menu's Page Setup... item in a document-based application. The default implementation of this method invokes [self printInfo], makes a copy of the print info object, and invokes [self runModalPageLayoutWithPrintInfo:printInfoCopy delegate:aPrivateDelegate didRunSelector:aSelectorForAPrivateMethod contextInfo:privateContextInfo]. If the user OKs the page layout panel, [self shouldChangePrintInfo:printInfoCopy] is invoked. If that returns YES, [self setPrintInfo:printInfoCopy] is invoked.
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)runPageLayout:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
/* Present a page layout panel to the user. When the page layout panel has been dismissed, regardless of whether the user cancelled or OK'ed it, send the message selected by didRunSelector to the delegate, with the contextInfo as the last argument. The method selected by didRunSelector must have the same signature as:
 | 
			
		||||
 | 
			
		||||
    - (void)document:(NSDocument *)document didRunPageLayoutAndUserAccepted:(BOOL)userAccepted contextInfo:(void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
The default implementation of this method creates a page layout panel, invokes [self preparePageLayout:thePageLayoutPanel] to provide an opportunity for customization, then presents the panel.
 | 
			
		||||
*/
 | 
			
		||||
- (void)runModalPageLayoutWithPrintInfo:(NSPrintInfo *)printInfo delegate:(nullable id)delegate didRunSelector:(nullable SEL)didRunSelector contextInfo:(nullable void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
/* Given the page layout panel that -runModalPageLayoutWithPrintInfo:delegate:didRunSelector:contextInfo: is about to present to the user, make any final changes before it is presented, and return YES for success. Return NO for failure, to cancel the presentation of the panel. The default implementation of this method just returns YES.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)preparePageLayout:(NSPageLayout *)pageLayout;
 | 
			
		||||
 | 
			
		||||
/* Given a print info object that is the result of the user OK'ing the page layout panel presented by -runPageLayout:, return YES if the print info should be set in the document, NO otherwise.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)shouldChangePrintInfo:(NSPrintInfo *)newPrintInfo;
 | 
			
		||||
 | 
			
		||||
/* The print info for the document. The default implementation of -setPrintInfo: records the change as an undoable change, if the document has an undo manager. If the document has no undo manager, it invokes [self updateChangeCount:NSChangeDone].
 | 
			
		||||
*/
 | 
			
		||||
@property (copy) NSPrintInfo *printInfo;
 | 
			
		||||
 | 
			
		||||
/* The action of the File menu's Print... item in a document-based application. The default implementation of this method merely invokes [self printDocumentWithSettings:[NSDictionary dictionary] showPrintPanel:YES delegate:nil didPrintSelector:NULL contextInfo:NULL].
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)printDocument:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
/* Print the document. If showing of the print panel is specified, present it first, and print only if the user OKs the panel. The NSPrintInfo attributes in the passed-in printSettings dictionary should be added to a copy of the document's print info, and the resulting print info should be used for the operation. When printing is completed or has been cancelled, send the message selected by didPrintSelector to the delegate, with the contextInfo as the last argument. The method selected by didPrintSelector must have the same signature as:
 | 
			
		||||
 | 
			
		||||
    - (void)document:(NSDocument *)document didPrint:(BOOL)didPrintSuccessfully contextInfo:(void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
The default implementation of this method first makes sure that any editor registered using Cocoa Bindings' NSEditorRegistration protocol has committed its changes, then invokes [self printOperationWithSettings:printSettings error:&anError]. If nil is returned it presents the error to the user in a document-modal panel before messaging the delegate. Otherwise it invokes [thePrintOperation setShowsPrintPanel:showPrintPanel] then [self runModalPrintOperation:thePrintOperation delegate:delegate didRunSelector:didPrintSelector contextInfo:contextInfo].
 | 
			
		||||
 | 
			
		||||
Starting in OS X 10.6, if the printSettings dictionary has an NSPrintJobDisposition entry whose value is NSPrintSaveJob, while lacking an NSPrintJobSavingURL or NSPrintSavePath entry indicating where the PDF file should be written, then the default implementation of this method will present a save panel asking the user where the PDF file should be saved. Additionally, starting in OS X 10.9, the default implementation of this method will invoke -PDFPrintOperation instead of -printOperationWithSettings:error: in this scenario.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method invokes [self printShowingPrintPanel:showPrintPanel] if -printShowingPrintPanel: is overridden. When doing this it uses private functionality to arrange for 1) the print settings to take effect despite the fact that the override of -printShowingPrintPanel: can't possibly know about them, and 2) getting notified when the print operation has been completed, so it can message the delegate at the correct time. Correct messaging of the delegate is necessary for correct handling of the Print Apple event.
 | 
			
		||||
*/
 | 
			
		||||
- (void)printDocumentWithSettings:(NSDictionary<NSPrintInfoAttributeKey, id> *)printSettings showPrintPanel:(BOOL)showPrintPanel delegate:(nullable id)delegate didPrintSelector:(nullable SEL)didPrintSelector contextInfo:(nullable void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
/* Create a print operation that can be run to print the document's current contents, and return it if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why the print operation could not be created. The NSPrintInfo attributes in the passed-in printSettings dictionary should be added to a copy of the document's print info, and the resulting print info should be used for the operation. The default implementation of this method does nothing. You must override it to enable printing in your application.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSPrintOperation *)printOperationWithSettings:(NSDictionary<NSPrintInfoAttributeKey, id> *)printSettings error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
/* Run a print operation, possibly with printing UI presented document-modally. When printing is completed, regardless of success or failure, or has been cancelled, send the message selected by didRunSelector to the delegate, with the contextInfo as the last argument. The method selected by didRunSelector must have the same signature as:
 | 
			
		||||
 | 
			
		||||
    - (void)document:(NSDocument *)document didRunPrintOperation:(BOOL)didPrintSuccessfully contextInfo:(void *)contextInfo;
 | 
			
		||||
*/
 | 
			
		||||
- (void)runModalPrintOperation:(NSPrintOperation *)printOperation delegate:(nullable id)delegate didRunSelector:(nullable SEL)didRunSelector contextInfo:(nullable void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** PDF Creation ***
 | 
			
		||||
 | 
			
		||||
/* The action of the File menu's Export As PDF... item in a document-based application. The default implementation of this method merely invokes [self printDocumentWithSettings:@{ NSPrintJobDisposition : NSPrintSaveJob } showPrintPanel:NO delegate:nil didPrintSelector:NULL contextInfo:NULL].
 | 
			
		||||
 */
 | 
			
		||||
- (IBAction)saveDocumentToPDF:(nullable id)sender API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
/* Create a print operation that can be run to create a PDF representation of the document's current contents, and return it if successful. You typically should not use [self printInfo] when creating this print operation, but you should instead maintain a separate NSPrintInfo instance specifically for creating PDFs. The default implementation of this method simply invokes [self printOperationWithSettings:@{ NSPrintJobDisposition : NSPrintSaveJob } error:NULL], but you are highly encouraged to override it if your document subclass supports creating PDF representations.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly, strong) NSPrintOperation *PDFPrintOperation API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Sharing ***
 | 
			
		||||
 | 
			
		||||
/* If YES, allows this instance to be shared via NSDocumentController's standard Share menu. If NO, the standard Share menu will be disabled when this document is targeted.
 | 
			
		||||
 
 | 
			
		||||
 By default, this returns the same value as [[self class] autosavesInPlace].
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) BOOL allowsDocumentSharing API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
/* Share the document's file using the given NSSharingService. First, ensure the document is in a state where it can be properly shared by the given service by saving or relocating the receiver's file, if necessary. Then perform the given sharing service with 'self.fileURL' as the only item. When sharing is complete or fails, invoke the completion handler indicating whether the operation was successful.
 | 
			
		||||
 
 | 
			
		||||
 The default implementation of this method first ensures the document is saved by autosaving the document if possible, or else presenting the user with a save panel. If the given sharing service has the name NSSharingServiceNameCloudSharing, then it also ensures that file is located in an appropriate container for sharing (e.g. iCloud Drive). When the sharing service finishes, it displays an errors returned by the NSSharingService, then invokes the completion handler, passing a boolean indicating whether sharing succeeded or not.
 | 
			
		||||
 
 | 
			
		||||
 If the given sharing service had a delegate already set, the default implementation replaces it with its own delegate in order to get completion notifications. However, all NSSharingServiceDelegate methods will be forwarded to the original delegate as well.
 | 
			
		||||
 
 | 
			
		||||
 When an NSDocument is the only item being used with NSSharingServicePicker or NSSharingServicePickerTouchBarItem, it will invoke this method instead of calling -[NSSharingService performWithItems:] directly.
 | 
			
		||||
 */
 | 
			
		||||
- (void)shareDocumentWithSharingService:(NSSharingService *)sharingService completionHandler:(void (^ _Nullable)(BOOL success))completionHandler API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
/* Given the NSSharingServicePicker used by an NSDocumentController-owned Share menu (either an automatically inserted one, or one returned by +[NSDocumentController standardShareMenuItem]), make any final changes before that menu is presented. Specifically, you may choose to set a custom NSSharingServicePickerDelegate to customize the construction of the resulting menu, or provide a custom NSSharingServiceDelegate for the chosen service.
 | 
			
		||||
 */
 | 
			
		||||
- (void)prepareSharingServicePicker:(NSSharingServicePicker *)sharingServicePicker API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Change Management ***
 | 
			
		||||
 | 
			
		||||
/* Return YES if the document has changes that have not been saved, NO otherwise, primarily determined by the history of previous invocations of -updateChangeCount:. The default implementation of this method returns NO immediately after invocation of -updateChangeCount:NSChangeCleared. It will then return YES if subsequent invocations of -updateChangeCount: have recorded a situation in which the document has changes that have not been saved. Also, it will always return YES after invocation of -updateChangeCount:NSChangeReadOtherContents, until the next invocation of -updateChangeCount:NSChangeCleared. (-updateChangeCount:NSChangeAutosaved has no effect on what the default implementation of this method returns.) Lastly, because NSDocument implements Cocoa Bindings' NSEditorRegistration protocol, the default implementation will return YES whenever there are registered key-value binding editors.
 | 
			
		||||
*/
 | 
			
		||||
@property (getter=isDocumentEdited, readonly) BOOL documentEdited;
 | 
			
		||||
 | 
			
		||||
/* Return YES if the document is in read-only "viewing mode". You may use this information to prevent certain kinds of user actions or changes when the user is viewing an old document version.
 | 
			
		||||
*/
 | 
			
		||||
@property (getter=isInViewingMode, readonly) BOOL inViewingMode API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Record the fact that a change affecting the values returned by -isDocumentEdited and -hasUnautosavedChanges has occurred. See the comments for NSDocumentChangeType for examples of when this method is invoked by NSDocument's own method implementations. Your application only needs to invoke this method explicitly if it is not taking advantage of NSDocument's built-in undo support. The default implementation of this method also sends all of the document's window controllers -setDocumentEdited: messages when appropriate.
 | 
			
		||||
*/
 | 
			
		||||
- (void)updateChangeCount:(NSDocumentChangeType)change;
 | 
			
		||||
 | 
			
		||||
/* Return an object that encapsulates the current record of document change at the beginning of a save operation, for passing to -updateChangeCountWithToken:forSaveOperation: at the end of the save operation. For example, -saveToURL:ofType:forSaveOperation:completionHandler: invokes this method, on the main thread, before it does any actual saving.
 | 
			
		||||
*/
 | 
			
		||||
- (id)changeCountTokenForSaveOperation:(NSSaveOperationType)saveOperation API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Record the fact that saving has succeeded and update the values returned by methods like -isDocumentEdited and -hasUnautosavedChanges. For example, -saveToURL:ofType:forSaveOperation:completionHandler: invokes this method, on the main thread, when it is done saving. The default implementation of this method also sends all of the document's window controllers -setDocumentEdited: messages when appropriate.
 | 
			
		||||
 | 
			
		||||
This was method was introduced with support for asynchronous saving in Mac OS 10.7. Because the goal of asynchronous saving is to let the user continue changing the document during save operations, the old mechanism of merely invoke [self updateChangeCount:NSChangeCleared] when saving has succeeded is no longer sufficient.
 | 
			
		||||
*/
 | 
			
		||||
- (void)updateChangeCountWithToken:(id)changeCountToken forSaveOperation:(NSSaveOperationType)saveOperation API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* The document's undo manager. The default implementation of -setUndoManager:, in addition to recording the undo manager, registers the document as an observer of various NSUndoManager notifications so that -updateChangeCount: is invoked as undoable changes are made to the document. The default implementation of -undoManager creates an undo manager if the document does not already have one and -hasUndoManager would return YES.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, strong) NSUndoManager *undoManager;
 | 
			
		||||
 | 
			
		||||
/* Whether or not the document has an undo manager. The default implementation of -setHasUndoManager: releases the document's current undo manager if it has one before the invocation but is not to have one afterward.
 | 
			
		||||
*/
 | 
			
		||||
@property BOOL hasUndoManager;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Error Presentation ***
 | 
			
		||||
 | 
			
		||||
/* Methods that are declared by NSResponder and also implemented by NSDocument, even though for historical reasons NSDocument is not a subclass of NSResponder. NSDocument's default implementations are equivalent to NSResponder's while treating the shared NSDocumentController as the "next responder" and forwarding error presentation messages to it, despite the fact that for historical reasons NSDocumentController is not a subclass of NSResponder either.
 | 
			
		||||
 | 
			
		||||
NSWindowController has overrides of -presentError:modalForWindow:delegate:didPresentSelector:contextInfo: and -presentError: that treat the window controller's document as the "next responder" and forward these messages to it, if the window controller has a document (some do, some don't).
 | 
			
		||||
 | 
			
		||||
The default implementations of several NSDocument methods invoke -presentError:modalForWindow:delegate:didPresentSelector:contextInfo:.
 | 
			
		||||
 | 
			
		||||
You can customize the presentation of errors on a per-NSDocument-subclass basis by overriding -willPresentError:. Your override should follow the advice given for overriding of -[NSResponder willPresentError:].
 | 
			
		||||
*/
 | 
			
		||||
- (void)presentError:(NSError *)error modalForWindow:(NSWindow *)window delegate:(nullable id)delegate didPresentSelector:(nullable SEL)didPresentSelector contextInfo:(nullable void *)contextInfo;
 | 
			
		||||
- (BOOL)presentError:(NSError *)error;
 | 
			
		||||
- (NSError *)willPresentError:(NSError *)error;
 | 
			
		||||
 | 
			
		||||
/* Given an NSError that has been returned by an NSDocument method, accommodate the fact that the NSError is not going to be presented to the user and the error is definitely not going to be recovered from. Some NSDocument methods, like those involved in writing, sometimes don't immediately delete temporary files if there is a chance that the error can be recovered from and the operation can continue. To make sure that cleanup is always done you should invoke this method with NSDocument errors that are not going to be passed to one of the presentError:... methods. For example, when NSDocument's implementation of -[NSFilePresenter savePresentedItemChangesWithCompletionHandler:] invokes this method when it invokes -autosaveWithImplicitCancellability:completionHandler: and the completion handler is passed an NSError, because it does not present the error to the user.
 | 
			
		||||
*/
 | 
			
		||||
- (void)willNotPresentError:(NSError *)error API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Windows and Window Controllers ***
 | 
			
		||||
 | 
			
		||||
/* Create the user interface for this document, but don't show it yet. The default implementation of this method invokes [self windowNibName], creates a new window controller using the resulting nib name (if it is not nil), specifying this document as the nib file's owner, and then invokes [self addWindowController:theNewWindowController] to attach it. You can override this method to use a custom subclass of NSWindowController or to create more than one window controller right away. NSDocumentController invokes this method when creating or opening new documents.
 | 
			
		||||
*/
 | 
			
		||||
- (void)makeWindowControllers;
 | 
			
		||||
 | 
			
		||||
/* Return the name of the nib to be used by -makeWindowControllers. The default implementation returns nil. You can override this method to return the name of a nib in your application's resources; the class of the file's owner in that nib must match the class of this object, and the window outlet of the file's owner should be connected to a window. Virtually every subclass of NSDocument has to override either -makeWindowControllers or -windowNibName.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSNibName windowNibName;
 | 
			
		||||
 | 
			
		||||
/* Be notified that a window controller will or did load a nib with this document as the nib file's owner. The default implementations of these methods do nothing. You can override these methods to do additional setup during the creation of the document's user interface, especially when there's no other reason to create a custom subclass of NSWindowController, so you're not, and you're simply overriding -windowNibName instead of -makeWindowControllers.
 | 
			
		||||
*/
 | 
			
		||||
- (void)windowControllerWillLoadNib:(NSWindowController *)windowController;
 | 
			
		||||
- (void)windowControllerDidLoadNib:(NSWindowController *)windowController;
 | 
			
		||||
 | 
			
		||||
/* The setter for the "window" IB outlet of this class. It is invoked automatically during the loading of any nib for which this document is the file's owner, if the file's owner window outlet is connected in the nib. You should not invoke this method directly, and typically you would not override it either.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setWindow:(nullable NSWindow *)window;
 | 
			
		||||
 | 
			
		||||
/* Add or remove a window controller from this document's list of attached window controllers, and set the document of the passed-in window controller. You cannot attach a window controller to more than one document at a time. The default implementation of -addWindowController: removes the passed-in window controller from the document to which it is attached, if it is already attached to one. It also ignores redundant invocations. The default implementations of both of these methods send -setDocument: messages to the passed-in window controller (with a nil argument, in the latter case). You wouldn't typically override either of these methods. You typically invoke -addWindowController: once or more from an override of -makeWindowControllers, if you override -makeWindowControllers, and can invoke it at other times in applications that present multiple windows per document to the user.
 | 
			
		||||
*/
 | 
			
		||||
- (void)addWindowController:(NSWindowController *)windowController;
 | 
			
		||||
- (void)removeWindowController:(NSWindowController *)windowController;
 | 
			
		||||
 | 
			
		||||
/* Present the user interface for this document. The default implementation of this method merely sends -showWindow: messages to each of the attached window controllers. You typically would not invoke or override this method. NSDocumentController invokes this method when creating or opening new documents.
 | 
			
		||||
*/
 | 
			
		||||
- (void)showWindows;
 | 
			
		||||
 | 
			
		||||
/* Return an array of all window controllers that have been added to this document with -addWindowController: but not yet removed with -removeWindowController:.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSArray<__kindof NSWindowController *> *windowControllers;
 | 
			
		||||
 | 
			
		||||
/* If the window controller is one whose closing results in the document being closed too, or there is only one window controller attached to the document, do the exact same thing that -canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo: would do. Otherwise send the message selected by shouldCloseSelector to the delegate, with the contextInfo as the last argument, specifying that the window controller should be closed. The method selected by shouldCloseSelector must have the same signature as:
 | 
			
		||||
 | 
			
		||||
    - (void)document:(NSDocument *)document shouldClose:(BOOL)shouldClose contextInfo:(void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
The default implementation of this method sends the window controller a -shouldCloseDocument message and, if the result is YES or the current count of window controllers is one, merely invokes [self canCloseDocumentWithDelegate:delegate shouldCloseSelector:shouldCloseSelector contextInfo:contextInfo]. Otherwise it messages the delegate as described above. You can override this method, but typically you would not invoke it. NSWindow invokes this method for any window that has a window controller and a document associated with it, before sending the window delegate any -windowShouldClose: message.
 | 
			
		||||
*/
 | 
			
		||||
- (void)shouldCloseWindowController:(NSWindowController *)windowController delegate:(nullable id)delegate shouldCloseSelector:(nullable SEL)shouldCloseSelector contextInfo:(nullable void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
/* Set the name for this document that is fit for presentation to the user. If the value is nil then a name based on -defaultDraftName is used.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setDisplayName:(nullable NSString *)displayNameOrNil API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Returns the name for this document that is fit for presentation to the user. You can override this method, but overriding -[NSWindowController windowTitleForDocumentDisplayName:] is usually better, because a document's display name is used in error alerts, alerts presented during document saving, the alert that's presented when the user attempts to close a document that has unsaved changes, and save panels (as the default value of the "Save As:" field). In those places the document file's actual name really is what should be used.
 | 
			
		||||
*/
 | 
			
		||||
@property (copy, null_resettable) NSString *displayName;
 | 
			
		||||
 | 
			
		||||
/* Return the default draft name for the receiver. The default implementation returns the "Untitled" string for the user's current locale.
 | 
			
		||||
 
 | 
			
		||||
 NSDocument invokes this in -displayName when the receiver hasn't yet been assigned one and also prior to autosaving with NSAutosaveAsOperation. NSDocument will append a number to this string if there is a already another document or file with the same name. Applications will typically return a name that describes the kind of document. For example, a spreadsheet application may return "Spreadsheet". Alternatively, a document created from a template may choose to return the name of that template, like "Résumé".
 | 
			
		||||
*/
 | 
			
		||||
- (NSString *)defaultDraftName API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
/* Of the windows associated with this document, return the one most appropriate to use as the parent window of a document-modal sheet. This method may return nil, in which case the invoker should present an application-modal panel. NSDocument's implementation of this method returns the window of the first window controller, or nil if there are no window controllers or if the first window controller has no window.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, strong) NSWindow *windowForSheet;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Types ***
 | 
			
		||||
 | 
			
		||||
/* Return the names of the types for which this class can be instantiated for the application to play the Editor or Viewer role. The default implementation of this method returns information derived from the application's Info.plist. You must typically override it in document classes that are dynamically loaded from plugins. NSDocumentController uses this method when presenting an open panel and when trying to figure the NSDocument subclass to instantiate when opening a particular type of document.
 | 
			
		||||
*/
 | 
			
		||||
@property (class, readonly, copy) NSArray<NSString *> *readableTypes;
 | 
			
		||||
 | 
			
		||||
/* Return the names of the types which this class can save. Typically this includes types for which the application can play the Editor role, plus types than can be merely exported by the application. The default implementation of this method returns information derived from the application's Info.plist. You must typically override it in document classes that are dynamically loaded from plugins.
 | 
			
		||||
*/
 | 
			
		||||
@property (class, readonly, copy) NSArray<NSString *> *writableTypes;
 | 
			
		||||
 | 
			
		||||
/* Return YES if instances of this class can be instantiated for the application to play the Editor role, NO otherwise. The default implementation of this method returns information derived from the application's Info.plist. You must typically override it in document classes that are dynamically loaded from plugins. NSDocument uses this method when presenting a save panel; in that situation all types returned by -writableTypes are presented in the standard file format popup, except the ones for which -isNativeType returns NO.
 | 
			
		||||
*/
 | 
			
		||||
+ (BOOL)isNativeType:(NSString *)type;
 | 
			
		||||
 | 
			
		||||
/* Return the names of the types to which this document can be saved for a kind of save operation. For every kind of save operation except NSSaveToOperation the returned array must only include types for which the the application can play the Editor role. For NSSaveToOperation the returned array may include types for which the application can only play the Viewer role, and other types that the application can merely export. The default implementation of this method returns [[self class] writableTypes] with, except during NSSaveToOperations, types for which +isNativeType returns NO filtered out.
 | 
			
		||||
 | 
			
		||||
You can override this method to limit the set of writable types when the document currently contains data that is not representable in all types. For example, you can disallow saving to .rtf files when the document contains an attachment and can only be saved properly to .rtfd files. NSDocument uses this this method during save operations that present save panels, and during scripted save operations that do not. It may be called at additional times in future releases of Mac OS X. 
 | 
			
		||||
 | 
			
		||||
You can invoke this method when creating a custom save panel accessory view to easily present the same set of types that NSDocument would in its standard file format popup menu.
 | 
			
		||||
*/
 | 
			
		||||
- (NSArray<NSString *> *)writableTypesForSaveOperation:(NSSaveOperationType)saveOperation;
 | 
			
		||||
 | 
			
		||||
/* For a specified type, and a particular kind of save operation, return a file name extension that can be appended to a base file name. The default implementation of this method invokes [[NSWorkspace sharedWorkspace] preferredFilenameExtensionForType:typeName] if the type is a UTI or, for backward binary compatibility with Mac OS 10.4 and earlier, invokes [[NSDocumentController sharedDocumentController] fileExtensionsFromType:typeName] and chooses the first file name extension in the returned array if not.
 | 
			
		||||
 | 
			
		||||
You can override this method to customize the appending of extensions to file names by NSDocument. It's invoked from a variety of places within AppKit itself.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSString *)fileNameExtensionForType:(NSString *)typeName saveOperation:(NSSaveOperationType)saveOperation API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Menu Item Validation ***
 | 
			
		||||
 | 
			
		||||
/* Conformance to the NSUserInterfaceValidations protocol. NSDocument's implementation of this method conditionally enables menu items for all of the action methods listed in this header file.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Ubiquitous Storage ***
 | 
			
		||||
 | 
			
		||||
/* Return YES if instances of this class should allow the use of ubiquitous document storage. The default implementation of this method returns YES if the application has a valid ubiquity container entitlement. When this method returns YES, NSDocument may do things like add new menu items and other UI for ubiquitous documents and allow documents to be saved or moved into the default ubiquity container. You can override this method to return NO for document classes that should not include these features. */
 | 
			
		||||
@property (class, readonly) BOOL usesUbiquitousStorage API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSDocument(NSDeprecated)
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Backward Compatibility ***
 | 
			
		||||
 | 
			
		||||
/* Methods that were deprecated in Mac OS 10.6. See the comments above for information about when your overrides of them are still invoked, for backward binary compatibility.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)saveToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation error:(NSError **)outError API_DEPRECATED("Use -saveToURL:ofType:forSaveOperation:completionHandler: instead", macos(10.4,10.6));
 | 
			
		||||
 | 
			
		||||
/* Methods that were deprecated in Mac OS 10.4. See the comments above for information about when your overrides of them are still invoked, for backward binary compatibility.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSData *)dataRepresentationOfType:(NSString *)type API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (nullable NSDictionary *)fileAttributesToWriteToFile:(NSString *)fullDocumentPath ofType:(NSString *)documentTypeName saveOperation:(NSSaveOperationType)saveOperationType API_DEPRECATED("", macos(10.1,10.4));
 | 
			
		||||
- (nullable NSString *)fileName API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (nullable NSFileWrapper *)fileWrapperRepresentationOfType:(NSString *)type API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (nullable id)initWithContentsOfFile:(NSString *)absolutePath ofType:(NSString *)typeName API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (nullable id)initWithContentsOfURL:(NSURL *)url ofType:(NSString *)typeName API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)type API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (BOOL)loadFileWrapperRepresentation:(NSFileWrapper *)wrapper ofType:(NSString *)type API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (void)printShowingPrintPanel:(BOOL)flag API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)type API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (BOOL)readFromURL:(NSURL *)url ofType:(NSString *)type API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (BOOL)revertToSavedFromFile:(NSString *)fileName ofType:(NSString *)type API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (BOOL)revertToSavedFromURL:(NSURL *)url ofType:(NSString *)type API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (NSInteger)runModalPageLayoutWithPrintInfo:(NSPrintInfo *)printInfo API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (void)saveToFile:(NSString *)fileName saveOperation:(NSSaveOperationType)saveOperation delegate:(nullable id)delegate didSaveSelector:(nullable SEL)didSaveSelector contextInfo:(nullable void *)contextInfo API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (void)setFileName:(nullable NSString *)fileName API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (BOOL)writeToFile:(NSString *)fileName ofType:(NSString *)type API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (BOOL)writeToFile:(NSString *)fullDocumentPath ofType:(NSString *)documentTypeName originalFile:(nullable NSString *)fullOriginalDocumentPath saveOperation:(NSSaveOperationType)saveOperationType API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (BOOL)writeToURL:(NSURL *)url ofType:(NSString *)type API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (BOOL)writeWithBackupToFile:(NSString *)fullDocumentPath ofType:(NSString *)documentTypeName saveOperation:(NSSaveOperationType)saveOperationType API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,305 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSDocumentController.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1997-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSNibDeclarations.h>
 | 
			
		||||
#import <AppKit/NSMenu.h>
 | 
			
		||||
#import <AppKit/NSUserInterfaceValidation.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSDate.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSDocument, NSError, NSMenuItem, NSMutableDictionary, NSOpenPanel, NSURL, NSWindow;
 | 
			
		||||
 | 
			
		||||
NS_SWIFT_UI_ACTOR
 | 
			
		||||
@interface NSDocumentController : NSObject<NSCoding, NSMenuItemValidation, NSUserInterfaceValidations>
 | 
			
		||||
 | 
			
		||||
#pragma mark *** The Shared Document Controller ***
 | 
			
		||||
 | 
			
		||||
/* Return the application's shared document controller. This method will create an instance of NSDocumentController if there is no shared document controller yet. Because the first instance of NSDocumentController to be allocate and initialized during application launch is used as the shared document controller, you have two options for installing an instance of a custom subclass of NSDocumentController as the shared document controller:
 | 
			
		||||
    1) Instantiate your NSDocumentController subclass in the application's main nib, or
 | 
			
		||||
    2) Allocate and initialize an instance of your subclass in your application delegate's applicationWillFinishLaunching: method.
 | 
			
		||||
*/
 | 
			
		||||
@property (class, readonly, strong) __kindof NSDocumentController *sharedDocumentController;
 | 
			
		||||
 | 
			
		||||
/* The designated initializer. The first instance of NSDocumentController to be allocate and initialized during application launch is used as the shared document controller.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Currently Open Documents ***
 | 
			
		||||
 | 
			
		||||
/* Return an array of all open documents.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSArray<__kindof NSDocument *> *documents;
 | 
			
		||||
 | 
			
		||||
/* Return the active document, or nil if there is no active document. The "active" document is the one corresponding to the key window, or the one corresponding to the main window if the key window has no document.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, strong) __kindof NSDocument *currentDocument;
 | 
			
		||||
 | 
			
		||||
/* Return the path of the directory containing the active document's file or file package, if there is an active document and it has a file or file package. Return nil otherwise. The default implementation of -URLsFromRunningOpenPanel invokes this to find the current directory to set in the open panel before presenting it.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSString *currentDirectory;
 | 
			
		||||
 | 
			
		||||
/* Given a URL, return the open document whose file or file package is located by the URL, or nil if there is no such open document. The default implementation of this method queries each open document to find one whose URL matches, and returns the first one whose URL does match.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self documentForFileName:[url path]] if -documentForFileName: is overridden and the URL uses the "file:" scheme.  
 | 
			
		||||
*/
 | 
			
		||||
- (nullable __kindof NSDocument *)documentForURL:(NSURL *)url;
 | 
			
		||||
 | 
			
		||||
/* Given a window, return the document corresponding to the window, nil if no document corrresponds to the window.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable __kindof NSDocument *)documentForWindow:(NSWindow *)window;
 | 
			
		||||
 | 
			
		||||
/* Add or remove a document from the list of open documents. You can override these methods if your application needs to customize what is done when documents are opened and closed. -addDocument is invoked by the default implementations of all NSDocumentController methods whose names start with "open." Your application can invoke -addDocument: manually if it creates a document using something other than one of NSDocument's "open" methods. -removeDocument is invoked by the default implementation of -[NSDocument close].
 | 
			
		||||
*/
 | 
			
		||||
- (void)addDocument:(NSDocument *)document;
 | 
			
		||||
- (void)removeDocument:(NSDocument *)document;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Document Creation ***
 | 
			
		||||
 | 
			
		||||
/* The action of the File menu's New item in a document-based application. The default implementation of this method invokes -openUntitledDocumentAndDisplay:error: and, if nil is returned, presents the error in an application-modal panel.
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)newDocument:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
/* Create a new untitled document, present its user interface if displayDocument is YES, and return the document if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why a new untitled document could not be created. The default implementation of this method invokes [self defaultType] to determine the type of new document to create, invokes -makeUntitledDocumentOfType:error: to create it, then invokes -addDocument: to record its opening. If displayDocument is YES, it then sends the new document -makeWindowControllers and -showWindows messages.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method uses the file coordination mechanism that was added to the Foundation framework in Mac OS 10.7. It passes the document to +[NSFileCoordinator addFilePresenter:] right after -addDocument: is invoked. (The balancing invocation of +[NSFileCoordinator removeFilePresenter:] is in -[NSDocument close]).
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self openUntitledDocumentOfType:[self defaultType] display:displayDocument] if -openUntitledDocumentOfType:display: is overridden.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable __kindof NSDocument *)openUntitledDocumentAndDisplay:(BOOL)displayDocument error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
/* Instantiate a new untitled document of the specified type and return it if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why a new untitled document could not be instantiated. The default implementation of this method invokes -documentClassForType: to find out the class of document to instantiate, allocates a document object, and initializes it by sending it an -initWithType:error: message.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self makeUntitledDocumentOfType:typeName] if -makeUntitledDocumentOfType: is overridden.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable __kindof NSDocument *)makeUntitledDocumentOfType:(NSString *)typeName error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Document Opening ***
 | 
			
		||||
 | 
			
		||||
/* The action of the File menu's Open... item in a document-based application. The default implementation of this method invokes -beginOpenPanelWithCompletionHandler:, unless -fileNamesFromRunningOpenPanel is overridden, in which case that method is invoked instead for backward binary compatibility with Mac OS 10.3 and earlier. If an array other than nil is obtained from that call, it invokes -openDocumentWithContentsOfURL:display:completionHandler: for each URL and, if an error is signaled for any of them, presents the error in an application-modal panel.
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)openDocument:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
/* Present an application-modal open panel to the user and, if the user selects one or more files and indicates that they are to be opened, return an array of those files' URLs. Return nil otherwise. The default implementation of this method invokes -runModalOpenPanel:forTypes: after it has set up an open panel.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSArray<NSURL *> *)URLsFromRunningOpenPanel;
 | 
			
		||||
 | 
			
		||||
/* Present the application-modal open panel to the user, specifying a list of UTIs (in Mac OS 10.5), file name extensions, and encoded HFS file types for openable files. Return NSOKButton or NSCancelButton depending on how the user dismisses the panel.
 | 
			
		||||
*/
 | 
			
		||||
- (NSInteger)runModalOpenPanel:(NSOpenPanel *)openPanel forTypes:(nullable NSArray<NSString *> *)types;
 | 
			
		||||
 | 
			
		||||
/* Present an open panel, which may or may not be application-modal, to the user and, if the user selects one or more files and indicates that they are to be opened, invoke the completion handler with an array of those files' URLs. Invoke the completion handler with nil otherwise. The default implementation of this method invokes -beginOpenPanel:forTypes:completionHandler:. However, for backward binary compatibility, it invokes -runModalOpenPanel:forTypes: instead if you override it in a subclass and not -beginOpenPanel:forTypes:completionHandler:.
 | 
			
		||||
 | 
			
		||||
If you override -[NSDocumentController openDocument:], you would typically want to invoke this method instead of -beginOpenPanel:forTypes:completionHandler: or -URLsFromRunningOpenPanel directly. You typically would not override this method without calling super.
 | 
			
		||||
*/
 | 
			
		||||
- (void)beginOpenPanelWithCompletionHandler:(void (^)(NSArray<NSURL *> * _Nullable))completionHandler API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
/* Present an open panel, which will always be non-modal, to the user, specifying a list of UTIs for openable files. Invoke the completion handler with NSOKButton or NSCancelButton depending on how the user dismisses the panel.
 | 
			
		||||
 | 
			
		||||
You typically would not invoke this method directly. You can override it though if you need to customize the open panel before it gets displayed.
 | 
			
		||||
*/
 | 
			
		||||
- (void)beginOpenPanel:(NSOpenPanel *)openPanel forTypes:(nullable NSArray<NSString *> *)inTypes completionHandler:(void (^)(NSInteger result))completionHandler API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
/* Open a document located by a URL, present its user interface if displayDocument is YES, and invoke the passed-in completion handler at some point in the future, perhaps after the method invocation has returned. The completion handler must be invoked on the main thread. If successful, pass the document to the completion handler, and also whether the document was already open or being opened before this method was invoked. If not successful, pass a nil document and an NSError that encapsulates the reason why the document could not be opened.
 | 
			
		||||
 
 | 
			
		||||
The default implementation of this method checks to see if the document is already open or being opened, and if it is not determines the type of the document, invokes -makeDocumentWithContentsOfURL:ofType:error: to instantiate it, invokes -addDocument: to record its opening, and sends the document -makeWindowControllers and -showWindows messages if displayDocument is YES. If the document is already open it is just sent a -showWindows message if displayDocument is YES. If the relevant document class returns YES when sent +canConcurrentlyReadDocumentsOfType: then the invocation of -makeDocumentWithContentsOfURL:ofType:error: is done on a thread other than the main one and when that has returned the rest of the operation is done on the main thread.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method uses the file coordination mechanism that was added to the Foundation framework in Mac OS 10.7. All of the work it does is one big coordinated read, and it passes the document to +[NSFileCoordinator addFilePresenter:] right after -addDocument: is invoked. (The balancing invocation of +[NSFileCoordinator removeFilePresenter:] is in -[NSDocument close]).
 | 
			
		||||
 | 
			
		||||
You can override this method to customize how documents are opened. Its implemention however is somewhat complex so unless your customization is to do additional work before invoking super, or to invoke super with a completion handler that does additional work before invoking the original completion handler, you should investigate overriding one of the methods that it invokes instead. If you do override this method you should investigate whether you should also override -reopenDocumentForURL:withContentsOfURL:display:completionHandler: to apply the same customization. In either cause take care to always invoke the completion handler on the main thread.
 | 
			
		||||
 | 
			
		||||
You can of course invoke this method to open a document.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.6 and earlier, the default implementation of this method invokes [self openDocumentWithContentsOfURL:url display:displayDocument error:&anError] if that method or the even older -openDocumentWithContentsOfFile:display: method is overridden and this one is not, instead of invoking -makeDocumentWithContentsOfURL:ofType:error: and all the rest.
 | 
			
		||||
*/
 | 
			
		||||
- (void)openDocumentWithContentsOfURL:(NSURL *)url display:(BOOL)displayDocument completionHandler:(void (^)(NSDocument * _Nullable document, BOOL documentWasAlreadyOpen, NSError * _Nullable error))completionHandler API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Instantiate a document located by a URL, of a specified type, and return it if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why the document could not be instantiated. The default implementation of this method invokes -documentClassForType: to find out the class of document to instantiate, allocates a document object, and initializes it by sending it an -initWithContentsOfURL:ofType:error: message.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self makeDocumentWithContentsOfFile:[url path] ofType:typeName] if -makeDocumentWithContentsOfFile:ofType: is overridden and the URL uses the "file:" scheme.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable __kindof NSDocument *)makeDocumentWithContentsOfURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Document Reopening ***
 | 
			
		||||
 | 
			
		||||
/* Reopen a document, perhaps located by a URL, perhaps not, by reading the contents for the document from another URL, which may or may not be a different URL, present its user interface if displayDocument is YES, and invoke the passed-in completion handler at some point in the future, perhaps after the method invocation has returned. The completion handler must be invoked on the main thread. If successful, pass the document to the completion handler, and also whether the document was already open or being opened before this method was invoked. If not successful, pass a nil document and an NSError that encapsulates the reason why the document could not be opened. A nil URL indicates that the opened document is to have no fileURL, much like an untitled document has.
 | 
			
		||||
 
 | 
			
		||||
The default implementation of this method is very similar to -openDocumentWithContentsOfURL:display:completionHandler:'s, the primary difference being that it invokes -makeDocumentForURL:withContentsOfURL:ofType:error: instead of -makeDocumentWithContentsOfURL:ofType:error:.
 | 
			
		||||
 | 
			
		||||
You can override this method to customize how documents are reopened during application launching by the restorable state mechanism that was added to the AppKit framework in Mac OS 10.7. Its implemention however is somewhat complex so unless your customization is to do additional work before invoking super, or to invoke super with a completion handler that does additional work before invoking the original completion handler, you should investigate overriding one of the methods that it invokes instead.
 | 
			
		||||
 | 
			
		||||
We don't anticipate any uses for an application to invoke this method directly, but you may discover one.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.6 and earlier, the default implementation of this method invokes [self reopenDocumentForURL:url withContentsOfURLcontentsURL error:&anError] if that method is overridden and this one is not, instead of invoking -makeDocumentForURL:withContentsOfURL:ofType:error: and all the rest.
 | 
			
		||||
*/
 | 
			
		||||
- (void)reopenDocumentForURL:(nullable NSURL *)urlOrNil withContentsOfURL:(NSURL *)contentsURL display:(BOOL)displayDocument completionHandler:(void (^)(NSDocument * _Nullable document, BOOL documentWasAlreadyOpen, NSError * _Nullable error))completionHandler API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Instantiate a document, perhaps located by a URL, perhaps not, by reading the contents for the document from another URL, which may or may not be a different URL, and return it if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why the document could not be instantiated. The default implementation of this method invokes -documentClassForType: to find out the class of document to instantiate, allocates a document object, and initializes it by sending it an -initForURL:withContentsOfURL:ofType:error: message.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable __kindof NSDocument *)makeDocumentForURL:(nullable NSURL *)urlOrNil withContentsOfURL:(NSURL *)contentsURL ofType:(NSString *)typeName error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Document Autosaving ***
 | 
			
		||||
 | 
			
		||||
/* The time interval in seconds for periodic autosaving. A value of 0 indicates that periodic autosaving should not be done at all. NSDocument will use this number as the minimum amount of time to wait between detecting that a document has unautosaved changes and sending the document an -autosaveDocumentWithDelegate:didAutosaveSelector:contextInfo: message. The default value is 0. You can change it to enable periodic autosaving.
 | 
			
		||||
*/
 | 
			
		||||
@property NSTimeInterval autosavingDelay;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Document Saving ***
 | 
			
		||||
 | 
			
		||||
/* The action of the File menu's Save All item in a document-based application. The default implementation of this method sends each modified document a -saveDocumentWithDelegate:didSaveSelector:contextInfo: message.
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)saveAllDocuments:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Document Closing ***
 | 
			
		||||
 | 
			
		||||
/* Return YES if any open document is modified, NO otherwise. This method is invoked at application quitting time, to determine whether -reviewUnsavedDocumentsWithAlertTitle:cancellable:delegate:didReviewAllSelector:contextInfo: should be invoked.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) BOOL hasEditedDocuments;
 | 
			
		||||
 | 
			
		||||
/* If there is more than one modified document, present an application-modal alert panel telling the user that there are unsaved documents and giving the option of canceling, not saving the documents, or saving the documents. If the user indicates that saving should be done, or if there was only one modified document in the first place, invoke -closeAllDocumentsWithDelegate:didCloseAllSelector:didReviewAll:contextInfo: to attempt to close all modified documents, doing whatever saving is necessary to not lose data. Finally, send the message selected by didReviewAllSelector to the delegate, with the contextInfo as the last argument. The default implementation of this method ignores the passed-in title string (which is passed in only as the result of a historical quirk). The method selected by didReviewAllSelector must have the same signature as:
 | 
			
		||||
 | 
			
		||||
    - (void)documentController:(NSDocumentController *)documentController didReviewAll:(BOOL)didReviewAll contextInfo:(void *)contextInfo;
 | 
			
		||||
*/
 | 
			
		||||
- (void)reviewUnsavedDocumentsWithAlertTitle:(nullable NSString *)title cancellable:(BOOL)cancellable delegate:(nullable id)delegate didReviewAllSelector:(nullable SEL)didReviewAllSelector contextInfo:(nullable void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
/* For each open, modified, document present a document-modal alert panel asking whether the document should be saved and giving the option of canceling, not saving the document, or saving the document. Stop presenting alert panels if the user indicates cancellation in any one of them. The default implementation of this merely sends each open document -canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo: and -close messages until one of them cannot be closed. The method selected by didCloseAllSelector must have the same signature as:
 | 
			
		||||
 | 
			
		||||
    - (void)documentController:(NSDocumentController *)documentController didCloseAll:(BOOL)didCloseAll contextInfo:(void *)contextInfo;
 | 
			
		||||
*/
 | 
			
		||||
- (void)closeAllDocumentsWithDelegate:(nullable id)delegate didCloseAllSelector:(nullable SEL)didCloseAllSelector contextInfo:(nullable void *)contextInfo;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Document Duplicating ***
 | 
			
		||||
 | 
			
		||||
/* Create a new document that will not yet have a location by reading the contents for the document from another URL, present its user interface, and return the document if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why a new document could not be created. If duplicateByCopying is YES then first copy the contents located at the passed-in URL into a file located in the same directory that is used for the autosaved contents of untitled documents and with the same sort of name. if displayNameOrNil is not nil then use that value to derive a display name for the new document that does not match one that is already in use by an open document.
 | 
			
		||||
 
 | 
			
		||||
The default implementation of this method copies the file if specified, determines the type of the document, invokes -makeDocumentForURL:withContentsOfURL:ofType:error: to instantiate it, sends the document -setDisplayName: to name it if displayNameOrNil is not nil, invokes -addDocument: to record its opening, and sends the document -makeWindowControllers and -showWindows messages.
 | 
			
		||||
 | 
			
		||||
The default implementation of this method uses the file coordination mechanism that was added to the Foundation framework in Mac OS 10.7. It passes the document to +[NSFileCoordinator addFilePresenter:] right after -addDocument: is invoked. (The balancing invocation of +[NSFileCoordinator removeFilePresenter:] is in -[NSDocument close]).
 | 
			
		||||
 | 
			
		||||
You can override this method to customize how documents are duplicated. It is invoked by -[NSDocument duplicateAndReturnError:]. It may however also be invoked from other places in AppKit.
 | 
			
		||||
 
 | 
			
		||||
We don't anticipate any uses for your application to invoke this method directly, but you may discover one.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable __kindof NSDocument *)duplicateDocumentWithContentsOfURL:(NSURL *)url copying:(BOOL)duplicateByCopying displayName:(nullable NSString *)displayNameOrNil error:(NSError **)outError API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Document Sharing ***
 | 
			
		||||
 | 
			
		||||
/* If YES, allows automatic insertion of a Share menu in the File menu.
 | 
			
		||||
 
 | 
			
		||||
 By default, this will be YES if your application has any NSDocument subclasses for which autosavesInPlace is YES. To disable the Share menu entirely, or to enable custom placement or construction of the Share menu, applications can explicitly opt out of automatic share menu insertion by overriding this property to return NO.
 | 
			
		||||
 
 | 
			
		||||
 Be aware that even if allowsAutomaticShareMenu is YES, NSDocumentController may choose not to insert the Share menu if it detects that the application already has a Share menu.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) BOOL allowsAutomaticShareMenu API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
/* A menu item that can be used for sharing the current document. You would typically only use this if you make your NSDocument subclass return NO for allowsAutomaticShareMenu to do custom placement of the Share menu.
 | 
			
		||||
 */
 | 
			
		||||
- (NSMenuItem *)standardShareMenuItem API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Error Presentation ***
 | 
			
		||||
 | 
			
		||||
/* Methods that are declared by NSResponder and also implemented by NSDocumentController, even though for historical reasons NSDocumentController is not a subclass of NSResponder. NSDocumentController's default implementations are equivalent to NSResponder's while treating the application object as the "next responder" and forwarding error presentation messages to it.
 | 
			
		||||
 | 
			
		||||
NSDocument has overrides of -presentError:modalForWindow:delegate:didPresentSelector:contextInfo: and -presentError: that treat the shared document controller as the "next responder" and forward these messages it.
 | 
			
		||||
 | 
			
		||||
The default implementations of several NSDocumentController methods invoke -presentError:.
 | 
			
		||||
 | 
			
		||||
You can customize the presentation of errors for all kinds of documents by overriding -willPresentError:. Your override should follow the advice given for overriding of -[NSResponder willPresentError:].
 | 
			
		||||
*/
 | 
			
		||||
- (void)presentError:(NSError *)error modalForWindow:(NSWindow *)window delegate:(nullable id)delegate didPresentSelector:(nullable SEL)didPresentSelector contextInfo:(nullable void *)contextInfo;
 | 
			
		||||
- (BOOL)presentError:(NSError *)error;
 | 
			
		||||
- (NSError *)willPresentError:(NSError *)error;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** The Open Recent Menu ***
 | 
			
		||||
 | 
			
		||||
/* Return the maximum number of items that may be presented in the standard Open Recent menu. A value of 0 indicates that NSDocumentController will not attempt to add an Open Recent menu to your application's File menu, though NSDocumentController will not attempt to remove any Open Recent menu item if there is one already there. The default implementation returns a value that is subject to change and may or may not be derived from a setting made by the user in a System Preferences panel.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) NSUInteger maximumRecentDocumentCount;
 | 
			
		||||
 | 
			
		||||
/* The action of the Open Recent menu's Clear Menu item.
 | 
			
		||||
*/
 | 
			
		||||
- (IBAction)clearRecentDocuments:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
/* Add an item corresponding to a document to the Open Recent menu, or replace an existing item for the same document.
 | 
			
		||||
*/
 | 
			
		||||
- (void)noteNewRecentDocument:(NSDocument *)document;
 | 
			
		||||
 | 
			
		||||
/* Add an item corresponding to the data located by a URL to the Open Recent menu, or replace an existing item with the same URL. You can use this even in non-NSDocument-based applications.
 | 
			
		||||
*/
 | 
			
		||||
- (void)noteNewRecentDocumentURL:(NSURL *)url;
 | 
			
		||||
 | 
			
		||||
/* Return an array of URLs for the entries currently appearing in the Open Recent menu.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSArray<NSURL *> *recentDocumentURLs;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Document Types ***
 | 
			
		||||
 | 
			
		||||
/* Return the name of the document type that should be used when creating new documents. The default implementation of this method returns the first Editor type declared in the application's Info.plist, or returns nil if no Editor type is declared. You can override it to customize the type of document that is created when, for instance, the user chooses New in the File menu.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly) NSString *defaultType;
 | 
			
		||||
 | 
			
		||||
/* Given a URL, return the name of the document type that should be used when opening the document at that location, if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why the document's type could not be determined, or the fact that the document's type is just unrecognized. The default implementation of this method merely returns the URL's NSURLTypeIdentifierKey resource value. You can override this to customize type determination for documents being opened.
 | 
			
		||||
 | 
			
		||||
For backward binary compatibility with Mac OS 10.4 and earlier, the default implementation of this method actually first does the same thing that it did in Mac OS 10.4 (invoke -typeFromFileExtension:, possibly twice, passing an HFS file type string for the second invocation) if there are any CFBundleDocumentTypes Info.plist entries that don't have LSItemContentTypes subentries, and only gets the URL's NSURLTypeIdentifierKey resource value if that does not succeed.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSString *)typeForContentsOfURL:(NSURL *)url error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
/* Return the names of NSDocument subclasses supported by this application. The default implementation of this method returns information derived from the application's Info.plist. You can override it to return the names of document classes that are dynamically loaded from plugins.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *documentClassNames;
 | 
			
		||||
 | 
			
		||||
/* Given a document type name, return the subclass of NSDocument that should be instantiated when opening a document of that type, or nil for failure.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable Class)documentClassForType:(NSString *)typeName;
 | 
			
		||||
 | 
			
		||||
/* Given a document type name, return a string describing the document type that is fit to present to the user, or nil for failure.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSString *)displayNameForType:(NSString *)typeName;
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Menu Item Validation ***
 | 
			
		||||
 | 
			
		||||
/* Conformance to the NSUserInterfaceValidations protocol. NSDocumentController's implementation of this method conditionally enables menu items for all of the action methods listed in this header file, as well as the private action method for Open Recent menu items.
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSDocumentController(NSDeprecated)
 | 
			
		||||
 | 
			
		||||
#pragma mark *** Backward Compatibility
 | 
			
		||||
 | 
			
		||||
/* Methods that were deprecated in Mac OS 10.7. See the comments above for information about when your overrides of them are still invoked, for backward binary compatibility.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable id)openDocumentWithContentsOfURL:(NSURL *)url display:(BOOL)displayDocument error:(NSError **)outError API_DEPRECATED("Use -openDocumentWithContentsOfURL:display:completionHandler: instead", macos(10.4,10.7));
 | 
			
		||||
- (BOOL)reopenDocumentForURL:(nullable NSURL *)url withContentsOfURL:(NSURL *)contentsURL error:(NSError **)outError API_DEPRECATED("Use -reopenDocumentForURL:withContentsOfURL:display:completionHandler: instead", macos(10.4,10.7));
 | 
			
		||||
 | 
			
		||||
/* Methods that were deprecated in Mac OS 10.5, and don't work well in applications whose document types are declared with UTIs. In general, if each of the application's CFBundleDocumentTypes Info.plist entries has a valid LSItemContentTypes subentry, and the application doesn't invoke deprecated methods like -fileNamesFromRunningOpenPanel, then these methods will never be invoked from within Cocoa.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSArray *)fileExtensionsFromType:(NSString *)typeName API_DEPRECATED("", macos(10.0,10.5));
 | 
			
		||||
- (nullable NSString *)typeFromFileExtension:(NSString *)fileNameExtensionOrHFSFileType API_DEPRECATED("", macos(10.0,10.5));
 | 
			
		||||
 | 
			
		||||
/* Methods that were deprecated in Mac OS 10.4. See the comments above for information about when your overrides of them are still invoked, for backward binary compatibility.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable id)documentForFileName:(NSString *)fileName API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (nullable NSArray *)fileNamesFromRunningOpenPanel API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (nullable id)makeDocumentWithContentsOfFile:(NSString *)fileName ofType:(NSString *)type API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (nullable id)makeDocumentWithContentsOfURL:(NSURL *)url ofType:(null_unspecified NSString *)type API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (nullable id)makeUntitledDocumentOfType:(NSString *)type API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (nullable id)openDocumentWithContentsOfFile:(NSString *)fileName display:(BOOL)display API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (nullable id)openDocumentWithContentsOfURL:(NSURL *)url display:(BOOL)display API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (nullable id)openUntitledDocumentOfType:(NSString*)type display:(BOOL)display API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (void)setShouldCreateUI:(BOOL)flag API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
- (BOOL)shouldCreateUI API_DEPRECATED("", macos(10.0,10.4));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,32 @@
 | 
			
		||||
/*
 | 
			
		||||
        NSDocumentScripting.h
 | 
			
		||||
        AppKit Framework
 | 
			
		||||
        Copyright (c) 1997-2021, Apple Inc.
 | 
			
		||||
        All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSDocument.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSCloseCommand;
 | 
			
		||||
@class NSScriptCommand;
 | 
			
		||||
@class NSScriptObjectSpecifier;
 | 
			
		||||
@class NSString;
 | 
			
		||||
 | 
			
		||||
@interface NSDocument (NSScripting)
 | 
			
		||||
 | 
			
		||||
@property (copy) NSString *lastComponentOfFileName;
 | 
			
		||||
 | 
			
		||||
- (nullable id)handleSaveScriptCommand:(NSScriptCommand *)command;
 | 
			
		||||
- (nullable id)handleCloseScriptCommand:(NSCloseCommand *)command;
 | 
			
		||||
- (nullable id)handlePrintScriptCommand:(NSScriptCommand *)command;
 | 
			
		||||
 | 
			
		||||
@property (readonly, strong) NSScriptObjectSpecifier *objectSpecifier;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,213 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSDragging.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObjCRuntime.h>
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <limits.h>
 | 
			
		||||
#import <AppKit/NSPasteboard.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
@protocol NSPasteboardWriting;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSDraggingItem, NSDraggingSession, NSImage, NSPasteboard, NSView, NSWindow;
 | 
			
		||||
@class NSURL;
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSDragOperation) {
 | 
			
		||||
    NSDragOperationNone		= 0,
 | 
			
		||||
    NSDragOperationCopy		= 1,
 | 
			
		||||
    NSDragOperationLink		= 2,
 | 
			
		||||
    NSDragOperationGeneric	= 4,
 | 
			
		||||
    NSDragOperationPrivate	= 8,
 | 
			
		||||
    NSDragOperationMove		= 16,
 | 
			
		||||
    NSDragOperationDelete	= 32,
 | 
			
		||||
    NSDragOperationEvery	= NSUIntegerMax,
 | 
			
		||||
    
 | 
			
		||||
    NSDragOperationAll_Obsolete	API_DEPRECATED("", macos(10.0,10.10)) = 15, // Use NSDragOperationEvery
 | 
			
		||||
    NSDragOperationAll API_DEPRECATED("", macos(10.0,10.10)) = NSDragOperationAll_Obsolete, // Use NSDragOperationEvery
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSDraggingFormation) {
 | 
			
		||||
    NSDraggingFormationDefault = 0, // System determined formation.
 | 
			
		||||
    NSDraggingFormationNone,  // Drag images maintain their set positions relative to each other
 | 
			
		||||
    NSDraggingFormationPile,  // Drag images are placed on top of each other with random rotations
 | 
			
		||||
    NSDraggingFormationList,  // Drag images are laid out vertically, non-overlapping with the left edges aligned
 | 
			
		||||
    NSDraggingFormationStack // Drag images are laid out overlapping diagonally
 | 
			
		||||
} API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSDraggingContext) {
 | 
			
		||||
    NSDraggingContextOutsideApplication = 0,
 | 
			
		||||
    NSDraggingContextWithinApplication
 | 
			
		||||
} API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSDraggingItemEnumerationOptions) {
 | 
			
		||||
    NSDraggingItemEnumerationConcurrent			= NSEnumerationConcurrent,
 | 
			
		||||
    /* When the following option is set, AppKit will automatically set the imageComponentProvider to nil for all dragging items that do not meet the classes/searchOptions criteria. Effectively, this hides the drag image for non valid items for this destination. */
 | 
			
		||||
    NSDraggingItemEnumerationClearNonenumeratedImages 	= (1UL << 16),
 | 
			
		||||
} API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* The spring loading highlight styles roughly correlate to {None: NotSpringLoadable, Light: SpringLoadable, Dark: SpringLoadingEngaged}. However, this not not strictly true as Drag & Drop may switch between highlight styles as an animated signal to the user. */
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSSpringLoadingHighlight) {
 | 
			
		||||
    NSSpringLoadingHighlightNone = 0,
 | 
			
		||||
    NSSpringLoadingHighlightStandard,
 | 
			
		||||
    NSSpringLoadingHighlightEmphasized
 | 
			
		||||
} API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* protocol for the sender argument of the messages sent to a drag destination.  The view or
 | 
			
		||||
   window that registered dragging types sends these messages as dragging is
 | 
			
		||||
   happening to find out details about that session of dragging.
 | 
			
		||||
 */
 | 
			
		||||
@protocol NSDraggingInfo <NSObject>
 | 
			
		||||
@required
 | 
			
		||||
@property (nullable, readonly) NSWindow *draggingDestinationWindow;
 | 
			
		||||
@property (readonly) NSDragOperation draggingSourceOperationMask;
 | 
			
		||||
@property (readonly) NSPoint draggingLocation;
 | 
			
		||||
 | 
			
		||||
/* Returns the current location of the current composited dragging image’s origin in NSDraggingFormationNone translated to the base coordinate system of the destination object’s window
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) NSPoint draggedImageLocation;
 | 
			
		||||
@property (nullable, readonly) NSImage *draggedImage API_DEPRECATED("Use NSDraggingItem objects instead", macos(10.0, 11.0));
 | 
			
		||||
@property (readonly) NSPasteboard *draggingPasteboard;
 | 
			
		||||
@property (nullable, readonly) id draggingSource;
 | 
			
		||||
@property (readonly) NSInteger draggingSequenceNumber;
 | 
			
		||||
- (void)slideDraggedImageTo:(NSPoint)screenPoint;
 | 
			
		||||
- (nullable NSArray<NSString *> *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination API_DEPRECATED("Use NSFilePromiseReceiver objects instead", macos(10.0,10.13));
 | 
			
		||||
 | 
			
		||||
/* Controls the dragging formation while the drag is over this destination. The default value is the current drag formation. */
 | 
			
		||||
@property NSDraggingFormation draggingFormation API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* During the conclusion of an accepted drag, if this property is set to YES, the drag manager will animate each dragging image to their NSDraggingFormationNone locations. Otherwise, the drag images are removed without any animation. Note: This property is inspected between -prepareForDragOperation: and -performDragOperation:. If the final destination frames do not match the current NSDraggingFormationNone frames, then enumerate through the draggingItems during -performDragOperation: to set thier NSDraggingFormationNone frames to the correct destinations.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL animatesToDestination API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* During draggingEntered: or draggingUpdated:, you are responsible for returning the drag operation. In some cases, you may accept some, but not all items on the dragging pasteboard. (For example, you only accept image files.) If you only accept some of the items, you should set this property so the drag manager can update the drag count badge. When -updateItems: is called, you should set the image of non valid dragging items to nil. If none of the drag items are valid then do not call this method. Simply return NSDragOperationNone from draggingEntered: and/or draggingUpdated: and do not modify any drag item properties.
 | 
			
		||||
 */
 | 
			
		||||
@property NSInteger numberOfValidItemsForDrop API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Use the following enumerate method to modify the properties of each dragging item. For example, change the drag image and size.
 | 
			
		||||
   Note: All changes made here are only in effect while the drag is over the destination. When the drag exits the destination all properties return to the values last set by the dragging session.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* Enumerate through each dragging item. Any changes made to the properties of the draggingItem are reflected in the drag and are automatically removed when the drag exits. Classes in the provided array must implement the NSPasteboardReading protocol. Cocoa classes that implement this protocol include NSImage, NSString, NSURL, NSColor, NSAttributedString, and NSPasteboardItem. For every item on the pasteboard, each class in the provided array will be queried for the types it can read using -readableTypesForPasteboard:. An instance will be created of the first class found in the provided array whose readable types match a conforming type contained in that pasteboard item. If an Instance is created from the pasteboard item data, it is placed into an NSDraggingItem along with the dragging properties of that item such as the dragging image. The NSDraggingItem is then passed as a parameter to the provided block. Additional search options, such as restricting the search to file URLs with particular content types, can be specified with a search options dictionary.  See the comments for the Pasteboard Reading Options keys in NSPasteboard.h for a full description. Note: all coordinate properties in the NSDraggingItem are in the coordinate system of view. If view is nil, the screen coordinate space is used.
 | 
			
		||||
*/
 | 
			
		||||
- (void)enumerateDraggingItemsWithOptions:(NSDraggingItemEnumerationOptions)enumOpts forView:(nullable  NSView *)view classes:(NSArray<Class> *)classArray searchOptions:(NSDictionary<NSPasteboardReadingOptionKey, id> *)searchOptions usingBlock:(void (^)(NSDraggingItem *draggingItem, NSInteger idx, BOOL *stop))block API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSSpringLoadingHighlight springLoadingHighlight API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Used when the drag crosses two distinct but valid spring loading regions within the same destination. The hover timer is reset and if the user is currently in a force click, they must release and re-force click to highlight the new region. */
 | 
			
		||||
- (void)resetSpringLoading API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Methods implemented by an object that receives dragged images.  The
 | 
			
		||||
   destination view or window is sent these messages during dragging if it
 | 
			
		||||
   responds to them.
 | 
			
		||||
 */
 | 
			
		||||
@protocol NSDraggingDestination <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
 | 
			
		||||
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender; /* if the destination responded to draggingEntered: but not to draggingUpdated: the return value from draggingEntered: is used */
 | 
			
		||||
- (void)draggingExited:(nullable id <NSDraggingInfo>)sender;
 | 
			
		||||
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
 | 
			
		||||
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
 | 
			
		||||
- (void)concludeDragOperation:(nullable id <NSDraggingInfo>)sender;
 | 
			
		||||
/* draggingEnded: is implemented as of Mac OS 10.5 */
 | 
			
		||||
- (void)draggingEnded:(id<NSDraggingInfo>)sender;
 | 
			
		||||
/* the receiver of -wantsPeriodicDraggingUpdates should return NO if it does not require periodic -draggingUpdated messages (eg. not autoscrolling or otherwise dependent on draggingUpdated: sent while mouse is stationary) */
 | 
			
		||||
- (BOOL)wantsPeriodicDraggingUpdates;
 | 
			
		||||
 | 
			
		||||
/* While a destination may change the dragging images at any time, it is recommended to wait until this method is called before updating the dragging image. This allows the system to delay changing the dragging images until it is likely that the user will drop on this destination. Otherwise, the dragging images will change too often during the drag which would be distracting to the user. The destination may update the dragging images by calling one of the -enumerateDraggingItems methods on the sender.
 | 
			
		||||
*/
 | 
			
		||||
- (void)updateDraggingItemsForDrag:(nullable id <NSDraggingInfo>)sender API_AVAILABLE(macos(10.7));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@protocol NSDraggingSource <NSObject>
 | 
			
		||||
/* Methods implemented by an object that initiates a drag session. The source application is sent these messages during dragging.  The first must be implemented, the others are sent if the source responds to them.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
@required 
 | 
			
		||||
/* Declares what types of operations the source allows to be performed. Apple may provide more specific "within" values in the future. To account for this, for unrecongized localities, return the operation mask for the most specific context that you are concerned with. For example:
 | 
			
		||||
    switch(context) {
 | 
			
		||||
        case NSDraggingContextOutsideApplication:
 | 
			
		||||
            return ...
 | 
			
		||||
            break;
 | 
			
		||||
 | 
			
		||||
        case NSDraggingContextWithinApplication:
 | 
			
		||||
        default:
 | 
			
		||||
            return ...
 | 
			
		||||
            break;
 | 
			
		||||
    }
 | 
			
		||||
*/
 | 
			
		||||
- (NSDragOperation)draggingSession:(NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context;
 | 
			
		||||
 | 
			
		||||
@optional
 | 
			
		||||
- (void)draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint;
 | 
			
		||||
- (void)draggingSession:(NSDraggingSession *)session movedToPoint:(NSPoint)screenPoint;
 | 
			
		||||
- (void)draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation;
 | 
			
		||||
 | 
			
		||||
- (BOOL)ignoreModifierKeysForDraggingSession:(NSDraggingSession *)session;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSSpringLoadingOptions) {
 | 
			
		||||
    NSSpringLoadingDisabled	= 0,		// Spring loading disabled
 | 
			
		||||
    NSSpringLoadingEnabled	= 1UL << 0,	// Spring loading allowed (via Force Click release and hover timeout depending on user preferences)
 | 
			
		||||
    
 | 
			
		||||
    /* Activate spring loading when user enters Force Click as opposed to release from Force Click. Spring loading is de-activated when Force Click is released. If hover is enabled, spring loading is activated on hover timeout and deactivates when the drag exits the target. This option should be used sparingly. */
 | 
			
		||||
    NSSpringLoadingContinuousActivation    = 1UL << 1,
 | 
			
		||||
    
 | 
			
		||||
    /* Disable spring loading activation via hover. This option should be used sparingly, but there are some rare cases where spring loading via hover results in too many false positives, but is otherwise very useful with a Force Click. These are generally cases when the destination view is very large, such as a canvas. */
 | 
			
		||||
    NSSpringLoadingNoHover 	= 1UL << 3
 | 
			
		||||
} API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
@protocol NSSpringLoadingDestination <NSObject>
 | 
			
		||||
@required
 | 
			
		||||
/* Perform the spring loading action (For example, the button's action, or select the tab). Normally, spring loading is a discrete action that only activates after the user completes the spring loading input. When the NSSpringLoadingContinuousActivation option set, spring loading become a continuous action that activates (YES) when the user starts spring loading and then deactivates (NO) when the user releases spring loading. See NSSpringLoadingContinuousActivation for more information.
 | 
			
		||||
 */
 | 
			
		||||
- (void)springLoadingActivated:(BOOL)activated draggingInfo:(id <NSDraggingInfo>)draggingInfo API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Called when the spring loading highlight changes */
 | 
			
		||||
- (void)springLoadingHighlightChanged:(id <NSDraggingInfo>)draggingInfo API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Note: You must also implement either -springLoadingEntered: or -springLoadingUpdated: */
 | 
			
		||||
 | 
			
		||||
@optional
 | 
			
		||||
/* Called when a drag enters the spring loading destination. Return NSSpringLoadingEnabled to enable spring loading. A view is not considered valid spring loading drag destination if neither this method nor springLoadingUpdated: is implemented */
 | 
			
		||||
- (NSSpringLoadingOptions)springLoadingEntered:(id <NSDraggingInfo>)draggingInfo API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Called when a drag moves or the drag info changes. If this method is not implemented, then the value from -springLoadingEntered: is used. */
 | 
			
		||||
- (NSSpringLoadingOptions)springLoadingUpdated:(id <NSDraggingInfo>)draggingInfo API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Called when a drag exits the spring loading destination */
 | 
			
		||||
- (void)springLoadingExited:(id <NSDraggingInfo>)draggingInfo API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* The drag & drop operation has ended. Un-spring if needed. Note: If this obejct is both an NSSpringLoadingDestination and NSDraggingDestination, draggingEnded: will only be called once. */
 | 
			
		||||
- (void)draggingEnded:(id <NSDraggingInfo>)draggingInfo API_AVAILABLE(macos(10.11));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@interface NSObject(NSDraggingSourceDeprecated)
 | 
			
		||||
- (nullable NSArray<NSString *> *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination API_DEPRECATED("Use NSFilePromiseProvider objects instead", macos(10.0,10.13));
 | 
			
		||||
- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)flag API_DEPRECATED("Use -draggingSession:sourceOperationMaskForDraggingContext: instead", macos(10.0,10.7));
 | 
			
		||||
- (void)draggedImage:(null_unspecified NSImage *)image beganAt:(NSPoint)screenPoint API_DEPRECATED("Use -draggingSession:willBeginAtPoint: instead", macos(10.0,10.7));
 | 
			
		||||
- (void)draggedImage:(null_unspecified NSImage *)image endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation API_DEPRECATED("Use -draggingSession:endedAtPoint:operation: instead", macos(10.0,10.7));
 | 
			
		||||
- (void)draggedImage:(null_unspecified NSImage *)image movedTo:(NSPoint)screenPoint API_DEPRECATED("Use -draggingSession:movedToPoint: instead", macos(10.0,10.7));
 | 
			
		||||
- (BOOL)ignoreModifierKeysWhileDragging API_DEPRECATED("Use -ignoreModifierKeysForDraggingSession: instead", macos(10.0,10.7));
 | 
			
		||||
 | 
			
		||||
- (void)draggedImage:(null_unspecified NSImage *)image endedAt:(NSPoint)screenPoint deposited:(BOOL)flag DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,77 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSDraggingItem.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2010-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
@protocol NSPasteboardWriting;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSString;
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSDraggingImageComponentKey NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSDraggingImageComponentKey const NSDraggingImageComponentIconKey API_AVAILABLE(macos(10.7));
 | 
			
		||||
APPKIT_EXTERN NSDraggingImageComponentKey const NSDraggingImageComponentLabelKey API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.7))
 | 
			
		||||
@interface NSDraggingImageComponent : NSObject
 | 
			
		||||
+ (NSDraggingImageComponent *)draggingImageComponentWithKey:(NSDraggingImageComponentKey)key;
 | 
			
		||||
 | 
			
		||||
/* Designated initializer */
 | 
			
		||||
- (instancetype)initWithKey:(NSDraggingImageComponentKey)key NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
/* key must be unique for each component in an NSDraggingItem. You can create your own named components, but the following names have special meaning. NSDraggingImageComponentIconKey is an image of the item being dragged. NSDraggingImageComponentLabelKey represents a textual label associate with the item, for example, a file name.
 | 
			
		||||
*/
 | 
			
		||||
@property (copy) NSDraggingImageComponentKey key;
 | 
			
		||||
 | 
			
		||||
/* An object providing the image contents of the component, typically you set an NSImage, but may be anything CALayer accepts.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, strong) id contents;
 | 
			
		||||
 | 
			
		||||
/* The coordinate space is the bounds of the parent NSDraggingItem. That is, {{0,0}, {draggingFrame.size.width, draggingFrame.size.height}} Note: NSDraggingItem does not clip its components.
 | 
			
		||||
*/
 | 
			
		||||
@property NSRect frame;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.7))
 | 
			
		||||
@interface NSDraggingItem : NSObject
 | 
			
		||||
 | 
			
		||||
/* The designated initializer. When creating an NSDraggingItem the pasteboardWriter must implement the NSPasteboardWriting protocol.
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)initWithPasteboardWriter:(id <NSPasteboardWriting>)pasteboardWriter NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
/* When you create an NSDraggingItem, item is the pasteboardWriter passed to initWithPasteboardWriter. However, when enumerating dragging items in an NSDraggingSession or NSDraggingInfo object, item is not the original pasteboardWriter. It is an instance of one of the classes provided to the enumeration method.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, strong) id item;
 | 
			
		||||
 | 
			
		||||
/* The dragging frame that provides the spatial relationship between NSDraggingItems in the NSDraggingFormationNone. Note: The exact coordinate space of this rect depends on where it is used. See NSDraggingSession and NSDraggingInfo. 
 | 
			
		||||
*/
 | 
			
		||||
@property NSRect draggingFrame;
 | 
			
		||||
 | 
			
		||||
/* The dragging image is the composite of an array of NSDraggingImageComponents. The dragging image components may not be set directly. Instead, provide a block to generate the components and the block will be called if necessary. The block may be set to nil, meaning that this drag item has no image. Generally, only dragging destinations do this, and only if there is at least one valid item in the drop, and this is not it. The components are composited in painting order. That is, each component in the array is painted on top of the previous components in the array.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, copy) NSArray<NSDraggingImageComponent *> * _Nonnull (^imageComponentsProvider)(void);
 | 
			
		||||
 | 
			
		||||
/* Alternate single image component setter. This method simplifies modifiying the components of an NSDraggingItem when there is only one component. This method will set the draggingFrame and imageComponentsProvider properties. frame is in the same coordinate space that the draggingFrame property is. To hide this item, set contents to nil.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setDraggingFrame:(NSRect)frame contents:(nullable id)contents;
 | 
			
		||||
 | 
			
		||||
/* An array of NSDraggingImageComponents that are used to create the drag image. Note: the array contains copies of the components. Changes made to these copies are not reflected in the drag. If needed, the imageComponentsProvider block is called to generate the image components.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly, copy) NSArray<NSDraggingImageComponent *> *imageComponents;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,54 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSDraggingSession.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2010-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <AppKit/NSDragging.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
@protocol NSDraggingSource, NSPasteboardWriting;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSPasteboard, NSImage, NSDraggingItem;
 | 
			
		||||
API_AVAILABLE(macos(10.7))
 | 
			
		||||
@interface NSDraggingSession : NSObject
 | 
			
		||||
/* Controls the dragging formation when the drag is over the source. The default value is NSDraggingFormationNone. */
 | 
			
		||||
@property NSDraggingFormation draggingFormation;
 | 
			
		||||
 | 
			
		||||
/* Controls whether the dragging image animates back to its starting point on a cancelled or failed drag. -draggingSession:endedAtPoint:operation: is a good time to change this value depending on the result of the drag operation. The default value is YES.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL animatesToStartingPositionsOnCancelOrFail;
 | 
			
		||||
 | 
			
		||||
/* The index of the draggingItem under the cursor. The default is the NSDraggingItem closest to the location in the event that was passed to -beginDraggingSessionWithItems:event:source:
 | 
			
		||||
 */
 | 
			
		||||
@property NSInteger draggingLeaderIndex;
 | 
			
		||||
 | 
			
		||||
/* Returns the pasteboard object that holds the data being dragged. */
 | 
			
		||||
@property(readonly) NSPasteboard *draggingPasteboard;
 | 
			
		||||
 | 
			
		||||
/* Returns a number that uniquely identifies the dragging session. */
 | 
			
		||||
@property(readonly) NSInteger draggingSequenceNumber;
 | 
			
		||||
 | 
			
		||||
/* The current location (cursor) of the drag in screen coordinates. */
 | 
			
		||||
@property(readonly) NSPoint draggingLocation;
 | 
			
		||||
 | 
			
		||||
/* Use the following enumerate methods to modify the properties of each dragging item. For example, change the drag image and size.
 | 
			
		||||
   Note: All changes made here are only in effect while destination is not overriding them. When the drag exits the destination, all properties return to the last values set here.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* Enumerate through each dragging item. Any changes made to the properties of the draggingItem are reflected in the drag when the destination is not overriding them. Classes in the provided array must implement the NSPasteboardReading protocol. Cocoa classes that implement this protocol include NSImage, NSString, NSURL, NSColor, NSAttributedString, and NSPasteboardItem. For every item on the pasteboard, each class in the provided array will be queried for the types it can read using -readableTypesForPasteboard:. An instance will be created of the first class found in the provided array whose readable types match a conforming type contained in that pasteboard item. If an Instance is created from the pasteboard item data, it is placed into an NSDraggingItem along with the dragging properties of that item such as the drag image. The NSDraggingItem is then passed as a parameter to the provided block. Additional search options, such as restricting the search to file URLs with particular content types, can be specified with a search options dictionary.  See the comments for the Pasteboard Reading Options keys in NSPasteboard.h for a full description. Note: all coordinate properties in the NSDraggingItem are in the coordinate system of view. If view is nil, the screen coordinate space is used.
 | 
			
		||||
*/
 | 
			
		||||
- (void)enumerateDraggingItemsWithOptions:(NSDraggingItemEnumerationOptions)enumOpts forView:(nullable NSView *)view classes:(NSArray<Class> *)classArray searchOptions:(NSDictionary<NSPasteboardReadingOptionKey, id> *)searchOptions usingBlock:(void (NS_NOESCAPE ^)(NSDraggingItem *draggingItem, NSInteger idx, BOOL *stop))block;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,89 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSDrawer.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 1999-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <CoreFoundation/CFDate.h>
 | 
			
		||||
#import <CoreFoundation/CFRunLoop.h>
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <AppKit/NSResponder.h>
 | 
			
		||||
#import <AppKit/NSWindow.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSLock;
 | 
			
		||||
@class NSView;
 | 
			
		||||
@class NSWindow;
 | 
			
		||||
@class NSNotification;
 | 
			
		||||
@protocol NSDrawerDelegate;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSDrawerState) {
 | 
			
		||||
    NSDrawerClosedState API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13)) = 0,
 | 
			
		||||
    NSDrawerOpeningState API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13)) = 1,
 | 
			
		||||
    NSDrawerOpenState API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13)) = 2,
 | 
			
		||||
    NSDrawerClosingState API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13)) = 3
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13))
 | 
			
		||||
@interface NSDrawer : NSResponder <NSAccessibilityElement, NSAccessibility>
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithContentSize:(NSSize)contentSize preferredEdge:(NSRectEdge)edge;
 | 
			
		||||
 | 
			
		||||
@property (nullable, assign) NSWindow *parentWindow;
 | 
			
		||||
@property (nullable, strong) NSView *contentView;
 | 
			
		||||
@property NSRectEdge preferredEdge;
 | 
			
		||||
@property (nullable, assign) id<NSDrawerDelegate> delegate;
 | 
			
		||||
 | 
			
		||||
- (void)open;
 | 
			
		||||
- (void)openOnEdge:(NSRectEdge)edge;
 | 
			
		||||
- (void)close;
 | 
			
		||||
 | 
			
		||||
- (void)open:(nullable id)sender;
 | 
			
		||||
- (void)close:(nullable id)sender;
 | 
			
		||||
- (void)toggle:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSInteger state;
 | 
			
		||||
@property (readonly) NSRectEdge edge;
 | 
			
		||||
 | 
			
		||||
@property NSSize contentSize;
 | 
			
		||||
@property NSSize minContentSize;
 | 
			
		||||
@property NSSize maxContentSize;
 | 
			
		||||
 | 
			
		||||
@property CGFloat leadingOffset;
 | 
			
		||||
@property CGFloat trailingOffset;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSWindow(NSDrawers)
 | 
			
		||||
 | 
			
		||||
@property (nullable, readonly, copy) NSArray<NSDrawer *> *drawers API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSDrawerDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
- (BOOL)drawerShouldOpen:(NSDrawer *)sender API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13));
 | 
			
		||||
- (BOOL)drawerShouldClose:(NSDrawer *)sender API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13));
 | 
			
		||||
- (NSSize)drawerWillResizeContents:(NSDrawer *)sender toSize:(NSSize)contentSize API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13));
 | 
			
		||||
 | 
			
		||||
- (void)drawerWillOpen:(NSNotification *)notification API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13));
 | 
			
		||||
- (void)drawerDidOpen:(NSNotification *)notification API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13));
 | 
			
		||||
- (void)drawerWillClose:(NSNotification *)notification API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13));
 | 
			
		||||
- (void)drawerDidClose:(NSNotification *)notification API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSDrawerWillOpenNotification API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13));
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSDrawerDidOpenNotification API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13));
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSDrawerWillCloseNotification API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13));
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSDrawerDidCloseNotification API_DEPRECATED("Drawers are deprecated; consider using NSSplitViewController", macos(10.0,10.13));
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,32 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSEPSImageRep.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSImageRep.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSPDFImageRep;
 | 
			
		||||
 | 
			
		||||
@interface NSEPSImageRep : NSImageRep
 | 
			
		||||
 | 
			
		||||
+ (nullable instancetype)imageRepWithData:(NSData *)epsData;	/* Convenience of initWithData: */
 | 
			
		||||
- (nullable instancetype)initWithData:(NSData *)epsData;
 | 
			
		||||
 | 
			
		||||
/* prepareGState is unused */
 | 
			
		||||
- (void)prepareGState API_DEPRECATED("", macos(10.0,10.10));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSData *EPSRepresentation;
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSRect boundingBox;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,55 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSErrors.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
@class NSString;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
// The following strings are the names of exceptions the AppKit can raise
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSTextLineTooLongException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSTextNoSelectionException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSWordTablesWriteException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSWordTablesReadException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSTextReadException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSTextWriteException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSPasteboardCommunicationException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSPrintingCommunicationException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSAbortModalException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSAbortPrintingException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSIllegalSelectorException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSAppKitVirtualMemoryException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSBadRTFDirectiveException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSBadRTFFontTableException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSBadRTFStyleSheetException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSTypedStreamVersionException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSTIFFException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSPrintPackageException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSBadRTFColorTableException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSDraggingException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSColorListIOException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSColorListNotEditableException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSBadBitmapParametersException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSWindowServerCommunicationException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSFontUnavailableException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSPPDIncludeNotFoundException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSPPDParseException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSPPDIncludeStackOverflowException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSPPDIncludeStackUnderflowException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSRTFPropertyStackOverflowException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSAppKitIgnoredException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSBadComparisonException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSImageCacheException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSNibLoadingException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSBrowserIllegalDelegateException;
 | 
			
		||||
APPKIT_EXTERN NSExceptionName NSAccessibilityException API_DEPRECATED("Exceptions are no longer appropriate for indicating errors in accessibility API. Unexpected values should be handled through appropriate type checking.", macos(10.1,10.11));
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,631 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSEvent.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSTouch.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <ApplicationServices/ApplicationServices.h>
 | 
			
		||||
#import <Foundation/NSObjCRuntime.h>
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSDate.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <Foundation/NSSet.h>
 | 
			
		||||
#import <IOKit/hidsystem/IOLLEvent.h>
 | 
			
		||||
#import <limits.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSGraphicsContext, NSWindow, NSTrackingArea;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSEventType) {        /* various types of events */
 | 
			
		||||
    NSEventTypeLeftMouseDown             = 1,
 | 
			
		||||
    NSEventTypeLeftMouseUp               = 2,
 | 
			
		||||
    NSEventTypeRightMouseDown            = 3,
 | 
			
		||||
    NSEventTypeRightMouseUp              = 4,
 | 
			
		||||
    NSEventTypeMouseMoved                = 5,
 | 
			
		||||
    NSEventTypeLeftMouseDragged          = 6,
 | 
			
		||||
    NSEventTypeRightMouseDragged         = 7,
 | 
			
		||||
    NSEventTypeMouseEntered              = 8,
 | 
			
		||||
    NSEventTypeMouseExited               = 9,
 | 
			
		||||
    NSEventTypeKeyDown                   = 10,
 | 
			
		||||
    NSEventTypeKeyUp                     = 11,
 | 
			
		||||
    NSEventTypeFlagsChanged              = 12,
 | 
			
		||||
    NSEventTypeAppKitDefined             = 13,
 | 
			
		||||
    NSEventTypeSystemDefined             = 14,
 | 
			
		||||
    NSEventTypeApplicationDefined        = 15,
 | 
			
		||||
    NSEventTypePeriodic                  = 16,
 | 
			
		||||
    NSEventTypeCursorUpdate              = 17,
 | 
			
		||||
    NSEventTypeScrollWheel               = 22,
 | 
			
		||||
    NSEventTypeTabletPoint               = 23,
 | 
			
		||||
    NSEventTypeTabletProximity           = 24,
 | 
			
		||||
    NSEventTypeOtherMouseDown            = 25,
 | 
			
		||||
    NSEventTypeOtherMouseUp              = 26,
 | 
			
		||||
    NSEventTypeOtherMouseDragged         = 27,
 | 
			
		||||
    /* The following event types are available on some hardware on 10.5.2 and later */
 | 
			
		||||
    NSEventTypeGesture API_AVAILABLE(macos(10.5))       = 29,
 | 
			
		||||
    NSEventTypeMagnify API_AVAILABLE(macos(10.5))       = 30,
 | 
			
		||||
    NSEventTypeSwipe   API_AVAILABLE(macos(10.5))       = 31,
 | 
			
		||||
    NSEventTypeRotate  API_AVAILABLE(macos(10.5))       = 18,
 | 
			
		||||
    NSEventTypeBeginGesture API_AVAILABLE(macos(10.5))  = 19,
 | 
			
		||||
    NSEventTypeEndGesture API_AVAILABLE(macos(10.5))    = 20,
 | 
			
		||||
    
 | 
			
		||||
    NSEventTypeSmartMagnify API_AVAILABLE(macos(10.8)) = 32,
 | 
			
		||||
    NSEventTypeQuickLook API_AVAILABLE(macos(10.8)) = 33,
 | 
			
		||||
    
 | 
			
		||||
    NSEventTypePressure API_AVAILABLE(macos(10.10.3)) = 34,
 | 
			
		||||
    NSEventTypeDirectTouch API_AVAILABLE(macos(10.10)) = 37,
 | 
			
		||||
 | 
			
		||||
    NSEventTypeChangeMode API_AVAILABLE(macos(10.15)) = 38,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const NSEventType NSLeftMouseDown 	API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeLeftMouseDown", macos(10.0,10.12)) = NSEventTypeLeftMouseDown;
 | 
			
		||||
static const NSEventType NSLeftMouseUp 		API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeLeftMouseUp", macos(10.0,10.12)) = NSEventTypeLeftMouseUp;
 | 
			
		||||
static const NSEventType NSRightMouseDown 	API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeRightMouseDown", macos(10.0,10.12)) = NSEventTypeRightMouseDown;
 | 
			
		||||
static const NSEventType NSRightMouseUp		API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeRightMouseUp", macos(10.0,10.12)) = NSEventTypeRightMouseUp;
 | 
			
		||||
static const NSEventType NSMouseMoved 		API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeMouseMoved", macos(10.0,10.12)) = NSEventTypeMouseMoved;
 | 
			
		||||
static const NSEventType NSLeftMouseDragged	API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeLeftMouseDragged", macos(10.0,10.12)) = NSEventTypeLeftMouseDragged;
 | 
			
		||||
static const NSEventType NSRightMouseDragged 	API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeRightMouseDragged", macos(10.0,10.12)) = NSEventTypeRightMouseDragged;
 | 
			
		||||
static const NSEventType NSMouseEntered 	API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeMouseEntered", macos(10.0,10.12)) = NSEventTypeMouseEntered;
 | 
			
		||||
static const NSEventType NSMouseExited 		API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeMouseExited", macos(10.0,10.12)) = NSEventTypeMouseExited;
 | 
			
		||||
static const NSEventType NSKeyDown 		API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeKeyDown", macos(10.0,10.12)) = NSEventTypeKeyDown;
 | 
			
		||||
static const NSEventType NSKeyUp 		API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeKeyUp", macos(10.0,10.12)) = NSEventTypeKeyUp;
 | 
			
		||||
static const NSEventType NSFlagsChanged 	API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeFlagsChanged", macos(10.0,10.12)) = NSEventTypeFlagsChanged;
 | 
			
		||||
static const NSEventType NSAppKitDefined 	API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeAppKitDefined", macos(10.0,10.12)) = NSEventTypeAppKitDefined;
 | 
			
		||||
static const NSEventType NSSystemDefined 	API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeSystemDefined", macos(10.0,10.12)) = NSEventTypeSystemDefined;
 | 
			
		||||
static const NSEventType NSApplicationDefined	API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeApplicationDefined", macos(10.0,10.12)) = NSEventTypeApplicationDefined;
 | 
			
		||||
static const NSEventType NSPeriodic 		API_DEPRECATED_WITH_REPLACEMENT("NSEventTypePeriodic", macos(10.0,10.12)) = NSEventTypePeriodic;
 | 
			
		||||
static const NSEventType NSCursorUpdate 	API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeCursorUpdate", macos(10.0,10.12)) = NSEventTypeCursorUpdate;
 | 
			
		||||
static const NSEventType NSScrollWheel 		API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeScrollWheel", macos(10.0,10.12)) = NSEventTypeScrollWheel;
 | 
			
		||||
static const NSEventType NSTabletPoint 		API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeTabletPoint", macos(10.0,10.12)) = NSEventTypeTabletPoint;
 | 
			
		||||
static const NSEventType NSTabletProximity 	API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeTabletProximity", macos(10.0,10.12)) = NSEventTypeTabletProximity;
 | 
			
		||||
static const NSEventType NSOtherMouseDown	API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeOtherMouseDown", macos(10.0,10.12)) = NSEventTypeOtherMouseDown;
 | 
			
		||||
static const NSEventType NSOtherMouseUp 	API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeOtherMouseUp", macos(10.0,10.12)) = NSEventTypeOtherMouseUp;
 | 
			
		||||
static const NSEventType NSOtherMouseDragged 	API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeOtherMouseDragged", macos(10.0,10.12)) = NSEventTypeOtherMouseDragged;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// For APIs introduced in Mac OS X 10.6 and later, this type is used with NS*Mask constants to indicate the events of interest.
 | 
			
		||||
typedef NS_OPTIONS(unsigned long long, NSEventMask) { /* masks for the types of events */
 | 
			
		||||
    NSEventMaskLeftMouseDown         = 1ULL << NSEventTypeLeftMouseDown,
 | 
			
		||||
    NSEventMaskLeftMouseUp           = 1ULL << NSEventTypeLeftMouseUp,
 | 
			
		||||
    NSEventMaskRightMouseDown        = 1ULL << NSEventTypeRightMouseDown,
 | 
			
		||||
    NSEventMaskRightMouseUp          = 1ULL << NSEventTypeRightMouseUp,
 | 
			
		||||
    NSEventMaskMouseMoved            = 1ULL << NSEventTypeMouseMoved,
 | 
			
		||||
    NSEventMaskLeftMouseDragged      = 1ULL << NSEventTypeLeftMouseDragged,
 | 
			
		||||
    NSEventMaskRightMouseDragged     = 1ULL << NSEventTypeRightMouseDragged,
 | 
			
		||||
    NSEventMaskMouseEntered          = 1ULL << NSEventTypeMouseEntered,
 | 
			
		||||
    NSEventMaskMouseExited           = 1ULL << NSEventTypeMouseExited,
 | 
			
		||||
    NSEventMaskKeyDown               = 1ULL << NSEventTypeKeyDown,
 | 
			
		||||
    NSEventMaskKeyUp                 = 1ULL << NSEventTypeKeyUp,
 | 
			
		||||
    NSEventMaskFlagsChanged          = 1ULL << NSEventTypeFlagsChanged,
 | 
			
		||||
    NSEventMaskAppKitDefined         = 1ULL << NSEventTypeAppKitDefined,
 | 
			
		||||
    NSEventMaskSystemDefined         = 1ULL << NSEventTypeSystemDefined,
 | 
			
		||||
    NSEventMaskApplicationDefined    = 1ULL << NSEventTypeApplicationDefined,
 | 
			
		||||
    NSEventMaskPeriodic              = 1ULL << NSEventTypePeriodic,
 | 
			
		||||
    NSEventMaskCursorUpdate          = 1ULL << NSEventTypeCursorUpdate,
 | 
			
		||||
    NSEventMaskScrollWheel           = 1ULL << NSEventTypeScrollWheel,
 | 
			
		||||
    NSEventMaskTabletPoint           = 1ULL << NSEventTypeTabletPoint,
 | 
			
		||||
    NSEventMaskTabletProximity       = 1ULL << NSEventTypeTabletProximity,
 | 
			
		||||
    NSEventMaskOtherMouseDown        = 1ULL << NSEventTypeOtherMouseDown,
 | 
			
		||||
    NSEventMaskOtherMouseUp          = 1ULL << NSEventTypeOtherMouseUp,
 | 
			
		||||
    NSEventMaskOtherMouseDragged     = 1ULL << NSEventTypeOtherMouseDragged,
 | 
			
		||||
    /* The following event masks are available on some hardware on 10.5.2 and later */
 | 
			
		||||
    NSEventMaskGesture API_AVAILABLE(macos(10.5))          = 1ULL << NSEventTypeGesture,
 | 
			
		||||
    NSEventMaskMagnify API_AVAILABLE(macos(10.5))          = 1ULL << NSEventTypeMagnify,
 | 
			
		||||
    NSEventMaskSwipe API_AVAILABLE(macos(10.5))            = 1ULL << NSEventTypeSwipe,
 | 
			
		||||
    NSEventMaskRotate API_AVAILABLE(macos(10.5))           = 1ULL << NSEventTypeRotate,
 | 
			
		||||
    NSEventMaskBeginGesture API_AVAILABLE(macos(10.5))     = 1ULL << NSEventTypeBeginGesture,
 | 
			
		||||
    NSEventMaskEndGesture API_AVAILABLE(macos(10.5))       = 1ULL << NSEventTypeEndGesture,
 | 
			
		||||
    
 | 
			
		||||
    /* Note: You can only use these event masks on 64 bit. In other words, you cannot setup a local, nor global, event monitor for these event types on 32 bit. Also, you cannot search the event queue for them (nextEventMatchingMask:...) on 32 bit.
 | 
			
		||||
     */
 | 
			
		||||
    NSEventMaskSmartMagnify API_AVAILABLE(macos(10.8)) = 1ULL << NSEventTypeSmartMagnify,
 | 
			
		||||
    NSEventMaskPressure API_AVAILABLE(macos(10.10.3)) = 1ULL << NSEventTypePressure,
 | 
			
		||||
    NSEventMaskDirectTouch API_AVAILABLE(macos(10.12.2)) = 1ULL << NSEventTypeDirectTouch,
 | 
			
		||||
 | 
			
		||||
    NSEventMaskChangeMode API_AVAILABLE(macos(10.15)) = 1ULL << NSEventTypeChangeMode,
 | 
			
		||||
    
 | 
			
		||||
    NSEventMaskAny              = NSUIntegerMax,
 | 
			
		||||
    
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const NSEventMask NSLeftMouseDownMask 		API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskLeftMouseDown", macos(10.0,10.12)) = NSEventMaskLeftMouseDown;
 | 
			
		||||
static const NSEventMask NSLeftMouseUpMask 		API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskLeftMouseUp", macos(10.0,10.12)) = NSEventMaskLeftMouseUp;
 | 
			
		||||
static const NSEventMask NSRightMouseDownMask	 	API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskRightMouseDown", macos(10.0,10.12)) = NSEventMaskRightMouseDown;
 | 
			
		||||
static const NSEventMask NSRightMouseUpMask 		API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskRightMouseUp", macos(10.0,10.12)) = NSEventMaskRightMouseUp;
 | 
			
		||||
static const NSEventMask NSMouseMovedMask 		API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskMouseMoved", macos(10.0,10.12)) = NSEventMaskMouseMoved;
 | 
			
		||||
static const NSEventMask NSLeftMouseDraggedMask 	API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskLeftMouseDragged", macos(10.0,10.12)) = NSEventMaskLeftMouseDragged;
 | 
			
		||||
static const NSEventMask NSRightMouseDraggedMask 	API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskRightMouseDragged", macos(10.0,10.12)) = NSEventMaskRightMouseDragged;
 | 
			
		||||
static const NSEventMask NSMouseEnteredMask 		API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskMouseEntered", macos(10.0,10.12)) = NSEventMaskMouseEntered;
 | 
			
		||||
static const NSEventMask NSMouseExitedMask 		API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskMouseExited", macos(10.0,10.12)) = NSEventMaskMouseExited;
 | 
			
		||||
static const NSEventMask NSKeyDownMask 			API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskKeyDown", macos(10.0,10.12)) = NSEventMaskKeyDown;
 | 
			
		||||
static const NSEventMask NSKeyUpMask 			API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskKeyUp", macos(10.0,10.12)) = NSEventMaskKeyUp;
 | 
			
		||||
static const NSEventMask NSFlagsChangedMask 		API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskFlagsChanged", macos(10.0,10.12)) = NSEventMaskFlagsChanged;
 | 
			
		||||
static const NSEventMask NSAppKitDefinedMask 		API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskAppKitDefined", macos(10.0,10.12)) = NSEventMaskAppKitDefined;
 | 
			
		||||
static const NSEventMask NSSystemDefinedMask 		API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskSystemDefined", macos(10.0,10.12)) = NSEventMaskSystemDefined;
 | 
			
		||||
static const NSEventMask NSApplicationDefinedMask 	API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskApplicationDefined", macos(10.0,10.12)) = NSEventMaskApplicationDefined;
 | 
			
		||||
static const NSEventMask NSPeriodicMask 		API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskPeriodic", macos(10.0,10.12)) = NSEventMaskPeriodic;
 | 
			
		||||
static const NSEventMask NSCursorUpdateMask 		API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskCursorUpdate", macos(10.0,10.12)) = NSEventMaskCursorUpdate;
 | 
			
		||||
static const NSEventMask NSScrollWheelMask 		API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskScrollWheel", macos(10.0,10.12)) = NSEventMaskScrollWheel;
 | 
			
		||||
static const NSEventMask NSTabletPointMask 		API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskTabletPoint", macos(10.0,10.12)) = NSEventMaskTabletPoint;
 | 
			
		||||
static const NSEventMask NSTabletProximityMask	 	API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskTabletProximity", macos(10.0,10.12)) = NSEventMaskTabletProximity;
 | 
			
		||||
static const NSEventMask NSOtherMouseDownMask 		API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskOtherMouseDown", macos(10.0,10.12)) = NSEventMaskOtherMouseDown;
 | 
			
		||||
static const NSEventMask NSOtherMouseUpMask 		API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskOtherMouseUp", macos(10.0,10.12)) = NSEventMaskOtherMouseUp;
 | 
			
		||||
static const NSEventMask NSOtherMouseDraggedMask 	API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskOtherMouseDragged", macos(10.0,10.12)) = NSEventMaskOtherMouseDragged;
 | 
			
		||||
static const NSEventMask NSAnyEventMask			API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskAny", macos(10.0,10.12)) = NSUIntegerMax;
 | 
			
		||||
 | 
			
		||||
NS_INLINE NSEventMask NSEventMaskFromType(NSEventType type) { return (1UL << type); }
 | 
			
		||||
 | 
			
		||||
/* Device-independent bits found in event modifier flags */
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSEventModifierFlags) {
 | 
			
		||||
    NSEventModifierFlagCapsLock           = 1 << 16, // Set if Caps Lock key is pressed.
 | 
			
		||||
    NSEventModifierFlagShift              = 1 << 17, // Set if Shift key is pressed.
 | 
			
		||||
    NSEventModifierFlagControl            = 1 << 18, // Set if Control key is pressed.
 | 
			
		||||
    NSEventModifierFlagOption             = 1 << 19, // Set if Option or Alternate key is pressed.
 | 
			
		||||
    NSEventModifierFlagCommand            = 1 << 20, // Set if Command key is pressed.
 | 
			
		||||
    NSEventModifierFlagNumericPad         = 1 << 21, // Set if any key in the numeric keypad is pressed.
 | 
			
		||||
    NSEventModifierFlagHelp               = 1 << 22, // Set if the Help key is pressed.
 | 
			
		||||
    NSEventModifierFlagFunction           = 1 << 23, // Set if any function key is pressed.
 | 
			
		||||
    
 | 
			
		||||
    // Used to retrieve only the device-independent modifier flags, allowing applications to mask off the device-dependent modifier flags, including event coalescing information.
 | 
			
		||||
    NSEventModifierFlagDeviceIndependentFlagsMask    = 0xffff0000UL
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const NSEventModifierFlags NSAlphaShiftKeyMask         API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagCapsLock", macos(10.0,10.12)) = NSEventModifierFlagCapsLock;
 | 
			
		||||
static const NSEventModifierFlags NSShiftKeyMask              API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagShift", macos(10.0,10.12)) = NSEventModifierFlagShift;
 | 
			
		||||
static const NSEventModifierFlags NSControlKeyMask            API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagControl", macos(10.0,10.12)) = NSEventModifierFlagControl;
 | 
			
		||||
static const NSEventModifierFlags NSAlternateKeyMask          API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagOption", macos(10.0,10.12)) = NSEventModifierFlagOption;
 | 
			
		||||
static const NSEventModifierFlags NSCommandKeyMask            API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagCommand", macos(10.0,10.12)) = NSEventModifierFlagCommand;
 | 
			
		||||
static const NSEventModifierFlags NSNumericPadKeyMask         API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagNumericPad", macos(10.0,10.12)) = NSEventModifierFlagNumericPad;
 | 
			
		||||
static const NSEventModifierFlags NSHelpKeyMask               API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagHelp", macos(10.0,10.12)) = NSEventModifierFlagHelp;
 | 
			
		||||
static const NSEventModifierFlags NSFunctionKeyMask           API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagFunction", macos(10.0,10.12)) = NSEventModifierFlagFunction;
 | 
			
		||||
static const NSEventModifierFlags NSDeviceIndependentModifierFlagsMask    API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagDeviceIndependentFlagsMask", macos(10.0,10.12)) = NSEventModifierFlagDeviceIndependentFlagsMask;
 | 
			
		||||
 | 
			
		||||
/* pointer types for NSEventTypeTabletProximity events or mouse events with subtype NSEventSubtypeTabletProximity*/
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSPointingDeviceType) {        
 | 
			
		||||
    NSPointingDeviceTypeUnknown     = NX_TABLET_POINTER_UNKNOWN,
 | 
			
		||||
    NSPointingDeviceTypePen         = NX_TABLET_POINTER_PEN,
 | 
			
		||||
    NSPointingDeviceTypeCursor      = NX_TABLET_POINTER_CURSOR,
 | 
			
		||||
    NSPointingDeviceTypeEraser      = NX_TABLET_POINTER_ERASER
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const NSPointingDeviceType NSUnknownPointingDevice     API_DEPRECATED_WITH_REPLACEMENT("NSPointingDeviceTypeUnknown", macos(10.0,10.12)) = NSPointingDeviceTypeUnknown;
 | 
			
		||||
static const NSPointingDeviceType NSPenPointingDevice         API_DEPRECATED_WITH_REPLACEMENT("NSPointingDeviceTypePen", macos(10.0,10.12)) = NSPointingDeviceTypePen;
 | 
			
		||||
static const NSPointingDeviceType NSCursorPointingDevice      API_DEPRECATED_WITH_REPLACEMENT("NSPointingDeviceTypeCursor", macos(10.0,10.12)) = NSPointingDeviceTypeCursor;
 | 
			
		||||
static const NSPointingDeviceType NSEraserPointingDevice      API_DEPRECATED_WITH_REPLACEMENT("NSPointingDeviceTypeEraser", macos(10.0,10.12)) = NSPointingDeviceTypeEraser;
 | 
			
		||||
 | 
			
		||||
/* button masks for NSEventTypeTabletPoint events or mouse events with subtype NSEventSubtypeTabletPoint */
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSEventButtonMask) {
 | 
			
		||||
    NSEventButtonMaskPenTip                = NX_TABLET_BUTTON_PENTIPMASK,
 | 
			
		||||
    NSEventButtonMaskPenLowerSide          = NX_TABLET_BUTTON_PENLOWERSIDEMASK,
 | 
			
		||||
    NSEventButtonMaskPenUpperSide          = NX_TABLET_BUTTON_PENUPPERSIDEMASK
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const NSEventButtonMask NSPenTipMask                API_DEPRECATED_WITH_REPLACEMENT("NSEventButtonMaskPenTip", macos(10.0,10.12)) = NSEventButtonMaskPenTip;
 | 
			
		||||
static const NSEventButtonMask NSPenLowerSideMask          API_DEPRECATED_WITH_REPLACEMENT("NSEventButtonMaskPenLowerSide", macos(10.0,10.12)) = NSEventButtonMaskPenLowerSide;
 | 
			
		||||
static const NSEventButtonMask NSPenUpperSideMask          API_DEPRECATED_WITH_REPLACEMENT("NSEventButtonMaskPenUpperSide", macos(10.0,10.12)) = NSEventButtonMaskPenUpperSide;
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSEventPhase) {
 | 
			
		||||
    NSEventPhaseNone        = 0, // event not associated with a phase.
 | 
			
		||||
    NSEventPhaseBegan       = 0x1 << 0,
 | 
			
		||||
    NSEventPhaseStationary  = 0x1 << 1,
 | 
			
		||||
    NSEventPhaseChanged     = 0x1 << 2,
 | 
			
		||||
    NSEventPhaseEnded       = 0x1 << 3,
 | 
			
		||||
    NSEventPhaseCancelled   = 0x1 << 4,
 | 
			
		||||
    NSEventPhaseMayBegin    = 0x1 << 5,
 | 
			
		||||
} API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSEventGestureAxis) {
 | 
			
		||||
    NSEventGestureAxisNone = 0,
 | 
			
		||||
    NSEventGestureAxisHorizontal,
 | 
			
		||||
    NSEventGestureAxisVertical
 | 
			
		||||
} API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSEventSwipeTrackingOptions) {
 | 
			
		||||
    NSEventSwipeTrackingLockDirection = 0x1 << 0, // Clamp gestureAmount to 0 if the user starts to swipe in the opposite direction than they started.
 | 
			
		||||
    NSEventSwipeTrackingClampGestureAmount = 0x1 << 1  // Don't allow gestureAmount to go beyond +/-1.0
 | 
			
		||||
} API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(short, NSEventSubtype) {
 | 
			
		||||
    /* event subtypes for NSEventTypeAppKitDefined events */
 | 
			
		||||
    NSEventSubtypeWindowExposed            = 0,
 | 
			
		||||
    NSEventSubtypeApplicationActivated     = 1,
 | 
			
		||||
    NSEventSubtypeApplicationDeactivated   = 2,
 | 
			
		||||
    NSEventSubtypeWindowMoved              = 4,
 | 
			
		||||
    NSEventSubtypeScreenChanged            = 8,
 | 
			
		||||
    
 | 
			
		||||
    /* event subtypes for NSEventTypeSystemDefined events */
 | 
			
		||||
    NSEventSubtypePowerOff             = 1,
 | 
			
		||||
    
 | 
			
		||||
    /* event subtypes for mouse events */
 | 
			
		||||
    NSEventSubtypeMouseEvent        = NX_SUBTYPE_DEFAULT,
 | 
			
		||||
    NSEventSubtypeTabletPoint       = NX_SUBTYPE_TABLET_POINT,
 | 
			
		||||
    NSEventSubtypeTabletProximity   = NX_SUBTYPE_TABLET_PROXIMITY,
 | 
			
		||||
    NSEventSubtypeTouch  API_AVAILABLE(macos(10.6))             = NX_SUBTYPE_MOUSE_TOUCH
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const NSEventSubtype NSWindowExposedEventType            API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeWindowExposed", macos(10.0,10.12)) = NSEventSubtypeWindowExposed;
 | 
			
		||||
static const NSEventSubtype NSApplicationActivatedEventType     API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeApplicationActivated", macos(10.0,10.12)) = NSEventSubtypeApplicationActivated;
 | 
			
		||||
static const NSEventSubtype NSApplicationDeactivatedEventType   API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeApplicationDeactivated", macos(10.0,10.12)) = NSEventSubtypeApplicationDeactivated;
 | 
			
		||||
static const NSEventSubtype NSWindowMovedEventType              API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeWindowMoved", macos(10.0,10.12)) = NSEventSubtypeWindowMoved;
 | 
			
		||||
static const NSEventSubtype NSScreenChangedEventType            API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeScreenChanged", macos(10.0,10.12)) = NSEventSubtypeScreenChanged;
 | 
			
		||||
static const NSEventSubtype NSAWTEventType                      API_DEPRECATED("This subtype no longer exists", macos(10.10,10.12)) = (NSEventSubtype)16;
 | 
			
		||||
static const NSEventSubtype NSPowerOffEventType             API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypePowerOff", macos(10.0,10.12)) = NSEventSubtypePowerOff;
 | 
			
		||||
static const NSEventSubtype NSMouseEventSubtype             API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeMouseEvent", macos(10.0,10.12)) = NSEventSubtypeMouseEvent;
 | 
			
		||||
static const NSEventSubtype NSTabletPointEventSubtype       API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeTabletPoint", macos(10.0,10.12)) = NSEventSubtypeTabletPoint;
 | 
			
		||||
static const NSEventSubtype NSTabletProximityEventSubtype   API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeTabletProximity", macos(10.0,10.12)) = NSEventSubtypeTabletProximity;
 | 
			
		||||
static const NSEventSubtype NSTouchEventSubtype             API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeTouch", macos(10.0,10.12)) = NSEventSubtypeTouch;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// NSPressureBehavior - The pressure gesture behavior that describes how a pressure gesture behaves and progresses
 | 
			
		||||
// In general, pressure gestures begin when stage reaches 1 and end when stage reaches 0. This corresponds to the simultaneously generated mouse down/up events.
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSPressureBehavior) {
 | 
			
		||||
    NSPressureBehaviorUnknown = -1,
 | 
			
		||||
    
 | 
			
		||||
    // The default primary behavior when otherwise not explicitly configured. In 10.10.3 the default is NSPressureBehaviorPrimaryDeepClick.
 | 
			
		||||
    NSPressureBehaviorPrimaryDefault = 0,
 | 
			
		||||
    
 | 
			
		||||
    // Variable pressure with a small dynamic range after mouseDown.
 | 
			
		||||
    // Mouse events: LeftMouse
 | 
			
		||||
    // # of Stages: 1
 | 
			
		||||
    // Allowed stage transitions: 1->0
 | 
			
		||||
    // Actuations: mouseDown, mouseUp
 | 
			
		||||
    // stageTransition: NO
 | 
			
		||||
    NSPressureBehaviorPrimaryClick = 1,
 | 
			
		||||
    
 | 
			
		||||
    // Variable pressure with a large dynamic range after mouseDown suitable for drawing and general pressure use.
 | 
			
		||||
    // Mouse events: LeftMouse
 | 
			
		||||
    // # of Stages: 1
 | 
			
		||||
    // Allowed stage transitions: 1->0
 | 
			
		||||
    // Actuations: mouseDown, mouseUp
 | 
			
		||||
    // stageTransition: NO
 | 
			
		||||
    NSPressureBehaviorPrimaryGeneric = 2,
 | 
			
		||||
    
 | 
			
		||||
    // Variable pressure after mouseDown suitable for controlling speed. Used by NSAcceleratorButton
 | 
			
		||||
    // Mouse events: LeftMouse
 | 
			
		||||
    // # of Stages: 1
 | 
			
		||||
    // Allowed stage transitions: 1->0
 | 
			
		||||
    // Actuations: mouseDown, mouseUp
 | 
			
		||||
    // stageTransition: NO
 | 
			
		||||
    NSPressureBehaviorPrimaryAccelerator = 3,
 | 
			
		||||
    
 | 
			
		||||
    // Toggle between stages 1 and 2 until drag or mouse up (e.g. Force Click)
 | 
			
		||||
    // Mouse events: LeftMouse
 | 
			
		||||
    // # of Stages: 2 (stage 2 is disabled once dragging starts)
 | 
			
		||||
    // Allowed stage transitions: 1->0, 1->2, 2->1, 2->0
 | 
			
		||||
    // Actuations: mouseDown, mouseUp, 1->2, 2->1
 | 
			
		||||
    // stageTransition: into and release from stage 2
 | 
			
		||||
    NSPressureBehaviorPrimaryDeepClick = 5,
 | 
			
		||||
    
 | 
			
		||||
    // Toggle between stages 1 and 2 until mouse up (e.g. Force Click)
 | 
			
		||||
    // Mouse events: LeftMouse
 | 
			
		||||
    // # of Stages: 2
 | 
			
		||||
    // Allowed stage transitions: 1->0, 1->2, 2->1, 2->0
 | 
			
		||||
    // Actuations: mouseDown, mouseUp, 1->2, 2->1
 | 
			
		||||
    // stageTransition: into and release from stage 2
 | 
			
		||||
    NSPressureBehaviorPrimaryDeepDrag = 6,
 | 
			
		||||
    
 | 
			
		||||
}API_AVAILABLE(macos(10.10.3));
 | 
			
		||||
 | 
			
		||||
@interface NSEvent : NSObject <NSCopying, NSCoding>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* these messages are valid for all events */
 | 
			
		||||
@property (readonly) NSEventType type;
 | 
			
		||||
@property (readonly) NSEventModifierFlags modifierFlags;
 | 
			
		||||
@property (readonly) NSTimeInterval timestamp;
 | 
			
		||||
@property (readonly, nullable, weak) NSWindow *window;
 | 
			
		||||
@property (readonly) NSInteger windowNumber;
 | 
			
		||||
@property (nullable, readonly, strong) NSGraphicsContext *context API_DEPRECATED("This method always returns nil. If you need access to the current drawing context, use [NSGraphicsContext currentContext] inside of a draw operation.", macos(10.0,10.12));
 | 
			
		||||
 | 
			
		||||
/* these messages are valid for all mouse down/up/drag events */
 | 
			
		||||
@property (readonly) NSInteger clickCount;
 | 
			
		||||
@property (readonly) NSInteger buttonNumber;    // for NSOtherMouse events, but will return valid constants for NSLeftMouse and NSRightMouse
 | 
			
		||||
/* these messages are valid for all mouse down/up/drag and enter/exit events */
 | 
			
		||||
@property (readonly) NSInteger eventNumber;
 | 
			
		||||
 | 
			
		||||
/* -pressure is valid for all mouse down/up/drag events, and is also valid for NSEventTypeTabletPoint events on 10.4 or later and NSEventTypePressure on 10.10.3 or later */
 | 
			
		||||
@property (readonly) float pressure;
 | 
			
		||||
/* -locationInWindow is valid for all mouse-related events */
 | 
			
		||||
@property (readonly) NSPoint locationInWindow;
 | 
			
		||||
 | 
			
		||||
/* these messages are valid for scroll wheel events and mouse move/drag events.  As of 10.5.2, deltaX and deltaY are also valid for swipe events.  A non-0 deltaX will represent a horizontal swipe, -1 for swipe right and 1 for swipe left.  A non-0 deltaY will represent a vertical swipe, -1 for swipe down and 1 for swipe up. As of 10.7, the preferred methods for scroll wheel events are scrollingDeltaX and scrollingDeltaY defined below.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) CGFloat deltaX;    
 | 
			
		||||
@property (readonly) CGFloat deltaY;    
 | 
			
		||||
@property (readonly) CGFloat deltaZ;    // 0 for most scroll wheel and mouse events
 | 
			
		||||
 | 
			
		||||
/* This message is valid for NSEventTypeScrollWheel events. A generic scroll wheel issues rather coarse scroll deltas. Some Apple mice and trackpads provide much more precise delta. This method determines the resolution of the scrollDeltaX and scrollDeltaY values.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) BOOL hasPreciseScrollingDeltas API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* The following two message are the preferred API for accessing NSEventTypeScrollWheel deltas. When -hasPreciseScrollingDeltas reutrns NO, multiply the returned value by line or row height. When -hasPreciseScrollingDeltas returns YES, scroll by the returned value (in points).
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) CGFloat scrollingDeltaX API_AVAILABLE(macos(10.7));
 | 
			
		||||
@property (readonly) CGFloat scrollingDeltaY API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* This message is valid for NSEventTypeScrollWheel events. With the Magic Mouse and some trackpads, the user can flick thier finger resulting in a stream of scroll events that dissipate over time. The location of these scroll wheel events changes as the user moves the cursor. AppKit latches these scroll wheel events to the view that is under the cursor when the flick occurs. A custom view can use this method to recognize these momentum scroll events and further route the event to the appropriate sub component.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) NSEventPhase momentumPhase API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* valid for NSEventScrollWheel events. The user may choose to change the scrolling behavior such that it feels like they are moving the content instead of the scroll bar. To accomplish this, deltaX/Y and scrollingDeltaX/Y are automatically inverted for NSEventScrollWheel events according to the user's preferences. However, for some uses, the behavior should not respect the user preference. This method allows you to determine when the event has been inverted and compensate by multiplying -1 if needed. 
 | 
			
		||||
*/
 | 
			
		||||
@property (getter=isDirectionInvertedFromDevice, readonly) BOOL directionInvertedFromDevice API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* these messages are valid for keyup and keydown events */
 | 
			
		||||
@property (nullable, readonly, copy) NSString *characters;
 | 
			
		||||
@property (nullable, readonly, copy) NSString *charactersIgnoringModifiers;
 | 
			
		||||
 | 
			
		||||
/* This message is valid keyup and keydown events.
 | 
			
		||||
    It returns the character(s) that would have been generated if a different modifier combination had been used.
 | 
			
		||||
    It uses [self keyCode], the new modifiers and the current keyboard input source's layout data for re-translation.  It entirely ignores the modifiers that are already present in the event and calling this method will not affect the dead key state for current text input.
 | 
			
		||||
    If there is invalid data in this event, -charactersByApplyingModifiers will return nil.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSString *)charactersByApplyingModifiers:(NSEventModifierFlags)modifiers API_AVAILABLE(macos(10.15)); 
 | 
			
		||||
 | 
			
		||||
  /* the chars that would have been generated, regardless of modifier keys (except shift) */
 | 
			
		||||
@property (getter=isARepeat, readonly) BOOL ARepeat;
 | 
			
		||||
/* this message is valid for keyup, keydown and flagschanged events */
 | 
			
		||||
@property (readonly) unsigned short keyCode;        /* device-independent key number */
 | 
			
		||||
 | 
			
		||||
/* these messages are valid for enter and exit events */
 | 
			
		||||
@property (readonly) NSInteger trackingNumber;
 | 
			
		||||
@property (nullable, readonly) void *userData NS_RETURNS_INNER_POINTER;
 | 
			
		||||
/* -trackingArea returns the NSTrackingArea that generated this event.  It is possible for there to be no trackingArea associated with the event in some cases where the event corresponds to a trackingRect installed with -[NSView addTrackingRect:owner:userData:assumeInside:], in which case nil is returned. */
 | 
			
		||||
@property (nullable, readonly, strong) NSTrackingArea *trackingArea API_AVAILABLE(macos(10.5)); 
 | 
			
		||||
 | 
			
		||||
/* this message is valid for kit, system, and app-defined events */
 | 
			
		||||
/* this message is also valid for mouse events on 10.4 or later */
 | 
			
		||||
@property (readonly) NSEventSubtype subtype;
 | 
			
		||||
 | 
			
		||||
/* these messages are valid for kit, system, and app-defined events */
 | 
			
		||||
@property (readonly) NSInteger data1;
 | 
			
		||||
@property (readonly) NSInteger data2;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* -eventRef and +eventWithEventRef:  are valid for all events */
 | 
			
		||||
/* -eventRef returns an EventRef corresponding to the NSEvent.  The EventRef is retained by the NSEvent, so will be valid as long as the NSEvent is valid, and will be released when the NSEvent is freed.  You can use RetainEvent to extend the lifetime of the EventRef, with a corresponding ReleaseEvent when you are done with it.  If there is no EventRef corresponding to the NSEvent, -eventRef will return NULL.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly) const void * /* EventRef */eventRef NS_RETURNS_INNER_POINTER API_AVAILABLE(macos(10.5));
 | 
			
		||||
/* +eventWithEventRef: returns an autoreleased NSEvent corresponding to the EventRef.  The EventRef is retained by the NSEvent and will be released when the NSEvent is freed.  If there is no NSEvent corresponding to the EventRef, +eventWithEventRef will return nil.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSEvent *)eventWithEventRef:(const void * /* EventRef */)eventRef API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* -CGEvent returns an autoreleased CGEventRef corresponding to the NSEvent.  If there is no CGEventRef corresponding to the NSEvent, -CGEvent will return NULL.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly) CGEventRef CGEvent API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* +eventWithCGEvent: returns an autoreleased NSEvent corresponding to the CGEventRef.  The CGEventRef is retained by the NSEvent and will be released when the NSEvent is freed.  If there is no NSEvent corresponding to the CGEventRef, +eventWithEventRef will return nil.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSEvent *)eventWithCGEvent:(CGEventRef)cgEvent API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Enable or disable coalescing of mouse movement events, including mouse moved, mouse dragged, and tablet events.  Coalescing is enabled by default.
 | 
			
		||||
*/
 | 
			
		||||
@property (class, getter=isMouseCoalescingEnabled) BOOL mouseCoalescingEnabled API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* This message is valid for events of type NSEventTypeMagnify, on 10.5.2 or later */
 | 
			
		||||
@property (readonly) CGFloat magnification API_AVAILABLE(macos(10.5));       // change in magnification.   This value should be added to the current scaling of an item to get the new scale factor.
 | 
			
		||||
 | 
			
		||||
/* this message is valid for mouse events with subtype NSEventSubtypeTabletPoint or NSEventSubtypeTabletProximity, and for NSEventTypeTabletPoint and NSEventTypeTabletProximity events */
 | 
			
		||||
@property (readonly) NSUInteger deviceID;
 | 
			
		||||
 | 
			
		||||
/* this message is valid for valid for mouse events with subtype NSEventSubtypeTabletPoint, and for NSEventTypeTabletPoint events.  On 10.5.2 or later, it is also valid for NSEventTypeRotate events. */
 | 
			
		||||
@property (readonly) float rotation;       // In degrees.  For NSEventTypeTabletPoint, this is rotation of the pen.  For NSEventTypeRotate, it is rotation on the track pad.
 | 
			
		||||
 | 
			
		||||
/* these messages are valid for mouse events with subtype NSEventSubtypeTabletPoint, and for NSEventTypeTabletPoint events */
 | 
			
		||||
/* absolute x coordinate in tablet space at full tablet resolution */
 | 
			
		||||
@property (readonly) NSInteger absoluteX; 
 | 
			
		||||
/* absolute y coordinate in tablet space at full tablet resolution */
 | 
			
		||||
@property (readonly) NSInteger absoluteY;               
 | 
			
		||||
/* absolute z coordinate in tablet space at full tablet resolution */
 | 
			
		||||
@property (readonly) NSInteger absoluteZ;     
 | 
			
		||||
/* mask indicating which buttons are pressed.*/
 | 
			
		||||
@property (readonly) NSEventButtonMask buttonMask;
 | 
			
		||||
/* range is -1 to 1 for both axes */
 | 
			
		||||
@property (readonly) NSPoint tilt;     
 | 
			
		||||
/* tangential pressure on the device; range is -1 to 1 */
 | 
			
		||||
@property (readonly) float tangentialPressure;  
 | 
			
		||||
/* NSArray of 3 vendor defined shorts */
 | 
			
		||||
@property (readonly, strong) id vendorDefined;    
 | 
			
		||||
 | 
			
		||||
/* these messages are valid for mouse events with subtype NSEventSubtypeTabletProximity, and  for NSEventTypeTabletProximity events */
 | 
			
		||||
/* vendor defined, typically USB vendor ID */
 | 
			
		||||
@property (readonly) NSUInteger vendorID;
 | 
			
		||||
/* vendor defined tablet ID */
 | 
			
		||||
@property (readonly) NSUInteger tabletID;
 | 
			
		||||
/* index of the device on the tablet.  Usually 0, except for tablets that support multiple concurrent devices */
 | 
			
		||||
@property (readonly) NSUInteger pointingDeviceID;
 | 
			
		||||
/* system assigned unique tablet ID */
 | 
			
		||||
@property (readonly) NSUInteger systemTabletID;
 | 
			
		||||
/* vendor defined pointing device type */
 | 
			
		||||
@property (readonly) NSUInteger vendorPointingDeviceType; 
 | 
			
		||||
/* vendor defined serial number of pointing device */
 | 
			
		||||
@property (readonly) NSUInteger pointingDeviceSerialNumber; 
 | 
			
		||||
/* vendor defined unique ID */
 | 
			
		||||
@property (readonly) unsigned long long uniqueID;    
 | 
			
		||||
/* mask representing capabilities of device */
 | 
			
		||||
@property (readonly) NSUInteger capabilityMask;    
 | 
			
		||||
/* mask representing capabilities of device */
 | 
			
		||||
@property (readonly) NSPointingDeviceType pointingDeviceType;
 | 
			
		||||
/* YES - entering; NO - leaving */
 | 
			
		||||
@property (getter=isEnteringProximity, readonly) BOOL enteringProximity;    
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
- (NSSet<NSTouch *> *)touchesMatchingPhase:(NSTouchPhase)phase inView:(nullable NSView *)view API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Only valid for NSEventTypeGesture events. Equivalent to [event touchesMatchingPhase:NSTouchPhaseAny inView:nil] */
 | 
			
		||||
- (NSSet <NSTouch *> *)allTouches API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/* Only valid for NSEventTypeGesture events. Equivalent to [event touchesMatchingPhase:NSTouchPhaseAny inView:view] */
 | 
			
		||||
- (NSSet <NSTouch *> *)touchesForView:(NSView *)view API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/* An array of auxiliary NSTouch’s for the touch events that did not get delivered for a given main touch. This also includes an auxiliary version of the main touch itself. Only valid for NSEventTypeDirectTouch events.
 | 
			
		||||
*/
 | 
			
		||||
- (NSArray <NSTouch *> *)coalescedTouchesForTouch:(NSTouch *)touch API_AVAILABLE(macos(10.12.2));
 | 
			
		||||
 | 
			
		||||
/* The phase of a gesture scroll event. A gesture phrase are all the events that begin with a NSEventPhaseBegan and end with either a NSEventPhaseEnded or NSEventPhaseCancelled. All the gesture events are sent to the view under the cursor when the NSEventPhaseBegan occurred.  A gesture scroll event starts with a NSEventPhaseBegan phase and ends with a NSPhaseEnded. Legacy scroll wheel events (say from a Mighty Mouse) and momentum scroll wheel events have a phase of NSEventPhaseNone.
 | 
			
		||||
    Valid for NSEventTypeScrollWheel
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) NSEventPhase phase API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* This message is valid for NSEventTypePressure events. Pressure gesture events go through multiple stages.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) NSInteger stage API_AVAILABLE(macos(10.10.3));
 | 
			
		||||
 | 
			
		||||
/* This message is valid for NSEventTypePressure events. Positive stageTransition describes approaching the next stage of the pressure gesture. Negative stageTransition describes approaching release of the current stage.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) CGFloat stageTransition API_AVAILABLE(macos(10.10.3));
 | 
			
		||||
 | 
			
		||||
/* This message is valid for Mouse events. The event mask describing the various events that you may also get during this event sequence. Useful for determining if the input device issuing this mouse event can also simultaneously issue NSEventTypePressure events.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) NSEventMask associatedEventsMask API_AVAILABLE(macos(10.10.3));
 | 
			
		||||
 | 
			
		||||
/* this message is valid for NSEventTypePressure events */
 | 
			
		||||
@property (readonly) NSPressureBehavior pressureBehavior API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Returns the user's preference about using gesture scrolls as a way to track fluid swipes. This value is determined by the Mouse / Trackpad preference panel for the current user. Generally, NSScrollView will check this for you. However, if your app is not using an NSScrollView, or your NSResponder can receive scrollWheel messages without first being sent to an NSScrollView, then you should check this preference before calling -trackSwipeEventWithOptions:dampenAmountThresholdMin:max:usingHandler:
 | 
			
		||||
*/
 | 
			
		||||
@property (class, readonly, getter=isSwipeTrackingFromScrollEventsEnabled) BOOL swipeTrackingFromScrollEventsEnabled API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* This method allows easy tracking and UI feedback of scroll events as fluid swipes. Fluid swipes are tracked not only to the end of the physical gesture phase by the user, but also to the completion of any UI animation that should be performed. Using this method allows your implementation to maintain a consistent fluid feel with other applications. Any gesture amount outside of the supplied minimum and maximum dampen amount is pre-dampened for you to provide an elastic feel.
 | 
			
		||||
 | 
			
		||||
   The trackingHandler has the following parameters:
 | 
			
		||||
       gestureAmount: the amount of gesture that you should display in the UI. This may be a fractional amount. Note: Upon completion, the gesture amount will animate to one of the following values: -1, 0, 1.
 | 
			
		||||
       phase: the phase of the physical gesture as performed by the user. When the phase is either NSPhaseEnded, or NSPhaseCancelled, the use has physically ended the gesture successfully or not, respectively. Your handler will continue to be called with updated progress values to complete the fluid swipe animation with a phase of NSPhaseNone.
 | 
			
		||||
       isComplete: Signifies the swipe and animation are complete and you should tear down any temporary animation objects. The trackingHandler is released and will not be called further.
 | 
			
		||||
      *stop: A pointer to a BOOL allowing you to cancel further use of this trackingHandler by setting its value to YES. The trackingHandler is released appropriately.
 | 
			
		||||
 | 
			
		||||
   Note: This method returns immediately and tracking is performed asynchronously.
 | 
			
		||||
 | 
			
		||||
   Valid for Scroll events with a phase of NSEventPhaseBegan or NSEventPhaseChanged
 | 
			
		||||
*/
 | 
			
		||||
- (void)trackSwipeEventWithOptions:(NSEventSwipeTrackingOptions)options dampenAmountThresholdMin:(CGFloat)minDampenThreshold max:(CGFloat)maxDampenThreshold usingHandler:(void (^)(CGFloat gestureAmount, NSEventPhase phase, BOOL isComplete, BOOL *stop))trackingHandler API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* used for initial delay and periodic behavior in tracking loops */
 | 
			
		||||
+ (void)startPeriodicEventsAfterDelay:(NSTimeInterval)delay withPeriod:(NSTimeInterval)period;
 | 
			
		||||
+ (void)stopPeriodicEvents;
 | 
			
		||||
 | 
			
		||||
/* apps will rarely create these objects */
 | 
			
		||||
+ (nullable NSEvent *)mouseEventWithType:(NSEventType)type location:(NSPoint)location modifierFlags:(NSEventModifierFlags)flags timestamp:(NSTimeInterval)time windowNumber:(NSInteger)wNum context:(nullable NSGraphicsContext* __unused)unusedPassNil eventNumber:(NSInteger)eNum clickCount:(NSInteger)cNum pressure:(float)pressure;
 | 
			
		||||
+ (nullable NSEvent *)keyEventWithType:(NSEventType)type location:(NSPoint)location modifierFlags:(NSEventModifierFlags)flags timestamp:(NSTimeInterval)time windowNumber:(NSInteger)wNum context:(nullable NSGraphicsContext* __unused)unusedPassNil characters:(NSString *)keys charactersIgnoringModifiers:(NSString *)ukeys isARepeat:(BOOL)flag keyCode:(unsigned short)code;
 | 
			
		||||
+ (nullable NSEvent *)enterExitEventWithType:(NSEventType)type location:(NSPoint)location modifierFlags:(NSEventModifierFlags)flags timestamp:(NSTimeInterval)time windowNumber:(NSInteger)wNum context:(nullable NSGraphicsContext* __unused)unusedPassNil eventNumber:(NSInteger)eNum trackingNumber:(NSInteger)tNum userData:(nullable void *)data;
 | 
			
		||||
+ (nullable NSEvent *)otherEventWithType:(NSEventType)type location:(NSPoint)location modifierFlags:(NSEventModifierFlags)flags timestamp:(NSTimeInterval)time windowNumber:(NSInteger)wNum context:(nullable NSGraphicsContext* __unused)unusedPassNil subtype:(short)subtype data1:(NSInteger)d1 data2:(NSInteger)d2;
 | 
			
		||||
 | 
			
		||||
// global mouse coordinates
 | 
			
		||||
@property (class, readonly) NSPoint mouseLocation;
 | 
			
		||||
 | 
			
		||||
/* modifier keys currently down.  This returns the state of devices combined with synthesized events at the moment, independent of which events have been delivered via the event stream. */
 | 
			
		||||
@property (class, readonly) NSEventModifierFlags modifierFlags API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* mouse buttons currently down.  Returns indices of the mouse buttons currently down.  1 << 0 corresponds to leftMouse, 1 << 1 to rightMouse, and 1 << n, n >= 2 to other mouse buttons.  This returns the state of devices combined with synthesized events at the moment, independent of which events have been delivered via the event stream, so this method is not suitable for tracking. */
 | 
			
		||||
@property (class, readonly) NSUInteger pressedMouseButtons API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* the time in which a second click must occur in order to be considered a doubleClick.  This is a system value so overrides will have no effect. */
 | 
			
		||||
@property (class, readonly) NSTimeInterval doubleClickInterval   API_AVAILABLE(macos(10.6));
 | 
			
		||||
/* the time for which a key must be held down in order to generate the first key repeat event.  This is a system value so overrides will have no effect. */
 | 
			
		||||
@property (class, readonly) NSTimeInterval keyRepeatDelay        API_AVAILABLE(macos(10.6));
 | 
			
		||||
/* the time between subsequent key repeat events.  This is a system value so overrides will have no effect. */
 | 
			
		||||
@property (class, readonly) NSTimeInterval keyRepeatInterval     API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
   API for monitoring events in other processes, or in your own process. For either +addGlobal or +addLocal, pass an event mask specifying which events you wish to monitor, and a block that will be called with the event to monitor.
 | 
			
		||||
 | 
			
		||||
   Use +addGlobal to install an event monitor that receives copies of events posted to other applications. Events are delivered asynchronously to your app and you can only observe the event; you cannot modify or otherwise prevent the event from being delivered to its original target application. Key-related events may only be monitored if accessibility is enabled or if your application is trusted for accessibility access (see AXIsProcessTrusted in AXUIElement.h). Note that your handler will not be called for events that are sent to your own application.
 | 
			
		||||
 | 
			
		||||
   Use +addLocal to install an event monitor that receives events before they are dispatched by -[NSApplication sendEvent:]. In this case, your block should either return a valid NSEvent (which may be the same as the incoming NSEvent, or may be a newly created NSEvent) to cause the event to be dispatched, or it may return nil to stop dispatching of the event. Note that your handler will not be called for events that are consumed by nested event-tracking loops such as control tracking, menu tracking, or window dragging; only events that are dispatched through -[NSApplication sendEvent:] will be passed to your handler.
 | 
			
		||||
 | 
			
		||||
   In either case, the return value of the API is a retained NSObject. You typically do not need to retain and release the event monitor yourself, since the implementation will retain it while needed.
 | 
			
		||||
   
 | 
			
		||||
   To remove the event monitor, under both garbage collection and non-GC, pass the return value from the +add API to +removeMonitor.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable id)addGlobalMonitorForEventsMatchingMask:(NSEventMask)mask handler:(void (^)(NSEvent *event))block API_AVAILABLE(macos(10.6));
 | 
			
		||||
+ (nullable id)addLocalMonitorForEventsMatchingMask:(NSEventMask)mask handler:(NSEvent* _Nullable (^)(NSEvent *event))block API_AVAILABLE(macos(10.6));
 | 
			
		||||
+ (void)removeMonitor:(id)eventMonitor API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Unicodes we reserve for function keys on the keyboard,  OpenStep reserves the range 0xF700-0xF8FF for this purpose.  The availability of various keys will be system dependent. */
 | 
			
		||||
enum {
 | 
			
		||||
    NSUpArrowFunctionKey        = 0xF700,
 | 
			
		||||
    NSDownArrowFunctionKey      = 0xF701,
 | 
			
		||||
    NSLeftArrowFunctionKey      = 0xF702,
 | 
			
		||||
    NSRightArrowFunctionKey     = 0xF703,
 | 
			
		||||
    NSF1FunctionKey             = 0xF704,
 | 
			
		||||
    NSF2FunctionKey             = 0xF705,
 | 
			
		||||
    NSF3FunctionKey             = 0xF706,
 | 
			
		||||
    NSF4FunctionKey             = 0xF707,
 | 
			
		||||
    NSF5FunctionKey             = 0xF708,
 | 
			
		||||
    NSF6FunctionKey             = 0xF709,
 | 
			
		||||
    NSF7FunctionKey             = 0xF70A,
 | 
			
		||||
    NSF8FunctionKey             = 0xF70B,
 | 
			
		||||
    NSF9FunctionKey             = 0xF70C,
 | 
			
		||||
    NSF10FunctionKey            = 0xF70D,
 | 
			
		||||
    NSF11FunctionKey            = 0xF70E,
 | 
			
		||||
    NSF12FunctionKey            = 0xF70F,
 | 
			
		||||
    NSF13FunctionKey            = 0xF710,
 | 
			
		||||
    NSF14FunctionKey            = 0xF711,
 | 
			
		||||
    NSF15FunctionKey            = 0xF712,
 | 
			
		||||
    NSF16FunctionKey            = 0xF713,
 | 
			
		||||
    NSF17FunctionKey            = 0xF714,
 | 
			
		||||
    NSF18FunctionKey            = 0xF715,
 | 
			
		||||
    NSF19FunctionKey            = 0xF716,
 | 
			
		||||
    NSF20FunctionKey            = 0xF717,
 | 
			
		||||
    NSF21FunctionKey            = 0xF718,
 | 
			
		||||
    NSF22FunctionKey            = 0xF719,
 | 
			
		||||
    NSF23FunctionKey            = 0xF71A,
 | 
			
		||||
    NSF24FunctionKey            = 0xF71B,
 | 
			
		||||
    NSF25FunctionKey            = 0xF71C,
 | 
			
		||||
    NSF26FunctionKey            = 0xF71D,
 | 
			
		||||
    NSF27FunctionKey            = 0xF71E,
 | 
			
		||||
    NSF28FunctionKey            = 0xF71F,
 | 
			
		||||
    NSF29FunctionKey            = 0xF720,
 | 
			
		||||
    NSF30FunctionKey            = 0xF721,
 | 
			
		||||
    NSF31FunctionKey            = 0xF722,
 | 
			
		||||
    NSF32FunctionKey            = 0xF723,
 | 
			
		||||
    NSF33FunctionKey            = 0xF724,
 | 
			
		||||
    NSF34FunctionKey            = 0xF725,
 | 
			
		||||
    NSF35FunctionKey            = 0xF726,
 | 
			
		||||
    NSInsertFunctionKey         = 0xF727,
 | 
			
		||||
    NSDeleteFunctionKey         = 0xF728,
 | 
			
		||||
    NSHomeFunctionKey           = 0xF729,
 | 
			
		||||
    NSBeginFunctionKey          = 0xF72A,
 | 
			
		||||
    NSEndFunctionKey            = 0xF72B,
 | 
			
		||||
    NSPageUpFunctionKey         = 0xF72C,
 | 
			
		||||
    NSPageDownFunctionKey       = 0xF72D,
 | 
			
		||||
    NSPrintScreenFunctionKey    = 0xF72E,
 | 
			
		||||
    NSScrollLockFunctionKey     = 0xF72F,
 | 
			
		||||
    NSPauseFunctionKey          = 0xF730,
 | 
			
		||||
    NSSysReqFunctionKey         = 0xF731,
 | 
			
		||||
    NSBreakFunctionKey          = 0xF732,
 | 
			
		||||
    NSResetFunctionKey          = 0xF733,
 | 
			
		||||
    NSStopFunctionKey           = 0xF734,
 | 
			
		||||
    NSMenuFunctionKey           = 0xF735,
 | 
			
		||||
    NSUserFunctionKey           = 0xF736,
 | 
			
		||||
    NSSystemFunctionKey         = 0xF737,
 | 
			
		||||
    NSPrintFunctionKey          = 0xF738,
 | 
			
		||||
    NSClearLineFunctionKey      = 0xF739,
 | 
			
		||||
    NSClearDisplayFunctionKey   = 0xF73A,
 | 
			
		||||
    NSInsertLineFunctionKey     = 0xF73B,
 | 
			
		||||
    NSDeleteLineFunctionKey     = 0xF73C,
 | 
			
		||||
    NSInsertCharFunctionKey     = 0xF73D,
 | 
			
		||||
    NSDeleteCharFunctionKey     = 0xF73E,
 | 
			
		||||
    NSPrevFunctionKey           = 0xF73F,
 | 
			
		||||
    NSNextFunctionKey           = 0xF740,
 | 
			
		||||
    NSSelectFunctionKey         = 0xF741,
 | 
			
		||||
    NSExecuteFunctionKey        = 0xF742,
 | 
			
		||||
    NSUndoFunctionKey           = 0xF743,
 | 
			
		||||
    NSRedoFunctionKey           = 0xF744,
 | 
			
		||||
    NSFindFunctionKey           = 0xF745,
 | 
			
		||||
    NSHelpFunctionKey           = 0xF746,
 | 
			
		||||
    NSModeSwitchFunctionKey     = 0xF747
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,53 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSFilePromiseProvider.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2015-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <AppKit/NSPasteboard.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@protocol NSFilePromiseProviderDelegate;
 | 
			
		||||
@class NSOperationQueue;
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.12))
 | 
			
		||||
@interface NSFilePromiseProvider : NSObject <NSPasteboardWriting>
 | 
			
		||||
/* The UTI of the promised file type. An exception is thrown if the fileType does not conform to kUTTypeData or kUTTypeDirectory */
 | 
			
		||||
@property(copy) NSString *fileType;
 | 
			
		||||
 | 
			
		||||
/* Your object that is ultimately responsible for determining the final file name and writing the promised data to the destination. */
 | 
			
		||||
@property(weak, nullable) id <NSFilePromiseProviderDelegate> delegate;
 | 
			
		||||
 | 
			
		||||
/* When a simple string identifier is not enough. Store a pointer to an object that contains the source of the promised file data. */
 | 
			
		||||
@property(strong, nullable) id userInfo;
 | 
			
		||||
 | 
			
		||||
/* See fileType above for restrictions on the type of files to pass in */
 | 
			
		||||
- (instancetype)initWithFileType:(NSString *)fileType delegate:(id <NSFilePromiseProviderDelegate>)delegate;
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSFilePromiseProviderDelegate <NSObject>
 | 
			
		||||
@required
 | 
			
		||||
/* Return the base filename (not a full path) for this promise item. Do not start writing the file yet. */
 | 
			
		||||
- (NSString *)filePromiseProvider:(NSFilePromiseProvider*)filePromiseProvider fileNameForType:(NSString *)fileType;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Write the contents of this promise item to the provided URL and call completionHandler when done. NSFilePromiseReceiver automatically wraps this message with NSFileCoordinator when the promise destination is an NSFilePromiseReceiver. Always use the supplied URL. Note: This request shall occur on the NSOperationQueue supplied by -promiseOperationQueue.
 | 
			
		||||
 */
 | 
			
		||||
- (void)filePromiseProvider:(NSFilePromiseProvider*)filePromiseProvider writePromiseToURL:(NSURL *)url completionHandler:(void (^)(NSError * _Nullable errorOrNil))completionHandler;
 | 
			
		||||
 | 
			
		||||
@optional
 | 
			
		||||
/* The operation queue that the write request will be issued from. If this method is not implemented, the mainOperationQueue is used. */
 | 
			
		||||
- (NSOperationQueue *)operationQueueForFilePromiseProvider:(NSFilePromiseProvider*)filePromiseProvider;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,45 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSFilePromiseReceiver.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2015-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <AppKit/NSPasteboard.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSOperationQueue;
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.12))
 | 
			
		||||
@interface NSFilePromiseReceiver : NSObject <NSPasteboardReading>
 | 
			
		||||
/* A view must register what types it accepts via -registerForDraggedTypes:. Use this class method to get the file promise drag types that NSFilePromiseReceiver can accept, in order to register a view to accept promised files.
 | 
			
		||||
 */
 | 
			
		||||
@property (class, readonly, copy) NSArray<NSString *> *readableDraggedTypes;
 | 
			
		||||
 | 
			
		||||
/* The UTI of the file types promised (Note: The count of fileTypes should tell you the number of promised files, however, that is not guaranteed. Historically, some legacy file promisers only list each unique fileType once and write one or more files per type.
 | 
			
		||||
 */
 | 
			
		||||
@property(copy, readonly) NSArray<NSString*> *fileTypes;
 | 
			
		||||
 | 
			
		||||
/* The file names of the promised files that are being written to the destination location. Note: This property returns an empty array until the file promise is called in via receivePromisedFilesAtDestination.
 | 
			
		||||
 Note: This is an array, because legacy promises are an array of files on one pasteboard item.
 | 
			
		||||
 */
 | 
			
		||||
@property(copy, readonly) NSArray<NSString*> *fileNames;
 | 
			
		||||
 | 
			
		||||
/* This effectively calls in the promises. Therefore, only call once you are accepting the file promise.
 | 
			
		||||
 All file promisesReceiver's in a drag must specify the same destination location.
 | 
			
		||||
 This is an array, because legacy promises are an array of files on one pasteboard item.
 | 
			
		||||
 The reader block is called on the supplied operationQueue when the promised file is ready to be read. When the source is an NSFilePromiseProvider, the readerBlock call is wrapped in an NSFileCoordination read. Otherwise, a heuristic is used to determine when the promised file is ready to be read.
 | 
			
		||||
 The options dictionary is ignored for now.
 | 
			
		||||
 Note: Writing of the promised file may be cancelled or fail. When either occurs, the readerBlock is still called, but with a non-nil NSError. When NSError is non-nil, fileURL should be ignored.
 | 
			
		||||
 */
 | 
			
		||||
- (void)receivePromisedFilesAtDestination:(NSURL *)destinationDir options:(NSDictionary *)options operationQueue:(NSOperationQueue *)operationQueue reader:(void(^)(NSURL *fileURL, NSError * _Nullable errorOrNil))reader;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,10 @@
 | 
			
		||||
/*
 | 
			
		||||
        NSFileWrapper.h
 | 
			
		||||
        Application Kit
 | 
			
		||||
        Copyright (c) 1995-2021, Apple Inc.
 | 
			
		||||
        All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#warning NSFileWrapper has been moved to Foundation. Import <Foundation/Foundation.h> instead of <AppKit/NSFileWrapper.h>.
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSFileWrapper.h>
 | 
			
		||||
@@ -0,0 +1,25 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSFileWrapperExtensions.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2002-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSFileWrapper.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSImage;
 | 
			
		||||
 | 
			
		||||
@interface NSFileWrapper(NSExtensions)
 | 
			
		||||
 | 
			
		||||
/* The icon. -icon may return nil even if the receiver is the result of reading a parent from the file system (use NSFileWrapperReadingImmediately if appropriate to prevent that). The image that's returned might be shared by many NSFileWrappers so your application must not mutate it. If your application needs to mutate the returned image it should make a copy and mutate the copy instead.
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, strong) NSImage *icon;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,188 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSFont.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSString.h> // for NSStringEncoding
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <AppKit/NSCell.h> // for NSControlSize
 | 
			
		||||
#import <AppKit/NSFontDescriptor.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSFontDescriptor, NSAffineTransform, NSGraphicsContext;
 | 
			
		||||
 | 
			
		||||
/********* Font Matrix *********/
 | 
			
		||||
/* This is a font matrix value representing [1 0 0 1 0 0].
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN const CGFloat * NSFontIdentityMatrix;
 | 
			
		||||
 | 
			
		||||
NS_AUTOMATED_REFCOUNT_WEAK_UNAVAILABLE
 | 
			
		||||
@interface NSFont : NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
/********* Factory *********/
 | 
			
		||||
+ (nullable NSFont *)fontWithName:(NSString *)fontName size:(CGFloat)fontSize;
 | 
			
		||||
+ (nullable NSFont *)fontWithName:(NSString *)fontName matrix:(const CGFloat *)fontMatrix;
 | 
			
		||||
/* Instantiates an NSFont object matching fontDescriptor. If fontSize is greater than 0.0, it has precedence over NSFontSizeAttribute in fontDescriptor.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSFont *)fontWithDescriptor:(NSFontDescriptor *)fontDescriptor size:(CGFloat)fontSize;
 | 
			
		||||
 | 
			
		||||
/* Instantiates an NSFont object matching fontDescriptor. If textTransform is non-nil, it has precedence over NSFontMatrixAttribute in fontDescriptor.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSFont *)fontWithDescriptor:(NSFontDescriptor *)fontDescriptor textTransform:(nullable NSAffineTransform *)textTransform;
 | 
			
		||||
 | 
			
		||||
/********* Meta Font *********/
 | 
			
		||||
/* User font settings
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSFont *)userFontOfSize:(CGFloat)fontSize;	// Application font
 | 
			
		||||
+ (nullable NSFont *)userFixedPitchFontOfSize:(CGFloat)fontSize; // fixed-pitch font
 | 
			
		||||
+ (void)setUserFont:(nullable NSFont *)font;	// set preference for Application font.
 | 
			
		||||
+ (void)setUserFixedPitchFont:(nullable NSFont *)font; // set preference for fixed-pitch.
 | 
			
		||||
 | 
			
		||||
/* UI font settings
 | 
			
		||||
*/
 | 
			
		||||
+ (NSFont *)systemFontOfSize:(CGFloat)fontSize;	// System font with NSFontWeightRegular and proportional digits
 | 
			
		||||
+ (NSFont *)boldSystemFontOfSize:(CGFloat)fontSize; // System font with NSFontWeightBold and proportional digits
 | 
			
		||||
+ (NSFont *)labelFontOfSize:(CGFloat)fontSize; // Label font
 | 
			
		||||
 | 
			
		||||
+ (NSFont *)titleBarFontOfSize:(CGFloat)fontSize;
 | 
			
		||||
+ (NSFont *)menuFontOfSize:(CGFloat)fontSize;
 | 
			
		||||
+ (NSFont *)menuBarFontOfSize:(CGFloat)fontSize;
 | 
			
		||||
+ (NSFont *)messageFontOfSize:(CGFloat)fontSize;
 | 
			
		||||
+ (NSFont *)paletteFontOfSize:(CGFloat)fontSize;
 | 
			
		||||
+ (NSFont *)toolTipsFontOfSize:(CGFloat)fontSize;
 | 
			
		||||
+ (NSFont *)controlContentFontOfSize:(CGFloat)fontSize;
 | 
			
		||||
 | 
			
		||||
/* Following two factory methods return system font with NSFontWeightTrait. Returns the system font object corresponding to fontSize and weight. +monospacedDigitSystemFontOfSize:weight: always return a system font instance with monospaced digit glyphs. It's recommended to use the symbolic weight values declared in NSFontDescriptor.h. Due to sophisticated system font weight matching logic underneath, it's recommended to use this factory method all the time when getting non-standard weight system fonts instead of transforming existing instances via methods like -[NSFontManager convertFont:toSize]. When asked for a missing weight for the running version of OS X, this method returns the nearest heavier weight available if the application is linked against the current or older SDK; otherwise, it returns the nearest lighter weight available.
 | 
			
		||||
*/
 | 
			
		||||
+ (NSFont *)systemFontOfSize:(CGFloat)fontSize weight:(NSFontWeight)weight API_AVAILABLE(macos(10.11));
 | 
			
		||||
+ (NSFont *)monospacedDigitSystemFontOfSize:(CGFloat)fontSize weight:(NSFontWeight)weight API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* Returns current default monospaced font for system UI. Clients of this API should be aware that the monospaced system font has a similar coverage of default system UI font, which includes Latin and common symbols used for displaying text like source code. For the characters it does not cover, the subtituted fonts are usually not the same width as the monospaced system font, they can be wider, narrower, or variable. To ensure fixed advances in text layout, clients can consider using string attributes like NSFontFixedAdvanceAttribute. */
 | 
			
		||||
+ (NSFont *)monospacedSystemFontOfSize:(CGFloat)fontSize weight:(NSFontWeight)weight API_AVAILABLE(macos(10.15));
 | 
			
		||||
 | 
			
		||||
// Use instead of -[NSFontManager convertFont:toSize:].
 | 
			
		||||
- (NSFont *)fontWithSize:(CGFloat)fontSize API_AVAILABLE(macos(10.15));
 | 
			
		||||
 | 
			
		||||
/* UI font size settings
 | 
			
		||||
*/
 | 
			
		||||
@property (class, readonly) CGFloat systemFontSize; // size of the standard System font.
 | 
			
		||||
@property (class, readonly) CGFloat smallSystemFontSize; // size of standard small System font.
 | 
			
		||||
@property (class, readonly) CGFloat labelFontSize; // size of the standard Label Font.
 | 
			
		||||
 | 
			
		||||
+ (CGFloat)systemFontSizeForControlSize:(NSControlSize)controlSize;
 | 
			
		||||
 | 
			
		||||
/********* Core font attribute *********/
 | 
			
		||||
@property (readonly, copy) NSString *fontName;
 | 
			
		||||
@property (readonly) CGFloat pointSize;
 | 
			
		||||
@property (readonly) const CGFloat *matrix NS_RETURNS_INNER_POINTER;
 | 
			
		||||
@property (nullable, readonly, copy) NSString *familyName;
 | 
			
		||||
@property (nullable, readonly, copy) NSString *displayName;
 | 
			
		||||
@property (readonly, strong) NSFontDescriptor *fontDescriptor;
 | 
			
		||||
@property (readonly, copy) NSAffineTransform *textTransform;
 | 
			
		||||
 | 
			
		||||
/********* Glyph coverage *********/
 | 
			
		||||
@property (readonly) NSUInteger numberOfGlyphs;
 | 
			
		||||
@property (readonly) NSStringEncoding mostCompatibleStringEncoding;
 | 
			
		||||
@property (readonly, strong) NSCharacterSet *coveredCharacterSet;
 | 
			
		||||
 | 
			
		||||
/********* Font instance-wide metrics *********/
 | 
			
		||||
/* These methods return scaled numbers.  If the font was created with a matrix, the matrix is applied automatically; otherwise the coordinates are multiplied by size.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly) NSRect boundingRectForFont;
 | 
			
		||||
@property (readonly) NSSize maximumAdvancement;
 | 
			
		||||
 | 
			
		||||
@property (readonly) CGFloat ascender;
 | 
			
		||||
@property (readonly) CGFloat descender;
 | 
			
		||||
@property (readonly) CGFloat leading;
 | 
			
		||||
 | 
			
		||||
@property (readonly) CGFloat underlinePosition;
 | 
			
		||||
@property (readonly) CGFloat underlineThickness;
 | 
			
		||||
@property (readonly) CGFloat italicAngle;
 | 
			
		||||
@property (readonly) CGFloat capHeight;
 | 
			
		||||
@property (readonly) CGFloat xHeight;
 | 
			
		||||
@property (getter=isFixedPitch, readonly) BOOL fixedPitch;
 | 
			
		||||
 | 
			
		||||
/********* Glyph metrics *********/
 | 
			
		||||
/********* Glyph metrics *********/
 | 
			
		||||
- (NSRect)boundingRectForCGGlyph:(CGGlyph)glyph API_AVAILABLE(macos(10.13));
 | 
			
		||||
- (NSSize)advancementForCGGlyph:(CGGlyph)glyph API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
// bulk query
 | 
			
		||||
- (void)getBoundingRects:(NSRectArray)bounds forCGGlyphs:(const CGGlyph *)glyphs count:(NSUInteger)glyphCount API_AVAILABLE(macos(10.13));
 | 
			
		||||
- (void)getAdvancements:(NSSizeArray)advancements forCGGlyphs:(const CGGlyph *)glyphs count:(NSUInteger)glyphCount API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
/********* NSGraphicsContext-related *********/
 | 
			
		||||
- (void)set;
 | 
			
		||||
- (void)setInContext:(NSGraphicsContext *)graphicsContext;
 | 
			
		||||
 | 
			
		||||
/********* Vertical mode *********/
 | 
			
		||||
/* Returns a vertical version of the receiver if such a configuration is supported.  Returns the receiver if no vertical variant available.  A vertical font applies appropriate rotation to the text matrix in -setInContext:, returns vertical metrics, and enables the vertical glyph substitution feature by default. */
 | 
			
		||||
@property (readonly, copy) NSFont *verticalFont API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/* Returns YES if a vertical variant */
 | 
			
		||||
@property (getter=isVertical, readonly) BOOL vertical API_AVAILABLE(macos(10.7));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/********* Notifications *********/
 | 
			
		||||
/* This notification is posted when the antialias threshold is changed by the user.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSAntialiasThresholdChangedNotification;
 | 
			
		||||
 | 
			
		||||
/* This notification is posted when the available font set is modified as a result of activation/deactivation.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSFontSetChangedNotification;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/********* Deprecated API *********/
 | 
			
		||||
// NSGlyph and related API are soft deprecated. They will be formally deprecated in a future version. Use CGGlyph-based TextKit API instead
 | 
			
		||||
typedef unsigned int NSGlyph; // Use CGGlyph instead
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
    NSControlGlyph = 0x00FFFFFF, // Deprecated. Use NSGlyphPropertyControlCharacter instead
 | 
			
		||||
    NSNullGlyph = 0x0 // Deprecated. Use NSGlyphPropertyNull instead
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// NSFontRenderingMode-related API is now deprecated.
 | 
			
		||||
/********* Screen Font Rendering Mode *********/
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSFontRenderingMode) {
 | 
			
		||||
    NSFontDefaultRenderingMode = 0, // Determines the actual mode based on the user preference settings
 | 
			
		||||
    NSFontAntialiasedRenderingMode = 1, // Antialiased, floating-point advancements rendering mode (synonym to printerFont)
 | 
			
		||||
    NSFontIntegerAdvancementsRenderingMode = 2, // integer advancements rendering mode
 | 
			
		||||
    NSFontAntialiasedIntegerAdvancementsRenderingMode = 3 // Antialiased, integer advancements rendering mode
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSMultibyteGlyphPacking) {
 | 
			
		||||
    NSNativeShortGlyphPacking API_DEPRECATED("", macos(10.0,10.13)) = 5
 | 
			
		||||
} API_DEPRECATED("", macos(10.0,10.13));
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSInteger NSConvertGlyphsToPackedGlyphs(NSGlyph * _Nonnull glBuf, NSInteger count, NSMultibyteGlyphPacking packing, char * _Nonnull packedGlyphs) API_DEPRECATED("", macos(10.0,10.13));
 | 
			
		||||
 | 
			
		||||
@interface NSFont (NSFont_Deprecated)
 | 
			
		||||
- (NSGlyph)glyphWithName:(NSString *)name;
 | 
			
		||||
- (NSRect)boundingRectForGlyph:(NSGlyph)glyph; // Deprecated. Use -boundingRectForCGGlyph: instead
 | 
			
		||||
- (NSSize)advancementForGlyph:(NSGlyph)glyph; // Deprecated. Use -advancementForCGGlyph: instead
 | 
			
		||||
 | 
			
		||||
// bulk query
 | 
			
		||||
- (void)getBoundingRects:(NSRectArray)bounds forGlyphs:(const NSGlyph *)glyphs count:(NSUInteger)glyphCount; // Deprecated. Use -getBoundingRects:forCGGlyphs:count: instead
 | 
			
		||||
- (void)getAdvancements:(NSSizeArray)advancements forGlyphs:(const NSGlyph *)glyphs count:(NSUInteger)glyphCount; // Deprecated. Use -getAdvancements:forCGGlyphs:count: insteda
 | 
			
		||||
- (void)getAdvancements:(NSSizeArray)advancements forPackedGlyphs:(const void *)packedGlyphs length:(NSUInteger)length; // Deprecated. Use -getAdvancements:forCGGlyphs:count: instead
 | 
			
		||||
 | 
			
		||||
/********* Rendering mode *********/
 | 
			
		||||
@property (readonly, copy) NSFont *printerFont;
 | 
			
		||||
@property (readonly, copy) NSFont *screenFont;
 | 
			
		||||
- (NSFont *)screenFontWithRenderingMode:(NSFontRenderingMode)renderingMode;
 | 
			
		||||
@property (readonly) NSFontRenderingMode renderingMode;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSFont (NSFont_TextStyles)
 | 
			
		||||
// Returns an instance of the font associated with the text style. See NSFontDescriptor.h for the complete list.
 | 
			
		||||
+ (NSFont *)preferredFontForTextStyle:(NSFontTextStyle)style options:(NSDictionary<NSFontTextStyleOptionKey, id> *)options API_AVAILABLE(macos(11.0));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,59 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSFontAssetRequest.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2017-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSProgress.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
@class NSFontDescriptor;
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSFontAssetRequestOptions) {
 | 
			
		||||
    NSFontAssetRequestOptionUsesStandardUI = 1 << 0, // Use standard system UI for downloading.
 | 
			
		||||
} API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 The NSFontAssetRequest class is used to interact with the on demand font assets.
 | 
			
		||||
 | 
			
		||||
 The purpose of the system is to allow an application to download certain font assets on demand, when they are required. This also means that the system can purge any asset from disk when it is no longer required, which will save disk space. This class describes which assets are required, makes the request and reports progress, allows the app to specify how long during its execution that they are required.
 | 
			
		||||
 | 
			
		||||
 Assets are downloaded into the application container for sandboxed applications, or shared by all applications for non-sandboxed applications, and are made available via the standard NSFont lookup API.
 | 
			
		||||
 | 
			
		||||
 The request object itself is lightweight. You may create as many as you need, for example to request the same set of font descriptors in different components of your application.
 | 
			
		||||
*/
 | 
			
		||||
API_AVAILABLE(macos(10.13))
 | 
			
		||||
@interface NSFontAssetRequest : NSObject <NSProgressReporting>
 | 
			
		||||
 | 
			
		||||
- (instancetype)init NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 An array of font descriptors is required argument to the init method. The fontDescriptors argument describes queries for downloadable font assets (list available at https://support.apple.com/en-us/HT206872#download). Any assets downloaded can be found using the standard NSFont lookup API once the request is completed.
 | 
			
		||||
 */
 | 
			
		||||
- (instancetype)initWithFontDescriptors:(NSArray<NSFontDescriptor *> *)fontDescriptors options:(NSFontAssetRequestOptions)options NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 The downloaded font descriptors up to this point.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly, copy) NSArray<NSFontDescriptor *> *downloadedFontDescriptors;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Progress for the request. The progress object will be valid at initialization and begin updating after the -downloadFontAssetsWithCompletionHandler: method is called.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly, strong) NSProgress *progress;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Start the download process. completionHandler will be called whenever encounters any error, or when all download has been completed without error. completionHandler should return NO if you wish to stop downloading from that point, or YES if you wish to continue trying downloading the next font.
 | 
			
		||||
 */
 | 
			
		||||
- (void)downloadFontAssetsWithCompletionHandler:(BOOL (^)(NSError * _Nullable error))completionHandler;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,188 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSFontCollection.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2010-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <Foundation/NSError.h>
 | 
			
		||||
#import <Foundation/NSLocale.h>
 | 
			
		||||
#import <Foundation/NSString.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSFontDescriptor;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Named collection visibility
 | 
			
		||||
 */
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSFontCollectionVisibility) {
 | 
			
		||||
    // Visible within this process, not persistent
 | 
			
		||||
    NSFontCollectionVisibilityProcess = (1UL << 0),
 | 
			
		||||
    
 | 
			
		||||
    // Visible to all processes, stored persistently
 | 
			
		||||
    NSFontCollectionVisibilityUser = (1UL << 1),
 | 
			
		||||
    
 | 
			
		||||
    // Visible to all users, stored persistently
 | 
			
		||||
    NSFontCollectionVisibilityComputer = (1UL << 2)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Matching options
 | 
			
		||||
 */
 | 
			
		||||
typedef NSString * NSFontCollectionMatchingOptionKey NS_TYPED_ENUM;
 | 
			
		||||
// NSNumber BOOL specifying whether disabled fonts should be included in the list of matching descriptors (YES) or not (NO). When unspecified, CoreText assumes NO. This option is intended only for font management applications. This option will make descriptor matching slower.
 | 
			
		||||
APPKIT_EXTERN NSFontCollectionMatchingOptionKey const NSFontCollectionIncludeDisabledFontsOption API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
// NSNumber BOOL controlling whether more than one copy of a font with the same PostScript name should be included in the list of matching descriptors
 | 
			
		||||
APPKIT_EXTERN NSFontCollectionMatchingOptionKey const NSFontCollectionRemoveDuplicatesOption API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
// NSNumber BOOL specifying that auto-activation should not be used to find missing fonts
 | 
			
		||||
APPKIT_EXTERN NSFontCollectionMatchingOptionKey const NSFontCollectionDisallowAutoActivationOption API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSFontCollectionName NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 NSFontCollection - immutable font list
 | 
			
		||||
 */
 | 
			
		||||
API_AVAILABLE(macos(10.7))
 | 
			
		||||
@interface NSFontCollection : NSObject <NSCopying, NSMutableCopying, NSCoding>
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Creating collections
 | 
			
		||||
 */
 | 
			
		||||
// Return a font collection matching the given descriptors
 | 
			
		||||
+ (NSFontCollection *)fontCollectionWithDescriptors:(NSArray<NSFontDescriptor *> *)queryDescriptors;
 | 
			
		||||
 | 
			
		||||
// Return a font collection matching all registered fonts
 | 
			
		||||
@property (class, readonly, copy) NSFontCollection *fontCollectionWithAllAvailableDescriptors;
 | 
			
		||||
 | 
			
		||||
// Return a collection with fonts for the specified locale.
 | 
			
		||||
+ (nullable NSFontCollection *)fontCollectionWithLocale:(NSLocale *)locale;
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 Naming collections
 | 
			
		||||
 
 | 
			
		||||
 These methods allow you to associate a name with a collection. Named collections are shown by user interfaces such as NSFontPanel.
 | 
			
		||||
 
 | 
			
		||||
 Set the visibility to NSFontCollectionVisibilityProcess if you wish to make the collection visible to the current process, but not to other processes. NSFontCollectionVisibilityUser will archive the collection to persistent storage and make it visible to other processes. NSFontCollectionVisibilityComputer is like NSFontCollectionVisibilityUser but makes the collection visible to all users of the computer.
 | 
			
		||||
 
 | 
			
		||||
 There is no association between the the NSFontCollection instance and the name from which it was created. When you change the collection, you must show it again to see the changes reflected on disk or in font UI.
 | 
			
		||||
 
 | 
			
		||||
 Errors returned from these methods are NSFileManager errors.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
// Make the font collection visible by giving it a name
 | 
			
		||||
+ (BOOL)showFontCollection:(NSFontCollection *)collection withName:(NSFontCollectionName)name visibility:(NSFontCollectionVisibility)visibility error:(NSError **)error;
 | 
			
		||||
 | 
			
		||||
// Remove font collection from view (for a persistent collection, deletes the named font collection from disk)
 | 
			
		||||
+ (BOOL)hideFontCollectionWithName:(NSFontCollectionName)name visibility:(NSFontCollectionVisibility)visibility error:(NSError **)error;
 | 
			
		||||
 | 
			
		||||
// Rename named collection
 | 
			
		||||
+ (BOOL)renameFontCollectionWithName:(NSFontCollectionName)oldName visibility:(NSFontCollectionVisibility)visibility toName:(NSFontCollectionName)newName error:(NSError **)outError;
 | 
			
		||||
 | 
			
		||||
// Named collections visible to this process (array of NSString)
 | 
			
		||||
@property (class, readonly, copy) NSArray<NSFontCollectionName> *allFontCollectionNames;
 | 
			
		||||
 | 
			
		||||
// Return the specified named collection
 | 
			
		||||
+ (nullable NSFontCollection *)fontCollectionWithName:(NSFontCollectionName)name;
 | 
			
		||||
 | 
			
		||||
// Return the specified named collection with specified visibility
 | 
			
		||||
+ (nullable NSFontCollection *)fontCollectionWithName:(NSFontCollectionName)name visibility:(NSFontCollectionVisibility)visibility;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Descriptor matching
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
// The list of NSFontDescriptors to match. The matching descriptors are produced by matching this list of descriptors.
 | 
			
		||||
@property (nullable, readonly, copy) NSArray<NSFontDescriptor *> *queryDescriptors;
 | 
			
		||||
 | 
			
		||||
// A separate list of query descriptors. The matching results from this list are excluded from matchingDescriptors.
 | 
			
		||||
@property (nullable, readonly, copy) NSArray<NSFontDescriptor *> *exclusionDescriptors;
 | 
			
		||||
 | 
			
		||||
// Returns a list of descriptors matching the logical descriptors.
 | 
			
		||||
// These are determined at runtime as (matching queryDescriptors - matching exclusionDescriptors).
 | 
			
		||||
// options may be nil or a dictionary containing any combination of {NSFontCollectionIncludeDisabledFontsOption, NSFontCollectionRemoveDuplicatesOption, NSFontCollectionDisallowAutoActivationOption}.
 | 
			
		||||
@property (nullable, readonly, copy) NSArray<NSFontDescriptor *> *matchingDescriptors;
 | 
			
		||||
- (nullable NSArray<NSFontDescriptor *> *)matchingDescriptorsWithOptions:(nullable NSDictionary<NSFontCollectionMatchingOptionKey, NSNumber *> *)options;
 | 
			
		||||
 | 
			
		||||
// Return a list of matching descriptors for a particular family
 | 
			
		||||
- (nullable NSArray<NSFontDescriptor *> *)matchingDescriptorsForFamily:(NSString *)family;
 | 
			
		||||
- (nullable NSArray<NSFontDescriptor *> *)matchingDescriptorsForFamily:(NSString *)family options:(nullable NSDictionary<NSFontCollectionMatchingOptionKey, NSNumber *> *)options;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 NSMutableFontCollection - mutable font list
 | 
			
		||||
 */
 | 
			
		||||
API_AVAILABLE(macos(10.7))
 | 
			
		||||
@interface NSMutableFontCollection : NSFontCollection
 | 
			
		||||
 | 
			
		||||
// Return a font collection matching the given descriptors
 | 
			
		||||
+ (NSMutableFontCollection *)fontCollectionWithDescriptors:(NSArray<NSFontDescriptor *> *)queryDescriptors;
 | 
			
		||||
 | 
			
		||||
// Return a font collection matching all registered fonts
 | 
			
		||||
@property (class, readonly, copy) NSMutableFontCollection *fontCollectionWithAllAvailableDescriptors;
 | 
			
		||||
 | 
			
		||||
// Return a collection with fonts for the specified locale.
 | 
			
		||||
+ (NSMutableFontCollection *)fontCollectionWithLocale:(NSLocale *)locale;
 | 
			
		||||
 | 
			
		||||
// Return the specified named collection
 | 
			
		||||
+ (nullable NSMutableFontCollection *)fontCollectionWithName:(NSFontCollectionName)name;
 | 
			
		||||
 | 
			
		||||
// Return the specified named collection with specified visibility
 | 
			
		||||
+ (nullable NSMutableFontCollection *)fontCollectionWithName:(NSFontCollectionName)name visibility:(NSFontCollectionVisibility)visibility;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSArray<NSFontDescriptor *> *queryDescriptors;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSArray<NSFontDescriptor *> *exclusionDescriptors;
 | 
			
		||||
 | 
			
		||||
// Edit the query and exclusion arrays to ensure that the results of querying the given descriptors are included in the matching descriptors.
 | 
			
		||||
- (void)addQueryForDescriptors:(NSArray<NSFontDescriptor *> *)descriptors;
 | 
			
		||||
 | 
			
		||||
// Edit the query and exclusion arrays to ensure that the results of querying the given descriptors are excluded from the matching descriptors.
 | 
			
		||||
- (void)removeQueryForDescriptors:(NSArray<NSFontDescriptor *> *)descriptors;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 NSFontCollectionDidChangeNotification
 | 
			
		||||
 
 | 
			
		||||
 This notification is sent to the local notification center when a named, persistent collection is modified.
 | 
			
		||||
 User info key NSFontCollectionNotificationAction describes the nature of the change.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSNotificationName const NSFontCollectionDidChangeNotification API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
// Notification user info dictionary keys
 | 
			
		||||
typedef NSString * NSFontCollectionUserInfoKey NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSFontCollectionUserInfoKey const NSFontCollectionActionKey API_AVAILABLE(macos(10.7));			// NSString: action taken
 | 
			
		||||
APPKIT_EXTERN NSFontCollectionUserInfoKey const NSFontCollectionNameKey API_AVAILABLE(macos(10.7));			// NSString: current name of affected collection
 | 
			
		||||
APPKIT_EXTERN NSFontCollectionUserInfoKey const NSFontCollectionOldNameKey API_AVAILABLE(macos(10.7));		// NSString: for NSFontCollectionWasRenamed, previous name of affected collection
 | 
			
		||||
APPKIT_EXTERN NSFontCollectionUserInfoKey const NSFontCollectionVisibilityKey API_AVAILABLE(macos(10.7));		// NSNumber: visibility of affected collection
 | 
			
		||||
 | 
			
		||||
// Values for NSFontCollectionAction
 | 
			
		||||
typedef NSString * NSFontCollectionActionTypeKey NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSFontCollectionActionTypeKey const NSFontCollectionWasShown API_AVAILABLE(macos(10.7));
 | 
			
		||||
APPKIT_EXTERN NSFontCollectionActionTypeKey const NSFontCollectionWasHidden API_AVAILABLE(macos(10.7));
 | 
			
		||||
APPKIT_EXTERN NSFontCollectionActionTypeKey const NSFontCollectionWasRenamed API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Standard named collections
 | 
			
		||||
 
 | 
			
		||||
 Standard mutable collection names -- these names are included in the list of allFontCollectionNames -- they have special meaning to the
 | 
			
		||||
 Cocoa font system and should not be hidden or renamed.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSFontCollectionName const NSFontCollectionAllFonts API_AVAILABLE(macos(10.7));		// All fonts in the system
 | 
			
		||||
APPKIT_EXTERN NSFontCollectionName const NSFontCollectionUser API_AVAILABLE(macos(10.7));			// Per-user unmodifiable collection
 | 
			
		||||
APPKIT_EXTERN NSFontCollectionName const NSFontCollectionFavorites API_AVAILABLE(macos(10.7));		// Collection of the user's preferred font descriptors
 | 
			
		||||
APPKIT_EXTERN NSFontCollectionName const NSFontCollectionRecentlyUsed API_AVAILABLE(macos(10.7));	// Collection automatically maintained by NSFontManager
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,235 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSFontDescriptor.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2003-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <Foundation/NSSet.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
/* Symbolic Font Traits */
 | 
			
		||||
typedef uint32_t NSFontSymbolicTraits; // Deprecated. Use NSFontDescriptorSymbolicTraits instead
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(uint32_t, NSFontDescriptorSymbolicTraits) {
 | 
			
		||||
    NSFontDescriptorTraitItalic = 1u << 0,
 | 
			
		||||
    NSFontDescriptorTraitBold = 1u << 1,
 | 
			
		||||
    NSFontDescriptorTraitExpanded = 1u << 5,
 | 
			
		||||
    NSFontDescriptorTraitCondensed = 1u << 6,
 | 
			
		||||
    NSFontDescriptorTraitMonoSpace = 1u << 10,
 | 
			
		||||
    NSFontDescriptorTraitVertical = 1u << 11,
 | 
			
		||||
    NSFontDescriptorTraitUIOptimized = 1u << 12,
 | 
			
		||||
    NSFontDescriptorTraitTightLeading = 1u << 15,
 | 
			
		||||
    NSFontDescriptorTraitLooseLeading = 1u << 16,
 | 
			
		||||
    
 | 
			
		||||
    NSFontDescriptorTraitEmphasized API_UNAVAILABLE(macos) = NSFontDescriptorTraitBold,
 | 
			
		||||
 | 
			
		||||
    NSFontDescriptorClassMask = 0xF0000000,
 | 
			
		||||
    
 | 
			
		||||
    NSFontDescriptorClassUnknown = 0u << 28,
 | 
			
		||||
    NSFontDescriptorClassOldStyleSerifs = 1u << 28,
 | 
			
		||||
    NSFontDescriptorClassTransitionalSerifs = 2u << 28,
 | 
			
		||||
    NSFontDescriptorClassModernSerifs = 3u << 28,
 | 
			
		||||
    NSFontDescriptorClassClarendonSerifs = 4u << 28,
 | 
			
		||||
    NSFontDescriptorClassSlabSerifs = 5u << 28,
 | 
			
		||||
    NSFontDescriptorClassFreeformSerifs = 7u << 28,
 | 
			
		||||
    NSFontDescriptorClassSansSerif = 8u << 28,
 | 
			
		||||
    NSFontDescriptorClassOrnamentals = 9u << 28,
 | 
			
		||||
    NSFontDescriptorClassScripts = 10u << 28,
 | 
			
		||||
    NSFontDescriptorClassSymbolic = 12u << 28
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@class NSAffineTransform;
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSFontDescriptorAttributeName NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
typedef NSString * NSFontDescriptorTraitKey NS_TYPED_ENUM;
 | 
			
		||||
typedef NSString * NSFontDescriptorVariationKey NS_TYPED_ENUM;
 | 
			
		||||
typedef NSString * NSFontDescriptorFeatureKey NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
typedef CGFloat NSFontWeight NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
typedef NSString * NSFontDescriptorSystemDesign NS_TYPED_ENUM;
 | 
			
		||||
typedef NSString * NSFontTextStyle NS_TYPED_ENUM API_AVAILABLE(macos(11.0));
 | 
			
		||||
typedef NSString * NSFontTextStyleOptionKey NS_TYPED_ENUM API_AVAILABLE(macos(11.0));
 | 
			
		||||
 | 
			
		||||
@interface NSFontDescriptor: NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
/* Core attribute access */
 | 
			
		||||
@property (nullable, readonly, copy) NSString *postscriptName;
 | 
			
		||||
@property (readonly) CGFloat pointSize;
 | 
			
		||||
@property (nullable, readonly, copy) NSAffineTransform *matrix;
 | 
			
		||||
@property (readonly) NSFontDescriptorSymbolicTraits symbolicTraits;
 | 
			
		||||
/* YES indicates that any fonts matching the descriptor needs to be downloaded prior to instantiating a font. To ensure that the matching fonts are available before use, use NSFontAssetRequest to download. NO indicates that the descriptor is not available for download, has already been downloaded, or is backed by an installed font.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) BOOL requiresFontAssetRequest API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
- (nullable id)objectForKey:(NSFontDescriptorAttributeName)attribute;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSDictionary<NSFontDescriptorAttributeName, id> *fontAttributes;
 | 
			
		||||
 | 
			
		||||
/* Instantiation */
 | 
			
		||||
+ (NSFontDescriptor *)fontDescriptorWithFontAttributes:(nullable NSDictionary<NSFontDescriptorAttributeName, id> *)attributes;
 | 
			
		||||
+ (NSFontDescriptor *)fontDescriptorWithName:(NSString *)fontName size:(CGFloat)size;
 | 
			
		||||
+ (NSFontDescriptor *)fontDescriptorWithName:(NSString *)fontName matrix:(NSAffineTransform *)matrix;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithFontAttributes:(nullable NSDictionary<NSFontDescriptorAttributeName, id> *)attributes;
 | 
			
		||||
/* Instance conversion */
 | 
			
		||||
/* Returns "normalized" font descriptors matching the receiver. mandatoryKeys is an NSSet instance containing keys that are required to be identical in order to be matched. mandatoryKeys can be nil.
 | 
			
		||||
*/
 | 
			
		||||
- (NSArray<NSFontDescriptor *> *)matchingFontDescriptorsWithMandatoryKeys:(nullable NSSet<NSFontDescriptorAttributeName> *)mandatoryKeys;
 | 
			
		||||
 | 
			
		||||
/* Returns a "normalized" font descriptor matching the receiver. It is the first element returned from -matchingFontDescriptorsWithMandatoryKeys:. mandatoryKeys is an NSSet instance containing keys that are required to be identical in order to be matched. mandatoryKeys can be nil.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSFontDescriptor *)matchingFontDescriptorWithMandatoryKeys:(nullable NSSet<NSFontDescriptorAttributeName> *)mandatoryKeys API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
- (NSFontDescriptor *)fontDescriptorByAddingAttributes:(NSDictionary<NSFontDescriptorAttributeName, id> *)attributes; // the new attributes take precedence over the existing ones in the receiver
 | 
			
		||||
- (NSFontDescriptor *)fontDescriptorWithSymbolicTraits:(NSFontDescriptorSymbolicTraits)symbolicTraits;
 | 
			
		||||
- (NSFontDescriptor *)fontDescriptorWithSize:(CGFloat)newPointSize;
 | 
			
		||||
- (NSFontDescriptor *)fontDescriptorWithMatrix:(NSAffineTransform *)matrix;
 | 
			
		||||
- (NSFontDescriptor *)fontDescriptorWithFace:(NSString *)newFace;
 | 
			
		||||
- (NSFontDescriptor *)fontDescriptorWithFamily:(NSString *)newFamily;
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)fontDescriptorWithDesign:(NSFontDescriptorSystemDesign)design API_AVAILABLE(macos(10.15));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* Predefined font attributes not defined in NSAttributedString.h */
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontFamilyAttribute;
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontNameAttribute;
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontFaceAttribute;
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontSizeAttribute;
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontVisibleNameAttribute;
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontMatrixAttribute                  ; // An NSAffineTransform instance. (default: identity matrix)
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontVariationAttribute               ; // An NSDictionary instance describing variation axis (default: supplied by font)
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontCharacterSetAttribute            ; // An NSCharacterSet instance representing a set of Unicode characters covered by the font. (default: supplied by font)
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontCascadeListAttribute             ; // An NSArray instance. Each member of the array is a sub-descriptor. (default: the system default cascading list for user's locale)
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontTraitsAttribute                  ; // An NSDictionary instance fully describing font traits. (default: supplied by font)
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontFixedAdvanceAttribute            ; // A float represented as an NSNumber. The value overrides glyph advancement specified by the font. (default: 0.0)
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontFeatureSettingsAttribute          API_AVAILABLE(macos(10.5)); // An array of dictionaries representing non-default font feature settings. Each dictionary contains NSFontFeatureTypeIdentifierKey and NSFontFeatureSelectorIdentifierKey.
 | 
			
		||||
 | 
			
		||||
/* Font traits keys */
 | 
			
		||||
/* This key is used with a trait dictionary to get the symbolic traits value as an NSNumber.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorTraitKey NSFontSymbolicTrait;
 | 
			
		||||
 | 
			
		||||
/* This key is used with a trait dictionary to get the normalized weight value as an NSNumber. The valid value range is from -1.0 to 1.0. The value of 0.0 corresponds to the regular or medium font weight.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorTraitKey NSFontWeightTrait;
 | 
			
		||||
 | 
			
		||||
/* This key is used with a trait dictionary to get the relative inter-glyph spacing value as an NSNumber. The valid value range is from -1.0 to 1.0. The value of 0.0 corresponds to the regular glyph spacing.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorTraitKey NSFontWidthTrait;
 | 
			
		||||
 | 
			
		||||
/* This key is used with a trait dictionary to get the relative slant angle value as an NSNumber. The valid value range is from -1.0 to 1.0. The value or 0.0 corresponds to 0 degree clockwise rotation from the vertical and 1.0 corresponds to 30 degrees clockwise rotation.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorTraitKey NSFontSlantTrait;
 | 
			
		||||
 | 
			
		||||
/* Font variation keys */
 | 
			
		||||
/* This key is used with a variation axis dictionary to get the axis identifier value as an NSNumber.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorVariationKey NSFontVariationAxisIdentifierKey;
 | 
			
		||||
 | 
			
		||||
/* This key is used with a variation axis dictionary to get the  minimum axis value as an NSNumber.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorVariationKey NSFontVariationAxisMinimumValueKey;
 | 
			
		||||
 | 
			
		||||
/* This key is used with a variation axis dictionary to get the maximum axis value as an NSNumber.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorVariationKey NSFontVariationAxisMaximumValueKey;
 | 
			
		||||
 | 
			
		||||
/* This key is used with a variation axis dictionary to get the default axis value as an NSNumber.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorVariationKey NSFontVariationAxisDefaultValueKey;
 | 
			
		||||
 | 
			
		||||
/* This key is used with a variation axis dictionary to get the localized variation axis name.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorVariationKey NSFontVariationAxisNameKey;
 | 
			
		||||
 | 
			
		||||
/* Font feature keys */
 | 
			
		||||
/* A number object specifying font feature type such as ligature, character shape, etc. Refer to ATS/SFNTLayoutTypes.h for predefined feature types.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorFeatureKey NSFontFeatureTypeIdentifierKey API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* A number object specifying font feature selector such as common ligature off, traditional character shape, etc. Refer to ATS/SFNTLayoutTypes.h for predefined feature selectors.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorFeatureKey NSFontFeatureSelectorIdentifierKey API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Font weight trait */
 | 
			
		||||
/* Predefined symbolic weight values used for NSFontWeightTrait and +[NSFont systemFontOfSize:weight:].
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN const NSFontWeight NSFontWeightUltraLight API_AVAILABLE(macos(10.11));
 | 
			
		||||
APPKIT_EXTERN const NSFontWeight NSFontWeightThin API_AVAILABLE(macos(10.11));
 | 
			
		||||
APPKIT_EXTERN const NSFontWeight NSFontWeightLight API_AVAILABLE(macos(10.11));
 | 
			
		||||
APPKIT_EXTERN const NSFontWeight NSFontWeightRegular API_AVAILABLE(macos(10.11));
 | 
			
		||||
APPKIT_EXTERN const NSFontWeight NSFontWeightMedium API_AVAILABLE(macos(10.11));
 | 
			
		||||
APPKIT_EXTERN const NSFontWeight NSFontWeightSemibold API_AVAILABLE(macos(10.11));
 | 
			
		||||
APPKIT_EXTERN const NSFontWeight NSFontWeightBold API_AVAILABLE(macos(10.11));
 | 
			
		||||
APPKIT_EXTERN const NSFontWeight NSFontWeightHeavy API_AVAILABLE(macos(10.11));
 | 
			
		||||
APPKIT_EXTERN const NSFontWeight NSFontWeightBlack API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorSystemDesign const NSFontDescriptorSystemDesignDefault API_AVAILABLE(macos(10.15));
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorSystemDesign const NSFontDescriptorSystemDesignSerif API_AVAILABLE(macos(10.15));
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorSystemDesign const NSFontDescriptorSystemDesignMonospaced API_AVAILABLE(macos(10.15));
 | 
			
		||||
APPKIT_EXTERN NSFontDescriptorSystemDesign const NSFontDescriptorSystemDesignRounded API_AVAILABLE(macos(10.15));
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleLargeTitle API_AVAILABLE(macos(11.0));
 | 
			
		||||
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleTitle1 API_AVAILABLE(macos(11.0));
 | 
			
		||||
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleTitle2 API_AVAILABLE(macos(11.0));
 | 
			
		||||
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleTitle3 API_AVAILABLE(macos(11.0));
 | 
			
		||||
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleHeadline API_AVAILABLE(macos(11.0));
 | 
			
		||||
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleSubheadline API_AVAILABLE(macos(11.0));
 | 
			
		||||
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleBody API_AVAILABLE(macos(11.0));
 | 
			
		||||
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleCallout API_AVAILABLE(macos(11.0));
 | 
			
		||||
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleFootnote API_AVAILABLE(macos(11.0));
 | 
			
		||||
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleCaption1 API_AVAILABLE(macos(11.0));
 | 
			
		||||
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleCaption2 API_AVAILABLE(macos(11.0));
 | 
			
		||||
 | 
			
		||||
// Deprecated
 | 
			
		||||
typedef uint32_t NSFontFamilyClass; // Deprecated. Use NSFontDescriptorSymbolicTraits instead
 | 
			
		||||
 | 
			
		||||
// The following enum items are deprecated. Use NSFontDescriptorSymbolicTraits instead
 | 
			
		||||
enum {
 | 
			
		||||
    NSFontUnknownClass = 0 << 28,
 | 
			
		||||
    NSFontOldStyleSerifsClass = 1 << 28,
 | 
			
		||||
    NSFontTransitionalSerifsClass = 2 << 28,
 | 
			
		||||
    NSFontModernSerifsClass = 3 << 28,
 | 
			
		||||
    NSFontClarendonSerifsClass = 4 << 28,
 | 
			
		||||
    NSFontSlabSerifsClass = 5 << 28,
 | 
			
		||||
    NSFontFreeformSerifsClass = 7 << 28,
 | 
			
		||||
    NSFontSansSerifClass = 8 << 28,
 | 
			
		||||
    NSFontOrnamentalsClass = 9 << 28,
 | 
			
		||||
    NSFontScriptsClass = 10 << 28,
 | 
			
		||||
    NSFontSymbolicClass = 12 << 28
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
    NSFontFamilyClassMask = 0xF0000000
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
    NSFontItalicTrait = (1 << 0),
 | 
			
		||||
    NSFontBoldTrait = (1 << 1),
 | 
			
		||||
    NSFontExpandedTrait = (1 << 5),
 | 
			
		||||
    NSFontCondensedTrait = (1 << 6),
 | 
			
		||||
    NSFontMonoSpaceTrait = (1 << 10),
 | 
			
		||||
    NSFontVerticalTrait = (1 << 11),
 | 
			
		||||
    NSFontUIOptimizedTrait = (1 << 12)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSString * NSFontColorAttribute 			API_DEPRECATED("", macos(10.3,10.4)); // This attribute is obsolete. Use NSForegroundColorAttributeName instead.
 | 
			
		||||
 | 
			
		||||
@interface NSFontDescriptor (NSFontDescriptor_TextStyles)
 | 
			
		||||
// Returns a font descriptor containing the text style.
 | 
			
		||||
+ (NSFontDescriptor *)preferredFontDescriptorForTextStyle:(NSFontTextStyle)style options:(NSDictionary<NSFontTextStyleOptionKey, id> *)options API_AVAILABLE(macos(11.0));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,159 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSFontManager.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <AppKit/NSMenu.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSFont, NSFontPanel, NSMenu, NSFontDescriptor;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Font Traits
 | 
			
		||||
 *
 | 
			
		||||
 * This list should be kept small since the more traits that are assigned
 | 
			
		||||
 * to a given font, the harder it will be to map it to some other family.
 | 
			
		||||
 * Some traits are mutually exclusive such as NSExpanded and NSCondensed.
 | 
			
		||||
 */
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSFontTraitMask) {
 | 
			
		||||
    NSItalicFontMask			= 0x00000001,
 | 
			
		||||
    NSBoldFontMask			= 0x00000002,
 | 
			
		||||
    NSUnboldFontMask			= 0x00000004,
 | 
			
		||||
    NSNonStandardCharacterSetFontMask	= 0x00000008,
 | 
			
		||||
    NSNarrowFontMask			= 0x00000010,
 | 
			
		||||
    NSExpandedFontMask			= 0x00000020,
 | 
			
		||||
    NSCondensedFontMask			= 0x00000040,
 | 
			
		||||
    NSSmallCapsFontMask			= 0x00000080,
 | 
			
		||||
    NSPosterFontMask			= 0x00000100,
 | 
			
		||||
    NSCompressedFontMask		= 0x00000200,
 | 
			
		||||
    NSFixedPitchFontMask		= 0x00000400,
 | 
			
		||||
    NSUnitalicFontMask			= 0x01000000
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSFontCollectionOptions) {
 | 
			
		||||
   NSFontCollectionApplicationOnlyMask = 1 << 0
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* And these "actions" are really tag values in Font Menu cells which send any of the action messages listed above.  Normally, they're pre-defined in the font panel.
 | 
			
		||||
 */
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSFontAction) {
 | 
			
		||||
    NSNoFontChangeAction		= 0,
 | 
			
		||||
    NSViaPanelFontAction		= 1,
 | 
			
		||||
    NSAddTraitFontAction		= 2,
 | 
			
		||||
    NSSizeUpFontAction			= 3,
 | 
			
		||||
    NSSizeDownFontAction		= 4,
 | 
			
		||||
    NSHeavierFontAction			= 5,
 | 
			
		||||
    NSLighterFontAction			= 6,
 | 
			
		||||
    NSRemoveTraitFontAction		= 7
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@interface NSFontManager : NSObject <NSMenuItemValidation>
 | 
			
		||||
 | 
			
		||||
+ (void)setFontPanelFactory:(nullable Class)factoryId;
 | 
			
		||||
+ (void)setFontManagerFactory:(nullable Class)factoryId;
 | 
			
		||||
@property (class, readonly, strong) NSFontManager *sharedFontManager;
 | 
			
		||||
 | 
			
		||||
@property (getter=isMultiple, readonly) BOOL multiple;
 | 
			
		||||
@property (nullable, readonly, strong) NSFont *selectedFont;
 | 
			
		||||
- (void)setSelectedFont:(NSFont *)fontObj isMultiple:(BOOL)flag;
 | 
			
		||||
- (void)setFontMenu:(NSMenu *)newMenu;
 | 
			
		||||
- (nullable NSMenu *)fontMenu:(BOOL)create;
 | 
			
		||||
- (nullable NSFontPanel *)fontPanel:(BOOL)create;
 | 
			
		||||
- (nullable NSFont *)fontWithFamily:(NSString *)family traits:(NSFontTraitMask)traits weight:(NSInteger)weight size:(CGFloat)size;
 | 
			
		||||
- (NSFontTraitMask)traitsOfFont:(NSFont *)fontObj;
 | 
			
		||||
- (NSInteger)weightOfFont:(NSFont *)fontObj;
 | 
			
		||||
 | 
			
		||||
/* Three methods for supporting app font management.  The fonts and names used/returned by these functions are the same as those used by the NSFontPanel.  The third method below takes as input a name as returned by "availableFontFamilies" and returns an NSArray of NSArrays.  The elements of the "inner" arrays are: (0) the font's name, (1) non-family part of the name as used by NSFontPanel, (2) an NSNumber indicating the weight, and (3) an NSNumber indicating the traits.
 | 
			
		||||
*/
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *availableFonts;
 | 
			
		||||
@property (readonly, copy) NSArray<NSString *> *availableFontFamilies;
 | 
			
		||||
- (nullable NSArray<NSArray *> *)availableMembersOfFontFamily:(NSString *)fam;
 | 
			
		||||
 | 
			
		||||
- (NSFont *)convertFont:(NSFont *)fontObj;
 | 
			
		||||
- (NSFont *)convertFont:(NSFont *)fontObj toSize:(CGFloat)size;
 | 
			
		||||
- (nullable NSFont *)convertFont:(NSFont *)fontObj toFace:(NSString *)typeface;
 | 
			
		||||
- (NSFont *)convertFont:(NSFont *)fontObj toFamily:(NSString *)family;
 | 
			
		||||
- (NSFont *)convertFont:(NSFont *)fontObj toHaveTrait:(NSFontTraitMask)trait;
 | 
			
		||||
- (NSFont *)convertFont:(NSFont *)fontObj toNotHaveTrait:(NSFontTraitMask)trait;
 | 
			
		||||
- (NSFont *)convertWeight:(BOOL)upFlag ofFont:(NSFont *)fontObj;
 | 
			
		||||
@property (getter=isEnabled) BOOL enabled;
 | 
			
		||||
@property SEL action;
 | 
			
		||||
@property (nullable, assign) id delegate API_DEPRECATED("NSFontManager doesn't have any delegate method. This property should not be used.", macos(10.0,10.11));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
- (BOOL)sendAction;
 | 
			
		||||
 | 
			
		||||
- (NSString *) localizedNameForFamily:(NSString *)family face:(nullable NSString *)faceKey;
 | 
			
		||||
 | 
			
		||||
- (void)setSelectedAttributes:(NSDictionary<NSString *, id> *)attributes isMultiple:(BOOL)flag;
 | 
			
		||||
- (NSDictionary<NSString *, id> *)convertAttributes:(NSDictionary<NSString *, id> *)attributes;
 | 
			
		||||
 | 
			
		||||
- (nullable NSArray *)availableFontNamesMatchingFontDescriptor:(NSFontDescriptor *)descriptor API_DEPRECATED("Use -[NSFontDescriptor matchingFontDescriptorsWithMandatoryKeys:] instead", macos(10.0,10.11));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray *collectionNames API_DEPRECATED("Use +[NSFontCollection allFontCollectionNames] instead", macos(10.0,10.11));
 | 
			
		||||
- (nullable NSArray *)fontDescriptorsInCollection:(NSString *)collectionNames API_DEPRECATED("Use -[NSFontCollection matchingDescriptors] instead", macos(10.0,10.11));
 | 
			
		||||
- (BOOL)addCollection:(NSString *)collectionName options:(NSFontCollectionOptions)collectionOptions API_DEPRECATED("Use +[NSFontCollection showFontCollection:withName:visibility:name:] instead", macos(10.0,10.11));
 | 
			
		||||
- (BOOL)removeCollection:(NSString *)collectionName API_DEPRECATED("Use +[NSFontCollection hideFontCollectionWithName:visibility:error:] instead", macos(10.0,10.11));
 | 
			
		||||
 | 
			
		||||
- (void)addFontDescriptors:(NSArray *)descriptors  toCollection:(NSString *)collectionName API_DEPRECATED("Use -[NSMutableFontCollection addQueryForDescriptors:] instead", macos(10.0,10.11));
 | 
			
		||||
- (void)removeFontDescriptor:(NSFontDescriptor *)descriptor fromCollection:(NSString *)collection API_DEPRECATED("Use -[NSMutableFontCollection removeQueryForDescriptors:] instead", macos(10.0,10.11));
 | 
			
		||||
 | 
			
		||||
/* Returns the current font action used by -convertFont:. This method is intended to be invoked to query the font conversion action while the action message (usually -changeFont:) is being invoked.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) NSFontAction currentFontAction API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Converts fontTraits to a new traits mask value just as -convertFont:. This method is intended to be invoked to query the font traits while the action message (usually -changeFont:) is being invoked when the current font action is either NSAddTraitFontAction or NSRemoveTraitFontAction.
 | 
			
		||||
 */
 | 
			
		||||
- (NSFontTraitMask)convertFontTraits:(NSFontTraitMask)traits API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
@property (nullable, weak) id target API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSFontManager(NSFontManagerMenuActionMethods)
 | 
			
		||||
 | 
			
		||||
- (BOOL)fontNamed:(NSString *)fName hasTraits:(NSFontTraitMask)someTraits;
 | 
			
		||||
 | 
			
		||||
/* The following is like "availableFonts", but checks traits.  Returns an auto-released instance.  To get fonts with "non-italic" or "non-bold" combine the flags NSUnitalicFontMask and/or NSUnboldFontMask as the argument "someTraits".
 | 
			
		||||
*/
 | 
			
		||||
- (nullable NSArray<NSString *> *)availableFontNamesWithTraits:(NSFontTraitMask)someTraits;
 | 
			
		||||
 | 
			
		||||
/* These methods are action messages sent from Font Menu items:
 | 
			
		||||
*/
 | 
			
		||||
- (void)addFontTrait:(nullable id)sender;
 | 
			
		||||
- (void)removeFontTrait:(nullable id)sender;
 | 
			
		||||
- (void)modifyFontViaPanel:(nullable id)sender;
 | 
			
		||||
- (void)modifyFont:(nullable id)sender;
 | 
			
		||||
- (void)orderFrontFontPanel:(nullable id)sender;
 | 
			
		||||
- (void)orderFrontStylesPanel:(nullable id)sender;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
/* This method is perhaps inappropriately named; it is sent to the delegate of the shared NSFontPanel instance, not to the delegate of the NSFontManager.
 | 
			
		||||
*/
 | 
			
		||||
@interface NSObject(NSFontManagerDelegate)
 | 
			
		||||
- (BOOL)fontManager:(id)sender willIncludeFont:(NSString *)fontName API_DEPRECATED("Use NSFontCollection for providing filtered font lists", macos(10.0,10.11));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#if __swift__ < 40200
 | 
			
		||||
/* This is the message that's propagated up the responder chain.
 | 
			
		||||
*/
 | 
			
		||||
@interface NSObject(NSFontManagerResponderMethod)
 | 
			
		||||
- (void)changeFont:(nullable id)sender API_DEPRECATED("This is now an optional method of the NSFontChanging protocol.", macos(10.0, 11.0));
 | 
			
		||||
@end
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,93 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSFontPanel.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSPanel.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSFontPanel, NSMutableDictionary, NSFontManager, NSMutableArray, NSTableView, NSFontDescriptor, NSFont;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSFontPanelModeMask) {
 | 
			
		||||
    NSFontPanelModeMaskFace = 1 << 0,
 | 
			
		||||
    NSFontPanelModeMaskSize = 1 << 1,
 | 
			
		||||
    NSFontPanelModeMaskCollection = 1 << 2,
 | 
			
		||||
    NSFontPanelModeMaskUnderlineEffect = 1<<8,
 | 
			
		||||
    NSFontPanelModeMaskStrikethroughEffect = 1<<9,
 | 
			
		||||
    NSFontPanelModeMaskTextColorEffect = 1<< 10,
 | 
			
		||||
    NSFontPanelModeMaskDocumentColorEffect = 1<<11,
 | 
			
		||||
    NSFontPanelModeMaskShadowEffect = 1<<12,
 | 
			
		||||
    NSFontPanelModeMaskAllEffects = 0XFFF00,
 | 
			
		||||
    NSFontPanelModesMaskStandardModes = 0xFFFF,
 | 
			
		||||
    NSFontPanelModesMaskAllModes = 0xFFFFFFFF
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@protocol NSFontChanging <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
/* This is the message that's propagated up the responder chain.
 | 
			
		||||
 */
 | 
			
		||||
- (void)changeFont:(nullable NSFontManager *)sender;
 | 
			
		||||
- (NSFontPanelModeMask)validModesForFontPanel:(NSFontPanel *)fontPanel;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#if __swift__ < 40200
 | 
			
		||||
@interface NSObject (NSFontPanelValidationAdditions)
 | 
			
		||||
- (NSFontPanelModeMask)validModesForFontPanel:(NSFontPanel *)fontPanel API_DEPRECATED("This is now an optional method of the NSFontChanging protocol.", macos(10.0, 11.0));
 | 
			
		||||
@end
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@interface NSFontPanel : NSPanel
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, strong) NSFontPanel *sharedFontPanel;
 | 
			
		||||
@property (class, readonly) BOOL sharedFontPanelExists;
 | 
			
		||||
 | 
			
		||||
@property (nullable, strong) NSView *accessoryView;
 | 
			
		||||
- (void)setPanelFont:(NSFont *)fontObj isMultiple:(BOOL)flag;
 | 
			
		||||
- (NSFont *)panelConvertFont:(NSFont *)fontObj;
 | 
			
		||||
@property BOOL worksWhenModal;
 | 
			
		||||
@property (getter=isEnabled) BOOL enabled;
 | 
			
		||||
 | 
			
		||||
/* This method triggers a re-load to the default state, so that the delegate will be called, and have an opportunity to scrutinize the default list of fonts to be displayed in the panel.
 | 
			
		||||
*/
 | 
			
		||||
- (void) reloadDefaultFontFamilies;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// The following enum items are deprecated. Use NSFontPanelModeMask instead
 | 
			
		||||
enum {
 | 
			
		||||
    NSFontPanelFaceModeMask = 1 << 0,
 | 
			
		||||
    NSFontPanelSizeModeMask = 1 << 1,
 | 
			
		||||
    NSFontPanelCollectionModeMask = 1 << 2,
 | 
			
		||||
    NSFontPanelUnderlineEffectModeMask = 1<<8,
 | 
			
		||||
    NSFontPanelStrikethroughEffectModeMask = 1<<9,
 | 
			
		||||
    NSFontPanelTextColorEffectModeMask = 1<< 10,
 | 
			
		||||
    NSFontPanelDocumentColorEffectModeMask = 1<<11,
 | 
			
		||||
    NSFontPanelShadowEffectModeMask = 1<<12,
 | 
			
		||||
    NSFontPanelAllEffectsModeMask = 0XFFF00,
 | 
			
		||||
    NSFontPanelStandardModesMask = 0xFFFF,
 | 
			
		||||
    NSFontPanelAllModesMask = 0xFFFFFFFF
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Tags of views in the FontPanel
 | 
			
		||||
 THESE ARE ALL OBSOLETE and should not be used.
 | 
			
		||||
 */
 | 
			
		||||
enum {
 | 
			
		||||
    NSFPPreviewButton			= 131,
 | 
			
		||||
    NSFPRevertButton			= 130,
 | 
			
		||||
    NSFPSetButton			= 132,
 | 
			
		||||
    NSFPPreviewField			= 128,
 | 
			
		||||
    NSFPSizeField			= 129,
 | 
			
		||||
    NSFPSizeTitle			= 133,
 | 
			
		||||
    NSFPCurrentField			= 134
 | 
			
		||||
} API_DEPRECATED("", macos(10.0,10.0));
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,55 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSForm.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSMatrix.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSFormCell;
 | 
			
		||||
 | 
			
		||||
API_DEPRECATED("Use NSTextField directly instead, and consider NSStackView for layout assistance", macos(10.0,10.10))
 | 
			
		||||
@interface  NSForm : NSMatrix
 | 
			
		||||
 | 
			
		||||
- (NSInteger)indexOfSelectedItem;
 | 
			
		||||
- (void)setEntryWidth:(CGFloat)width;
 | 
			
		||||
- (void)setInterlineSpacing:(CGFloat)spacing;
 | 
			
		||||
- (void)setBordered:(BOOL)flag;
 | 
			
		||||
- (void)setBezeled:(BOOL)flag;
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
- (void)setTitleAlignment:(NSTextAlignment)mode;
 | 
			
		||||
- (void)setTextAlignment:(NSTextAlignment)mode;
 | 
			
		||||
#endif
 | 
			
		||||
- (void)setTitleFont:(NSFont *)fontObj;
 | 
			
		||||
- (void)setTextFont:(NSFont *)fontObj;
 | 
			
		||||
- (null_unspecified id)cellAtIndex:(NSInteger)index;
 | 
			
		||||
- (void)drawCellAtIndex:(NSInteger)index;
 | 
			
		||||
- (NSFormCell *)addEntry:(NSString *)title;
 | 
			
		||||
- (null_unspecified NSFormCell *)insertEntry:(NSString *)title atIndex:(NSInteger)index;
 | 
			
		||||
- (void)removeEntryAtIndex:(NSInteger)index;
 | 
			
		||||
- (NSInteger)indexOfCellWithTag:(NSInteger)tag;
 | 
			
		||||
- (void)selectTextAtIndex:(NSInteger)index;
 | 
			
		||||
- (void)setFrameSize:(NSSize)newSize;
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
- (void)setTitleBaseWritingDirection:(NSWritingDirection)writingDirection;
 | 
			
		||||
- (void)setTextBaseWritingDirection:(NSWritingDirection)writingDirection;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Determine the preferred width of the text field portion of the receiver's cells. The preferred width is reflected in the cell's cellSize, which will be large enough to accommodate the title, bezel, and a text field of width preferredTextWidth. It is also reflected in the intrinsicContentSize of the NSForm. That is, under autolayout, the NSForm will try to size itself so that the text field cell is the given width, according to the usual content size constraint priorities.
 | 
			
		||||
 
 | 
			
		||||
 If the width is negative, the cellSize matches the historic behavior, which is that it is large enough to accommodate the title, bezel, and the current text. The default is -1.
 | 
			
		||||
 | 
			
		||||
 This method can aid migration to autolayout, and is sufficient for simple cases. However, for new apps, prefer to use NSTextFields directly instead of NSForm.
 | 
			
		||||
*/
 | 
			
		||||
- (void)setPreferredTextFieldWidth:(CGFloat)preferredWidth API_AVAILABLE(macos(10.8));
 | 
			
		||||
- (CGFloat)preferredTextFieldWidth API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,57 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSFormCell.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSActionCell.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@interface NSFormCell : NSActionCell
 | 
			
		||||
 | 
			
		||||
- (instancetype)initTextCell:(nullable NSString *)string NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initImageCell:(nullable NSImage *)image NS_UNAVAILABLE;
 | 
			
		||||
 | 
			
		||||
- (CGFloat)titleWidth:(NSSize)size;
 | 
			
		||||
@property CGFloat titleWidth;
 | 
			
		||||
@property (copy) NSString *title;
 | 
			
		||||
@property (strong) NSFont *titleFont;
 | 
			
		||||
@property (getter=isOpaque, readonly) BOOL opaque;
 | 
			
		||||
 | 
			
		||||
@property (nullable, copy) NSString *placeholderString;
 | 
			
		||||
@property (nullable, copy) NSAttributedString *placeholderAttributedString;
 | 
			
		||||
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
@property NSTextAlignment titleAlignment;
 | 
			
		||||
@property NSWritingDirection titleBaseWritingDirection;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Determine the preferred width of the text field portion of the receiver. The preferred width is reflected in the cell's cellSize, which will be large enough to accommodate the title, bezel, and a text field of width preferredTextWidth. It is also reflected in the intrinsicContentSize of the NSForm. That is, under autolayout, the NSForm will try to size itself so that the text field cell is the given width, according to the usual content size constraint priorities.
 | 
			
		||||
 
 | 
			
		||||
 If the width is negative, the cellSize matches the historic behavior, which is that it is large enough to accommodate the title, bezel, and the current text. The default is -1.
 | 
			
		||||
 
 | 
			
		||||
 This method can aid migration to autolayout, and is sufficient for simple cases. However, for new apps, prefer to use NSTextFields directly instead of NSForm.
 | 
			
		||||
 */
 | 
			
		||||
@property CGFloat preferredTextFieldWidth API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSFormCell(NSKeyboardUI)
 | 
			
		||||
/* Deprecated in 10.8 and higher. Use setTitle: instead.
 | 
			
		||||
 */
 | 
			
		||||
- (void)setTitleWithMnemonic:(null_unspecified NSString *)stringWithAmpersand API_DEPRECATED("", macos(10.0,10.8));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSFormCell(NSFormCellAttributedStringMethods)
 | 
			
		||||
@property (copy) NSAttributedString *attributedTitle;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,164 @@
 | 
			
		||||
/*
 | 
			
		||||
    NSGestureRecognizer.h
 | 
			
		||||
    Application Kit
 | 
			
		||||
    Copyright (c) 2013-2021, Apple Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/Foundation.h>
 | 
			
		||||
#import <CoreGraphics/CoreGraphics.h>
 | 
			
		||||
#import <AppKit/NSTouch.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@protocol NSGestureRecognizerDelegate;
 | 
			
		||||
@class NSView, NSEvent, NSPressureConfiguration, NSTouch;
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.10))
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSGestureRecognizerState) {
 | 
			
		||||
    NSGestureRecognizerStatePossible,   // the recognizer has not yet recognized its gesture, but may be evaluating events. this is the default state
 | 
			
		||||
    
 | 
			
		||||
    NSGestureRecognizerStateBegan,      // the recognizer has received events recognized as the gesture. the action method will be called at the next turn of the run loop
 | 
			
		||||
    NSGestureRecognizerStateChanged,    // the recognizer has received events recognized as a change to the gesture. the action method will be called at the next turn of the run loop
 | 
			
		||||
    NSGestureRecognizerStateEnded,      // the recognizer has received events recognized as the end of the gesture. the action method will be called at the next turn of the run loop and the recognizer will be reset to NSGestureRecognizerStatePossible
 | 
			
		||||
    NSGestureRecognizerStateCancelled,  // the recognizer has received events resulting in the cancellation of the gesture. the action method will be called at the next turn of the run loop. the recognizer will be reset to NSGestureRecognizerStatePossible
 | 
			
		||||
    
 | 
			
		||||
    NSGestureRecognizerStateFailed,     // the recognizer has received an event sequence that can not be recognized as the gesture. the action method will not be called and the recognizer will be reset to NSGestureRecognizerStatePossible
 | 
			
		||||
    
 | 
			
		||||
    // Discrete Gestures – gesture recognizers that recognize a discrete event but do not report changes (for example, a click) do not transition through the Began and Changed states and can not fail or be cancelled
 | 
			
		||||
    NSGestureRecognizerStateRecognized = NSGestureRecognizerStateEnded // the recognizer has received events recognized as the gesture. the action method will be called at the next turn of the run loop and the recognizer will be reset to NSGestureRecognizerStatePossible
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.10)) NS_SWIFT_UI_ACTOR
 | 
			
		||||
@interface NSGestureRecognizer : NSObject <NSCoding>
 | 
			
		||||
 | 
			
		||||
/* valid action method signatures:
 | 
			
		||||
     -(void)handleGesture;
 | 
			
		||||
     -(void)handleGesture:(NSGestureRecognizer*)gestureRecognizer;
 | 
			
		||||
*/
 | 
			
		||||
- (instancetype)initWithTarget:(nullable id)target action:(nullable SEL)action NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
@property (nullable, weak) id target;
 | 
			
		||||
@property (nullable) SEL action;
 | 
			
		||||
 | 
			
		||||
/* the current state of the gesture recognizer */
 | 
			
		||||
@property (readonly) NSGestureRecognizerState state;
 | 
			
		||||
 | 
			
		||||
/* the gesture recognizer's delegate */
 | 
			
		||||
@property (nullable, weak) id <NSGestureRecognizerDelegate> delegate;
 | 
			
		||||
 | 
			
		||||
/* default is YES. disabled gesture recognizers will not receive events. when changed to NO the gesture recognizer will be cancelled if it's currently recognizing a gesture */
 | 
			
		||||
@property (getter=isEnabled) BOOL enabled;
 | 
			
		||||
 | 
			
		||||
/* an NSGestureRecognizer receives events hit-tested to its view and any of that view's subviews
 | 
			
		||||
   the view the gesture is attached to. set by adding the recognizer to a NSView using the addGestureRecognizer: method
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, readonly) NSView *view;
 | 
			
		||||
 | 
			
		||||
/* The pressure configuration the view should use when this recognizer is eligible for recognition. At any point in time during recognition the view's effective pressure configuration will be the most compatible configuration among the set of active recognizers. This property may be set at any time before or during recognition. If recognition fails, the effective configuration will revert to the view's -pressureConfiguration. */
 | 
			
		||||
@property (strong) NSPressureConfiguration *pressureConfiguration API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/*  causes the specified events to be delivered to the target view only after this gesture has failed recognition. set to YES to prevent views from processing any events that may be recognized as part of this gesture. note: once a gesture recognizer starts delaying one type of event, all event types are delayed until this gesture has failed recognition. refer to specific gesture subclasses as they have different defaults.
 | 
			
		||||
*/
 | 
			
		||||
@property BOOL delaysPrimaryMouseButtonEvents;      // default is NO.
 | 
			
		||||
@property BOOL delaysSecondaryMouseButtonEvents;    // default is NO.
 | 
			
		||||
@property BOOL delaysOtherMouseButtonEvents;        // default is NO.
 | 
			
		||||
@property BOOL delaysKeyEvents;                     // default is NO.
 | 
			
		||||
@property BOOL delaysMagnificationEvents;           // default is NO.
 | 
			
		||||
@property BOOL delaysRotationEvents;                // default is NO.
 | 
			
		||||
 | 
			
		||||
/* individual NSGestureRecognizer subclasses may provide subclass-specific location information. see individual subclasses for details */
 | 
			
		||||
- (NSPoint)locationInView:(nullable NSView*)view;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSGestureRecognizer (NSTouchBar)
 | 
			
		||||
/* Currently, only NSTouchTypeDirect is supported. Defaults to 0 */
 | 
			
		||||
@property NSTouchTypeMask allowedTouchTypes API_AVAILABLE(macos(10.12.2));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@protocol NSGestureRecognizerDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
/* called when the window begins a new recognition stream
 | 
			
		||||
 return YES to allow the recognizer to process events. return NO to fail recognition and opt the recognizer out of the event stream
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)gestureRecognizer:(NSGestureRecognizer *)gestureRecognizer shouldAttemptToRecognizeWithEvent:(NSEvent *)event API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
/* called when a gesture recognizer attempts to transition out of NSGestureRecognizerStatePossible. returning NO causes it to transition to NSGestureRecognizerStateFailed */
 | 
			
		||||
- (BOOL)gestureRecognizerShouldBegin:(NSGestureRecognizer *)gestureRecognizer;
 | 
			
		||||
 | 
			
		||||
/* called when the recognition of one of gestureRecognizer or otherGestureRecognizer would be blocked by the other
 | 
			
		||||
   return YES to allow both to recognize simultaneously. the default implementation returns NO (by default no two gestures can be recognized simultaneously)
 | 
			
		||||
 | 
			
		||||
   note: returning YES is guaranteed to allow simultaneous recognition. returning NO is not guaranteed to prevent simultaneous recognition, as the other gesture's delegate may return YES
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)gestureRecognizer:(NSGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(NSGestureRecognizer *)otherGestureRecognizer;
 | 
			
		||||
 | 
			
		||||
/* called once per attempt to recognize, so failure requirements can be determined lazily and may be set up between recognizers across view hierarchies
 | 
			
		||||
   return YES to set up a dynamic failure requirement between gestureRecognizer and otherGestureRecognizer
 | 
			
		||||
 | 
			
		||||
   note: returning YES is guaranteed to set up the failure requirement. returning NO does not guarantee that there will not be a failure requirement as the other gesture's counterpart delegate or subclass methods may return YES
 | 
			
		||||
*/
 | 
			
		||||
- (BOOL)gestureRecognizer:(NSGestureRecognizer *)gestureRecognizer shouldRequireFailureOfGestureRecognizer:(NSGestureRecognizer *)otherGestureRecognizer;
 | 
			
		||||
- (BOOL)gestureRecognizer:(NSGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(NSGestureRecognizer *)otherGestureRecognizer;
 | 
			
		||||
 | 
			
		||||
/* called before touchesBegan:withEvent: is called on the gesture recognizer for a new touch. return NO to prevent the gesture recognizer from seeing this touch
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)gestureRecognizer:(NSGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(NSTouch *)touch API_AVAILABLE(macos(10.12.2));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
// the extensions in this header are to be used only by subclasses of NSGestureRecognizer
 | 
			
		||||
// code that uses NSGestureRecognizers must never call these
 | 
			
		||||
 | 
			
		||||
@interface NSGestureRecognizer (NSSubclassUse)
 | 
			
		||||
 | 
			
		||||
// readonly for users of a gesture recognizer. may only be changed by direct subclasses of NSGestureRecognizer
 | 
			
		||||
@property NSGestureRecognizerState state;  // the current state of the gesture recognizer. can only be set by subclasses of NSGestureRecognizer, but can be read by consumers
 | 
			
		||||
 | 
			
		||||
// the following methods are to be overridden by subclasses of NSGestureRecognizer
 | 
			
		||||
// if you override one you must call super
 | 
			
		||||
 | 
			
		||||
// called automatically by the runtime after the gesture state has been set to NSGestureRecognizerStateEnded
 | 
			
		||||
// any internal state should be reset to prepare for a new attempt to recognize the gesture
 | 
			
		||||
// after this is received all remaining active touches will be ignored (no further updates will be received for touches that had already begun but haven't ended)
 | 
			
		||||
- (void)reset;
 | 
			
		||||
 | 
			
		||||
// same behavior as the equivalent delegate methods, but can be used by subclasses to define class-wide prevention rules
 | 
			
		||||
// for example, a NSTapGestureRecognizer never prevents another NSClickGestureRecognizer with a higher click count
 | 
			
		||||
- (BOOL)canPreventGestureRecognizer:(NSGestureRecognizer *)preventedGestureRecognizer;
 | 
			
		||||
- (BOOL)canBePreventedByGestureRecognizer:(NSGestureRecognizer *)preventingGestureRecognizer;
 | 
			
		||||
 | 
			
		||||
// same behavior as the equivalent delegate methods, but can be used by subclasses to define class-wide failure requirements
 | 
			
		||||
- (BOOL)shouldRequireFailureOfGestureRecognizer:(NSGestureRecognizer *)otherGestureRecognizer;
 | 
			
		||||
- (BOOL)shouldBeRequiredToFailByGestureRecognizer:(NSGestureRecognizer *)otherGestureRecognizer;
 | 
			
		||||
 | 
			
		||||
// mirror of the event-delivery methods on NSResponder
 | 
			
		||||
// NSGestureRecognizers aren't in the responder chain, but observe events hit-tested to their view and their view's subviews
 | 
			
		||||
// NSGestureRecognizers receive events before the view to which the event was hit-tested
 | 
			
		||||
- (void)mouseDown:(NSEvent *)event;
 | 
			
		||||
- (void)rightMouseDown:(NSEvent *)event;
 | 
			
		||||
- (void)otherMouseDown:(NSEvent *)event;
 | 
			
		||||
- (void)mouseUp:(NSEvent *)event;
 | 
			
		||||
- (void)rightMouseUp:(NSEvent *)event;
 | 
			
		||||
- (void)otherMouseUp:(NSEvent *)event;
 | 
			
		||||
- (void)mouseDragged:(NSEvent *)event;
 | 
			
		||||
- (void)rightMouseDragged:(NSEvent *)event;
 | 
			
		||||
- (void)otherMouseDragged:(NSEvent *)event;
 | 
			
		||||
- (void)keyDown:(NSEvent *)event;
 | 
			
		||||
- (void)keyUp:(NSEvent *)event;
 | 
			
		||||
- (void)flagsChanged:(NSEvent *)event;
 | 
			
		||||
- (void)tabletPoint:(NSEvent *)event;
 | 
			
		||||
- (void)magnifyWithEvent:(NSEvent *)event;
 | 
			
		||||
- (void)rotateWithEvent:(NSEvent *)event;
 | 
			
		||||
- (void)pressureChangeWithEvent:(NSEvent *)event API_AVAILABLE(macos(10.10.3));
 | 
			
		||||
- (void)touchesBeganWithEvent:(NSEvent *)event API_AVAILABLE(macos(10.12.2));
 | 
			
		||||
- (void)touchesMovedWithEvent:(NSEvent *)event API_AVAILABLE(macos(10.12.2));
 | 
			
		||||
- (void)touchesEndedWithEvent:(NSEvent *)event API_AVAILABLE(macos(10.12.2));
 | 
			
		||||
- (void)touchesCancelledWithEvent:(NSEvent *)event API_AVAILABLE(macos(10.12.2));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,44 @@
 | 
			
		||||
#if !__has_include(<UIFoundation/NSGlyphGenerator.h>)
 | 
			
		||||
/*
 | 
			
		||||
        NSGlyphGenerator.h
 | 
			
		||||
        Application Kit
 | 
			
		||||
        Copyright (c) 1993-2021, Apple Inc.
 | 
			
		||||
        All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSAttributedString.h>
 | 
			
		||||
#import <AppKit/NSFont.h> // for NSGlyph
 | 
			
		||||
 | 
			
		||||
// NSGlyphGenerator is now deprecated. It will be formally deprecated in a future version of macOS. Use -layoutManager:shouldGenerateGlyphs:properties:characterIndexes:forGlyphRange: in order to customize the canonical glyph generation mapping
 | 
			
		||||
 | 
			
		||||
/* NSGlyphStorage layout options */
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
    NSShowControlGlyphs = (1 << 0), // if set, generates displayable glyphs for control chars
 | 
			
		||||
    NSShowInvisibleGlyphs = (1 << 1), // if set, generates displayable glyphs for invisible chars
 | 
			
		||||
    NSWantsBidiLevels = (1 << 2) // if set, generates bidi levels
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@protocol NSGlyphStorage
 | 
			
		||||
- (void)insertGlyphs:(const NSGlyph *)glyphs length:(NSUInteger)length forStartingGlyphAtIndex:(NSUInteger)glyphIndex characterIndex:(NSUInteger)charIndex;
 | 
			
		||||
 | 
			
		||||
// sets glyph attribute defined in NSLayoutManager.h
 | 
			
		||||
- (void)setIntAttribute:(NSInteger)attributeTag value:(NSInteger)val forGlyphAtIndex:(NSUInteger)glyphIndex;
 | 
			
		||||
 | 
			
		||||
- (NSAttributedString *)attributedString;
 | 
			
		||||
- (NSUInteger)layoutOptions;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSGlyphGenerator : NSObject
 | 
			
		||||
- (void)generateGlyphsForGlyphStorage:(id <NSGlyphStorage>)glyphStorage desiredNumberOfCharacters:(NSUInteger)nChars glyphIndex:(nullable NSUInteger *)glyphIndex characterIndex:(nullable NSUInteger *)charIndex;
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, strong) NSGlyphGenerator *sharedGlyphGenerator;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#endif // !TARGET_OS_IPHONE
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
#else
 | 
			
		||||
#import <UIFoundation/NSGlyphGenerator.h>
 | 
			
		||||
#endif
 | 
			
		||||
@@ -0,0 +1,49 @@
 | 
			
		||||
#if !__has_include(<UIFoundation/NSGlyphInfo.h>)
 | 
			
		||||
/*
 | 
			
		||||
	NSGlyphInfo.h
 | 
			
		||||
	Copyright (c) 2002-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSString.h>
 | 
			
		||||
#import <AppKit/NSFont.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
#if !TARGET_OS_IPHONE
 | 
			
		||||
 | 
			
		||||
@interface NSGlyphInfo : NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
+ (nullable NSGlyphInfo *)glyphInfoWithCGGlyph:(CGGlyph)glyph forFont:(NSFont *)font baseString:(NSString *)string API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly) CGGlyph glyphID API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
@property (readonly, copy) NSString *baseString API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
// Non-CGGlyph NSGlyphInfo support is now deprecated. The following API will be formally deprecated in a future version of macOS
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSCharacterCollection) {
 | 
			
		||||
    NSIdentityMappingCharacterCollection = 0, // Identity mapping (CID == NSGlyph)
 | 
			
		||||
    NSAdobeCNS1CharacterCollection = 1, // Adobe-CNS1
 | 
			
		||||
    NSAdobeGB1CharacterCollection = 2, // Adobe-GB1
 | 
			
		||||
    NSAdobeJapan1CharacterCollection = 3, // Adobe-Japan1
 | 
			
		||||
    NSAdobeJapan2CharacterCollection = 4, // Adobe-Japan2
 | 
			
		||||
    NSAdobeKorea1CharacterCollection = 5, // Adobe-Korea1
 | 
			
		||||
}; // Deprecated.
 | 
			
		||||
 | 
			
		||||
@interface NSGlyphInfo (NSGlyphInfo_Deprecated)
 | 
			
		||||
+ (nullable NSGlyphInfo *)glyphInfoWithGlyphName:(NSString *)glyphName forFont:(NSFont *)font baseString:(NSString *)string;
 | 
			
		||||
+ (nullable NSGlyphInfo *)glyphInfoWithGlyph:(NSGlyph)glyph forFont:(NSFont *)font baseString:(NSString *)string;
 | 
			
		||||
+ (nullable NSGlyphInfo *)glyphInfoWithCharacterIdentifier:(NSUInteger)cid collection:(NSCharacterCollection)characterCollection baseString:(NSString *)string ;
 | 
			
		||||
@property (nullable, readonly, copy) NSString *glyphName;
 | 
			
		||||
@property (readonly) NSUInteger characterIdentifier;
 | 
			
		||||
@property (readonly) NSCharacterCollection characterCollection;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif // !TARGET_OS_IPHONE
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
#else
 | 
			
		||||
#import <UIFoundation/NSGlyphInfo.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,143 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSGradient.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2006-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSBezierPath, NSColor, NSColorSpace;
 | 
			
		||||
 | 
			
		||||
typedef NS_OPTIONS(NSUInteger, NSGradientDrawingOptions) {
 | 
			
		||||
    NSGradientDrawsBeforeStartingLocation =   (1 << 0),
 | 
			
		||||
    NSGradientDrawsAfterEndingLocation =    (1 << 1),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* An NSGradient defines a transition between colors.  The transition is defined over a range from 0.0 to 1.0 inclusive.  A gradient typically contains a color at location 0.0, and one at location 1.0 with additional colors assigned to locations between 0.0 and 1.0.
 | 
			
		||||
 | 
			
		||||
An NSGradient is a drawing primitive that can draw itself as a linear or radial gradient.  The color value at location 0.0 is considered the starting color, the color value at location 1.0 is considered the ending color.  A primitive drawing method is provided for both linear and radial gradients.  Each primitive drawing method provides flexibility in specifying the location of its respective gradient.  These primitive drawing methods perform no clipping before drawing.
 | 
			
		||||
 | 
			
		||||
In addition, convenience drawing methods take a rectangle or path, and automatically calculate staring and ending locations and perform clipping to provide a convenient means for drawing gradient fills.  Two of the convenience methods are demonstrated below:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
The following code will fill a rectangle with a 45 degree linear gradient, from black to white:
 | 
			
		||||
	
 | 
			
		||||
	NSRect rect; // assume this exists
 | 
			
		||||
	NSGradient *gradient = [[NSGradient alloc] initWithStartingColor: [NSColor blackColor] endingColor: [NSColor whiteColor]];
 | 
			
		||||
	[gradient drawInRect: rect angle: 45.0];
 | 
			
		||||
	[gradient release];
 | 
			
		||||
	
 | 
			
		||||
The following code will fill an arbitrary bezier path with a radial gradient, from the center of the path's bounding box, that transitions through three colors, evenly distributed in the gradient from 0.0 to 1.0.
 | 
			
		||||
 | 
			
		||||
	NSBezierPath *path // assume this exists
 | 
			
		||||
	NSArray *colorArray = [NSArray arrayWithObjects: [NSColor blueColor], [NSColor yellowColor], [NSColor orangeColor], nil];
 | 
			
		||||
	NSGradient *gradient = [[NSGradient alloc] initWithColors: colorArray];
 | 
			
		||||
	[gradient drawInBezierPath: path relativeCenterPosition: NSZeroPoint];
 | 
			
		||||
	[gradient release];
 | 
			
		||||
	
 | 
			
		||||
An NSGradient has a color space.  When initialized, all colors provided are converted to that color space, and interpolation of colors occurs using the components of that color space.  The designated initializer takes a color space argument, all other initializers use the default generic RGB color space.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.5))
 | 
			
		||||
@interface NSGradient : NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
/* Initializes a gradient with starting color at location 0.0 and ending color at location 1.0  The color space returned by [NSColorSpace genericRGBColorSpace] is used.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable instancetype)initWithStartingColor:(NSColor *)startingColor endingColor:(NSColor *)endingColor;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Initializes a gradient with the first color in the array at 0.0, the last color in the array at 1.0, and intervening colors at equal intervals in between. The color space returned by [NSColorSpace genericRGBColorSpace] is used.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable instancetype)initWithColors:(NSArray<NSColor *> *)colorArray;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* This initializer takes the first color, then the first location as a CGFloat, then an alternating list of colors and CGFloats, terminated by nil.  If no color is provided for 0.0 or 1.0, the created color gradient will use the color provided at the locations closest to 0.0 and 1.0 for those values.  The color space returned by [NSColorSpace genericRGBColorSpace] is used.
 | 
			
		||||
 | 
			
		||||
    For example:
 | 
			
		||||
    NSGradient *gradient = [[NSGradient alloc] initWithColorsAndLocations: [NSColor blackColor], 0.0, [NSColor blueColor], 0.33, [NSColor cyanColor], 0.45, [NSColor orangeColor], 0.72, [NSColor redColor], 1.0, nil];
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
- (nullable instancetype)initWithColorsAndLocations:(NSColor *)firstColor, ... NS_REQUIRES_NIL_TERMINATION;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Initializes a gradient by pairing the colors provided in the color array with the locations provided in the locations array.    Each location should be a CGFloat between 0.0 and 1.0.  The color array and location array should not be empty, and should contain the same number of items.  If no color is provided for 0.0 or 1.0, the created color gradient will use the color provided at the locations closest to 0.0 and 1.0 for those values.  This is the designated initializer.
 | 
			
		||||
*/
 | 
			
		||||
- (nullable instancetype)initWithColors:(NSArray<NSColor *> *)colorArray atLocations:(nullable const CGFloat *)locations colorSpace:(NSColorSpace *)colorSpace NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* DRAWING LINEAR GRADIENTS */
 | 
			
		||||
 | 
			
		||||
/* Draws a linear gradient from start point to end point.  The option flags control whether the gradient draws itself before the start point, or after the end point.  The gradient is drawn in the current graphics context without performing any additinal clipping.  This is the primitive method for drawing a linear gradient.
 | 
			
		||||
*/
 | 
			
		||||
- (void)drawFromPoint:(NSPoint)startingPoint toPoint:(NSPoint)endingPoint options:(NSGradientDrawingOptions)options;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Convenience method for drawing a linear gradient to fill a rectangle.  Draws a linear gradient clipped to the provided rect.  The start point and end point are calculated with respect to the provided rect so that the gradient is drawn at the provided angle in degrees.  The end points are located such that both the start and end color in the gradient are visible in the rect.
 | 
			
		||||
*/
 | 
			
		||||
- (void)drawInRect:(NSRect)rect angle:(CGFloat)angle;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Convenience method for drawing a linear gradient to fill a path.  Draws a linear gradient clipped by the provided path.  The start point and end point are calculated with respect to the provided path so that the gradient is drawn at the provided angle in degrees. The end points are located such that both the start and end color in the gradient are visible in the path.
 | 
			
		||||
*/
 | 
			
		||||
- (void)drawInBezierPath:(NSBezierPath *)path angle:(CGFloat)angle;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* DRAWING RADIAL GRADIENTS */
 | 
			
		||||
 | 
			
		||||
/* Draws a radial gradient between two circles defined by the center point and radius of each circle.  The option flags control whether the gradient draws itself before the start point, or after the end point.  The gradient is drawn in the current graphics context without performing any additinal clipping.  This is the primitive method for drawing a radial gradient.
 | 
			
		||||
*/
 | 
			
		||||
- (void)drawFromCenter:(NSPoint)startCenter radius:(CGFloat)startRadius toCenter:(NSPoint)endCenter radius:(CGFloat)endRadius options:(NSGradientDrawingOptions)options;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Convenience method for drawing a radial gradient to fill a rect.  Draws a radial gradient clipped by the provided rect.  The starting circle is always a single point located at the center of the ending circle which encloses the drawn rect.  The radius of the ending circle is determined by the relative center position.
 | 
			
		||||
 | 
			
		||||
    The relative center position proportionally adjusts the center location of the radial gradient.  It maps the four corners of the rectangle to (-1.0, -1.0), (1.0, -1.0), (1.0, 1.0) and (-1.0, 1.0), with (0.0, 0.0) in the center of the rectangle.  Use NSZeroPoint to center the radial gradient in the rect.  The radius of the ending circle is the distance from the relative center to the opposite corner of the rect.
 | 
			
		||||
*/
 | 
			
		||||
- (void)drawInRect:(NSRect)rect relativeCenterPosition:(NSPoint)relativeCenterPosition;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Convenience method for drawing a radial gradient to fill a path.  Draws a radial gradient clipped by the provided path.  The starting circle is always a single point located at the center of the ending circle which encloses the drawn path.  The radius of the ending circle is determined by the relative center position.
 | 
			
		||||
 | 
			
		||||
    The relative center position proportionally adjusts the center location of the radial gradient.  It maps the four corners of the path bounding rect to (-1.0, -1.0), (1.0, -1.0), (1.0, 1.0) and (-1.0, 1.0), with (0.0, 0.0) in the center of path bounding rect.  Use NSZeroPoint to center the radial gradient in the path bounding rect.  The radius of the ending circle is the distance from the relative center to the opposite corner of the path bounding rect.
 | 
			
		||||
*/
 | 
			
		||||
- (void)drawInBezierPath:(NSBezierPath *)path relativeCenterPosition:(NSPoint)relativeCenterPosition;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* These methods are primarily for the use of controls which manipulate the color gradient.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* Returns the color space of the gradient */
 | 
			
		||||
@property (readonly, strong) NSColorSpace *colorSpace;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* The number of color stops in the color gradient */
 | 
			
		||||
@property (readonly) NSInteger numberOfColorStops;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Returns the color and location at a particular index in the color gradient */
 | 
			
		||||
- (void)getColor:(NSColor * _Nonnull * _Nullable)color location:(nullable CGFloat *)location atIndex:(NSInteger)index;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* This method will return the interpolated gradient value at the given location.  For example, in a two color gradient with white at location 0.0 and black at location 1.0, the interpolated color at location 0.5 would be 50% gray.
 | 
			
		||||
 | 
			
		||||
You should not need to override this method, it reports the color value of the gradient at a particular location, and does not affect the drawn color values.
 | 
			
		||||
*/
 | 
			
		||||
- (NSColor *)interpolatedColorAtLocation:(CGFloat)location;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1,267 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSGraphics.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSGeometry.h> 
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSColor, NSView;
 | 
			
		||||
 | 
			
		||||
/* Operation types for composite operators */
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSCompositingOperation) {
 | 
			
		||||
    /* Porter-Duff compositing operations */
 | 
			
		||||
    /* https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators */
 | 
			
		||||
    NSCompositingOperationClear,
 | 
			
		||||
    NSCompositingOperationCopy,
 | 
			
		||||
    NSCompositingOperationSourceOver,
 | 
			
		||||
    NSCompositingOperationSourceIn,
 | 
			
		||||
    NSCompositingOperationSourceOut,
 | 
			
		||||
    NSCompositingOperationSourceAtop,
 | 
			
		||||
    NSCompositingOperationDestinationOver,
 | 
			
		||||
    NSCompositingOperationDestinationIn,
 | 
			
		||||
    NSCompositingOperationDestinationOut,
 | 
			
		||||
    NSCompositingOperationDestinationAtop,
 | 
			
		||||
    NSCompositingOperationXOR,
 | 
			
		||||
    NSCompositingOperationPlusDarker,
 | 
			
		||||
    NSCompositingOperationHighlight API_DEPRECATED("Use NSCompositingOperationSourceOver instead", macos(10.0,10.0)),
 | 
			
		||||
    NSCompositingOperationPlusLighter,
 | 
			
		||||
    
 | 
			
		||||
    /* Separable blend-modes */
 | 
			
		||||
    /* https://www.w3.org/TR/compositing-1/#blendingseparable */
 | 
			
		||||
    NSCompositingOperationMultiply	API_AVAILABLE(macos(10.10)),
 | 
			
		||||
    NSCompositingOperationScreen	API_AVAILABLE(macos(10.10)),
 | 
			
		||||
    NSCompositingOperationOverlay	API_AVAILABLE(macos(10.10)),
 | 
			
		||||
    NSCompositingOperationDarken	API_AVAILABLE(macos(10.10)),
 | 
			
		||||
    NSCompositingOperationLighten	API_AVAILABLE(macos(10.10)),
 | 
			
		||||
    NSCompositingOperationColorDodge	API_AVAILABLE(macos(10.10)),
 | 
			
		||||
    NSCompositingOperationColorBurn	API_AVAILABLE(macos(10.10)),
 | 
			
		||||
    NSCompositingOperationSoftLight	API_AVAILABLE(macos(10.10)),
 | 
			
		||||
    NSCompositingOperationHardLight	API_AVAILABLE(macos(10.10)),
 | 
			
		||||
    NSCompositingOperationDifference	API_AVAILABLE(macos(10.10)),
 | 
			
		||||
    NSCompositingOperationExclusion	API_AVAILABLE(macos(10.10)),
 | 
			
		||||
    
 | 
			
		||||
    /* Non-separable blend-modes */
 | 
			
		||||
    /* https://www.w3.org/TR/compositing-1/#blendingnonseparable */
 | 
			
		||||
    NSCompositingOperationHue		API_AVAILABLE(macos(10.10)),
 | 
			
		||||
    NSCompositingOperationSaturation	API_AVAILABLE(macos(10.10)),
 | 
			
		||||
    NSCompositingOperationColor		API_AVAILABLE(macos(10.10)),
 | 
			
		||||
    NSCompositingOperationLuminosity	API_AVAILABLE(macos(10.10)),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static const NSCompositingOperation NSCompositeClear API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationClear", macos(10.0,10.12)) = NSCompositingOperationClear;
 | 
			
		||||
static const NSCompositingOperation NSCompositeCopy API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationCopy", macos(10.0,10.12)) = NSCompositingOperationCopy;
 | 
			
		||||
static const NSCompositingOperation NSCompositeSourceOver API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationSourceOver", macos(10.0,10.12)) = NSCompositingOperationSourceOver;
 | 
			
		||||
static const NSCompositingOperation NSCompositeSourceIn API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationSourceIn", macos(10.0,10.12)) = NSCompositingOperationSourceIn;
 | 
			
		||||
static const NSCompositingOperation NSCompositeSourceOut API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationSourceOut", macos(10.0,10.12)) = NSCompositingOperationSourceOut;
 | 
			
		||||
static const NSCompositingOperation NSCompositeSourceAtop API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationSourceAtop", macos(10.0,10.12)) = NSCompositingOperationSourceAtop;
 | 
			
		||||
static const NSCompositingOperation NSCompositeDestinationOver API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationDestinationOver", macos(10.0,10.12)) = NSCompositingOperationDestinationOver;
 | 
			
		||||
static const NSCompositingOperation NSCompositeDestinationIn API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationDestinationIn", macos(10.0,10.12)) = NSCompositingOperationDestinationIn;
 | 
			
		||||
static const NSCompositingOperation NSCompositeDestinationOut API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationDestinationOut", macos(10.0,10.12)) = NSCompositingOperationDestinationOut;
 | 
			
		||||
static const NSCompositingOperation NSCompositeDestinationAtop API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationDestinationAtop", macos(10.0,10.12)) = NSCompositingOperationDestinationAtop;
 | 
			
		||||
static const NSCompositingOperation NSCompositeXOR API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationXOR", macos(10.0,10.12)) = NSCompositingOperationXOR;
 | 
			
		||||
static const NSCompositingOperation NSCompositePlusDarker API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationPlusDarker", macos(10.0,10.12)) = NSCompositingOperationPlusDarker;
 | 
			
		||||
static const NSCompositingOperation NSCompositeHighlight API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationSourceOver", macos(10.0,10.0)) = NSCompositingOperationHighlight;
 | 
			
		||||
static const NSCompositingOperation NSCompositePlusLighter API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationPlusLighter", macos(10.0,10.12)) = NSCompositingOperationPlusLighter;
 | 
			
		||||
static const NSCompositingOperation NSCompositeMultiply	API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationMultiply", macos(10.0,10.12)) = NSCompositingOperationMultiply;
 | 
			
		||||
static const NSCompositingOperation NSCompositeScreen API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationScreen", macos(10.0,10.12)) = NSCompositingOperationScreen;
 | 
			
		||||
static const NSCompositingOperation NSCompositeOverlay API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationOverlay", macos(10.0,10.12)) = NSCompositingOperationOverlay;
 | 
			
		||||
static const NSCompositingOperation NSCompositeDarken API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationDarken", macos(10.0,10.12)) = NSCompositingOperationDarken;
 | 
			
		||||
static const NSCompositingOperation NSCompositeLighten API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationLighten", macos(10.0,10.12)) = NSCompositingOperationLighten;
 | 
			
		||||
static const NSCompositingOperation NSCompositeColorDodge API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationColorDodge", macos(10.0,10.12)) = NSCompositingOperationColorDodge;
 | 
			
		||||
static const NSCompositingOperation NSCompositeColorBurn API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationColorBurn", macos(10.0,10.12)) = NSCompositingOperationColorBurn;
 | 
			
		||||
static const NSCompositingOperation NSCompositeSoftLight API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationSoftLight", macos(10.0,10.12)) = NSCompositingOperationSoftLight;
 | 
			
		||||
static const NSCompositingOperation NSCompositeHardLight API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationHardLight", macos(10.0,10.12)) = NSCompositingOperationHardLight;
 | 
			
		||||
static const NSCompositingOperation NSCompositeDifference API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationDifference", macos(10.0,10.12)) = NSCompositingOperationDifference;
 | 
			
		||||
static const NSCompositingOperation NSCompositeExclusion API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationExclusion", macos(10.0,10.12)) = NSCompositingOperationExclusion;
 | 
			
		||||
 | 
			
		||||
static const NSCompositingOperation NSCompositeHue API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationHue", macos(10.0,10.12)) = NSCompositingOperationHue;
 | 
			
		||||
static const NSCompositingOperation NSCompositeSaturation API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationSaturation", macos(10.0,10.12)) = NSCompositingOperationSaturation;
 | 
			
		||||
static const NSCompositingOperation NSCompositeColor API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationColor", macos(10.0,10.12)) = NSCompositingOperationColor;
 | 
			
		||||
static const NSCompositingOperation NSCompositeLuminosity API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationLuminosity", macos(10.0,10.12)) = NSCompositingOperationLuminosity;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Types of window backing stores.
 | 
			
		||||
 */
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSBackingStoreType) {
 | 
			
		||||
    /* NSBackingStoreRetained and NSBackingStoreNonretained have effectively been synonyms of NSBackingStoreBuffered since OS X Mountain Lion.  Please switch to the equivalent NSBackingStoreBuffered.
 | 
			
		||||
     */
 | 
			
		||||
    NSBackingStoreRetained API_DEPRECATED_WITH_REPLACEMENT("NSBackingStoreBuffered", macos(10.0,10.13)) = 0,
 | 
			
		||||
    NSBackingStoreNonretained API_DEPRECATED_WITH_REPLACEMENT("NSBackingStoreBuffered", macos(10.0,10.13)) = 1,
 | 
			
		||||
    NSBackingStoreBuffered = 2,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* ways to order windows */
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSWindowOrderingMode) {
 | 
			
		||||
    NSWindowAbove		 =  1,
 | 
			
		||||
    NSWindowBelow		 = -1,
 | 
			
		||||
    NSWindowOut			 =  0
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* order in which to draw focus ring - above or below graphic or just draw ring */
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSFocusRingPlacement) {
 | 
			
		||||
    NSFocusRingOnly	 = 0,
 | 
			
		||||
    NSFocusRingBelow	 = 1,
 | 
			
		||||
    NSFocusRingAbove	 = 2
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* used by NSView and NSCell to configure if and how the control should draw its focus ring */
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSFocusRingType) {
 | 
			
		||||
    NSFocusRingTypeDefault = 0,
 | 
			
		||||
    NSFocusRingTypeNone = 1,
 | 
			
		||||
    NSFocusRingTypeExterior = 2
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// values interchangeable with CGColorRenderingIntent values
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSColorRenderingIntent) {
 | 
			
		||||
    NSColorRenderingIntentDefault, //  = kCGRenderingIntentDefault,
 | 
			
		||||
    NSColorRenderingIntentAbsoluteColorimetric, //  = kCGRenderingIntentAbsoluteColorimetric,
 | 
			
		||||
    NSColorRenderingIntentRelativeColorimetric, //  = kCGRenderingIntentRelativeColorimetric,
 | 
			
		||||
    NSColorRenderingIntentPerceptual, // = kCGRenderingIntentPerceptual,
 | 
			
		||||
    NSColorRenderingIntentSaturation // = kCGRenderingIntentSaturation
 | 
			
		||||
} API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSColorSpaceName NS_TYPED_ENUM;
 | 
			
		||||
/* Predefined colorspace names.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN NSColorSpaceName NSCalibratedWhiteColorSpace;	/* 1.0 == white */
 | 
			
		||||
APPKIT_EXTERN NSColorSpaceName NSCalibratedRGBColorSpace;
 | 
			
		||||
APPKIT_EXTERN NSColorSpaceName NSDeviceWhiteColorSpace;	/* 1.0 == white */
 | 
			
		||||
APPKIT_EXTERN NSColorSpaceName NSDeviceRGBColorSpace;
 | 
			
		||||
APPKIT_EXTERN NSColorSpaceName NSDeviceCMYKColorSpace;
 | 
			
		||||
APPKIT_EXTERN NSColorSpaceName NSNamedColorSpace;		/* Used for "catalog" colors */
 | 
			
		||||
APPKIT_EXTERN NSColorSpaceName NSPatternColorSpace;
 | 
			
		||||
APPKIT_EXTERN NSColorSpaceName NSCustomColorSpace;		/* Used to indicate a custom gstate in images */
 | 
			
		||||
 | 
			
		||||
/* Prefer colorspaces where 1.0 means white.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSColorSpaceName NSCalibratedBlackColorSpace     /* 1.0 == black */ API_DEPRECATED("", macos(10.0,10.6));
 | 
			
		||||
APPKIT_EXTERN NSColorSpaceName NSDeviceBlackColorSpace 	/* 1.0 == black */ API_DEPRECATED("", macos(10.0,10.6));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* NSWindowDepth defines the values used in setting window depth limits. "0" indicates default depth. Window depths should not be made persistent as they will not be the same across systems. Use the functions NSBitsPerSampleFromDepth(), NSColorSpaceFromDepth(), NSBitsPerPixelFromDepth(), and NSPlanarFromDepth() to extract info from an NSWindowDepth 
 | 
			
		||||
 | 
			
		||||
On Mac OS X 10.5 and earlier, use NSBestDepth() to compute window depths. NSBestDepth() will try to accomodate all the parameters (match or better); if there are multiple matches, it gives the closest, with matching colorSpace first, then bps, then planar, then bpp. bpp is "bits per pixel"; 0 indicates default (same as the number of bits per plane, either bps or bps * NSNumberOfColorComponents()); other values maybe used as hints to provide backing stores of different configuration; for instance, 8 bit color. exactMatch is optional and indicates whether all the parameters matched exactly.
 | 
			
		||||
 | 
			
		||||
On Mac OS X 10.6 and later, you can pass one of the explicit bit depths below to -[NSWindow setDepthLimit:].  NSWindowDepthTwentyfourBitRGB is the default.
 | 
			
		||||
*/
 | 
			
		||||
typedef NS_ENUM(int32_t, NSWindowDepth) {
 | 
			
		||||
    NSWindowDepthTwentyfourBitRGB = 0x208,
 | 
			
		||||
    NSWindowDepthSixtyfourBitRGB = 0x210,
 | 
			
		||||
    NSWindowDepthOnehundredtwentyeightBitRGB = 0x220
 | 
			
		||||
} API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSWindowDepth NSBestDepth (NSColorSpaceName colorSpace, NSInteger bps, NSInteger bpp, BOOL planar, BOOL * _Nullable exactMatch);
 | 
			
		||||
APPKIT_EXTERN BOOL NSPlanarFromDepth (NSWindowDepth depth);
 | 
			
		||||
APPKIT_EXTERN NSColorSpaceName _Nullable NSColorSpaceFromDepth (NSWindowDepth depth);
 | 
			
		||||
APPKIT_EXTERN NSInteger NSBitsPerSampleFromDepth(NSWindowDepth depth);
 | 
			
		||||
APPKIT_EXTERN NSInteger NSBitsPerPixelFromDepth(NSWindowDepth depth);
 | 
			
		||||
APPKIT_EXTERN NSInteger NSNumberOfColorComponents(NSColorSpaceName colorSpaceName);
 | 
			
		||||
APPKIT_EXTERN const NSWindowDepth *NSAvailableWindowDepths(void); /* returns pointer to 0-terminated array */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Standard gray values for the 2-bit deep grayscale colorspace.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN const CGFloat NSWhite;
 | 
			
		||||
APPKIT_EXTERN const CGFloat NSLightGray;
 | 
			
		||||
APPKIT_EXTERN const CGFloat NSDarkGray;
 | 
			
		||||
APPKIT_EXTERN const CGFloat NSBlack;
 | 
			
		||||
 | 
			
		||||
/* Approximate color gamut for use by NSScreen and NSWindow
 | 
			
		||||
 */
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSDisplayGamut) {
 | 
			
		||||
    NSDisplayGamutSRGB = 1,
 | 
			
		||||
    NSDisplayGamutP3 
 | 
			
		||||
} API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
/* Keys for deviceDescription dictionaries.
 | 
			
		||||
*/
 | 
			
		||||
typedef NSString * NSDeviceDescriptionKey NS_TYPED_EXTENSIBLE_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSDeviceDescriptionKey NSDeviceResolution;		/* NSValue containing NSSize, basically dpi */
 | 
			
		||||
APPKIT_EXTERN NSDeviceDescriptionKey NSDeviceColorSpaceName;	/* NSString */
 | 
			
		||||
APPKIT_EXTERN NSDeviceDescriptionKey NSDeviceBitsPerSample;		/* NSValue containing int */
 | 
			
		||||
APPKIT_EXTERN NSDeviceDescriptionKey NSDeviceIsScreen;		/* "YES" or not there */
 | 
			
		||||
APPKIT_EXTERN NSDeviceDescriptionKey NSDeviceIsPrinter;		/* "YES" or not there */
 | 
			
		||||
APPKIT_EXTERN NSDeviceDescriptionKey NSDeviceSize;			/* NSValue containing NSSize */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Graphics functions
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN void NSRectFill(NSRect rect);
 | 
			
		||||
APPKIT_EXTERN void NSRectFillList(const NSRect *rects, NSInteger count);
 | 
			
		||||
APPKIT_EXTERN void NSRectFillListWithGrays(const NSRect *rects, const CGFloat *grays, NSInteger num);
 | 
			
		||||
APPKIT_EXTERN void NSRectFillListWithColors(const NSRect *rects,  NSColor * const _Nonnull * _Nonnull colors, NSInteger num);
 | 
			
		||||
APPKIT_EXTERN void NSRectFillUsingOperation(NSRect rect, NSCompositingOperation op);
 | 
			
		||||
APPKIT_EXTERN void NSRectFillListUsingOperation(const NSRect *rects, NSInteger count, NSCompositingOperation op);
 | 
			
		||||
APPKIT_EXTERN void NSRectFillListWithColorsUsingOperation(const NSRect *rects, NSColor * const _Nonnull * _Nonnull colors, NSInteger num, NSCompositingOperation op);
 | 
			
		||||
APPKIT_EXTERN void NSFrameRect(NSRect rect);
 | 
			
		||||
APPKIT_EXTERN void NSFrameRectWithWidth(NSRect rect, CGFloat frameWidth);
 | 
			
		||||
APPKIT_EXTERN void NSFrameRectWithWidthUsingOperation(NSRect rect, CGFloat frameWidth, NSCompositingOperation op);
 | 
			
		||||
APPKIT_EXTERN void NSRectClip(NSRect rect);
 | 
			
		||||
APPKIT_EXTERN void NSRectClipList(const NSRect *rects, NSInteger count);
 | 
			
		||||
APPKIT_EXTERN NSRect NSDrawTiledRects(NSRect boundsRect, NSRect clipRect, const NSRectEdge *sides, const CGFloat *grays, NSInteger count);
 | 
			
		||||
APPKIT_EXTERN void NSDrawGrayBezel(NSRect rect, NSRect clipRect);
 | 
			
		||||
APPKIT_EXTERN void NSDrawGroove(NSRect rect, NSRect clipRect);
 | 
			
		||||
APPKIT_EXTERN void NSDrawWhiteBezel(NSRect rect, NSRect clipRect);
 | 
			
		||||
APPKIT_EXTERN void NSDrawButton(NSRect rect, NSRect clipRect);
 | 
			
		||||
APPKIT_EXTERN void NSEraseRect(NSRect rect);
 | 
			
		||||
APPKIT_EXTERN NSColor * _Nullable NSReadPixel(NSPoint passedPoint) API_DEPRECATED("Use -[NSBitmapImageRep colorAtX:y:] to interrogate pixel values.  If necessary, use -[NSView cacheDisplayInRect:toBitmapImageRep:] to snapshot a view hierarchy into an NSBitmapImageRep.", macos(10.0,10.14));
 | 
			
		||||
APPKIT_EXTERN void NSDrawBitmap(NSRect rect, NSInteger width, NSInteger height, NSInteger bps, NSInteger spp, NSInteger bpp, NSInteger bpr, BOOL isPlanar, BOOL hasAlpha, NSColorSpaceName colorSpaceName, const unsigned char *const _Nullable data[_Nonnull 5]);
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN void NSHighlightRect(NSRect rect) API_DEPRECATED("", macos(10.0,10.0));
 | 
			
		||||
APPKIT_EXTERN void NSBeep(void);
 | 
			
		||||
 | 
			
		||||
/* gets performance stats about window server memory usage */
 | 
			
		||||
APPKIT_EXTERN NSInteger NSGetWindowServerMemory(NSInteger context, NSInteger *virtualMemory, NSInteger *windowBackingMemory, NSString * _Nonnull * _Nonnull windowDumpString) API_DEPRECATED("Doesn't return anything useful since 10.0", macos(10.0,10.14));
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSRect NSDrawColorTiledRects(NSRect boundsRect, NSRect clipRect, const NSRectEdge *sides, NSColor * _Nonnull * _Nonnull colors, NSInteger count);
 | 
			
		||||
APPKIT_EXTERN void NSDrawDarkBezel(NSRect rect, NSRect clipRect);
 | 
			
		||||
APPKIT_EXTERN void NSDrawLightBezel(NSRect rect, NSRect clipRect);
 | 
			
		||||
APPKIT_EXTERN void NSDottedFrameRect(NSRect rect);
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN void NSDrawWindowBackground(NSRect rect);
 | 
			
		||||
APPKIT_EXTERN void NSSetFocusRingStyle(NSFocusRingPlacement placement);
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN void NSDisableScreenUpdates(void) API_DEPRECATED("As of 10.11 it is not generally necessary to take explicit action to achieve visual atomicity. +[NSAnimationContext runAnimationGroup:] and other similar methods can be used when a stronger than normal need for visual atomicity is required. The NSAnimationContext methods do not suffer from the same performance problems as NSDisableScreenUpdates.", macos(10.0,10.11));
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN void NSEnableScreenUpdates(void) API_DEPRECATED("As of 10.11 it is not generally necessary to take explicit action to achieve visual atomicity. +[NSAnimationContext runAnimationGroup:] and other similar methods can be used when a stronger than normal need for visual atomicity is required. The NSAnimationContext methods do not suffer from the same performance problems as NSEnableScreenUpdates.", macos(10.0,10.11));
 | 
			
		||||
 | 
			
		||||
/* Runs one of the standard system animation effects (display and sound).
 | 
			
		||||
** 'centerLocation' represents the center, in screen coordinates, to show the effect.
 | 
			
		||||
** 'size' specifies how big the effect should be.  Use NSZeroSize to get the default size.
 | 
			
		||||
** 'animationDelegate' is optionally, an object that wants to know when the effect has completed.
 | 
			
		||||
** 'didEndSelector' will be invoked in the animationDelegate when the animation has completed.
 | 
			
		||||
**  
 | 
			
		||||
** The didEndSelector should have the following signature:
 | 
			
		||||
** 	- (void)animationEffectDidEnd:(void *)contextInfo;
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSAnimationEffect) {
 | 
			
		||||
	// The default effect used to indicate removal of an item from a collection, 
 | 
			
		||||
	// such as toolbar (indicates removal, without destroying the underlying data).
 | 
			
		||||
	NSAnimationEffectDisappearingItemDefault = 0,
 | 
			
		||||
 | 
			
		||||
	// An effect showing a puff of smoke.
 | 
			
		||||
	NSAnimationEffectPoof = 10
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN void NSShowAnimationEffect(NSAnimationEffect animationEffect, NSPoint centerLocation, NSSize size, _Nullable id animationDelegate, _Nullable SEL didEndSelector, void * _Nullable contextInfo);
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN void NSCountWindows(NSInteger *count) API_DEPRECATED("Use +[NSWindow windowNumbersWithOptions:] instead", macos(10.0,10.6));
 | 
			
		||||
APPKIT_EXTERN void NSWindowList(NSInteger size, NSInteger list[_Nonnull]) API_DEPRECATED("Use +[NSWindow windowNumbersWithOptions:] instead", macos(10.0,10.6));
 | 
			
		||||
APPKIT_EXTERN void NSCountWindowsForContext(NSInteger context, NSInteger *count) API_DEPRECATED("Use +[NSWindow windowNumbersWithOptions:] instead", macos(10.0,10.6));
 | 
			
		||||
APPKIT_EXTERN void NSWindowListForContext(NSInteger context, NSInteger size, NSInteger list[_Nonnull]) API_DEPRECATED("Use +[NSWindow windowNumbersWithOptions:] instead", macos(10.0,10.6));
 | 
			
		||||
APPKIT_EXTERN void NSCopyBits(NSInteger srcGState, NSRect srcRect, NSPoint destPoint) API_DEPRECATED("", macos(10.0,10.10));
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,115 @@
 | 
			
		||||
/*
 | 
			
		||||
        NSGraphicsContext.h
 | 
			
		||||
        Application Kit
 | 
			
		||||
        Copyright (c) 1997-2021, Apple Inc.
 | 
			
		||||
        All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <AppKit/NSGraphics.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <CoreGraphics/CGContext.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSString;
 | 
			
		||||
@class NSWindow;
 | 
			
		||||
@class NSBitmapImageRep;
 | 
			
		||||
 | 
			
		||||
/* Attributes that can be passed to graphicsContextWithAttributes: method */
 | 
			
		||||
typedef NSString * NSGraphicsContextAttributeKey NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSGraphicsContextAttributeKey NSGraphicsContextDestinationAttributeName; // Can be an instance of NSWindow, NSMutableData, NSBitmapImageRep, or NSURL.
 | 
			
		||||
APPKIT_EXTERN NSGraphicsContextAttributeKey NSGraphicsContextRepresentationFormatAttributeName; // Specifies destination file format. Used only for NSMutableData or NSURL destinations
 | 
			
		||||
 | 
			
		||||
// Supported file format
 | 
			
		||||
typedef NSString * NSGraphicsContextRepresentationFormatName NS_TYPED_ENUM;
 | 
			
		||||
APPKIT_EXTERN NSGraphicsContextRepresentationFormatName NSGraphicsContextPSFormat;
 | 
			
		||||
APPKIT_EXTERN NSGraphicsContextRepresentationFormatName NSGraphicsContextPDFFormat;
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSImageInterpolation) {
 | 
			
		||||
   NSImageInterpolationDefault = 0,
 | 
			
		||||
   NSImageInterpolationNone = 1,
 | 
			
		||||
   NSImageInterpolationLow = 2, /* Low quality, fast interpolation. */
 | 
			
		||||
   NSImageInterpolationMedium API_AVAILABLE(macos(10.6)) = 4, /* Medium quality, slower than NSImageInterpolationLow. */
 | 
			
		||||
   NSImageInterpolationHigh = 3 /* Highest quality, slower than NSImageInterpolationMedium. */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@interface NSGraphicsContext : NSObject
 | 
			
		||||
 | 
			
		||||
// Instantiates from an appropriate concrete subclass depending on NSGraphicsContextDestinationAttributeName attribute
 | 
			
		||||
+ (nullable NSGraphicsContext *)graphicsContextWithAttributes:(NSDictionary<NSGraphicsContextAttributeKey, id> *)attributes;
 | 
			
		||||
 | 
			
		||||
// Convenience cover method for [NSGraphicsContext graphicsContextWithAttributes:[NSDictionary dictionaryWithObject:<NSWindow instance> forKey:NSGraphicsContextDestinationAttributeName]]
 | 
			
		||||
+ (NSGraphicsContext *)graphicsContextWithWindow:(NSWindow *)window;
 | 
			
		||||
 | 
			
		||||
/* Convenience cover method for [NSGraphicsContext graphicsContextWithAttributes:[NSDictionary dictionaryWithObject:<NSBitmapImageRep instance> forKey:NSGraphicsContextDestinationAttributeName]]. Only NSBitmapImageRep instances with isPlanar == NO are supported.
 | 
			
		||||
*/
 | 
			
		||||
+ (nullable NSGraphicsContext *)graphicsContextWithBitmapImageRep:(NSBitmapImageRep *)bitmapRep;
 | 
			
		||||
 | 
			
		||||
/* Instantiates from a CGContextRef.  initialFlippedState is used to determine the return value from -isFlipped when no view is focused in the context.
 | 
			
		||||
*/
 | 
			
		||||
+ (NSGraphicsContext *)graphicsContextWithCGContext:(CGContextRef)graphicsPort flipped:(BOOL)initialFlippedState API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
// Setting and identifying the current context in the thread
 | 
			
		||||
@property (class, nullable, strong) NSGraphicsContext *currentContext;
 | 
			
		||||
 | 
			
		||||
// Convenience cover method for [[NSGraphicsContext currentContext] isDrawingToScreen]
 | 
			
		||||
+ (BOOL)currentContextDrawingToScreen;
 | 
			
		||||
 | 
			
		||||
// Calls -saveGraphicsState on the current context, and pushes it on the per-thread stack.
 | 
			
		||||
+ (void)saveGraphicsState;
 | 
			
		||||
 | 
			
		||||
// Pops a context from the per-thread stack, makes it current, and calls -restoreGraphicsState on it.
 | 
			
		||||
+ (void)restoreGraphicsState;
 | 
			
		||||
 | 
			
		||||
// Returns attributes used to create this instance
 | 
			
		||||
@property (nullable, readonly, copy) NSDictionary<NSGraphicsContextAttributeKey, id> *attributes;
 | 
			
		||||
 | 
			
		||||
// Testing the drawing destination
 | 
			
		||||
@property (getter=isDrawingToScreen, readonly) BOOL drawingToScreen;
 | 
			
		||||
 | 
			
		||||
// Controlling the context
 | 
			
		||||
- (void)saveGraphicsState;
 | 
			
		||||
- (void)restoreGraphicsState;
 | 
			
		||||
 | 
			
		||||
- (void)flushGraphics;
 | 
			
		||||
 | 
			
		||||
@property (readonly) CGContextRef CGContext NS_RETURNS_INNER_POINTER API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
/* Returns the flip state of the receiver.  The state is determined by messaging -isFlipped to the focus view in the context.  If no view has focus, returns NO unless the receiver is instantiated via graphicsContextWithGraphicsPort:drawingToScreen:flipped: with initialFlippedState == YES.
 | 
			
		||||
*/
 | 
			
		||||
@property (getter=isFlipped, readonly) BOOL flipped;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSGraphicsContext(NSGraphicsContext_RenderingOptions)
 | 
			
		||||
 | 
			
		||||
@property BOOL shouldAntialias;
 | 
			
		||||
@property NSImageInterpolation imageInterpolation;
 | 
			
		||||
 | 
			
		||||
@property NSPoint patternPhase;
 | 
			
		||||
@property NSCompositingOperation compositingOperation;
 | 
			
		||||
@property NSColorRenderingIntent colorRenderingIntent API_AVAILABLE(macos(10.5));
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@class CIContext;
 | 
			
		||||
@interface NSGraphicsContext (NSQuartzCoreAdditions)
 | 
			
		||||
@property (nullable, readonly, strong) CIContext *CIContext;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSGraphicsContext (NSGraphicsContextDeprecated)
 | 
			
		||||
 | 
			
		||||
+ (void)setGraphicsState:(NSInteger)gState API_DEPRECATED("This method has no effect", macos(10.0,10.10));
 | 
			
		||||
 | 
			
		||||
- (null_unspecified id)focusStack API_DEPRECATED("", macos(10.0,10.6));
 | 
			
		||||
- (void)setFocusStack:(null_unspecified id)stack API_DEPRECATED("", macos(10.0,10.6));
 | 
			
		||||
 | 
			
		||||
+ (NSGraphicsContext *)graphicsContextWithGraphicsPort:(void *)graphicsPort flipped:(BOOL)initialFlippedState API_DEPRECATED_WITH_REPLACEMENT("graphicsContextWithCGContext:flipped:", macos(10.0,10.14));
 | 
			
		||||
@property (readonly) void *graphicsPort NS_RETURNS_INNER_POINTER API_DEPRECATED_WITH_REPLACEMENT("CGContext", macos(10.0,10.14));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,168 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSGridView.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 2015-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSView.h>
 | 
			
		||||
#import <AppKit/NSLayoutAnchor.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSLayoutConstraint, NSGridCell, NSGridColumn, NSGridRow;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSGridCellPlacement) {
 | 
			
		||||
    NSGridCellPlacementInherited = 0,
 | 
			
		||||
    NSGridCellPlacementNone,
 | 
			
		||||
    NSGridCellPlacementLeading,
 | 
			
		||||
    NSGridCellPlacementTop = NSGridCellPlacementLeading,
 | 
			
		||||
    
 | 
			
		||||
    NSGridCellPlacementTrailing,
 | 
			
		||||
    NSGridCellPlacementBottom = NSGridCellPlacementTrailing,
 | 
			
		||||
    
 | 
			
		||||
    NSGridCellPlacementCenter,
 | 
			
		||||
    NSGridCellPlacementFill
 | 
			
		||||
    
 | 
			
		||||
} API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSGridRowAlignment) {
 | 
			
		||||
    NSGridRowAlignmentInherited = 0,
 | 
			
		||||
    NSGridRowAlignmentNone,
 | 
			
		||||
    NSGridRowAlignmentFirstBaseline,
 | 
			
		||||
    NSGridRowAlignmentLastBaseline
 | 
			
		||||
} API_AVAILABLE(macos(10.12));
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN const CGFloat NSGridViewSizeForContent API_AVAILABLE(macos(10.12)); // Default value for row & column size, indicating it should automatically fit the content views.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 NSGridView is a layout container for aligning views in spreadsheet-like rows & columns, indexed from the top left starting at 0.  Rows and columns are sized to fit their largest content (unless an explicit size has been set), but all cells in a given column will be the same width and all cells in a row will be the same height.
 | 
			
		||||
 | 
			
		||||
 NSGridPlacement is used to specify the positioning of the contentView within the cell.  The content placement can be configured separately for the X & Y axes to align the content with either edge or to center it.  Placement properties on rows, columns, and cells default to 'inherited' so that the grid-level properties will effect all cells.  Content placement can be overridden for individual rows, columns, or cells by simply changing the appropriate property to a value other than 'inherited'.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.12))
 | 
			
		||||
@interface NSGridView : NSView
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithFrame:(NSRect)frameRect NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
+ (instancetype)gridViewWithNumberOfColumns:(NSInteger)columnCount rows:(NSInteger)rowCount; // Convenience initializer for gridview with specific dimensions.
 | 
			
		||||
+ (instancetype)gridViewWithViews:(NSArray<NSArray<NSView *> *> *)rows; // Convenience initializer for an autoreleased GridView large enough to hold the provided rows. Each element in 'rows' is an array of views for that row.
 | 
			
		||||
 | 
			
		||||
@property (readonly) NSInteger numberOfRows;
 | 
			
		||||
@property (readonly) NSInteger numberOfColumns;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Cells are arranged in rows and columns, which allow for configuration of content alignment on a row/column basis.
 | 
			
		||||
- (NSGridRow *)rowAtIndex:(NSInteger)index;
 | 
			
		||||
- (NSInteger)indexOfRow:(NSGridRow *)row; // Finds the index of the given row.  O(numberOfRows) time.
 | 
			
		||||
- (NSGridColumn *)columnAtIndex:(NSInteger)index;
 | 
			
		||||
- (NSInteger)indexOfColumn:(NSGridColumn *)column; // Finds the index of the given column.  O(numberOfColumns) time.
 | 
			
		||||
- (NSGridCell*)cellAtColumnIndex:(NSInteger)columnIndex rowIndex:(NSInteger)rowIndex;
 | 
			
		||||
- (nullable NSGridCell *)cellForView:(NSView*)view; // returns the cell from the receiver that contains the given view or one of its ancestors.
 | 
			
		||||
 | 
			
		||||
// Rows & columns can be inserted & removed dynamically.  The grid will be enlarged to hold the specified views, if needed.
 | 
			
		||||
- (NSGridRow *)addRowWithViews:(NSArray<NSView *> *)views;
 | 
			
		||||
- (NSGridRow *)insertRowAtIndex:(NSInteger)index withViews:(NSArray<NSView *> *)views;
 | 
			
		||||
- (void)moveRowAtIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex;
 | 
			
		||||
- (void)removeRowAtIndex:(NSInteger)index;
 | 
			
		||||
 | 
			
		||||
- (NSGridColumn *)addColumnWithViews:(NSArray<NSView *> *)views;
 | 
			
		||||
- (NSGridColumn *)insertColumnAtIndex:(NSInteger)index withViews:(NSArray<NSView *> *)views;
 | 
			
		||||
- (void)moveColumnAtIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex;
 | 
			
		||||
- (void)removeColumnAtIndex:(NSInteger)index;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Grid-level layout properties will be used by cells that don't have the properties defined themselves or at the column/row level.  They default to bottom-leading placement, with no alignment.
 | 
			
		||||
@property NSGridCellPlacement xPlacement;
 | 
			
		||||
@property NSGridCellPlacement yPlacement;
 | 
			
		||||
@property NSGridRowAlignment rowAlignment;
 | 
			
		||||
 | 
			
		||||
// Grid-level property values for row & column spacing are added to the padding properties on rows & columns.  Defaults to 6pt.
 | 
			
		||||
@property CGFloat rowSpacing;
 | 
			
		||||
@property CGFloat columnSpacing;
 | 
			
		||||
 | 
			
		||||
// Expands the cell at the top-leading corner of the given range to cover the entire area.  Other cells in the range become invalid: they will no longer maintain any layout, constraints, or content views.  Cell merging has no effect on the base cell coordinate system of the gridview, and cell references within a merged region will all refer to the single merged cell.  This is intended to be used to configure the grid geometry before installing views, but in the event that the cells being merged contain contentViews, only the top-leading will be kept.
 | 
			
		||||
- (void)mergeCellsInHorizontalRange:(NSRange)hRange verticalRange:(NSRange)vRange;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// NSGridRow represents a row of cells in the grid view, and allows content placement to be specified on a per-row basis.
 | 
			
		||||
API_AVAILABLE(macos(10.12)) NS_SWIFT_UI_ACTOR
 | 
			
		||||
@interface NSGridRow : NSObject <NSCoding>
 | 
			
		||||
 | 
			
		||||
@property (readonly,weak) NSGridView *gridView;
 | 
			
		||||
@property (readonly) NSInteger numberOfCells;
 | 
			
		||||
- (NSGridCell *)cellAtIndex:(NSInteger)index;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Row level placement properties will be used by cells whose Y-axis properties are set to 'inherited'.  These also default to 'inherited', falling back to the GridView level properties.
 | 
			
		||||
@property NSGridCellPlacement yPlacement;
 | 
			
		||||
@property NSGridRowAlignment rowAlignment;
 | 
			
		||||
@property CGFloat height; // Height of this row, or NSGridViewSizeForContent (the default) to fit content automatically.
 | 
			
		||||
@property CGFloat topPadding; // Padding is extra space between this row and an adjacent one.  Defaults to 0. Total inter-row-space is firstRow.bottomPadding + grid.rowSpacing + secondRow.topPadding
 | 
			
		||||
@property CGFloat bottomPadding;
 | 
			
		||||
 | 
			
		||||
@property (getter=isHidden) BOOL hidden; // Hidden rows/columns will collapse to 0 size and hide all their contentViews.
 | 
			
		||||
- (void)mergeCellsInRange:(NSRange)range;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// NSGridColumn represents a column of cells in the grid view, and allows content placement to be specified on a per-column basis.
 | 
			
		||||
API_AVAILABLE(macos(10.12)) NS_SWIFT_UI_ACTOR
 | 
			
		||||
@interface NSGridColumn : NSObject <NSCoding>
 | 
			
		||||
 | 
			
		||||
@property (readonly,weak) NSGridView *gridView;
 | 
			
		||||
@property (readonly) NSInteger numberOfCells;
 | 
			
		||||
- (NSGridCell *)cellAtIndex:(NSInteger)index;
 | 
			
		||||
 | 
			
		||||
// Column level placement will be used by cells whose xPlacement is set to 'inherited'.  This also defaults to 'inherited', falling back to the NSGridView property.
 | 
			
		||||
@property NSGridCellPlacement xPlacement;
 | 
			
		||||
@property CGFloat width; // Width of this column, or NSGridViewSizeForContent (the default) to fit content automatically.
 | 
			
		||||
@property CGFloat leadingPadding; // Padding is extra space between this column and an adjacent one.  Defaults to 0.  Total inter-column-space is firstColumn.trailingPadding + grid.columnSpacing + secondColumn.leadingPadding
 | 
			
		||||
@property CGFloat trailingPadding;
 | 
			
		||||
 | 
			
		||||
@property (getter=isHidden) BOOL hidden; // Hidden rows/columns will collapse to 0 size and hide all their contentViews.
 | 
			
		||||
- (void)mergeCellsInRange:(NSRange)range;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// NSGridCell represents a single cell in the grid.  The cell will maintain the necessary constraints for positioning out whichever contentView is set.
 | 
			
		||||
API_AVAILABLE(macos(10.12)) NS_SWIFT_UI_ACTOR
 | 
			
		||||
@interface NSGridCell : NSObject <NSCoding>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@property (strong,nullable) __kindof NSView *contentView; // The view whose placement will be managed by this cell.
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, strong) NSView *emptyContentView; // This view is used as a marker in NSGridView's "...WithViews:" methods to indicate a cell whose contentView should be nil.
 | 
			
		||||
 | 
			
		||||
@property (readonly,weak) NSGridRow *row;
 | 
			
		||||
@property (readonly,weak) NSGridColumn *column;
 | 
			
		||||
 | 
			
		||||
// These properties control how the content view is placed in the cell.  Placement is configured independently for each axis.  Baseline alignment within a row is handled separately.  Properties set to the default value of 'inherited' will "fall back" to properties defined on the row/column, or to the GridView itself if needed.  Properties set to 'none' will cause the corresponding aspect of content layout to be left unmanaged by the grid view.  Handling of baseline alignment is special: all cells within a row that specify a rowAlignment (i.e., not "None") are considered to be 'aligned'.  The contentViews of such cells will be aligned by the specified baseline for each cell.  This creates the potential for unsatisfiable constraints in combination with the yPlacement properties on the aligned views.  Therefore, the entire baseline-aligned group is placed using the yPlacement of the first cell with a value other than NSGridCellPlaceNone.  The yPlacement properties of the remaining cells are overridden by their rowAlignment.
 | 
			
		||||
 | 
			
		||||
@property NSGridCellPlacement xPlacement;
 | 
			
		||||
@property NSGridCellPlacement yPlacement;
 | 
			
		||||
@property NSGridRowAlignment rowAlignment;
 | 
			
		||||
 | 
			
		||||
// Set these constraints to provide custom placement for the cell's content view.  NSGridView will activate the constraints when the cell is visible, and deactivate them when it is hidden.  Note that it is usually also necessary to set the xPlacement and/or yPlacement to 'Custom' in order to prevent NSGridView from adding its own placement constraints in one or both axes (which is likely to cause unsatisfiable constraints in combination with the custom ones).
 | 
			
		||||
@property (copy) NSArray<NSLayoutConstraint *> *customPlacementConstraints;
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,83 @@
 | 
			
		||||
/*
 | 
			
		||||
 NSGroupTouchBarItem.h
 | 
			
		||||
 Application Kit
 | 
			
		||||
 Copyright (c) 2015-2021, Apple Inc.
 | 
			
		||||
 All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <AppKit/NSTouchBarItem.h>
 | 
			
		||||
#import <AppKit/NSUserInterfaceLayout.h>
 | 
			
		||||
#import <AppKit/NSUserInterfaceCompression.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.12.2), ios(13.0))
 | 
			
		||||
@interface NSGroupTouchBarItem : NSTouchBarItem
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    Returns an autoreleased NSGroupTouchBarItem whose groupTouchBar is built from the given items array.
 | 
			
		||||
    Customization is not enabled by default when creating an NSGroupTouchBarItem this way.
 | 
			
		||||
*/
 | 
			
		||||
+ (instancetype)groupItemWithIdentifier:(NSTouchBarItemIdentifier)identifier items:(NSArray<NSTouchBarItem *> *)items;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    Creates a NSGroupTouchBarItem with the allowed compression options provided in the order AppKit defines.
 | 
			
		||||
    Default order: BreakEqualWidths, ReduceMetrics, HideText, HideImages.
 | 
			
		||||
    This should only be used with standard options provided by AppKit. Custom options need to be added using the prioritizedCompressionOptions property.
 | 
			
		||||
 */
 | 
			
		||||
+ (instancetype)groupItemWithIdentifier:(NSTouchBarItemIdentifier)identifier items:(NSArray<NSTouchBarItem *> *)items allowedCompressionOptions:(NSUserInterfaceCompressionOptions *)allowedCompressionOptions API_AVAILABLE(macos(10.13)) API_UNAVAILABLE(ios);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    Creates a NSGroupTouchBarItem with the appropriate settings to match system style alerts in NSTouchBar.
 | 
			
		||||
    Spacing between items is under control of the client, but in general NSTouchBarItemIdentifierFixedSpaceLarge is recommended anywhere additional spacing is required.
 | 
			
		||||
    The groupUserInterfaceLayoutDirection will be set to [NSApp userInterfaceLayoutDirection].
 | 
			
		||||
 */
 | 
			
		||||
+ (instancetype)alertStyleGroupItemWithIdentifier:(NSTouchBarItemIdentifier)identifier API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    An NSTouchBar, presented seamlessly as part of the NSTouchBar this item is hosted in.
 | 
			
		||||
    The NSTouchBar may have its own principal item, and can be customized (or not) per the normal customization rules.
 | 
			
		||||
    By default this is an empty bar that cannot be customized. This property is archived.
 | 
			
		||||
*/
 | 
			
		||||
@property (strong) NSTouchBar *groupTouchBar;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    The localized string labelling this item during user customization. The default value is the empty string. This property is archived.
 | 
			
		||||
*/
 | 
			
		||||
@property (readwrite, copy, null_resettable) NSString *customizationLabel;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    Get and set the user interface layout direction of the groupTouchBar, which defines the order in which the items should be laid out.
 | 
			
		||||
    By default, this value is NSUserInterfaceLayoutDirectionLeftToRight.
 | 
			
		||||
    To flip the layout direction of the group to the user’s preferred layout, this should be set to [NSApp userInterfaceLayoutDirection].
 | 
			
		||||
 */
 | 
			
		||||
@property NSUserInterfaceLayoutDirection groupUserInterfaceLayoutDirection API_AVAILABLE(macos(10.13)) API_UNAVAILABLE(ios);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    When set, items in the associated groupTouchBar will be sized to have equal widths when possible.
 | 
			
		||||
    Defaults to NO.
 | 
			
		||||
 */
 | 
			
		||||
@property BOOL prefersEqualWidths API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    The preferred width for items in the group when prefersEqualWidths is YES. This is the width that items will be set to if they fit, and the item doesn't clip.
 | 
			
		||||
    Optional; ignored if <0. Defaults to -1.
 | 
			
		||||
 */
 | 
			
		||||
@property CGFloat preferredItemWidth API_AVAILABLE(macos(10.13));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    The currently active NSUserInterfaceCompressionOptions on the group.
 | 
			
		||||
 */
 | 
			
		||||
@property (readonly) NSUserInterfaceCompressionOptions *effectiveCompressionOptions API_AVAILABLE(macos(10.13)) API_UNAVAILABLE(ios);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
    The allowed compression options in the order they will be exercised.
 | 
			
		||||
    Client defined options should be added to specify the order in which they will be exercised.
 | 
			
		||||
    Options not included will be ignored.
 | 
			
		||||
    Defaults to an array containing all standard AppKit options in the order AppKit defines.
 | 
			
		||||
 */
 | 
			
		||||
@property (copy) NSArray<NSUserInterfaceCompressionOptions *> *prioritizedCompressionOptions API_AVAILABLE(macos(10.13)) API_UNAVAILABLE(ios);
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,42 @@
 | 
			
		||||
/*
 | 
			
		||||
   NSHapticFeedback.h
 | 
			
		||||
   Application Kit
 | 
			
		||||
   Copyright (c) 2015-2021, Apple Inc.
 | 
			
		||||
   All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObjCRuntime.h>
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSHapticFeedbackPattern) {
 | 
			
		||||
    NSHapticFeedbackPatternGeneric = 0, // when none of the other options apply
 | 
			
		||||
    NSHapticFeedbackPatternAlignment,  // Alignment of any type: guides, best fit, etc...
 | 
			
		||||
    NSHapticFeedbackPatternLevelChange // Changes in discrete pressure zones. Used by NSMultiLevelAcceleratorButtons.
 | 
			
		||||
} API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSHapticFeedbackPerformanceTime) {
 | 
			
		||||
    NSHapticFeedbackPerformanceTimeDefault = 0,     // Currently, NSHapticFeedbackPerformanceTimeDrawCompleted
 | 
			
		||||
    NSHapticFeedbackPerformanceTimeNow,             // Perform immediately. Do not synchronize
 | 
			
		||||
    NSHapticFeedbackPerformanceTimeDrawCompleted,   // Synchronize when the next cocoa screen drawing and layer rendering pass complete
 | 
			
		||||
} API_AVAILABLE(macos(10.11));
 | 
			
		||||
 | 
			
		||||
@protocol NSHapticFeedbackPerformer <NSObject>
 | 
			
		||||
@required
 | 
			
		||||
/* Provide user feedback synchronized with a drawing style. Always use the feedback pattern that describes the user action. In most cases, haptic feedback should occur with something on screen such as the appearance of an alignment guide. The haptic feedback performer waits until the performanceTime to ensure that the user simultaneously experiences both. Note: The system reserves the right to suppress this request. For example, Force Touch trackpads will not perform the feedback if the user isn't currently touching the trackpad.
 | 
			
		||||
 */
 | 
			
		||||
- (void)performFeedbackPattern:(NSHapticFeedbackPattern)pattern performanceTime:(NSHapticFeedbackPerformanceTime)performanceTime;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(10.11))
 | 
			
		||||
@interface NSHapticFeedbackManager : NSObject
 | 
			
		||||
/* The most appropriate feedback performer for the current input device, accessibility settings and user preferences. Note: This device may change during the life of your application. Always request the defaultPerformer when you need perform feedback.
 | 
			
		||||
 */
 | 
			
		||||
@property (class, readonly, strong) id<NSHapticFeedbackPerformer> defaultPerformer;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,71 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSHelpManager.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1995-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSMapTable.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <Foundation/NSBundle.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <AppKit/NSApplication.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSAttributedString, NSWindow;
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSHelpBookName NS_SWIFT_BRIDGED_TYPEDEF;
 | 
			
		||||
typedef NSString * NSHelpAnchorName NS_SWIFT_BRIDGED_TYPEDEF;
 | 
			
		||||
typedef NSString * NSHelpManagerContextHelpKey NS_SWIFT_BRIDGED_TYPEDEF;
 | 
			
		||||
 | 
			
		||||
NS_SWIFT_UI_ACTOR
 | 
			
		||||
@interface NSHelpManager : NSObject
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, strong) NSHelpManager *sharedHelpManager;
 | 
			
		||||
@property (class, getter=isContextHelpModeActive) BOOL contextHelpModeActive;
 | 
			
		||||
 | 
			
		||||
- (void)setContextHelp:(NSAttributedString *)attrString forObject:(id)object;
 | 
			
		||||
- (void)removeContextHelpForObject:(id)object;
 | 
			
		||||
- (nullable NSAttributedString *)contextHelpForObject:(id)object;
 | 
			
		||||
 | 
			
		||||
- (BOOL)showContextHelpForObject:(id)object locationHint:(NSPoint)pt;
 | 
			
		||||
 | 
			
		||||
- (void)openHelpAnchor:(NSHelpAnchorName)anchor inBook:(nullable NSHelpBookName)book;
 | 
			
		||||
- (void)findString:(NSString *)query inBook:(nullable NSHelpBookName)book;
 | 
			
		||||
 | 
			
		||||
/* Register one or more help books in the given bundle.  The main bundle is automatically registered by -openHelpAnchor:inBook: and -findString:inBook:.  You can use -registerBooksInBundle: to register help books in a plugin bundle, for example.  The Info.plist in the bundle should contain a help book directory path, which specifies one or more folders containing help books.  Returns NO if the bundle doesn't contain any help books or if registration fails.  Returns YES on successful registration. */
 | 
			
		||||
- (BOOL)registerBooksInBundle:(NSBundle *)bundle API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// Notifications for the activation/deactivation of the context help mode
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSContextHelpModeDidActivateNotification;
 | 
			
		||||
APPKIT_EXTERN NSNotificationName NSContextHelpModeDidDeactivateNotification;
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
//  Conveniences for accessing Help.plist
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
@interface NSBundle(NSBundleHelpExtension)
 | 
			
		||||
- (nullable NSAttributedString *)contextHelpForKey:(NSHelpManagerContextHelpKey)key;	/* return nil if not found */
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
//  Convenience methods on NSApplication
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
@interface NSApplication(NSApplicationHelpExtension)
 | 
			
		||||
- (void)activateContextHelpMode:(nullable id)sender;
 | 
			
		||||
  // Target method cover for [NSHelpManager setContextHelpModeActive:YES];
 | 
			
		||||
- (void)showHelp:(nullable id)sender;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@@ -0,0 +1,561 @@
 | 
			
		||||
/*
 | 
			
		||||
	NSImage.h
 | 
			
		||||
	Application Kit
 | 
			
		||||
	Copyright (c) 1994-2021, Apple Inc.
 | 
			
		||||
	All rights reserved.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#import <Foundation/NSObject.h>
 | 
			
		||||
#import <Foundation/NSArray.h>
 | 
			
		||||
#import <Foundation/NSDictionary.h>
 | 
			
		||||
#import <Foundation/NSGeometry.h>
 | 
			
		||||
#import <Foundation/NSBundle.h>
 | 
			
		||||
#import <AppKit/NSGraphics.h>
 | 
			
		||||
#import <AppKit/NSBitmapImageRep.h>
 | 
			
		||||
#import <AppKit/NSPasteboard.h>
 | 
			
		||||
#import <AppKit/NSLayoutConstraint.h>
 | 
			
		||||
#import <AppKit/NSFontDescriptor.h>
 | 
			
		||||
#import <AppKit/AppKitDefines.h>
 | 
			
		||||
#import <ApplicationServices/ApplicationServices.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define NSIMAGE_UNAVAILABLE_MACCATALYST TARGET_OS_IPHONE
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
 | 
			
		||||
 | 
			
		||||
@class NSColor, NSImageRep, NSGraphicsContext, NSURL, NSImageSymbolConfiguration;
 | 
			
		||||
@protocol NSImageDelegate;
 | 
			
		||||
 | 
			
		||||
typedef NSString * NSImageName NS_SWIFT_BRIDGED_TYPEDEF API_AVAILABLE(ios(13.0));
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSImageHintKey const NSImageHintCTM API_AVAILABLE(macos(10.6)); // value is NSAffineTransform
 | 
			
		||||
APPKIT_EXTERN NSImageHintKey const NSImageHintInterpolation API_AVAILABLE(macos(10.6)); // value is NSNumber with NSImageInterpolation enum value
 | 
			
		||||
APPKIT_EXTERN NSImageHintKey const NSImageHintUserInterfaceLayoutDirection API_AVAILABLE(macos(10.12)); // value is NSNumber with NSUserInterfaceLayoutDirection enum value
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSImageLoadStatus) {
 | 
			
		||||
    NSImageLoadStatusCompleted,
 | 
			
		||||
    NSImageLoadStatusCancelled,
 | 
			
		||||
    NSImageLoadStatusInvalidData,
 | 
			
		||||
    NSImageLoadStatusUnexpectedEOF,
 | 
			
		||||
    NSImageLoadStatusReadError
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSUInteger, NSImageCacheMode) {
 | 
			
		||||
    NSImageCacheDefault,    // unspecified. use image rep's default
 | 
			
		||||
    NSImageCacheAlways,     // always generate a cache when drawing
 | 
			
		||||
    NSImageCacheBySize,     // cache if cache size is smaller than original data
 | 
			
		||||
    NSImageCacheNever       // never cache, always draw direct
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSImageResizingMode) {
 | 
			
		||||
#if !TARGET_ABI_USES_IOS_VALUES
 | 
			
		||||
    NSImageResizingModeStretch = 0,
 | 
			
		||||
    NSImageResizingModeTile = 1,
 | 
			
		||||
#else /* !TARGET_ABI_USES_IOS_VALUES */
 | 
			
		||||
    NSImageResizingModeTile = 0,
 | 
			
		||||
    NSImageResizingModeStretch = 1,
 | 
			
		||||
#endif /* !TARGET_ABI_USES_IOS_VALUES */
 | 
			
		||||
} API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(ios(13.0))
 | 
			
		||||
#if NSIMAGE_UNAVAILABLE_MACCATALYST
 | 
			
		||||
__attribute__((objc_subclassing_restricted))
 | 
			
		||||
#endif /* NSIMAGE_UNAVAILABLE_MACCATALYST */
 | 
			
		||||
@interface NSImage : NSObject
 | 
			
		||||
 | 
			
		||||
#if NSIMAGE_UNAVAILABLE_MACCATALYST
 | 
			
		||||
- (instancetype)init API_UNAVAILABLE(ios);
 | 
			
		||||
+ (instancetype)new API_UNAVAILABLE(ios);
 | 
			
		||||
+ (instancetype)allocWithZone:(nullable NSZone *)zone API_UNAVAILABLE(ios);
 | 
			
		||||
+ (instancetype)alloc API_UNAVAILABLE(ios);
 | 
			
		||||
#endif /* NSIMAGE_UNAVAILABLE_MACCATALYST */
 | 
			
		||||
 | 
			
		||||
+ (nullable NSImage *)imageNamed:(NSImageName)name;	/* If this finds & creates the image, only name is saved when archived */
 | 
			
		||||
 | 
			
		||||
+ (nullable instancetype)imageWithSystemSymbolName:(NSString *)symbolName accessibilityDescription:(nullable NSString *)description API_AVAILABLE(macos(11.0));
 | 
			
		||||
 | 
			
		||||
- (instancetype)initWithSize:(NSSize)size NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
- (nullable instancetype)initWithData:(NSData *)data;			/* When archived, saves contents */
 | 
			
		||||
- (nullable instancetype)initWithContentsOfFile:(NSString *)fileName;	/* When archived, saves contents */
 | 
			
		||||
- (nullable instancetype)initWithContentsOfURL:(NSURL *)url;               /* When archived, saves contents */
 | 
			
		||||
- (nullable instancetype)initByReferencingFile:(NSString *)fileName;	/* When archived, saves fileName */
 | 
			
		||||
- (instancetype)initByReferencingURL:(NSURL *)url;		/* When archived, saves url, supports progressive loading */
 | 
			
		||||
- (nullable instancetype)initWithPasteboard:(NSPasteboard *)pasteboard;
 | 
			
		||||
 | 
			
		||||
// not for general use, but useful for compatibility with old NSImage behavior.  Ignore exif orientation tags in JPEG and such.  See AppKit release notes.
 | 
			
		||||
- (nullable instancetype)initWithDataIgnoringOrientation:(NSData *)data API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
// Note that the block passed to the below method may be invoked whenever and on whatever thread the image itself is drawn on. Care should be taken to ensure that all state accessed within the drawingHandler block is done so in a thread safe manner.
 | 
			
		||||
+ (instancetype)imageWithSize:(NSSize)size flipped:(BOOL)drawingHandlerShouldBeCalledWithFlippedContext drawingHandler:(BOOL (^)(NSRect dstRect))drawingHandler API_AVAILABLE(macos(10.8));
 | 
			
		||||
 | 
			
		||||
@property NSSize size;
 | 
			
		||||
- (BOOL)setName:(nullable NSImageName)string;
 | 
			
		||||
- (nullable NSImageName)name;
 | 
			
		||||
@property (copy) NSColor *backgroundColor;
 | 
			
		||||
@property BOOL usesEPSOnResolutionMismatch;
 | 
			
		||||
@property BOOL prefersColorMatch;
 | 
			
		||||
@property BOOL matchesOnMultipleResolution;
 | 
			
		||||
@property BOOL matchesOnlyOnBestFittingAxis API_AVAILABLE(macos(10.7)); // Available in MacOSX 10.7.4 // Available in MacOSX 10.7.4
 | 
			
		||||
 | 
			
		||||
- (void)drawAtPoint:(NSPoint)point fromRect:(NSRect)fromRect operation:(NSCompositingOperation)op fraction:(CGFloat)delta;
 | 
			
		||||
- (void)drawInRect:(NSRect)rect fromRect:(NSRect)fromRect operation:(NSCompositingOperation)op fraction:(CGFloat)delta;
 | 
			
		||||
- (void)drawInRect:(NSRect)dstSpacePortionRect fromRect:(NSRect)srcSpacePortionRect operation:(NSCompositingOperation)op fraction:(CGFloat)requestedAlpha respectFlipped:(BOOL)respectContextIsFlipped hints:(nullable NSDictionary<NSImageHintKey, id> *)hints API_AVAILABLE(macos(10.6));
 | 
			
		||||
- (BOOL)drawRepresentation:(NSImageRep *)imageRep inRect:(NSRect)rect;
 | 
			
		||||
 | 
			
		||||
/* This is exactly equivalent to calling -[image drawInRect:rect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1 respectFlipped:YES hints:nil].
 | 
			
		||||
 */
 | 
			
		||||
- (void)drawInRect:(NSRect)rect API_AVAILABLE(macos(10.9));
 | 
			
		||||
 | 
			
		||||
- (void)recache;
 | 
			
		||||
@property (nullable, readonly, strong) NSData *TIFFRepresentation;
 | 
			
		||||
- (nullable NSData *)TIFFRepresentationUsingCompression:(NSTIFFCompression)comp factor:(float)factor;
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSArray<NSImageRep *> *representations;
 | 
			
		||||
- (void)addRepresentations:(NSArray<NSImageRep *> *)imageReps;
 | 
			
		||||
- (void)addRepresentation:(NSImageRep *)imageRep;
 | 
			
		||||
- (void)removeRepresentation:(NSImageRep *)imageRep;
 | 
			
		||||
 | 
			
		||||
@property (getter=isValid, readonly) BOOL valid;
 | 
			
		||||
- (void)lockFocus;
 | 
			
		||||
- (void)lockFocusFlipped:(BOOL)flipped API_AVAILABLE(macos(10.6));
 | 
			
		||||
- (void)unlockFocus;
 | 
			
		||||
 | 
			
		||||
@property (nullable, weak) id<NSImageDelegate> delegate;
 | 
			
		||||
 | 
			
		||||
@property (class, readonly, copy) NSArray<NSString *> *imageTypes API_AVAILABLE(macos(10.5));
 | 
			
		||||
@property (class, readonly, copy) NSArray<NSString *> *imageUnfilteredTypes API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
+ (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard;
 | 
			
		||||
 | 
			
		||||
- (void)cancelIncrementalLoad;
 | 
			
		||||
 | 
			
		||||
@property NSImageCacheMode cacheMode;
 | 
			
		||||
 | 
			
		||||
/* The alignmentRect of an image is metadata that a client may use to help determine layout. The bottom of the rect gives the baseline of the image. The other edges give similar information in other directions.
 | 
			
		||||
 
 | 
			
		||||
 A 20x20 image of a phone icon with a glow might specify an alignmentRect of {{2,2},{16,16}} that excludes the glow. NSButtonCell can take advantage of the alignmentRect to place the image in the same visual location as an 16x16 phone icon without the glow. A 5x5 star that should render high when aligned with text might specify a rect of {{0,-7},{5,12}}.
 | 
			
		||||
 
 | 
			
		||||
 The alignmentRect of an image has no effect on methods such as drawInRect:fromRect:operation:Fraction: or drawAtPoint:fromRect:operation:fraction:. It is the client's responsibility to take the alignmentRect into account where applicable.
 | 
			
		||||
 
 | 
			
		||||
 The default alignmentRect of an image is {{0,0},imageSize}. The rect is adjusted when setSize: is called. 
 | 
			
		||||
 */
 | 
			
		||||
@property NSRect alignmentRect API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* The 'template' property is metadata that allows clients to be smarter about image processing.  An image should be marked as a template if it is basic glpyh-like black and white art that is intended to be processed into derived images for use on screen.
 | 
			
		||||
 
 | 
			
		||||
 NSButtonCell applies effects to images based on the state of the button.  For example, images are shaded darker when the button is pressed.  If a template image is set on a cell, the cell can apply more sophisticated effects.  For example, it may be processed into an image that looks engraved when drawn into a cell whose interiorBackgroundStyle is NSBackgroundStyleRaised, like on a textured button.
 | 
			
		||||
 */
 | 
			
		||||
#if defined(__cplusplus)
 | 
			
		||||
- (BOOL)isTemplate API_AVAILABLE(macos(10.5));
 | 
			
		||||
- (void)setTemplate:(BOOL)isTemplate API_AVAILABLE(macos(10.5));
 | 
			
		||||
#else
 | 
			
		||||
@property (getter=isTemplate) BOOL template API_AVAILABLE(macos(10.5));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* An accessibility description can be set on an image.  This description will be used automatically by interface elements that display images.  Like all accessibility descriptions, the string should be a short localized string that does not include the name of the interface element.  For instance, "delete" rather than "delete button". 
 | 
			
		||||
*/
 | 
			
		||||
@property (nullable, copy) NSString *accessibilityDescription API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Make an NSImage referencing a CGImage.  The client should not assume anything about the image, other than that drawing it is equivalent to drawing the CGImage.
 | 
			
		||||
 
 | 
			
		||||
 If size is NSZeroSize, the pixel dimensions of cgImage are the returned image's size.   
 | 
			
		||||
 
 | 
			
		||||
 This is not a designated initializer.
 | 
			
		||||
 
 | 
			
		||||
 Size of an NSImage is distinct from pixel dimensions.  If an NSImage is placed in an NSButton, it will be drawn in a rect with the provided size in the ambient coordinate system.
 | 
			
		||||
 */
 | 
			
		||||
- (instancetype)initWithCGImage:(CGImageRef)cgImage size:(NSSize)size API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Returns a CGImage capturing the drawing of the receiver.  This method returns an existing CGImage if one is available, or creates one if not.  It behaves the same as drawing the image with respect to caching and related behaviors.  This method is typically called, not overridden.  
 | 
			
		||||
 
 | 
			
		||||
 An NSImage is potentially resolution independent, and may have representations that allow it to draw well in many contexts.  A CGImage is more like a single pixel-based representation.   This method produces a snapshot of how the NSImage would draw if it was asked to draw in *proposedDestRect in the passed context.  Producing this snapshot may be more expensive than just drawing the NSImage, so prefer to use -[NSImage drawInRect:fromRect:operation:fraction:] unless you require a CGImage.
 | 
			
		||||
 
 | 
			
		||||
 The return value in *proposedDestRect tells the client where to draw the CGImage.  This rect may be outset from the requested rect, because a CGImage must have pixel-integral dimensions while an NSImage need not.
 | 
			
		||||
 
 | 
			
		||||
 All input parameters are optional.  They provide hints for how to choose among existing CGImages, or how to create one if there isn't already a CGImage available.  The parameters are _only_ hints.  Any CGImage is a valid return.
 | 
			
		||||
 
 | 
			
		||||
 If proposedDestRect is NULL, it defaults to the smallest pixel-integral rectangle containing {{0,0}, [self size]}.  The proposedDestRect is in user space in the reference context. 
 | 
			
		||||
 
 | 
			
		||||
 If referenceContext is nil, the method behaves as if a window context scaled by the default user space scaling factor was passed, though no context is actually created.  The properties of the context are used as hints for choosing the best representation and for creating a CGImage if creation is necessary.  It also provides the coordinate space in which the proposedDestRect is interpreted.  Only the snapshotted state of the context at the moment its passed to this method is relevant. Future changes to the context have no bearing on image behavior.
 | 
			
		||||
 
 | 
			
		||||
 The hints provide more context for selecting or generating a CGImage, and may override properties of the referenceContext.  Hints may be nil.  Any entries in a device description dictionary (see NSScreen) are valid, as are all CIContext creation options, plus a few extra hints defined below.  Unrecognized hints are ignored, but passed down to image reps (see -[NSImageRep CGImageForProposedRect:context:hints:]).  Explicit hints are particularly useful when it is not draw time and you don't have a context to pass in.  For example, if you want to pass a rect in pixels for proposedDestRect, you should pass a dictionary with the identity transform for NSImageHintCTM.  
 | 
			
		||||
  
 | 
			
		||||
 This method will always return a valid CGImage provided the NSImage is able to draw.  If the receiver is unable to draw for whatever reason, the error behavior is the same as when drawing the image.
 | 
			
		||||
 
 | 
			
		||||
 The CGImageRef returned is guaranteed to live as long as the current autorelease pool.  The caller should not release the CGImage.  This is the standard Cocoa convention, but people may not realize that it applies to CFTypes.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable CGImageRef)CGImageForProposedRect:(nullable NSRect *)proposedDestRect context:(nullable NSGraphicsContext *)referenceContext hints:(nullable NSDictionary<NSImageHintKey, id> *)hints API_AVAILABLE(macos(10.6)) CF_RETURNS_NOT_RETAINED;
 | 
			
		||||
 | 
			
		||||
/* Select best representation.  The parameters have the same meaning and behavior as in -CGImageForProposedRect:context:hints:.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSImageRep *)bestRepresentationForRect:(NSRect)rect context:(nullable NSGraphicsContext *)referenceContext hints:(nullable NSDictionary<NSImageHintKey, id> *)hints API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* Answers the question, "If you were to draw the image in the passed destination rect in the passed context respecting the passed flippedness with the passed hints, would the test rect in the context intersect a non-transparent portion of the image?"
 | 
			
		||||
 */
 | 
			
		||||
- (BOOL)hitTestRect:(NSRect)testRectDestSpace withImageDestinationRect:(NSRect)imageRectDestSpace context:(nullable NSGraphicsContext *)context hints:(nullable NSDictionary<NSImageHintKey, id> *)hints flipped:(BOOL)flipped API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
- (CGFloat)recommendedLayerContentsScale:(CGFloat)preferredContentsScale API_AVAILABLE(macos(10.7));
 | 
			
		||||
- (id)layerContentsForContentsScale:(CGFloat)layerContentsScale API_AVAILABLE(macos(10.7));
 | 
			
		||||
 | 
			
		||||
@property NSEdgeInsets capInsets API_AVAILABLE(macos(10.10));
 | 
			
		||||
@property NSImageResizingMode resizingMode API_AVAILABLE(macos(10.10));
 | 
			
		||||
 | 
			
		||||
- (nullable NSImage *)imageWithSymbolConfiguration:(NSImageSymbolConfiguration *)configuration API_AVAILABLE(macos(11.0));
 | 
			
		||||
 | 
			
		||||
@property (readonly, copy) NSImageSymbolConfiguration *symbolConfiguration API_AVAILABLE(macos(12.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#if !NSIMAGE_UNAVAILABLE_MACCATALYST
 | 
			
		||||
@interface NSImage () <NSCopying, NSSecureCoding, NSPasteboardReading, NSPasteboardWriting>
 | 
			
		||||
@end
 | 
			
		||||
#endif /* !NSIMAGE_UNAVAILABLE_MACCATALYST */
 | 
			
		||||
 | 
			
		||||
@protocol NSImageDelegate <NSObject>
 | 
			
		||||
@optional
 | 
			
		||||
 | 
			
		||||
- (nullable NSImage *)imageDidNotDraw:(NSImage *)sender inRect:(NSRect)rect;
 | 
			
		||||
 | 
			
		||||
- (void)image:(NSImage *)image willLoadRepresentation:(NSImageRep *)rep;
 | 
			
		||||
- (void)image:(NSImage *)image didLoadRepresentationHeader:(NSImageRep *)rep;
 | 
			
		||||
- (void)image:(NSImage *)image didLoadPartOfRepresentation:(NSImageRep *)rep withValidRows:(NSInteger)rows; 
 | 
			
		||||
- (void)image:(NSImage *)image didLoadRepresentation:(NSImageRep *)rep withStatus:(NSImageLoadStatus)status;
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@interface NSBundle(NSBundleImageExtension)
 | 
			
		||||
- (nullable NSImage *)imageForResource:(NSImageName)name API_AVAILABLE(macos(10.7)); /* May return nil if no file found */
 | 
			
		||||
 | 
			
		||||
/* Neither of the following methods can return images with multiple representations in different files (for example, MyImage.png and MyImage@2x.png.) The above method is generally prefered.
 | 
			
		||||
 */
 | 
			
		||||
- (nullable NSString *)pathForImageResource:(NSImageName)name;	/* May return nil if no file found */
 | 
			
		||||
- (nullable NSURL *)URLForImageResource:(NSImageName)name API_AVAILABLE(macos(10.6)); /* May return nil if no file found */
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#pragma mark - Deprecated declarations
 | 
			
		||||
 | 
			
		||||
@interface NSImage ()
 | 
			
		||||
 | 
			
		||||
- (null_unspecified NSImageRep *)bestRepresentationForDevice:(null_unspecified NSDictionary *)deviceDescription API_DEPRECATED("Use -[NSImage bestRepresentationForRect:context:hints:] instead.  Any deviceDescription dictionary is also a valid hints dictionary.", macos(10.0,10.6));
 | 
			
		||||
 | 
			
		||||
/* These return union of all the types registered with NSImageRep.
 | 
			
		||||
 */
 | 
			
		||||
+ (NSArray<NSString *> *)imageUnfilteredFileTypes API_DEPRECATED("Use +imageUnfilteredTypes instead", macos(10.0,10.10));
 | 
			
		||||
+ (NSArray<NSPasteboardType> *)imageUnfilteredPasteboardTypes API_DEPRECATED("Use +imageUnfilteredTypes instead", macos(10.0,10.10));
 | 
			
		||||
+ (NSArray<NSString *> *)imageFileTypes API_DEPRECATED("Use +imageTypes instead", macos(10.0,10.10));
 | 
			
		||||
+ (NSArray<NSPasteboardType> *)imagePasteboardTypes API_DEPRECATED("Use +imageTypes instead", macos(10.0,10.10));
 | 
			
		||||
 | 
			
		||||
#if TARGET_OS_OSX
 | 
			
		||||
- (instancetype)initWithIconRef:(IconRef)iconRef API_DEPRECATED("Use -[NSWorkspace iconForFile:], -[NSWorkspace iconForFiles:], -[NSWorkspace iconForFileType:], or +[NSImage imageNamed:] instead.", macos(10.5, 11.0));
 | 
			
		||||
#endif // TARGET_OS_OSX
 | 
			
		||||
 | 
			
		||||
- (void)setFlipped:(BOOL)flag API_DEPRECATED("The concept of flippedness for NSImage is deprecated.  Please see the AppKit 10.6 release notes for a discussion of why and for how to replace existing usage.", macos(10.0,10.6));
 | 
			
		||||
- (BOOL)isFlipped API_DEPRECATED("The concept of flippedness for NSImage is deprecated.  Please see the AppKit 10.6 release notes for a discussion of why and for how to replace existing usage.", macos(10.0,10.6));
 | 
			
		||||
 | 
			
		||||
// These methods have surprising semantics.  Prefer to use the 'draw' methods (and note the new draw method taking respectContextIsFlipped as a parameter).  Please see the AppKit 10.6 release notes for exactly what's going on.
 | 
			
		||||
- (void)dissolveToPoint:(NSPoint)point fraction:(CGFloat)fraction API_DEPRECATED("Use -drawAtPoint:... or -drawInRect:... methods instead", macos(10.0,10.6));
 | 
			
		||||
- (void)dissolveToPoint:(NSPoint)point fromRect:(NSRect)rect fraction:(CGFloat)fraction API_DEPRECATED("Use -drawAtPoint:... or -drawInRect:... methods instead", macos(10.0,10.6));
 | 
			
		||||
- (void)compositeToPoint:(NSPoint)point operation:(NSCompositingOperation)op API_DEPRECATED("Use -drawAtPoint:... or -drawInRect:... methods instead", macos(10.0,10.6));
 | 
			
		||||
- (void)compositeToPoint:(NSPoint)point fromRect:(NSRect)rect operation:(NSCompositingOperation)op API_DEPRECATED("Use -drawAtPoint:... or -drawInRect:... methods instead", macos(10.0,10.6));
 | 
			
		||||
- (void)compositeToPoint:(NSPoint)point operation:(NSCompositingOperation)op fraction:(CGFloat)delta API_DEPRECATED("Use -drawAtPoint:... or -drawInRect:... methods instead", macos(10.0,10.6));
 | 
			
		||||
- (void)compositeToPoint:(NSPoint)point fromRect:(NSRect)rect operation:(NSCompositingOperation)op fraction:(CGFloat)delta API_DEPRECATED("Use -drawAtPoint:... or -drawInRect:... methods instead", macos(10.0,10.6));
 | 
			
		||||
 | 
			
		||||
// This method doesn't do what people expect.  See AppKit 10.6 release notes.  Briefly, you can replace invocation of this method with code that locks focus on the image and then draws the rep in the image.
 | 
			
		||||
- (void)lockFocusOnRepresentation:(null_unspecified NSImageRep *)imageRepresentation API_DEPRECATED("Use -lockFocus followed by -[NSImageRep drawInRect:] instead. See documentation for more info.", macos(10.0,10.6));
 | 
			
		||||
 | 
			
		||||
- (void)setScalesWhenResized:(BOOL)flag API_DEPRECATED("You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details.", macos(10.0,10.6));
 | 
			
		||||
- (BOOL)scalesWhenResized API_DEPRECATED("You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details.", macos(10.0,10.6));
 | 
			
		||||
- (void)setDataRetained:(BOOL)flag API_DEPRECATED("You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details.", macos(10.0,10.6));
 | 
			
		||||
- (BOOL)isDataRetained API_DEPRECATED("You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details.", macos(10.0,10.6));
 | 
			
		||||
- (void)setCachedSeparately:(BOOL)flag API_DEPRECATED("You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details.", macos(10.0,10.6));
 | 
			
		||||
- (BOOL)isCachedSeparately API_DEPRECATED("You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details.", macos(10.0,10.6));
 | 
			
		||||
- (void)setCacheDepthMatchesImageDepth:(BOOL)flag API_DEPRECATED("You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details.", macos(10.0,10.6));
 | 
			
		||||
- (BOOL)cacheDepthMatchesImageDepth API_DEPRECATED("You should be able to remove use of this method without any replacement.  See 10.6 AppKit release notes for details.", macos(10.0,10.6));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
#pragma mark - Standard images
 | 
			
		||||
 | 
			
		||||
/* Standard images.
 | 
			
		||||
 
 | 
			
		||||
 Most images are named by a specific function or situation where they are intended to be used.  In some cases, the artwork may be more generic than the name.  For example, the image for NSImageNameInvalidDataFreestandingTemplate is an arrow in 10.5.  Please do not use an image outside of the function for which it is intended - the artwork can change between releases.  The invalid data image could change to a yellow exclamation-point-in-triangle icon.  If there is no image available for the situation you're interested in, please file a bug report, and use your own custom art in the meantime.
 | 
			
		||||
 
 | 
			
		||||
 The size of an image is also not guaranteed to be the same (or maintain the same aspect ratio) between releases, so you should explcitly size the image appropriately for your use.
 | 
			
		||||
 | 
			
		||||
 Constants that end in the word "Template" name black and clear images that return YES for isTemplate.  These images can be processed into variants appropriate for different situations.  For example, these images can invert in a selected table view row.  See -[NSImage setTemplate:] for more comments.  These images are inappropriate for display without further processing, but NSCell and its subclasses will perform the processing.
 | 
			
		||||
 
 | 
			
		||||
 Some images also contain the word "Freestanding".  This indicates that an image is appropriate for use as a borderless button - it doesn't need any extra bezel artwork behind it.  For example, Safari uses NSImageNameStopProgressTemplate as the stop button in a button on its toolbar, while it uses NSImageNameStopProgressFreestandingTemplate in the downloads window where it appears inline with a progress indicator.
 | 
			
		||||
  
 | 
			
		||||
 The string value of each symbol is typically the same as the constant name without the "ImageName" part.  For example, NSImageNameBonjour is @"NSBonjour".  This is documented so that images can be used by name in Interface Builder.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameAddTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameBluetoothTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameBonjour API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameBookmarksTemplate API_AVAILABLE(macos(10.6), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameCaution API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameComputer API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameEnterFullScreenTemplate API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameExitFullScreenTemplate API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameFolder API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameFolderBurnable API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameFolderSmart API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameFollowLinkFreestandingTemplate API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameHomeTemplate API_AVAILABLE(macos(10.6), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameIChatTheaterTemplate API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameLockLockedTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameLockUnlockedTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameNetwork API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNamePathTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameQuickLookTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameRefreshFreestandingTemplate API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameRefreshTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameRemoveTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameRevealFreestandingTemplate API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameShareTemplate API_AVAILABLE(macos(10.8), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameSlideshowTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameStatusAvailable API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameStatusNone API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameStatusPartiallyAvailable API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameStatusUnavailable API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameStopProgressFreestandingTemplate API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameStopProgressTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTrashEmpty API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTrashFull API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* This image is appropriate on an 'action' button.  An action button is a popup that has the same contents as the contextual menu for a related control.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameActionTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
 | 
			
		||||
/* This image can be used as a badge for a 'smart' item.  In 10.5, this and the 'action' image are both gears.  Please avoid using a gear for other situations, and if you do, use custom art.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameSmartBadgeTemplate API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* These images are intended for use in a segmented control for switching view interfaces for another part of the window.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameIconViewTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameListViewTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameColumnViewTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameFlowViewTemplate API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Place this image to the right of invalid data.  For example, use it if the user tries to commit a form when it's missing a required name field.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameInvalidDataFreestandingTemplate API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* Use these images for "go forward" or "go back" functions, as seen in Safari's toolbar.  These images will automatically mirror when the user interface layout direction is right to left.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameGoForwardTemplate API_AVAILABLE(macos(10.12), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameGoBackTemplate API_AVAILABLE(macos(10.12), ios(13.0));
 | 
			
		||||
 | 
			
		||||
/* These images are like GoForward and GoBack except that they always point in the specified direction regardless of layout direction.  See also the right and left facing triangle images.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameGoRightTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameGoLeftTemplate API_AVAILABLE(macos(10.5), ios(13.0));
 | 
			
		||||
 | 
			
		||||
/* Prefer the GoForward and GoBack or GoLeft and GoRight images for situations where they apply.  These generic triangles aren't endorsed for any particular use, but you can use them if you don't have any better art.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameRightFacingTriangleTemplate API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameLeftFacingTriangleTemplate API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* NSImageNameDotMac will continue to work for the forseeable future, and will return the same image as NSImageNameMobileMe.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameDotMac API_DEPRECATED_WITH_REPLACEMENT("NSImageNameMobileMe", macos(10.5,10.7));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameMobileMe API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* This image is appropriate as a drag image for multiple items.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameMultipleDocuments API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* These images are intended for use in toolbars in preference windows.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameUserAccounts API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNamePreferencesGeneral API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameAdvanced API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* These images are intended for use in other toolbars.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameInfo API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameFontPanel API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameColorPanel API_AVAILABLE(macos(10.5));
 | 
			
		||||
 | 
			
		||||
/* These images are appropriate for use in sharing or permissions interfaces.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameUser API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameUserGroup API_AVAILABLE(macos(10.5));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameEveryone API_AVAILABLE(macos(10.5));  
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameUserGuest API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* These images are the default state images used by NSMenuItem.  Drawing these outside of menus is discouraged.
 | 
			
		||||
*/
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameMenuOnStateTemplate API_AVAILABLE(macos(10.6));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameMenuMixedStateTemplate API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
/* The name @"NSApplicationIcon" has been available since Mac OS X 10.0.  The symbol NSImageNameApplicationIcon is new in 10.6.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameApplicationIcon API_AVAILABLE(macos(10.6));
 | 
			
		||||
 | 
			
		||||
#pragma mark - NSTouchBar images
 | 
			
		||||
 | 
			
		||||
/* These images are appropriate for use only in NSTouchBar.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarAddDetailTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarAddTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarAlarmTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarAudioInputMuteTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarAudioInputTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarAudioOutputMuteTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarAudioOutputVolumeHighTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarAudioOutputVolumeLowTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarAudioOutputVolumeMediumTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarAudioOutputVolumeOffTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarBookmarksTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarColorPickerFill API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarColorPickerFont API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarColorPickerStroke API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarCommunicationAudioTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarCommunicationVideoTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarComposeTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarDeleteTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarDownloadTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarEnterFullScreenTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarExitFullScreenTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarFastForwardTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarFolderCopyToTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarFolderMoveToTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarFolderTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarGetInfoTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarGoBackTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarGoDownTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarGoForwardTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarGoUpTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarHistoryTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarIconViewTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarListViewTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarMailTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarNewFolderTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarNewMessageTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarOpenInBrowserTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarPauseTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarPlayPauseTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarPlayTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarQuickLookTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarRecordStartTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarRecordStopTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarRefreshTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarRemoveTemplate API_AVAILABLE(macos(10.13), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarRewindTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarRotateLeftTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarRotateRightTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarSearchTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarShareTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarSidebarTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarSkipAhead15SecondsTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarSkipAhead30SecondsTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarSkipAheadTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarSkipBack15SecondsTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarSkipBack30SecondsTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarSkipBackTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarSkipToEndTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarSkipToStartTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarSlideshowTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarTagIconTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarTextBoldTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarTextBoxTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarTextCenterAlignTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarTextItalicTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarTextJustifiedAlignTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarTextLeftAlignTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarTextListTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarTextRightAlignTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarTextStrikethroughTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarTextUnderlineTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarUserAddTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarUserGroupTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarUserTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
 | 
			
		||||
/* If you have a volume indicator, use NSImageNameTouchBarAudioOutputVolume{Off,Low,Medium,High}Template, which align the speaker correctly.  For volume controls, use NSImageNameTouchBarVolume{Down,Up}Template.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarVolumeDownTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarVolumeUpTemplate API_AVAILABLE(macos(10.12.2), ios(13.0));
 | 
			
		||||
 | 
			
		||||
/* If you have an NSTouchBarItem with a seekable media control, NSImageNameTouchBarPlayheadTemplate is suitable for use in displaying the playhead.
 | 
			
		||||
 */
 | 
			
		||||
APPKIT_EXTERN NSImageName const NSImageNameTouchBarPlayheadTemplate API_AVAILABLE(macos(10.12.2));
 | 
			
		||||
 | 
			
		||||
typedef NS_ENUM(NSInteger, NSImageSymbolScale) {
 | 
			
		||||
    NSImageSymbolScaleSmall = 1,
 | 
			
		||||
    NSImageSymbolScaleMedium = 2,
 | 
			
		||||
    NSImageSymbolScaleLarge = 3,
 | 
			
		||||
} NS_SWIFT_NAME(NSImage.SymbolScale) API_AVAILABLE(macos(11.0));
 | 
			
		||||
 | 
			
		||||
API_AVAILABLE(macos(11.0)) NS_SWIFT_NAME(NSImage.SymbolConfiguration)
 | 
			
		||||
@interface NSImageSymbolConfiguration : NSObject <NSCopying, NSSecureCoding>
 | 
			
		||||
 | 
			
		||||
+ (instancetype)configurationWithPointSize:(CGFloat)pointSize weight:(NSFontWeight)weight scale:(NSImageSymbolScale)scale;
 | 
			
		||||
+ (instancetype)configurationWithPointSize:(CGFloat)pointSize weight:(NSFontWeight)weight;
 | 
			
		||||
+ (instancetype)configurationWithTextStyle:(NSFontTextStyle)style scale:(NSImageSymbolScale)scale;
 | 
			
		||||
+ (instancetype)configurationWithTextStyle:(NSFontTextStyle)style;
 | 
			
		||||
+ (instancetype)configurationWithScale:(NSImageSymbolScale)scale;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Create a color configuration with a palette derived from one color.
 | 
			
		||||
 | 
			
		||||
 A color scheme will be created based on the provided color, deriving
 | 
			
		||||
 secondary and tertiary colors by reducing the intensity of the base color.
 | 
			
		||||
 This is typically (but not only) accomplished by reducing opacity of the
 | 
			
		||||
 primary color.
 | 
			
		||||
 | 
			
		||||
 When combined with another configuration creating a palette, the
 | 
			
		||||
 last specified configuration will win, overwriting the other color
 | 
			
		||||
 configuration.
 | 
			
		||||
 | 
			
		||||
 If the symbol doesn't have a palette-based variant, the configuration will
 | 
			
		||||
 have no effect and the result will be a monochrome (templated) symbol.
 | 
			
		||||
 */
 | 
			
		||||
+ (instancetype)configurationWithHierarchicalColor:(NSColor *)hierarchicalColor API_AVAILABLE(macos(12.0));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Create a color configuration by specifying a palette of colors.
 | 
			
		||||
 The colors are used sequentially per layer: the first color for the first
 | 
			
		||||
 layer, the second color for the second layer etc. This is independent of
 | 
			
		||||
 the hierarchy level of the layer.
 | 
			
		||||
 | 
			
		||||
 When combined with another configuration creating a palette, the
 | 
			
		||||
 last specified configuration will win, overwriting the other color
 | 
			
		||||
 configuration.
 | 
			
		||||
 | 
			
		||||
 If the symbol doesn't have a palette-based variant, the configuration will
 | 
			
		||||
 have no effect and the result will be a monochrome (templated) symbol.
 | 
			
		||||
 */
 | 
			
		||||
+ (instancetype)configurationWithPaletteColors:(NSArray<NSColor *> *)paletteColors API_AVAILABLE(macos(12.0));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Create a configuration that specifies that the symbol should prefer
 | 
			
		||||
 its multicolor variant if one exists.
 | 
			
		||||
 | 
			
		||||
 This configuration can be combined with one of the palette-based
 | 
			
		||||
 configurations; in that case, the symbol will use the multicolor
 | 
			
		||||
 variant if one exists, or the palette variant otherwise.
 | 
			
		||||
 | 
			
		||||
 If the symbol supports neither, the result will be a monochrome
 | 
			
		||||
 (templated) symbol.
 | 
			
		||||
 */
 | 
			
		||||
+ (instancetype)configurationPreferringMulticolor NS_SWIFT_NAME(preferringMulticolor()) API_AVAILABLE(macos(12.0));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 Returns a new configuration object whose values are defined by
 | 
			
		||||
 applying values from the provided configuration and the receiver.
 | 
			
		||||
 | 
			
		||||
 Values defined by both configurations will use the provided
 | 
			
		||||
 configuration's values.
 | 
			
		||||
 */
 | 
			
		||||
- (instancetype)configurationByApplyingConfiguration:(NSImageSymbolConfiguration *)configuration API_AVAILABLE(macos(12.0));
 | 
			
		||||
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
API_UNAVAILABLE_END
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user