Unnamed: 0
int64 0
0
| repo_id
stringlengths 5
186
| file_path
stringlengths 15
223
| content
stringlengths 1
32.8M
⌀ |
---|---|---|---|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSWindowTab.h | /*
NSWindowTab.h
Application Kit
Copyright (c) 2016-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSWindow, NSView, NSImage;
/* This class encapsulates all the state and properties for a window when it exists in a tabbed window environment. See [NSWindow allowsAutomaticWindowTabbing] and [NSWindow tabbingIdentifier]. These properties can be set at anytime, but will only take effect when the window is shown in a tab.
*/
API_AVAILABLE(macos(10.13))
@interface NSWindowTab : NSObject
/* The tab title for this window when in a tab. By default it follows the window.title. You can override this by explicitly setting it to something custom. Setting it to nil will make it follow the window.title again. */
@property (copy, null_resettable) NSString *title;
/* The attributed string tab title for this window when in a tab. This value is only used when non-nil; otherwise the title is used. The attributedTitle will use the provided attributes that are explicitly given. Attributes not given, such as the font type, color and size, will default to the correct values for the window tab. */
@property (copy, nullable) NSAttributedString *attributedTitle;
/* The tool tip for this window when in a tab. By default, it is self.title but can be set to something custom. Setting it back to nil will make it follow self.title again.
*/
@property (copy, null_resettable) NSString *toolTip;
/* Get and set the accessory view for this window when it is in a tabbed window. translatesAutoresizingMaskIntoConstraints will automatically be set to NO on the view. Constraints can be created and activated to specify the view's width and height values. A constraint will automatically be added to y-center the view, and to right align the view.
*/
@property (strong, nullable) NSView *accessoryView;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSCollectionViewFlowLayout.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTrackingSeparatorToolbarItem.h | /*
NSTrackingSeparatorToolbarItem.h
Application Kit
Copyright (c) 2019-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSToolbarItem.h>
@class NSSplitView;
NS_ASSUME_NONNULL_BEGIN
API_AVAILABLE(macos(11.0)) API_UNAVAILABLE(ios)
@interface NSTrackingSeparatorToolbarItem : NSToolbarItem
/*
Creates a new NSTrackingSeparatorToolbarItem and configures it to attempt to visually align with the specified divider of the splitView.
The splitView must be in the same window as the toolbar containing this item by the time the toolbar is shown. Only vertical split views are supported.
*/
+ (instancetype)trackingSeparatorToolbarItemWithIdentifier:(NSToolbarItemIdentifier)identifier splitView:(NSSplitView *)splitView dividerIndex:(NSInteger)dividerIndex API_UNAVAILABLE(ios);
/*
The splitView must be in the same window as the toolbar containing this item by the time the toolbar is shown. Only vertical split views are supported.
*/
@property (strong) NSSplitView *splitView API_UNAVAILABLE(ios);
/*
The specific divider of the splitView which will be tracked.
*/
@property NSInteger dividerIndex API_UNAVAILABLE(ios);
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSStatusBarButton.h | /*
NSStatusBarButton.h
Application Kit
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSButton.h>
#import <AppKit/AppKitDefines.h>
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
/*!
* StatusBarButtons are the visual representation of NSStatusItems, and are primarily displayed on the right side of the menu bar.
* When a template image is set as the \c image property of the status bar button, it is rendered with the correct menu bar style. This guarantees that the button will look correct in various button states and appearances (such as dark menu bar).
*/
API_AVAILABLE(macos(10.10))
@interface NSStatusBarButton : NSButton
/// When YES the status bar icon has a disabled/off appearance while still being functional, such as allowing selection and actions. Defaults to NO.
@property BOOL appearsDisabled;
@end
API_UNAVAILABLE_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSGroupTouchBarItem.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSMatrix.h | /*
NSMatrix.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSControl.h>
#import <AppKit/NSUserInterfaceValidation.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSColor;
@protocol NSMatrixDelegate;
/* Matrix Constants */
typedef NS_ENUM(NSUInteger, NSMatrixMode) {
NSRadioModeMatrix = 0,
NSHighlightModeMatrix = 1,
NSListModeMatrix = 2,
NSTrackModeMatrix = 3
};
/*
NSMatrix is deprecated and will be unsupported in future releases. For radio button grouping, sibling radio buttons that share the same action will operate in an exclusive mode.
*/
@interface NSMatrix : NSControl <NSUserInterfaceValidations, NSViewToolTipOwner>
- (instancetype)initWithFrame:(NSRect)frameRect;
- (instancetype)initWithFrame:(NSRect)frameRect mode:(NSMatrixMode)mode prototype:(NSCell *)cell numberOfRows:(NSInteger)rowsHigh numberOfColumns:(NSInteger)colsWide;
- (instancetype)initWithFrame:(NSRect)frameRect mode:(NSMatrixMode)mode cellClass:(nullable Class)factoryId numberOfRows:(NSInteger)rowsHigh numberOfColumns:(NSInteger)colsWide;
@property (assign) Class cellClass;
@property (nullable, copy) __kindof NSCell *prototype;
- (NSCell *)makeCellAtRow:(NSInteger)row column:(NSInteger)col;
@property NSMatrixMode mode;
@property BOOL allowsEmptySelection;
- (void)sendAction:(SEL)selector to:(id)object forAllCells:(BOOL)flag;
@property (readonly, copy) NSArray<NSCell *> *cells;
- (void)sortUsingSelector:(SEL)comparator;
- (void)sortUsingFunction:(NSInteger (NS_NOESCAPE *)(id, id, void * _Nullable))compare context:(nullable void *)context;
@property (nullable, readonly, strong) __kindof NSCell *selectedCell;
@property (readonly, copy) NSArray<__kindof NSCell *> *selectedCells;
@property (readonly) NSInteger selectedRow;
@property (readonly) NSInteger selectedColumn;
@property (getter=isSelectionByRect) BOOL selectionByRect;
- (void)setSelectionFrom:(NSInteger)startPos to:(NSInteger)endPos anchor:(NSInteger)anchorPos highlight:(BOOL)lit;
- (void)deselectSelectedCell;
- (void)deselectAllCells;
- (void)selectCellAtRow:(NSInteger)row column:(NSInteger)col;
- (void)selectAll:(nullable id)sender;
- (BOOL)selectCellWithTag:(NSInteger)tag;
@property NSSize cellSize;
@property NSSize intercellSpacing;
- (void)setScrollable:(BOOL)flag;
@property (copy) NSColor *backgroundColor;
@property (nullable, copy) NSColor *cellBackgroundColor;
@property BOOL drawsCellBackground;
@property BOOL drawsBackground;
- (void)setState:(NSInteger)value atRow:(NSInteger)row column:(NSInteger)col;
- (void)getNumberOfRows:(nullable NSInteger *)rowCount columns:(nullable NSInteger *)colCount;
@property (readonly) NSInteger numberOfRows;
@property (readonly) NSInteger numberOfColumns;
- (nullable __kindof NSCell *)cellAtRow:(NSInteger)row column:(NSInteger)col;
- (NSRect)cellFrameAtRow:(NSInteger)row column:(NSInteger)col;
- (BOOL)getRow:(NSInteger *)row column:(NSInteger *)col ofCell:(NSCell *)cell;
- (BOOL)getRow:(NSInteger *)row column:(NSInteger *)col forPoint:(NSPoint)point;
- (void)renewRows:(NSInteger)newRows columns:(NSInteger)newCols;
- (void)putCell:(NSCell *)newCell atRow:(NSInteger)row column:(NSInteger)col;
- (void)addRow;
- (void)addRowWithCells:(NSArray<NSCell *> *)newCells;
- (void)insertRow:(NSInteger)row;
- (void)insertRow:(NSInteger)row withCells:(nullable NSArray<NSCell *> *)newCells;
- (void)removeRow:(NSInteger)row;
- (void)addColumn;
- (void)addColumnWithCells:(NSArray<NSCell *> *)newCells;
- (void)insertColumn:(NSInteger)column;
- (void)insertColumn:(NSInteger)column withCells:(nullable NSArray<NSCell *> *)newCells;
- (void)removeColumn:(NSInteger)col;
- (nullable __kindof NSCell *)cellWithTag:(NSInteger)tag;
@property (nullable) SEL doubleAction;
@property BOOL autosizesCells;
- (void)sizeToCells;
- (void)setValidateSize:(BOOL)flag;
- (void)drawCellAtRow:(NSInteger)row column:(NSInteger)col;
- (void)highlightCell:(BOOL)flag atRow:(NSInteger)row column:(NSInteger)col;
@property (getter=isAutoscroll) BOOL autoscroll;
- (void)scrollCellToVisibleAtRow:(NSInteger)row column:(NSInteger)col;
@property (readonly) NSInteger mouseDownFlags;
- (void)mouseDown:(NSEvent *)event;
- (BOOL)performKeyEquivalent:(NSEvent *)event;
- (BOOL)sendAction;
- (void)sendDoubleAction;
@property (nullable, weak) id<NSMatrixDelegate> delegate;
- (BOOL)textShouldBeginEditing:(NSText *)textObject;
- (BOOL)textShouldEndEditing:(NSText *)textObject;
- (void)textDidBeginEditing:(NSNotification *)notification;
- (void)textDidEndEditing:(NSNotification *)notification;
- (void)textDidChange:(NSNotification *)notification;
- (void)selectText:(nullable id)sender;
- (nullable __kindof NSCell *)selectTextAtRow:(NSInteger)row column:(NSInteger)col;
- (BOOL)acceptsFirstMouse:(nullable NSEvent *)event;
- (void)resetCursorRects;
- (void)setToolTip:(nullable NSString *)toolTipString forCell:(NSCell *)cell;
- (nullable NSString *)toolTipForCell:(NSCell *)cell;
/* Determine whether the receiver autorecalculates its cellSize. The default is NO. If set to YES, then the receiver will adjust its cellSize to accommodate its largest cell. Changing the cellSize does not directly affect the frame of the receiver; however it does affect the intrinsic content size, which may cause the receiver to resize under autolayout.
The default is NO. When using autolayout, you typically want this to be set to YES.
*/
@property BOOL autorecalculatesCellSize API_AVAILABLE(macos(10.8));
@end
@interface NSMatrix(NSKeyboardUI)
@property BOOL tabKeyTraversesCells;
@property (nullable, strong) __kindof NSCell *keyCell;
@end
@protocol NSMatrixDelegate <NSControlTextEditingDelegate> @end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSUserDefaultsController.h | /*
NSUserDefaultsController.h
Application Kit
Copyright (c) 2002-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSDictionary.h>
#import <AppKit/NSController.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSUserDefaults;
@interface NSUserDefaultsController : NSController
@property (class, readonly, strong) NSUserDefaultsController *sharedUserDefaultsController;
- (instancetype)initWithDefaults:(nullable NSUserDefaults *)defaults initialValues:(nullable NSDictionary<NSString *, id> *)initialValues NS_DESIGNATED_INITIALIZER; // if defaults is nil, the controller uses [NSUserDefaults standardUserDefaults]; if initialValues is nil, revertToInitialValues: has no effect
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
@property (readonly, strong) NSUserDefaults *defaults;
@property (nullable, copy) NSDictionary<NSString *, id> *initialValues;
@property BOOL appliesImmediately; // default: YES
@property (readonly) BOOL hasUnappliedChanges;
@property (readonly, strong) id values; // accessor object for default values (independent of whether they are derived directly from the NSUserDefaults or from the initial values)
- (IBAction)revert:(nullable id)sender;
- (IBAction)save:(nullable id)sender; // no effect if applies immediately
- (IBAction)revertToInitialValues:(nullable id)sender; // no effect if no initial values are specified
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSPathCell.h | /*
NSPathCell.h
Application Kit
Copyright (c) 2005-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <AppKit/NSActionCell.h>
#import <AppKit/NSSavePanel.h>
#import <AppKit/NSMenu.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSString, NSImage, NSAnimation, NSPathComponentCell, NSURL, NSPopUpButtonCell, NSNotification, NSOpenPanel;
@protocol NSPathCellDelegate;
/*
NSPathCell
This cell maintains a collection of NSPathComponentCells that represent a particular path to be displayed to the user. The path shown can be set by calling -setURL:. Doing so will remove all displayed NSPathComponentCells and automatically fill it up with NSPathComponentCells set to have the appropriate icons, display titles, and NSURL values for the particular path component they represent. One can manually fill up the control by setting the cell array or directly modifying existing cells.
Both an action and doubleAction can be set for the control. To find out what path component cell was clicked upon in the action, you can access the 'clickedPathComponentCell'. When the style is set to NSPathStylePopUp, the action is still sent, and the 'clickedPathComponentCell' for the represented menu item is correctly set. The 'clickedPathComponentCell' is only valid when the action is being sent. It will also be valid when the keyboard is used to invoke the action.
Automatic animated expansion of partially hidden NSPathComponentCells will happen if you correctly call mouseEntered: and mouseExited: for each NSPathComponentCell in the NSPathCell. This is not required if the pathStyle is set to NSPathStylePopUp, or if you wish to not have the animation.
The NSPathCell supports several path display styles. The NSPathStyleStandard has a light blue background with arrows indicating the path. The NSPathStylePopUp will look and work like an NSPopUpButton to display the full path, or select a new path, if the cell is editable.
If the cell isEditable (the default is YES), one can drag and drop into the cell to change the value. You can constrain what can be dropped using UTIs (Uniform Type Identifier) in the allowedTypes, or the appropriate delegate methods on NSPathControl.
If the cell isSelectable (the default is YES), the cell's contents can automatically be draged out. The proper UTI and filename and URL will be placed on the pasteboard. You can further control or limit this by using the appropriate delegate methods on NSPathControl.
If the cell isEditable and has the pathStyle set to NSPathStylePopUp, an additional item in the pop up menu will allow selecting another location. By default, an NSOpenPanel will be configured based on the allowedTypes. The NSOpenPanel that is used can be customized with a delegate method.
*/
typedef NS_ENUM(NSInteger, NSPathStyle) {
/* The standard display style and behavior. All path component cells are displayed with an image/icon and path component name. If the path can not fully be displayed, the middle parts are truncated as required..
*/
NSPathStyleStandard,
/* The pop up display style and behavior. Only the last path component is displayed with an image/icon and path component. The full path is shown when you click on the cell. If the cell isEditable, an option will be shown to select a different path.
*/
NSPathStylePopUp = 2,
/* This style is deprecated as of Mac OS X 10.7. Please use one of the other NSPathStyle values.
*/
NSPathStyleNavigationBar API_DEPRECATED("", macos(10.5,10.7))= 1
};
API_AVAILABLE(macos(10.5))
@interface NSPathCell : NSActionCell <NSMenuItemValidation, NSOpenSavePanelDelegate>
/* See NSPathControl for documentation on all the properties listed below. The NSPathControl directly calls the cell's methods.
*/
@property NSPathStyle pathStyle;
@property (nullable, copy) NSURL *URL;
/* If setObjectValue is called with an NSURL, setURL is automatically called. Calling objectValue will return the last set URL value. setObjectValue can also take a string value, with the items separated by the path separator. Any other value is a programming error and will cause an assertion.
*/
- (void)setObjectValue:(nullable id <NSCopying>)obj;
@property (nullable, copy) NSArray<NSString *> *allowedTypes;
@property (nullable, weak) id<NSPathCellDelegate> delegate;
/* Returns the class used to create pathComponentCells when automatically filling up the control. Subclassers can override this method to return a custom cell class that will automatically be used. By default, it will return [NSPathComponentCell class], or a specialized subclass thereof.
*/
@property (class, readonly) Class pathComponentCellClass;
@property (copy) NSArray<__kindof NSPathComponentCell *> *pathComponentCells;
/* Returns the current rect being displayed for a particular NSPathComponentCell 'cell', with respect to the 'frame' in 'view'. NSZeroRect will be returned if 'cell' is not found, or it currently is not visible.
*/
- (NSRect)rectOfPathComponentCell:(NSPathComponentCell *)cell withFrame:(NSRect)frame inView:(NSView *)view;
/* Returns the cell located at 'point' within 'frame' of 'view', or nil, if none exists at that location.
*/
- (nullable NSPathComponentCell *)pathComponentCellAtPoint:(NSPoint)point withFrame:(NSRect)frame inView:(NSView *)view;
/* Returns the clicked cell, or nil, if a no cell has been clicked. The clickedPathComponentCell is generally only valid when the action or doubleAction is being sent.
*/
@property (nullable, readonly, strong) NSPathComponentCell *clickedPathComponentCell;
/* The NSPathCell will dynamically animate to display the component that the mouse is hovering over by using mouseEntered and mouseExited events. The control should call these methods to correctly display the hovered component to the user. The control can acquire rects to track using rectOfPathComponentCell:withFrame:inView:.
*/
- (void)mouseEntered:(NSEvent *)event withFrame:(NSRect)frame inView:(NSView *)view;
- (void)mouseExited:(NSEvent *)event withFrame:(NSRect)frame inView:(NSView *)view;
/* Allows you to set the selector that will be called when the user double clicks on a particular NSPathComponentCell.
*/
@property (nullable) SEL doubleAction;
/* The background color to be drawn. By default, it will be set to a light blue color for NSPathStyleStandard, and nil for everything else. You can use [NSColor clearColor] to make the background transparent. NSPathCell will return YES from isOpaque if the backgroundColor has an alphaComponent of 1.0, otherwise, it will return NO. When drawing with the background color, NSCompositeSourceOver is used for the compositing operation.
*/
@property (nullable, copy) NSColor *backgroundColor;
@property (nullable, copy) NSString *placeholderString;
@property (nullable, copy) NSAttributedString *placeholderAttributedString;
/* The NSPathCell properly respects the controlSize for the NSPathStyleStandard and NSPathStylePopUp styles. When the controlSize is set, the new size is propigated to the subcells. */
@end
@protocol NSPathCellDelegate <NSObject>
@optional
/* Called before the 'openPanel' is shown, but after the 'openPanel' has allowedFileTypes set to the cell's allowedTypes. At this time, you can further customize the 'openPanel' as required. This is only ever called when the style is set to NSPathStylePopUp.
*/
- (void)pathCell:(NSPathCell *)pathCell willDisplayOpenPanel:(NSOpenPanel *)openPanel;
/* Called before the 'menu' is shown. At this time, you can further customize the 'menu' as required, adding and removing items. This is only ever called when the style is set to NSPathStylePopUp.
*/
- (void)pathCell:(NSPathCell *)pathCell willPopUpMenu:(NSMenu *)menu;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSPredicateEditor.h | /*
NSPredicateEditor.h
Application Kit
Copyright (c) 2006-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSRuleEditor.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSArray, NSPredicateEditorRowTemplate;
API_AVAILABLE(macos(10.5))
@interface NSPredicateEditor : NSRuleEditor
/* Setter - Sets the NSPredicateEditorRowTemplates for the NSPredicateEditor. When created, NSPredicateEditor contains a template representing compound predicates; if you wish to keep it, you should take care to include it in this array.
*/
/* Getter - Returns the row templates for this NSPredicateEditor.
*/
@property (copy) NSArray<NSPredicateEditorRowTemplate *> *rowTemplates;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTextContainer.h | #if !__has_include(<UIFoundation/NSTextContainer.h>)
/*
NSTextContainer.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <AppKit/NSParagraphStyle.h>
#import <AppKit/NSLayoutManager.h>
@class NSBezierPath;
@class NSTextLayoutManager;
NS_ASSUME_NONNULL_BEGIN
#if !TARGET_OS_IPHONE
API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0)) @interface NSTextContainer : NSObject <NSSecureCoding, NSTextLayoutOrientationProvider>
/**************************** Initialization ****************************/
- (instancetype)initWithSize:(NSSize)size NS_DESIGNATED_INITIALIZER API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
/**************************** Layout ****************************/
// Accessor for the NSLayoutManager object owning the receiver.
// Avoid assigning a layout manager directly through this property. Adding a text container to a layout manager through -[NSLayoutManager addTextContainer:] will use the property for assigning the new layout manager.
@property (nullable, assign) NSLayoutManager *layoutManager;
// This method should be used instead of the primitive -setLayoutManager: if you need to replace a container's layoutManager with a new one leaving the rest of the web intact. All the NSTextContainers on the old NSLayoutManager get transferred to the new one. This method deals with all the work of making sure the containers don't get deallocated and removing the old layoutManager from the text storage and replacing it with the new one.
- (void)replaceLayoutManager:(NSLayoutManager *)newLayoutManager API_AVAILABLE(macos(10.0), ios(9.0), tvos(9.0));
// Returns NSTextLayoutManager owning the text container. When non-nil, -layoutManager should be nil.
@property (weak, nullable, readonly) NSTextLayoutManager *textLayoutManager API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
/************************* Container shape properties *************************/
// Default value: CGSizeZero Defines the maximum size for the layout area returned from -lineFragmentRectForProposedRect:writingDirection:remainingRect:. 0.0 and less means no limitation.
@property NSSize size API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
// Default value : empty array An array of NSBezierPath representing the exclusion paths inside the receiver's bounding rect.
@property (copy) NSArray<NSBezierPath *> *exclusionPaths API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
// Default value: NSLineBreakByWordWrapping The line break mode defines the behavior of the last line inside the text container.
@property NSLineBreakMode lineBreakMode API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
/************************* Layout constraint properties *************************/
// Default value: 5.0 The layout padding at the beginning and end of the line fragment rects insetting the layout width available for the contents. This value is utilized by NSLayoutManager for determining the layout width.
@property CGFloat lineFragmentPadding;
// Default value: 0 (no limit) The maximum number of lines that can be stored in the receiver. This value is utilized by NSLayoutManager for determining the maximum number of lines associated with the text container.
@property NSUInteger maximumNumberOfLines API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
/**************************** Line fragments ****************************/
// Returns the bounds of a line fragment rect inside the receiver for proposedRect. This is the intersection of proposedRect and the receiver's bounding rect defined by -size property. The regions defined by -exclusionPaths property are excluded from the return value. charIndex is the character location inside the text storage for the line fragment being processed. It is possible that proposedRect can be divided into multiple line fragments due to exclusion paths. In that case, remainingRect returns the remainder that can be passed in as the proposed rect for the next iteration. baseWritingDirection determines the direction of advancement for line fragments inside a visual horizontal line. The values passed into the method are either NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft. This method can be overridden by subclasses for further text container region customization.
- (NSRect)lineFragmentRectForProposedRect:(NSRect)proposedRect atIndex:(NSUInteger)characterIndex writingDirection:(NSWritingDirection)baseWritingDirection remainingRect:(nullable NSRect *)remainingRect API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
// Returns YES if the receiver is a rectangular shape defined simply by -size. TextKit utilizes this information for enabling various layout optimizations. NSLayoutManager disables non-contiguous layout when this property is NO. The default implementation returns NO when -exclusionPaths has 1 or more items, -maximumNumberOfLines is not 0, or -lineFragmentRectForProposedRect:atIndex:writingDirection:remainingRect: is overridden. It's recommended to override this property when -lineFragmentRectForProposedRect:atIndex:writingDirection:remainingRect: is overridden.
@property (getter=isSimpleRectangularTextContainer, readonly) BOOL simpleRectangularTextContainer NS_AVAILABLE(10_0, 9_0);
/**************************** View synchronization ****************************/
// Default value: NO Define whether the text container view bounds changes can affect the text container size.
@property BOOL widthTracksTextView;
@property BOOL heightTracksTextView;
// Set/get the view which the container is drawn in. Having a view is optional.
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12
@property (nullable, strong) NSTextView *textView;
#else
@property (nullable, weak) NSTextView *textView;
#endif
@end
/**************************** Deprecated ****************************/
// NSLineSweepDirection and NSLineMovementDirection are soft deprecated starting with OS X 10.11. It will be officially deprecated in a future release
typedef NS_ENUM(NSUInteger, NSLineSweepDirection) {
NSLineSweepLeft = 0,
NSLineSweepRight = 1,
NSLineSweepDown = 2,
NSLineSweepUp = 3
};
typedef NS_ENUM(NSUInteger, NSLineMovementDirection) {
NSLineDoesntMove = 0,
NSLineMovesLeft = 1,
NSLineMovesRight = 2,
NSLineMovesDown = 3,
NSLineMovesUp = 4
};
@interface NSTextContainer (NSTextContainerDeprecated)
// Methods names with "containerSize" are soft deprecated starting with OS X 10.11. It will be officially deprecated in a future release
- (instancetype)initWithContainerSize:(NSSize)aContainerSize; // Use -initWithSize: instead. For binary compatibility, this method now just calls [self initWithSize:]. Also, -init still calls -initWithContainerSize:.
@property NSSize containerSize; // Use -size instead
// This method is soft deprecated starting with OS X 10.11. It will be officially deprecated in a future release
- (NSRect)lineFragmentRectForProposedRect:(NSRect)proposedRect sweepDirection:(NSLineSweepDirection)sweepDirection movementDirection:(NSLineMovementDirection)movementDirection remainingRect:(nullable NSRectPointer)remainingRect; // Use -lineFragmentRectForProposedRect:atIndex:writingDirection:remainingRect: instead
- (BOOL)containsPoint:(NSPoint)point API_DEPRECATED("", macos(10.0,10.11));
@end
#endif // !TARGET_OS_IPHONE
NS_ASSUME_NONNULL_END
#else
#import <UIFoundation/NSTextContainer.h>
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSSearchFieldCell.h | /*
NSSearchFieldCell.h
Application Kit
Copyright (c) 2003-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSTextFieldCell.h>
#import <AppKit/NSSearchField.h>
#import <AppKit/AppKitDefines.h>
// Search menu template tags. Special items in the search menu are tagged so when the actual dynamic search menu is constructed, we know which items to show or hide.
// Title of recents menu group. Hidden if no recents. Also use for separators that my go away with recents
static const NSInteger NSSearchFieldRecentsTitleMenuItemTag = 1000;
// Recent items have this tag. Use to indicate location of recents in custom menu if no title specified
static const NSInteger NSSearchFieldRecentsMenuItemTag = 1001;
// The 'Clear Recents' item has this tag. Hidden if no recents
static const NSInteger NSSearchFieldClearRecentsMenuItemTag = 1002;
// The item describing a lack of recents uses this tag. Hidden if recents
static const NSInteger NSSearchFieldNoRecentsMenuItemTag = 1003;
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSButtonCell, NSMenu, NSMutableArray, NSTimer, NSImage;
@interface NSSearchFieldCell : NSTextFieldCell
- (instancetype)initTextCell:(NSString *)string NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
- (instancetype)initImageCell:(nullable NSImage *)image NS_UNAVAILABLE;
@property (nullable, strong) NSButtonCell *searchButtonCell;
// can modify, set or cancel search button.
@property (nullable, strong) NSButtonCell *cancelButtonCell;
// can modify, set or clear cancel button.
- (void) resetSearchButtonCell;
- (void) resetCancelButtonCell;
// restore target, action, and image. if cell has been cleared, creates a new cell with default values.
- (NSRect) searchTextRectForBounds:(NSRect)rect;
- (NSRect) searchButtonRectForBounds:(NSRect)rect;
- (NSRect) cancelButtonRectForBounds:(NSRect)rect;
// for custom layout or to get current sizes
@property (nullable, strong) NSMenu *searchMenuTemplate;
// set/get search menu template. Menu can use custom tagged items to indicate special items. this menu isn't actually set but used to construct the dynamic search menu. if cleared, then we don't track recents.
@property BOOL sendsWholeSearchString;
// if clear, send action on each key stroke (after sufficient amount of time so we don't interfere with typing). if set, send only on return/enter or clicking magnifying search button
@property NSInteger maximumRecents;
// set/get limit max recents. allowable between 0 and 254. setting -1 will use default.
@property (null_resettable, copy) NSArray<NSString *> *recentSearches;
// if app wants to do custom search lists. will return empty array if no searches
@property (nullable, copy) NSSearchFieldRecentsAutosaveName recentsAutosaveName;
// must be set to use. default is nil which means no autosave.
@property BOOL sendsSearchStringImmediately;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSSegmentedCell.h | /*
NSSegmentedCell.h
Application Kit
Copyright (c) 2003-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSGeometry.h>
#import <AppKit/NSActionCell.h>
#import <AppKit/NSSegmentedControl.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSMutableArray;
@interface NSSegmentedCell : NSActionCell
/* Number of segments
*/
@property NSInteger segmentCount;
/* Which button is active. May turn off other segments depending on mode.
*/
@property NSInteger selectedSegment;
- (BOOL)selectSegmentWithTag:(NSInteger)tag;
/* For keyboard UI. Wraps.
*/
- (void)makeNextSegmentKey;
- (void)makePreviousSegmentKey;
@property NSSegmentSwitchTracking trackingMode;
// per segment info
/* Width of 0 means autosize to fit
*/
- (void)setWidth:(CGFloat)width forSegment:(NSInteger)segment;
- (CGFloat)widthForSegment:(NSInteger)segment;
- (void)setImage:(nullable NSImage *)image forSegment:(NSInteger)segment;
- (nullable NSImage *)imageForSegment:(NSInteger)segment;
- (void)setImageScaling:(NSImageScaling)scaling forSegment:(NSInteger)segment API_AVAILABLE(macos(10.5));
- (NSImageScaling)imageScalingForSegment:(NSInteger)segment API_AVAILABLE(macos(10.5));
- (void)setLabel:(NSString *)label forSegment:(NSInteger)segment;
- (nullable NSString *)labelForSegment:(NSInteger)segment;
- (void)setSelected:(BOOL)selected forSegment:(NSInteger)segment;
- (BOOL)isSelectedForSegment:(NSInteger)segment;
- (void)setEnabled:(BOOL)enabled forSegment:(NSInteger)segment;
- (BOOL)isEnabledForSegment:(NSInteger)segment;
- (void)setMenu:(nullable NSMenu *)menu forSegment:(NSInteger)segment;
- (nullable NSMenu *)menuForSegment:(NSInteger)segment;
- (void)setToolTip:(nullable NSString *)toolTip forSegment:(NSInteger)segment;
- (nullable NSString *)toolTipForSegment:(NSInteger)segment;
- (void)setTag:(NSInteger)tag forSegment:(NSInteger)segment;
- (NSInteger)tagForSegment:(NSInteger)segment;
/* see NSSegmentedControl.h for segment style names and values */
@property NSSegmentStyle segmentStyle API_AVAILABLE(macos(10.5));
/* For custom content drawing. frame has been adjusted to content area
*/
- (void)drawSegment:(NSInteger)segment inFrame:(NSRect)frame withView:(NSView *)controlView;
@end
@interface NSSegmentedCell (NSSegmentBackgroundStyle)
/* Describes the surface drawn onto in -[NSCell drawSegment:inFrame:withView:]. That method draws a segment interior, not the segment bezel. This is both an override point and a useful method to call. A segmented cell that draws a custom bezel would override this to describe that surface. A cell that has custom segment 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.
*/
- (NSBackgroundStyle)interiorBackgroundStyleForSegment:(NSInteger)segment API_AVAILABLE(macos(10.5));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSPrinter.h | /*
NSPrinter.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSGeometry.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <AppKit/NSGraphics.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSString;
/* Valid return values for -[NSPrinter statusForTable:].
*/
typedef NS_ENUM(NSUInteger, NSPrinterTableStatus) {
NSPrinterTableOK = 0,
NSPrinterTableNotFound = 1,
NSPrinterTableError = 2
};
typedef NSString * NSPrinterTypeName NS_TYPED_EXTENSIBLE_ENUM;
typedef NSString * NSPrinterPaperName NS_TYPED_EXTENSIBLE_ENUM;
@interface NSPrinter: NSObject<NSCopying, NSCoding>
/* Return an array of strings that contain the human-readable names of all available printers.
*/
@property (class, readonly, copy) NSArray<NSString *> *printerNames;
/* Return an array of strings that contain the human-readable descriptions of the makes and models of all available printers. The array may contain fewer entries than the array that would be returned by an invocation of +printerNames.
*/
@property (class, readonly, copy) NSArray<NSPrinterTypeName> *printerTypes;
/* Given a human-readable printer name of the sort that appears in a Print panel's "Printer:" popup menu, return an instance of NSPrinter if the named printer is available, nil otherwise.
*/
+ (nullable NSPrinter *)printerWithName:(NSString *)name;
/* Given a string of the sort returned by +printerTypes:, return the first printer whose description matches, or nil if no available printer matches.
*/
+ (nullable NSPrinter *)printerWithType:(NSPrinterTypeName)type;
/* Return the printer's human-readable name, or an empty string for failure.
*/
@property (readonly, copy) NSString *name;
/* Return a human-readable description of the printer's make and model, or an empty string for failure.
*/
@property (readonly, copy) NSPrinterTypeName type;
/* Return the PostScript language level of the printer if it is a PostScript printer, or 0 if it is not a PostScript printer or for failure.
*/
@property (readonly) NSInteger languageLevel;
/* Given a valid paper name, return the corresponding paper size in points, or NSZeroSize for failure.
*/
- (NSSize)pageSizeForPaper:(NSPrinterPaperName)paperName;
/* Return a dictionary that describes the printing device using entries keyed by the NSDevice... strings declared in NSGraphics.h. The only entry that is guaranteed to exist in the returned dictionary is NSDeviceIsPrinter.
*/
@property (readonly, copy) NSDictionary<NSDeviceDescriptionKey, id> *deviceDescription;
@end
@interface NSPrinter(NSDeprecated)
/* PMPrinter API should be used instead. Return the status of the named table in the printer's PostScript Printer Description (PPD) if the PPD is available. NSPrinterTableNotFound is returned for every table name if no PPD is available.
*/
- (NSPrinterTableStatus)statusForTable:(NSString *)tableName API_DEPRECATED("", macos(10.0,10.9));
/* PMPrinter API should be used instead. Methods for accessing the information in the printer's PPD. If no PPD is available for the printer, values such as NO, 0, NSZeroRect, NSZeroSize, and nil are returned.
*/
- (BOOL)isKey:(nullable NSString *)key inTable:(NSString *)table API_DEPRECATED("", macos(10.0,10.9));
- (BOOL)booleanForKey:(nullable NSString *)key inTable:(NSString *)table API_DEPRECATED("", macos(10.0,10.9));
- (float)floatForKey:(nullable NSString *)key inTable:(NSString *)table API_DEPRECATED("", macos(10.0,10.9));
- (int)intForKey:(nullable NSString *)key inTable:(NSString *)table API_DEPRECATED("", macos(10.0,10.9));
- (NSRect)rectForKey:(nullable NSString *)key inTable:(NSString *)table API_DEPRECATED("", macos(10.0,10.9));
- (NSSize)sizeForKey:(nullable NSString *)key inTable:(NSString *)table API_DEPRECATED("", macos(10.0,10.9));
- (nullable NSString *)stringForKey:(nullable NSString *)key inTable:(NSString *)table API_DEPRECATED("", macos(10.0,10.9));
- (nullable NSArray *)stringListForKey:(nullable NSString *)key inTable:(NSString *)table API_DEPRECATED("", macos(10.0,10.9));
/* -[NSPrinter imageRectForPaper:] will attempt to determine and return the bounds of the imageable area for a particular paper name, but querying such information by paper name alone is not reliable. Use -[NSPrintInfo imageablePageBounds], which was introduced in Mac OS 10.2, instead.
*/
- (NSRect)imageRectForPaper:(nullable NSString *)paperName API_DEPRECATED("", macos(10.0,10.2));
/* NSPrinter's implementations of these methods return values that are not reliable or meaningful for some printers.
*/
- (BOOL)acceptsBinary API_DEPRECATED("", macos(10.0,10.2));
- (BOOL)isColor API_DEPRECATED("", macos(10.0,10.2));
- (BOOL)isFontAvailable:(nullable NSString *)faceName API_DEPRECATED("", macos(10.0,10.2));
- (BOOL)isOutputStackInReverseOrder API_DEPRECATED("", macos(10.0,10.2));
/* NSPrinter's implementation of each of these methods returns nil.
*/
+ (nullable NSPrinter *)printerWithName:(NSString *)name domain:(nullable NSString *)domain includeUnavailable:(BOOL)flag API_DEPRECATED("", macos(10.0,10.2));
- (NSString *)domain API_DEPRECATED("", macos(10.0,10.2));
- (NSString *)host API_DEPRECATED("", macos(10.0,10.2));
- (NSString *)note API_DEPRECATED("", macos(10.0,10.2));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSBezierPath.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSScrollView.h | /*
NSScrollView.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSDate.h>
#import <AppKit/NSView.h>
#import <AppKit/NSScroller.h>
#import <AppKit/NSTextFinder.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSColor, NSClipView, NSRulerView, NSScroller;
typedef NS_ENUM(NSInteger, NSScrollElasticity) {
NSScrollElasticityAutomatic = 0, // automatically determine whether to allow elasticity on this axis
NSScrollElasticityNone = 1, // disallow scrolling beyond document bounds on this axis
NSScrollElasticityAllowed = 2, // allow content to be scrolled past its bounds on this axis in an elastic fashion
} API_AVAILABLE(macos(10.7));
@interface NSScrollView : NSView <NSTextFinderBarContainer>
- (instancetype)initWithFrame:(NSRect)frameRect NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
/* Returns the NSScrollView frame size that yields the specified contentView frame size. This method should be used in preference to the deprecated +frameSizeForContentSize:hasHorizontalScroller:hasVerticalScroller:borderType:, which makes assumptions about the scrollers' classes, control size, and style. The "horizontalScrollerClass" parameter should specify the class of horizontal scroller to use if the NSScrollView will have a horizontal scroller, or Nil if it will not. Likewise for the "verticalScrollerClass" parameter.
*/
+ (NSSize)frameSizeForContentSize:(NSSize)cSize horizontalScrollerClass:(nullable Class)horizontalScrollerClass verticalScrollerClass:(nullable Class)verticalScrollerClass borderType:(NSBorderType)type controlSize:(NSControlSize)controlSize scrollerStyle:(NSScrollerStyle)scrollerStyle API_AVAILABLE(macos(10.7));
/* Returns the contentView frame size that yields the specified NSScrollView frame size. This method should be used in preference to the deprecated +contentSizeForFrameSize:hasHorizontalScroller:hasVerticalScroller:borderType: method, which makes assumptions about the scrollers' classes, control size, and style. The "horizontalScrollerClass" parameter should specify the class of horizontal scroller to use if the NSScrollView will have a horizontal scroller, or Nil if it will not. Likewise for the "verticalScrollerClass" parameter.
*/
+ (NSSize)contentSizeForFrameSize:(NSSize)fSize horizontalScrollerClass:(nullable Class)horizontalScrollerClass verticalScrollerClass:(nullable Class)verticalScrollerClass borderType:(NSBorderType)type controlSize:(NSControlSize)controlSize scrollerStyle:(NSScrollerStyle)scrollerStyle API_AVAILABLE(macos(10.7));
/* Returns the NSScrollView frame size that yields the specified contentView frame size. This method assumes scrollers of NSRegularControlSize, that are not subclassed in a way that affects their metrics (scrollerWidth), and also assumes that scrollers of the current [NSScroller preferredScrollerStyle] will be used, which may not be the case if conditions such as legacy scroller subclassing or presence of accessory views force fallback to NSScrollerStyleLegacy for a particular NSScrollView instance. Since those assumptions will produce incorrect results for some cases, this method should be considered deprecated; use +frameSizeForContentSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:, which provides for full specification of the relevant parameters, instead.
*/
+ (NSSize)frameSizeForContentSize:(NSSize)cSize hasHorizontalScroller:(BOOL)hFlag hasVerticalScroller:(BOOL)vFlag borderType:(NSBorderType)type API_DEPRECATED("Use +frameSizeForContentSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle: instead", macos(10.0,10.7));
/*Returns the contentView frame size that yields the specified NSScrollView frame size. This method assumes scrollers of NSRegularControlSize, that are not subclassed in a way that affects their metrics (scrollerWidth), and also assumes that scrollers of the current [NSScroller preferredScrollerStyle] will be used, which may not be the case if conditions such as legacy scroller subclassing or presence of accessory views force fallback to NSScrollerStyleLegacy for a particular NSScrollView instance. Since those assumptions will produce incorrect results for some cases, this method should be considered deprecated; use +contentSizeForFrameSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:, which provides for full specification of the relevant parameters, instead.
*/
+ (NSSize)contentSizeForFrameSize:(NSSize)fSize hasHorizontalScroller:(BOOL)hFlag hasVerticalScroller:(BOOL)vFlag borderType:(NSBorderType)type API_DEPRECATED("+contentSizeForFrameSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle: instead", macos(10.0,10.7));
@property (readonly) NSRect documentVisibleRect;
@property (readonly) NSSize contentSize;
@property (nullable, strong) __kindof NSView *documentView;
@property (strong) NSClipView *contentView;
@property (nullable, strong) NSCursor *documentCursor;
@property NSBorderType borderType;
@property (copy) NSColor *backgroundColor;
@property BOOL drawsBackground;
@property BOOL hasVerticalScroller;
@property BOOL hasHorizontalScroller;
@property (nullable, strong) NSScroller *verticalScroller;
@property (nullable, strong) NSScroller *horizontalScroller;
@property BOOL autohidesScrollers;
@property CGFloat horizontalLineScroll;
@property CGFloat verticalLineScroll;
@property CGFloat lineScroll;
@property CGFloat horizontalPageScroll;
@property CGFloat verticalPageScroll;
@property CGFloat pageScroll;
@property BOOL scrollsDynamically;
- (void)tile;
- (void)reflectScrolledClipView:(NSClipView *)cView;
- (void)scrollWheel:(NSEvent *)event;
/* An NSScrollView's scrollerStyle determines the style of scrollers that it will use. AppKit sets this property automatically at runtime, based on the user's "Show scroll bars" setting and (if relevant) the set of connected pointing devices and their configured scroll capabilities, as determined by [NSScroller preferredScrollerStyle]. Setting an NSScrollView's scrollerStyle sets the scrollerStyle of its horizontalScroller and verticalScroller to match the new value. If the NSScrollView subsequently creates or is assigned a new horizontalScroller or verticalScroller, they will at that time be assigned the same scrollerStyle that was given to the NSScrollView.
*/
@property NSScrollerStyle scrollerStyle API_AVAILABLE(macos(10.7));
/* Applicable only to ScrolViews that use Overlay scrollers. Setting an NSScrollView's scrollerKnobStyle sets the knobStyle of its horizontalScroller and verticalScroller to match the new value. If the NSScrollView subsequently creates or is assigned a new horizontalScroller or verticalScroller, they will at that time be assigned the same knobStyle that was given to the NSScrollView.
*/
@property NSScrollerKnobStyle scrollerKnobStyle API_AVAILABLE(macos(10.7));
/* Applicable only to NSScrollViews that use Overlay scrollers. This method can be invoked to cause the Overlay scroller knobs to be momentarily shown.
*/
- (void)flashScrollers API_AVAILABLE(macos(10.7));
/* NSScrollView can scroll its contents past its bounds to achieve an elastic effect. When set to NSScrollElasticityAutomatic, scrolling the horizontal axis beyond its document bounds only occurs if the document width is greater than the view width or, the vertical scroller is hidden and the horizontal scroller is visible. The default value is NSScrollElasticityAutomatic.
*/
@property NSScrollElasticity horizontalScrollElasticity API_AVAILABLE(macos(10.7));
/* NSScrollView can scroll its contents past its bounds to achieve an elastic effect. When set to NSScrollElasticityAuto, scrolling the vertical axis beyond its docment bounds occurs if any of the following are true: visible vertical scroller, content height greater than view height, horizontal scroller hidden
*/
@property NSScrollElasticity verticalScrollElasticity API_AVAILABLE(macos(10.7));
/* Some content is scrollable in both the horizontal and vertical axes, but is predominantly scrolled one axis at a time. Other content (such as a drawing canvas) should scroll freely in both axes. Traditionally this is not an issue with scroll wheels since they can only scroll in one direction at a time. With scroll balls and touch surfaces, it becomes more difficult to determine the user's intention. This property helps NSScrollView determine the user's intention by specifying the type of scrolling content. When set to YES, NSScrollView will only scroll in the predominate direction the user is scrolling. The default value is YES for apps build on 10.7; NO otherwise.
*/
@property BOOL usesPredominantAxisScrolling API_AVAILABLE(macos(10.7));
/* Allow the user to magnify the scrollview. Note: this does not prevent the developer from manually adjusting the magnification value. If magnification exceeds either the maximum or minimum limits for magnification, and allowsMagnification is YES, the scroll view temporarily animates the content magnification just past those limits before returning to them. The default value is NO.
*/
@property BOOL allowsMagnification API_AVAILABLE(macos(10.8));
/* This value determines how much the content is currently scaled. To animate the magnification, use the object's animator. The default value is 1.0 */
@property CGFloat magnification API_AVAILABLE(macos(10.8));
/* This value determines how large the content can be magnified. It must be greater than or equal to the minimum magnification. The default value is 4.0.
*/
@property CGFloat maxMagnification API_AVAILABLE(macos(10.8));
/* This value determines how small the content can be magnified. The default value is 0.25.
*/
@property CGFloat minMagnification API_AVAILABLE(macos(10.8));
/* Magnify content view proportionally such that the entire rect (in content view space) fits centered in the scroll view. The resulting magnification value is clipped to the minMagnification and maxMagnification values. To animate the magnification, use the object's animator.
*/
- (void)magnifyToFitRect:(NSRect)rect API_AVAILABLE(macos(10.8));
/* Scale the content view such that the passed in point (in content view space) remains at the same screen location once the scaling is completed. The resulting magnification value is clipped to the minMagnification and maxMagnification values. To animate the magnification, use the object's animator.
*/
- (void)setMagnification:(CGFloat)magnification centeredAtPoint:(NSPoint)point API_AVAILABLE(macos(10.8));
/* Some subviews of the document view do not scroll like the rest of the document. Instead these views appear to float over the document (see NSTableView floating group rows). The following API makes it easier to work with these types of floating views. Note: You are responsible for keeping track of the floating views and removing them via -removeFromSuperview when they should no longer float. A view may only float on one axis at a time.
*/
- (void)addFloatingSubview:(NSView *)view forAxis:(NSEventGestureAxis)axis API_AVAILABLE(macos(10.9));
/* Automatically sets the scroll view's contentInsets property to account for any overlapping title bar. Defaults to YES.
*/
@property BOOL automaticallyAdjustsContentInsets API_AVAILABLE(macos(10.10));
/* The distance that the sub views are inset from the enclosing scroll view during tiling. When contentInset equal to NSEdgeInsetsZero, traditional tiling is performed. That is, the rulers, headers, etc... are tiled with the contentView frame filling the remaining space. When contentInset is not equal to NSEdgeInsetsZero, the rulers, header, etc... are inset as specified. The contentView is is placed underneath these sibling views and is only inset by scroll view border and non-overlay scrollers.
*/
@property NSEdgeInsets contentInsets API_AVAILABLE(macos(10.10));
/* The distance the scrollers are inset from the edge of the scroll view. */
@property NSEdgeInsets scrollerInsets API_AVAILABLE(macos(10.10));
@end
/* This notification is sent at the beginning of a magnify gesture. The notification object is the scroll view performing the magnification.
*/
APPKIT_EXTERN NSNotificationName const NSScrollViewWillStartLiveMagnifyNotification API_AVAILABLE(macos(10.8));
/* This notification is sent at the end of magnify gesture. The notification object is the scroll view view performing the magnification.
*/
APPKIT_EXTERN NSNotificationName const NSScrollViewDidEndLiveMagnifyNotification API_AVAILABLE(macos(10.8));
/* This notification is sent on the main thread at the beginning of user initiated live scroll tracking (gesture scroll or scroller tracking, e.g. thumb dragging).
The notification object is the scroll view performing the scroll.
*/
APPKIT_EXTERN NSNotificationName const NSScrollViewWillStartLiveScrollNotification API_AVAILABLE(macos(10.9));
/* This notification is sent on the main thread after changing the clipview bounds origin due to a user initiated event.
Not all user initiated scrolls are bracketed by a willStart/didEnd notification pair (legacy mice).
The notification object is the scroll view performing the scroll.
*/
APPKIT_EXTERN NSNotificationName const NSScrollViewDidLiveScrollNotification API_AVAILABLE(macos(10.9));
/* This notification is sent on the main thread at the end of live scroll tracking.
The notification object is the scroll view performing the scroll.
*/
APPKIT_EXTERN NSNotificationName const NSScrollViewDidEndLiveScrollNotification API_AVAILABLE(macos(10.9));
@interface NSScrollView (NSRulerSupport)
@property (class, null_resettable) Class rulerViewClass;
@property BOOL rulersVisible;
@property BOOL hasHorizontalRuler;
@property BOOL hasVerticalRuler;
@property (nullable, strong) NSRulerView *horizontalRulerView;
@property (nullable, strong) NSRulerView *verticalRulerView;
@end
typedef NS_ENUM(NSInteger, NSScrollViewFindBarPosition) {
NSScrollViewFindBarPositionAboveHorizontalRuler = 0,
NSScrollViewFindBarPositionAboveContent = 1,
NSScrollViewFindBarPositionBelowContent = 2
} API_AVAILABLE(macos(10.7));
@interface NSScrollView (NSFindBarSupport)
@property NSScrollViewFindBarPosition findBarPosition API_AVAILABLE(macos(10.7));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSSpeechRecognizer.h | /*
NSSpeechRecognizer.h
Application Kit
Copyright (c) 2003-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;
@protocol NSSpeechRecognizerDelegate;
@interface NSSpeechRecognizer : NSObject
- (nullable instancetype)init;
- (void)startListening;
- (void)stopListening;
@property (nullable, weak) id<NSSpeechRecognizerDelegate> delegate;
@property (nullable, copy) NSArray<NSString *> *commands;
@property (nullable, copy) NSString *displayedCommandsTitle;
@property BOOL listensInForegroundOnly;
@property BOOL blocksOtherRecognizers;
@end
@protocol NSSpeechRecognizerDelegate <NSObject>
@optional
- (void)speechRecognizer:(NSSpeechRecognizer *)sender didRecognizeCommand:(NSString *)command;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGLLayer.h | /*
NSOpenGLLayer.h
Application Kit
Copyright (c) 2008-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSView.h>
#import <AppKit/NSOpenGL.h>
#import <AppKit/AppKitDefines.h>
#import <QuartzCore/CAOpenGLLayer.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
NS_OPENGL_CLASS_DEPRECATED("Please use CAMetalLayer instead.", 10.6, 10.14)
@interface NSOpenGLLayer : CAOpenGLLayer
/* Provides access to the layer's associated view. Subclasses shouldn't invoke -setView:, but can override it if desired to intercept the layer's association to, or dissociation from, a view.
*/
@property (nullable, weak) NSView *view;
/* Provides access to the layer's associated NSOpenGLPixelFormat. Subclasses shouldn't invoke -setOpenGLPixelFormat:, but can override it if desired to intercept assignment of the layer's pixel format.
*/
@property (nullable, strong) NSOpenGLPixelFormat *openGLPixelFormat;
/* Provides access to the layer's associated NSOpenGLContext. Subclasses shouldn't invoke -setOpenGLContext:, but can override it if desired to intercept assignment of the layer's context.
*/
@property (nullable, strong) NSOpenGLContext *openGLContext;
/* Invoked by AppKit to ask for the pixel format to use. Should return an autoreleased NSOpenGLPixelFormat suitable for the displays specified by "mask". (In practice, this means including an NSOpenGLPFAScreenMask specification in the pixel format attribute list that's used to instantiate the NSOpenGLPixelFormat.)
*/
- (NSOpenGLPixelFormat *)openGLPixelFormatForDisplayMask:(uint32_t)mask;
/* Invoked by AppKit to ask for the OpenGL context to use. Should return an autoreleased NSOpenGLContext.
*/
- (NSOpenGLContext *)openGLContextForPixelFormat:(NSOpenGLPixelFormat *)pixelFormat;
/* Invoked by AppKit to ask the layer whether it can draw. Normally one would return YES, but one can return NO to cause the current frame to be skipped.
*/
- (BOOL)canDrawInOpenGLContext:(NSOpenGLContext *)context pixelFormat:(NSOpenGLPixelFormat *)pixelFormat forLayerTime:(CFTimeInterval)t displayTime:(const CVTimeStamp *)ts;
/* Invoked by AppKit to ask the layer to draw.
*/
- (void)drawInOpenGLContext:(NSOpenGLContext *)context pixelFormat:(NSOpenGLPixelFormat *)pixelFormat forLayerTime:(CFTimeInterval)t displayTime:(const CVTimeStamp *)ts;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSClickGestureRecognizer.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/AppKitDefines.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSPopUpButton.h | /*
NSPopUpButton.h
Application Kit
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSButton.h>
#import <AppKit/NSMenuItemCell.h>
#import <AppKit/NSMenuItem.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSMenu;
@interface NSPopUpButton : NSButton
- (instancetype)initWithFrame:(NSRect)buttonFrame pullsDown:(BOOL)flag;
// Overrides behavior of NSView. This is the menu for the popup, not a context menu. PopUpButtons do not have context menus.
@property (nullable, strong) NSMenu *menu;
// Behavior settings
@property BOOL pullsDown;
@property BOOL autoenablesItems;
@property NSRectEdge preferredEdge;
// The preferred edge is used for pull down menus and for popups under severe screen position restrictions. It indicates what edge of the cell the menu should pop out from.
// Adding and removing items
- (void)addItemWithTitle:(NSString *)title;
- (void)addItemsWithTitles:(NSArray<NSString *> *)itemTitles;
- (void)insertItemWithTitle:(NSString *)title atIndex:(NSInteger)index;
- (void)removeItemWithTitle:(NSString *)title;
- (void)removeItemAtIndex:(NSInteger)index;
- (void)removeAllItems;
// Accessing the items
@property (readonly, copy) NSArray<NSMenuItem *> *itemArray;
@property (readonly) NSInteger numberOfItems;
- (NSInteger)indexOfItem:(NSMenuItem *)item;
- (NSInteger)indexOfItemWithTitle:(NSString *)title;
- (NSInteger)indexOfItemWithTag:(NSInteger)tag;
- (NSInteger)indexOfItemWithRepresentedObject:(nullable id)obj;
- (NSInteger)indexOfItemWithTarget:(nullable id)target andAction:(nullable SEL)actionSelector;
- (nullable NSMenuItem *)itemAtIndex:(NSInteger)index;
- (nullable NSMenuItem *)itemWithTitle:(NSString *)title;
@property (nullable, readonly, strong) NSMenuItem *lastItem;
// Dealing with selection
- (void)selectItem:(nullable NSMenuItem *)item;
- (void)selectItemAtIndex:(NSInteger)index;
- (void)selectItemWithTitle:(NSString *)title;
- (BOOL)selectItemWithTag:(NSInteger)tag;
- (void)setTitle:(NSString *)string;
@property (nullable, readonly, strong) NSMenuItem *selectedItem;
@property (readonly) NSInteger indexOfSelectedItem;
@property (readonly) NSInteger selectedTag;
- (void)synchronizeTitleAndSelectedItem;
// Title conveniences
- (NSString *)itemTitleAtIndex:(NSInteger)index;
@property (readonly, copy) NSArray<NSString *> *itemTitles;
@property (nullable, readonly, copy) NSString *titleOfSelectedItem;
@end
/* Notifications */
APPKIT_EXTERN NSNotificationName NSPopUpButtonWillPopUpNotification;
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSSearchField.h | /*
NSSearchField.h
Application Kit
Copyright (c) 2003-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
typedef NSString * NSSearchFieldRecentsAutosaveName NS_SWIFT_BRIDGED_TYPEDEF;
@class NSSearchField;
@protocol NSSearchFieldDelegate <NSTextFieldDelegate>
@optional
- (void)searchFieldDidStartSearching:(NSSearchField *)sender API_AVAILABLE(macos(10.11));
- (void)searchFieldDidEndSearching:(NSSearchField *)sender API_AVAILABLE(macos(10.11));
@end
@interface NSSearchField : NSTextField
// The rectangle for the search text within the bounds of the search field. Subclasses can override this method for custom layout purposes.
@property (readonly) NSRect searchTextBounds API_AVAILABLE(macos(11.0));
// The rectangle for the search button within the bounds of the search field. Subclasses can override this method for custom layout purposes.
@property (readonly) NSRect searchButtonBounds API_AVAILABLE(macos(11.0));
// The rectangle for the cancel button within the bounds of the search field. Subclasses can override this method for custom layout purposes.
@property (readonly) NSRect cancelButtonBounds API_AVAILABLE(macos(11.0));
/* if app wants to do custom search lists. will return empty array if no searches */
@property (copy) NSArray<NSString *> *recentSearches;
/* must be set to use. default is nil which means no autosave. */
@property (nullable, copy) NSSearchFieldRecentsAutosaveName recentsAutosaveName;
/* set/get search menu template. Menu can use custom tagged items to indicate special items. this menu isn't actually set but used to construct the dynamic search menu. if cleared, then we don't track recents. */
@property (nullable, strong) NSMenu *searchMenuTemplate API_AVAILABLE(macos(10.10));
/* if clear, send action on each key stroke (after sufficient amount of time so we don't interfere with typing). if set, send only on return/enter or clicking magnifying search button */
@property BOOL sendsWholeSearchString API_AVAILABLE(macos(10.10));
/* set/get limit max recents. allowable between 0 and 254. setting -1 will use default. */
@property NSInteger maximumRecents API_AVAILABLE(macos(10.10));
@property BOOL sendsSearchStringImmediately API_AVAILABLE(macos(10.10));
@property (nullable, weak) id<NSSearchFieldDelegate> delegate API_AVAILABLE(macos(10.11));
@end
@interface NSSearchField (NSSearchField_Deprecated)
- (NSRect)rectForSearchTextWhenCentered:(BOOL)isCentered API_DEPRECATED_WITH_REPLACEMENT("searchTextBounds", macos(10.11, 12.0));
- (NSRect)rectForSearchButtonWhenCentered:(BOOL)isCentered API_DEPRECATED_WITH_REPLACEMENT("searchButtonBounds", macos(10.11, 12.0));
- (NSRect)rectForCancelButtonWhenCentered:(BOOL)isCentered API_DEPRECATED_WITH_REPLACEMENT("cancelButtonBounds", macos(10.11, 12.0));
@property BOOL centersPlaceholder API_DEPRECATED("The placeholder centering UI design is no longer available. Setting this property is no-op.", macos(10.11, 12.0));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSCustomImageRep.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSStoryboard.h | /*
NSStoryboard.h
Application Kit
Copyright (c) 2013-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
typedef NSString * NSStoryboardName NS_SWIFT_BRIDGED_TYPEDEF;
typedef NSString * NSStoryboardSceneIdentifier NS_SWIFT_BRIDGED_TYPEDEF;
typedef id _Nullable (^NSStoryboardControllerCreator)(NSCoder *coder);
API_AVAILABLE(macos(10.10))
@interface NSStoryboard : NSObject
/* The main UI storyboard for the application, specified by the "NSMainStoryboardFile" key in its Info.plist */
@property (class, readonly, strong, nullable) NSStoryboard *mainStoryboard API_AVAILABLE(macos(10.13));
/* This method instantiates a storyboard to represent the file with 'name' in the given bundle. The bundle argument is used to resolve resource references, typically to images, in the archived controllers. The bundle argument can be nil indicating that the main bundle should be used. */
+ (instancetype)storyboardWithName:(NSStoryboardName)name bundle:(nullable NSBundle *)storyboardBundleOrNil;
/* Every storyboard may have an initial view or window controller. Each invocation of this method instantiates an instance of the initial controller. The developer chooses the initial controller in an inspector within Interface Builder. */
- (nullable id)instantiateInitialController;
/* Every storyboard may have an initial view or window controller. Each invocation of this method instantiates an instance of the initial controller. The developer chooses the initial controller in an inspector within Interface Builder. A creator can be specified for controller instantiation, giving the developer a chance to call an initalizer that takes an NSCoder and additional arguments. If the block returns nil, the initial view controller will be created using the standard initWithCoder: initializer. */
- (nullable id)instantiateInitialControllerWithCreator:(nullable NS_NOESCAPE NSStoryboardControllerCreator)block API_AVAILABLE(macos(10.15));
/* Controllers in Interface Builder have an optional identifier within the storyboard. That identifier is set from the inspector in Interface Builder. The identifiers are optional, meaning that the developer only has to assign an identifier to a controller if they want to be able to manually invoke this method from code. */
- (id)instantiateControllerWithIdentifier:(NSStoryboardSceneIdentifier)identifier;
/* Controllers in Interface Builder have an optional identifier within the storyboard. That identifier is set from the inspector in Interface Builder. The identifiers are optional, meaning that the developer only has to assign an identifier to a controller if they want to be able to manually invoke this method from code. A creator can be specified for controller instantiation, giving the developer a chance to call an initalizer that takes an NSCoder and additional arguments. If the block returns nil, the view controller will be created using the standard initWithCoder: initializer. */
- (id)instantiateControllerWithIdentifier:(NSStoryboardSceneIdentifier)identifier creator:(nullable NS_NOESCAPE NSStoryboardControllerCreator)block API_AVAILABLE(macos(10.15));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSScreen.h | /*
NSScreen.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDate.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSNotification.h>
#import <AppKit/NSGraphics.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSColorSpace;
@interface NSScreen : NSObject
@property (class, readonly, copy) NSArray<NSScreen *> *screens; /* All screens; first one is "zero" screen */
@property (class, readonly, nullable, strong) NSScreen *mainScreen; /* Screen with key window */
@property (class, readonly, nullable, strong) NSScreen *deepestScreen;
/* screensHaveSeparateSpaces returns YES if each screen has its own set of spaces. This is a system setting and does not necessarily imply that there are multiple screens, nor that there are multiple spaces on any one screen
*/
@property (class, readonly) BOOL screensHaveSeparateSpaces API_AVAILABLE(macos(10.9));
@property (readonly) NSWindowDepth depth;
@property (readonly) NSRect frame;
@property (readonly) NSRect visibleFrame;
@property (readonly, copy) NSDictionary<NSDeviceDescriptionKey, id> *deviceDescription;
@property (nullable, readonly, strong) NSColorSpace *colorSpace API_AVAILABLE(macos(10.6));
@property (readonly) const NSWindowDepth *supportedWindowDepths NS_RETURNS_INNER_POINTER; /* 0 terminated */
/* canRepresentDisplayGamut: returns YES if the colorSpace of the receiving screen is capable of representing the given display gamut
*/
- (BOOL)canRepresentDisplayGamut:(NSDisplayGamut)displayGamut API_AVAILABLE(macos(10.12));
/* Convert to/from the device pixel aligned coordinates sytem of a display
*/
- (NSRect)convertRectToBacking:(NSRect)rect API_AVAILABLE(macos(10.7));
- (NSRect)convertRectFromBacking:(NSRect)rect API_AVAILABLE(macos(10.7));
/* Uses NSIntegralRectWithOptions() to produce a pixel aligned rectangle on the target screen from the given input rectangle in global screen coordinates.
*/
- (NSRect)backingAlignedRect:(NSRect)rect options:(NSAlignmentOptions)options API_AVAILABLE(macos(10.7));
/* Returns the scale factor representing the number of backing store pixels corresponding to each linear unit in screen space on this NSScreen. This method is provided for rare cases when the explicit scale factor is needed. Please use -convert*ToBacking: methods whenever possible.
*/
@property (readonly) CGFloat backingScaleFactor API_AVAILABLE(macos(10.7));
@property (readonly, copy) NSString *localizedName API_AVAILABLE(macos(10.15));
/* Indicates the obscured distance from each edge of the screen */
@property (readonly) NSEdgeInsets safeAreaInsets API_AVAILABLE(macos(12.0));
/* The following two rects are at the top of the screen, outside the rectangle defined by safeAreaInsets, but also unobscured. These rects are empty if there are no additional unobscured areas */
@property (readonly) NSRect auxiliaryTopLeftArea API_AVAILABLE(macos(12.0));
@property (readonly) NSRect auxiliaryTopRightArea API_AVAILABLE(macos(12.0));
@end
/* Notifications */
APPKIT_EXTERN NSNotificationName const NSScreenColorSpaceDidChangeNotification API_AVAILABLE(macos(10.6)); /* The notification object is the screen whose profile has changed */
// Extended Dynamic Range
@interface NSScreen ()
/* Returns the current maximum color component value for the screen. Typically the maximum is 1.0, but if any rendering context on the screen has requested extended dynamic range, it may return a value greater than 1.0, depending on system capabilities and other conditions. Only rendering contexts that support extended dynamic range can use values greater than 1.0. When the value changes, NSApplicationDidChangeScreenParametersNotification will be posted.
*/
@property (readonly) CGFloat maximumExtendedDynamicRangeColorComponentValue API_AVAILABLE(macos(10.11));
/* Returns the maximum color component value that the screen is capable of when extended dynamic range is enabled, regardless of whether or not extended dynamic range is currently enabled.
*/
@property (readonly) CGFloat maximumPotentialExtendedDynamicRangeColorComponentValue API_AVAILABLE(macos(10.15));
/* Returns the current maximum color component value for reference rendering to the screen. If values beyond this are used, the display hardware may adjust content to fit into its dynamic range. For screens that do not support reference rendering, this will return 0.
*/
@property (readonly) CGFloat maximumReferenceExtendedDynamicRangeColorComponentValue API_AVAILABLE(macos(10.15));
@end
// Variable Rate Refresh
@interface NSScreen ()
/** The maximum frames per second this screen supports.
*/
@property (readonly) NSInteger maximumFramesPerSecond API_AVAILABLE(macos(12.0));
/** The minimum refresh interval this screen supports, in seconds.
This is the shortest amount of time a frame will be present on screen.
minimumRefreshInterval and maximumRefreshInterval will be the same for displays that do not support variable refresh rates.
*/
@property (readonly) NSTimeInterval minimumRefreshInterval API_AVAILABLE(macos(12.0));
/** The maximum refresh interval this screen supports, in seconds.
minimumRefreshInterval and maximumRefreshInterval will be the same for displays that do not support variable refresh rates.
*/
@property (readonly) NSTimeInterval maximumRefreshInterval API_AVAILABLE(macos(12.0));
/** The update granularity of the screen's current mode, in seconds.
The display will update at the next boundary defined by the granularity, after the minimum refresh interval has been reached. When 0, the display can update at any time between the minimum and maximum refresh rate intervals of the screen. Fixed refresh rate screen modes will return the refresh interval as the update granularity (e.g. 16.66ms for 60Hz refresh rates), meaning updates only occur at refresh rate boundaries.
*/
@property (readonly) NSTimeInterval displayUpdateGranularity API_AVAILABLE(macos(12.0));
/** The time at which the last framebuffer update occurred on the display, in seconds since startup that the system has been awake.
*/
@property (readonly) NSTimeInterval lastDisplayUpdateTimestamp API_AVAILABLE(macos(12.0));
@end
@interface NSScreen (NSDeprecated)
/* This method is deprecated and should not be used by applications targeting Mac OS X 10.7 or later.
The implementation of this method will always return 1.0. Please use -convertRectToBacking: or -backingScaleFactor instead.
*/
- (CGFloat)userSpaceScaleFactor API_DEPRECATED("Use -convertRectToBacking: or -backingScaleFactor instead", macos(10.4,10.7));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSColorPanel.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSGlyphInfo.h | #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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSSound.h | /*
NSSound.h
Application Kit
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSPasteboard.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSBundle.h>
#import <Foundation/NSDate.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSData, NSURL;
@protocol NSSoundDelegate;
APPKIT_EXTERN NSPasteboardType const NSSoundPboardType;
typedef NSString * NSSoundName NS_SWIFT_BRIDGED_TYPEDEF;
typedef NSString * NSSoundPlaybackDeviceIdentifier NS_SWIFT_BRIDGED_TYPEDEF;
@interface NSSound : NSObject <NSCopying, NSSecureCoding, NSPasteboardReading, NSPasteboardWriting>
/* If this finds & creates the sound, only name is saved when archived.
*/
+ (nullable NSSound *)soundNamed:(NSSoundName)name;
/* When archived, byref ? saves url : saves contents.
*/
- (nullable instancetype)initWithContentsOfURL:(NSURL *)url byReference:(BOOL)byRef;
- (nullable instancetype)initWithContentsOfFile:(NSString *)path byReference:(BOOL)byRef;
/* Whether the data comes in from disk, or via this method, NSSound expects it to have a proper magic number, sound header, and data. Only uncompressed AIFF data is currently supported.
*/
- (nullable instancetype)initWithData:(NSData *)data;
- (BOOL)setName:(nullable NSSoundName)string;
@property (nullable, readonly, copy) NSSoundName name;
// Pasteboard support
+ (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard;
@property (class, readonly, copy) NSArray<NSString *> *soundUnfilteredTypes API_AVAILABLE(macos(10.5));
- (nullable instancetype)initWithPasteboard:(NSPasteboard *)pasteboard;
- (void)writeToPasteboard:(NSPasteboard *)pasteboard;
// Sound operations
- (BOOL)play; /* sound is played asynchronously */
- (BOOL)pause; /* returns NO if sound not paused */
- (BOOL)resume; /* returns NO if sound not resumed */
- (BOOL)stop;
@property (getter=isPlaying, readonly) BOOL playing;
@property (nullable, weak) id<NSSoundDelegate> delegate;
/* Returns the duration of the sound in seconds.
*/
@property (readonly) NSTimeInterval duration API_AVAILABLE(macos(10.5));
/* Sets and gets the volume for the sound without affecting the system-wide volume. The valid range is between 0. and 1., inclusive.
*/
@property float volume API_AVAILABLE(macos(10.5));
/* Getter: If the sound is playing, currentTime returns the number of seconds into the sound where playing is occurring. If the sound is not playing, currentTime returns the number of seconds into the sound where playing would start.
Setter: Sets the location of the currently playing audio to seconds. If the sound is not playing, this sets the number of seconds into the sound where playing would begin. The currentTime is not archived, copied, or stored on the pasteboard - all new sounds start with a currentTime of 0.
*/
@property NSTimeInterval currentTime API_AVAILABLE(macos(10.5));
/* Setter: Sets whether the sound should automatically restart when it is finished playing. If the sound is currently playing, this takes effect immediately. The default is NO. A looping sound does not send sound:didFinishPlaying: to its delegate unless it is sent a stop message.
Getter: Returns whether the sound will automatically restart when it is finished playing.
*/
@property BOOL loops API_AVAILABLE(macos(10.5));
/* Setter: Set the UID of the audio device where playback will occur. Pass nil to play on the default output device.
Getter: Get the UID of the audio device where playback will occur. Returns nil if playback tracks the default device, which is the default.
*/
@property (nullable, copy) NSSoundPlaybackDeviceIdentifier playbackDeviceIdentifier API_AVAILABLE(macos(10.5));
/* Set the channel mapping for the sound. Pass an array of NSNumbers, which maps sound channels to device channels. Pass -1 to indicate that a particular sound channel should be ignored. For any channel, instead of an NSNumber, you may also pass an NSArray of NSNumbers to map a single sound channel to multiple device channels.
*/
- (void)setChannelMapping:(null_unspecified NSArray *)channelMapping API_DEPRECATED("", macos(10.5,10.9));
/* Get the channel mapping for the sound. By default, a stereo sound maps its first and second channels to the left and right device channels, while a mono sound maps its single channel across every device channel.
*/
- (null_unspecified NSArray *)channelMapping API_DEPRECATED("", macos(10.5,10.9));
@end
@interface NSSound (NSDeprecated)
/* You can now use +soundUnfilteredTypes to get an array of Uniform Type Identifiers (UTIs).
*/
+ (null_unspecified NSArray *)soundUnfilteredFileTypes API_DEPRECATED("", macos(10.0,10.5));
+ (null_unspecified NSArray *)soundUnfilteredPasteboardTypes API_DEPRECATED("", macos(10.0,10.5));
@end
@protocol NSSoundDelegate <NSObject>
@optional
- (void)sound:(NSSound *)sound didFinishPlaying:(BOOL)flag;
@end
@interface NSBundle (NSBundleSoundExtensions)
/* May return nil if no file found
*/
- (nullable NSString *)pathForSoundResource:(NSSoundName)name;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSWindowScripting.h | /*
NSWindowScripting.h
AppKit Framework
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSWindow.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSCloseCommand;
@class NSScriptCommand;
@interface NSWindow(NSScripting)
// Key value coding (KVC) compliant get-accessors for the same-named attributes declared in Cocoa's definition of the Standard Suite. The -isMiniaturized, -isVisible, and -isZoomed methods, declared in NSWindow.h, also serve as KVC accessors.
@property (readonly) BOOL hasCloseBox;
@property (readonly) BOOL hasTitleBar;
@property (getter=isFloatingPanel, readonly) BOOL floatingPanel;
@property (getter=isMiniaturizable, readonly) BOOL miniaturizable;
@property (getter=isModalPanel, readonly) BOOL modalPanel;
@property (getter=isResizable, readonly) BOOL resizable;
@property (getter=isZoomable, readonly) BOOL zoomable;
@property NSInteger orderedIndex;
// Key value coding compliant set-accessors for the like-named attributes declared in Cocoa's definition of the Standard Suite. Attributes that don't have corresponding methods here are read-only.
- (void)setIsMiniaturized:(BOOL)flag;
- (void)setIsVisible:(BOOL)flag;
- (void)setIsZoomed:(BOOL)flag;
// Handlers for script commands declared in Cocoa's definition of the Standard suite.
- (nullable id)handleCloseScriptCommand:(NSCloseCommand *)command;
- (nullable id)handlePrintScriptCommand:(NSScriptCommand *)command;
- (nullable id)handleSaveScriptCommand:(NSScriptCommand *)command;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSButtonCell.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSSpellServer.h | /*
NSSpellServer.h
Application Kit
Copyright (c) 1990-2021, Apple Inc.
All rights reserved.
*/
#warning "NSSpellServer class has moved to the Foundation framework. Please adjust your header import."
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSUserInterfaceLayout.h | /*
NSUserInterfaceLayout.h
Application Kit
Copyright (c) 2015-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/AppKitDefines.h>
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
typedef NS_ENUM(NSInteger, NSUserInterfaceLayoutDirection) {
NSUserInterfaceLayoutDirectionLeftToRight = 0,
NSUserInterfaceLayoutDirectionRightToLeft = 1
};
typedef NS_ENUM(NSInteger, NSUserInterfaceLayoutOrientation) {
NSUserInterfaceLayoutOrientationHorizontal = 0,
NSUserInterfaceLayoutOrientationVertical = 1
} API_AVAILABLE(macos(10.9));
API_UNAVAILABLE_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSUserActivity.h | /*
NSUserActivity.h
Application Kit
Copyright (c) 2014-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSUserActivity.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSResponder.h>
#import <AppKit/NSDocument.h>
#if __OBJC2__
#define NS_USER_ACTIVITY_SUPPORTED 1
#endif
#if NS_USER_ACTIVITY_SUPPORTED
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@protocol NSUserActivityRestoring <NSObject>
/* This method exists to be overridden and will be called from the main thread. It will be called on any objects passed to the restorationHandler given to application:continueUserActivity:restorationHandler: below. You should use the state in the userInfo to restore the object. On OS X, activities managed by NSDocument can be restored automatically, if NO is returned from application:continueActivity:restorationHandler: (or it is unimplemented). In this situation, the document will be opened via -[NSDocumentController openDocumentWithContentsOfURL:display:completionHandler:], and will have restoreUserActivityState: called on it. */
- (void)restoreUserActivityState:(NSUserActivity *)userActivity API_AVAILABLE(macos(10.10));
@end
@interface NSResponder (NSUserActivity) <NSUserActivityRestoring>
/*
Setting an NSUserActivity will cause it to become managed by AppKit/UIKIt. NSUserActivities managed by AppKit/UIKIt will be saved automatically at an appropriate time. You will have an opportunity to add state representing the user’s activity via the below updateUserActivityState: override. It is recommended that you override the updateUserActivityState: method to lazily write any state to the userInfo.
On OS X, NSUserActivities managed by NSResponder will automatically becomeCurrent based on the main window and the responder chain.
To unassociate an object from the user activity, you can set this to nil. If no objects are associated with an NSUserActivity managed by AppKit/UIKit, it will be removed.
This property can be used from any thread.
This property is KVO observable.
*/
@property (nullable, strong) NSUserActivity *userActivity API_AVAILABLE(macos(10.10));
/* This method exists to be overridden and will be called from the main thread. You should save any state representing the user's activity into the NSUserActivity's userInfo via its -addUserInfoEntriesFromDictionary method. When the state is out of date, you should mark the userActivity as needing to save via the needsSave property, and your override will be invoked again at an appropriate time. */
- (void)updateUserActivityState:(NSUserActivity *)userActivity API_AVAILABLE(macos(10.10));
@end
@interface NSDocument (NSUserActivity) <NSUserActivityRestoring>
/*
This works just like the above responder methods for the most part.
On OS X, NSUserActivities managed by NSDocument will automatically become current when any of the document window controller's window's become main. You will need to invoke [[document userActivity] becomeCurrent] at an appropriate time if there aren't any.
If there is a CFBundleDocumentTypes entry for the document's type with a NSUbiquitousDocumentUserActivityType key, AppKit/UIKIt will automatically create an NSUserActivity with the given activityType when the document is ubiquitous. When it is non-ubiquitous, the userActivity will be nil. Note that userActivity is KVO observable, in case the userActivity is being shared with other objects that need to be kept in sync as the document moves into and out of iCloud.
*/
@property (nullable, strong) NSUserActivity *userActivity API_AVAILABLE(macos(10.10));
/* On OS X, The default implementation of this will put the fileURL into the userInfo with the NSUserActivityDocumentURLKey. NSDocument will automatically call needsSave on the userActivity when the fileURL changes. */
- (void)updateUserActivityState:(NSUserActivity *)activity API_AVAILABLE(macos(10.10));
@end
#if !TARGET_OS_IPHONE
/* When NSUbiquitousDocumentUserActivityType is present in a CFBundleDocumentTypes entry, AppKit will automatically create an NSUserActivity for documents in iCloud, using the given activityType. */
APPKIT_EXTERN NSString * const NSUserActivityDocumentURLKey API_AVAILABLE(macos(10.10));
#endif
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTextInputClient.h | /*
NSTextInputClient.h
Application Kit
Copyright (c) 2006-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSRange.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSAttributedString.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSAttributedString;
@protocol NSTextInputClient
@required
/* The receiver inserts string replacing the content specified by replacementRange. string can be either an NSString or NSAttributedString instance.
*/
- (void)insertText:(id)string replacementRange:(NSRange)replacementRange;
/* The receiver invokes the action specified by selector.
*/
- (void)doCommandBySelector:(SEL)selector;
/* The receiver inserts string replacing the content specified by replacementRange. string can be either an NSString or NSAttributedString instance. selectedRange specifies the selection inside the string being inserted; hence, the location is relative to the beginning of string. When string is an NSString, the receiver is expected to render the marked text with distinguishing appearance (i.e. NSTextView renders with -markedTextAttributes).
*/
- (void)setMarkedText:(id)string selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange;
/* The receiver unmarks the marked text. If no marked text, the invocation of this method has no effect.
*/
- (void)unmarkText;
/* Returns the selection range. The valid location is from 0 to the document length.
*/
- (NSRange)selectedRange;
/* Returns the marked range. Returns {NSNotFound, 0} if no marked range.
*/
- (NSRange)markedRange;
/* Returns whether or not the receiver has marked text.
*/
- (BOOL)hasMarkedText;
/* Returns attributed string specified by range. It may return nil. If non-nil return value and actualRange is non-NULL, it contains the actual range for the return value. The range can be adjusted from various reasons (i.e. adjust to grapheme cluster boundary, performance optimization, etc).
*/
- (nullable NSAttributedString *)attributedSubstringForProposedRange:(NSRange)range actualRange:(nullable NSRangePointer)actualRange;
/* Returns an array of attribute names recognized by the receiver.
*/
- (NSArray<NSAttributedStringKey> *)validAttributesForMarkedText;
/* Returns the first logical rectangular area for range. The return value is in the screen coordinate. The size value can be negative if the text flows to the left. If non-NULL, actuallRange contains the character range corresponding to the returned area.
*/
- (NSRect)firstRectForCharacterRange:(NSRange)range actualRange:(nullable NSRangePointer)actualRange;
/* Returns the index for character that is nearest to point. point is in the screen coordinate system.
*/
- (NSUInteger)characterIndexForPoint:(NSPoint)point;
@optional
/* Returns an attributed string representing the receiver's document content. An NSTextInputClient can implement this interface if can be done efficiently. The caller of this interface can random access arbitrary portions of the receiver's content more efficiently.
*/
- (NSAttributedString *)attributedString;
/* Returns the fraction of distance for point from the left side of the character. This allows caller to perform precise selection handling.
*/
- (CGFloat)fractionOfDistanceThroughGlyphForPoint:(NSPoint)point;
/* Returns the baseline position relative to the origin of rectangle returned by -firstRectForCharacterRange:actualRange:. This information allows the caller to access finer-grained character position inside the NSTextInputClient document.
*/
- (CGFloat)baselineDeltaForCharacterAtIndex:(NSUInteger)anIndex;
/* Returns the window level of the receiver. An NSTextInputClient can implement this interface to specify its window level if it is higher than NSFloatingWindowLevel.
*/
- (NSInteger)windowLevel;
/* Returns if the marked text is in vertical layout.
*/
- (BOOL)drawsVerticallyForCharacterAtIndex:(NSUInteger)charIndex API_AVAILABLE(macos(10.6));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSButtonTouchBarItem.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h | /*
NSWindow.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDate.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSAnimation.h>
#import <AppKit/NSAppearance.h>
#import <AppKit/NSApplication.h>
#import <AppKit/NSGraphics.h>
#import <AppKit/NSPasteboard.h>
#import <AppKit/NSResponder.h>
#import <AppKit/NSUserInterfaceItemIdentification.h>
#import <AppKit/NSUserInterfaceValidation.h>
#import <AppKit/NSMenu.h>
#import <ApplicationServices/ApplicationServices.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSButton, NSButtonCell, NSColor, NSImage, NSScreen, NSNotification, NSText, NSView, NSMutableSet, NSSet, NSDate, NSToolbar, NSGraphicsContext, NSURL, NSColorSpace, NSDockTile, NSViewController, NSTitlebarAccessoryViewController, NSEvent, NSWindowController, NSWindowTab, NSWindowTabGroup;
@protocol NSWindowDelegate;
static const NSAppKitVersion NSAppKitVersionNumberWithCustomSheetPosition = 686.0;
static const NSAppKitVersion NSAppKitVersionNumberWithDeferredWindowDisplaySupport = 1019.0;
typedef NS_OPTIONS(NSUInteger, NSWindowStyleMask) {
NSWindowStyleMaskBorderless = 0,
NSWindowStyleMaskTitled = 1 << 0,
NSWindowStyleMaskClosable = 1 << 1,
NSWindowStyleMaskMiniaturizable = 1 << 2,
NSWindowStyleMaskResizable = 1 << 3,
/* Specifies a window with textured background. Textured windows generally don't draw a top border line under the titlebar/toolbar. To get that line, use the NSUnifiedTitleAndToolbarWindowMask mask.
*/
NSWindowStyleMaskTexturedBackground API_DEPRECATED("Textured window style should no longer be used", macos(10.2, 11.0)) = 1 << 8,
/* Specifies a window whose titlebar and toolbar have a unified look - that is, a continuous background. Under the titlebar and toolbar a horizontal separator line will appear.
*/
NSWindowStyleMaskUnifiedTitleAndToolbar = 1 << 12,
/* When present, the window will appear full screen. This mask is automatically toggled when toggleFullScreen: is called.
*/
NSWindowStyleMaskFullScreen API_AVAILABLE(macos(10.7)) = 1 << 14,
/* If set, the contentView will consume the full size of the window; it can be combined with other window style masks, but is only respected for windows with a titlebar.
Utilizing this mask opts-in to layer-backing. Utilize the contentLayoutRect or auto-layout contentLayoutGuide to layout views underneath the titlebar/toolbar area.
*/
NSWindowStyleMaskFullSizeContentView API_AVAILABLE(macos(10.10)) = 1 << 15,
/* The following are only applicable for NSPanel (or a subclass thereof)
*/
NSWindowStyleMaskUtilityWindow = 1 << 4,
NSWindowStyleMaskDocModalWindow = 1 << 6,
NSWindowStyleMaskNonactivatingPanel = 1 << 7, // Specifies that a panel that does not activate the owning application
NSWindowStyleMaskHUDWindow API_AVAILABLE(macos(10.6)) = 1 << 13 // Specifies a heads up display panel
};
// Additional NSModalResponse values
static const NSModalResponse NSModalResponseOK = 1;
static const NSModalResponse NSModalResponseCancel = 0;
/* used with NSRunLoop's performSelector:target:argument:order:modes: */
enum {
NSDisplayWindowRunLoopOrdering = 600000,
NSResetCursorRectsRunLoopOrdering = 700000
};
typedef NS_ENUM(NSUInteger, NSWindowSharingType) {
NSWindowSharingNone = 0, // Window contents may not be read by another process
NSWindowSharingReadOnly = 1, // Window contents may be read but not modified by another process
NSWindowSharingReadWrite = 2 // Window contents may be read or modified by another process
} API_AVAILABLE(macos(10.5));
typedef NS_OPTIONS(NSUInteger, NSWindowCollectionBehavior) {
NSWindowCollectionBehaviorDefault = 0,
NSWindowCollectionBehaviorCanJoinAllSpaces = 1 << 0,
NSWindowCollectionBehaviorMoveToActiveSpace = 1 << 1,
/* You may specify at most one of NSWindowCollectionBehaviorManaged, NSWindowCollectionBehaviorTransient, or NSWindowCollectionBehaviorStationary. If unspecified, the window gets the default behavior determined by its window level */
NSWindowCollectionBehaviorManaged API_AVAILABLE(macos(10.6)) = 1 << 2, // participates in spaces, exposé. Default behavior if windowLevel == NSNormalWindowLevel
NSWindowCollectionBehaviorTransient API_AVAILABLE(macos(10.6)) = 1 << 3, // floats in spaces, hidden by exposé. Default behavior if windowLevel != NSNormalWindowLevel
NSWindowCollectionBehaviorStationary API_AVAILABLE(macos(10.6)) = 1 << 4, // unaffected by exposé. Stays visible and stationary, like desktop window
/* You may specify at most one of NSWindowCollectionBehaviorParticipatesInCycle or NSWindowCollectionBehaviorIgnoresCycle. If unspecified, the window gets the default behavior determined by its window level */
NSWindowCollectionBehaviorParticipatesInCycle API_AVAILABLE(macos(10.6)) = 1 << 5, // default behavior if windowLevel == NSNormalWindowLevel
NSWindowCollectionBehaviorIgnoresCycle API_AVAILABLE(macos(10.6)) = 1 << 6, // default behavior if windowLevel != NSNormalWindowLevel
/* You may specify at most one of NSWindowCollectionBehaviorFullScreenPrimary, NSWindowCollectionBehaviorFullScreenAuxiliary, or NSWindowCollectionBehaviorFullScreenNone. */
NSWindowCollectionBehaviorFullScreenPrimary API_AVAILABLE(macos(10.7)) = 1 << 7, // the frontmost window with this collection behavior will be the fullscreen window.
NSWindowCollectionBehaviorFullScreenAuxiliary API_AVAILABLE(macos(10.7)) = 1 << 8, // windows with this collection behavior can be shown with the fullscreen window.
NSWindowCollectionBehaviorFullScreenNone API_AVAILABLE(macos(10.7)) = 1 << 9, // The window can not be made fullscreen when this bit is set
/* You may specify at most one of NSWindowCollectionBehaviorFullScreenAllowsTiling or NSWindowCollectionBehaviorFullScreenDisallowsTiling, or an assertion will be raised.
The default behavior is to allow any window to participate in full screen tiling, as long as it meets certain requirements, such as being resizable and not a panel or sheet. Windows which are not full screen capable can still become a secondary tile in full screen. A window can explicitly allow itself to be placed into a full screen tile by including NSWindowCollectionBehaviorFullScreenAllowsTiling. Even if a window allows itself to be placed in a tile, it still may not be put in the tile if its minFullScreenContentSize is too large to fit. A window can explicitly disallow itself from being placed in a full screen tile by including NSWindowCollectionBehaviorFullScreenDisallowsTiling. This is useful for non-full screen capable windows to explicitly prevent themselves from being tiled. It can also be used by a full screen window to prevent any other windows from being placed in its full screen tile. */
NSWindowCollectionBehaviorFullScreenAllowsTiling API_AVAILABLE(macos(10.11)) = 1 << 11, // This window can be a full screen tile window. It does not have to have FullScreenPrimary set.
NSWindowCollectionBehaviorFullScreenDisallowsTiling API_AVAILABLE(macos(10.11)) = 1 << 12 // This window can NOT be made a full screen tile window; it still may be allowed to be a regular FullScreenPrimary window.
} API_AVAILABLE(macos(10.5));
typedef NS_ENUM(NSInteger, NSWindowAnimationBehavior) {
NSWindowAnimationBehaviorDefault = 0, // let AppKit infer animation behavior for this window
NSWindowAnimationBehaviorNone = 2, // suppress inferred animations (don't animate)
NSWindowAnimationBehaviorDocumentWindow = 3,
NSWindowAnimationBehaviorUtilityWindow = 4,
NSWindowAnimationBehaviorAlertPanel = 5
} API_AVAILABLE(macos(10.7));
/* Options used in +windowNumbersWithOptions:. If no options are specified, the returned list contains window numbers for visible windows on the active space belonging to the calling application. */
typedef NS_OPTIONS(NSUInteger, NSWindowNumberListOptions) {
NSWindowNumberListAllApplications = 1 << 0,
NSWindowNumberListAllSpaces = 1 << 4
} API_AVAILABLE(macos(10.6));
typedef NS_OPTIONS(NSUInteger, NSWindowOcclusionState) {
/* If set, at least part of the window is visible. If not set, the entire window is occluded. Windows with non-rectangular shapes may be completely occluded on screen but still count as visible, if their bounding box falls into a visible region. Windows that are completely transparent may also still count as visible. */
NSWindowOcclusionStateVisible = 1UL << 1,
} API_AVAILABLE(macos(10.9));
typedef NSInteger NSWindowLevel NS_TYPED_EXTENSIBLE_ENUM;
static const NSWindowLevel NSNormalWindowLevel = kCGNormalWindowLevel;
static const NSWindowLevel NSFloatingWindowLevel = kCGFloatingWindowLevel;
static const NSWindowLevel NSSubmenuWindowLevel = kCGTornOffMenuWindowLevel;
static const NSWindowLevel NSTornOffMenuWindowLevel = kCGTornOffMenuWindowLevel;
static const NSWindowLevel NSMainMenuWindowLevel = kCGMainMenuWindowLevel;
static const NSWindowLevel NSStatusWindowLevel = kCGStatusWindowLevel;
static const NSWindowLevel NSModalPanelWindowLevel = kCGModalPanelWindowLevel;
static const NSWindowLevel NSPopUpMenuWindowLevel = kCGPopUpMenuWindowLevel;
static const NSWindowLevel NSScreenSaverWindowLevel = kCGScreenSaverWindowLevel;
typedef NS_ENUM(NSUInteger, NSSelectionDirection) {
NSDirectSelection = 0,
NSSelectingNext,
NSSelectingPrevious
};
/* Standard window buttons */
typedef NS_ENUM(NSUInteger, NSWindowButton) {
NSWindowCloseButton,
NSWindowMiniaturizeButton,
NSWindowZoomButton,
NSWindowToolbarButton,
NSWindowDocumentIconButton,
NSWindowDocumentVersionsButton API_AVAILABLE(macos(10.7)) = 6,
};
typedef NS_ENUM(NSInteger, NSWindowTitleVisibility) {
/* The default mode has a normal window title and titlebar buttons. */
NSWindowTitleVisible = 0,
/* The always hidden mode hides the title and moves the toolbar up into the area previously occupied by the title. */
NSWindowTitleHidden = 1,
} API_AVAILABLE(macos(10.10));
typedef NS_ENUM(NSInteger, NSWindowToolbarStyle) {
// The default value. The style will be determined by the window's given configuration
NSWindowToolbarStyleAutomatic,
// The toolbar will appear below the window title
NSWindowToolbarStyleExpanded,
// The toolbar will appear below the window title and the items in the toolbar will attempt to have equal widths when possible
NSWindowToolbarStylePreference,
// The window title will appear inline with the toolbar when visible
NSWindowToolbarStyleUnified,
// Same as NSWindowToolbarStyleUnified, but with reduced margins in the toolbar allowing more focus to be on the contents of the window
NSWindowToolbarStyleUnifiedCompact
} API_AVAILABLE(macos(11.0));
static const NSTimeInterval NSEventDurationForever = DBL_MAX;
typedef NS_ENUM(NSInteger, NSWindowUserTabbingPreference) {
NSWindowUserTabbingPreferenceManual,
NSWindowUserTabbingPreferenceAlways,
NSWindowUserTabbingPreferenceInFullScreen,
} API_AVAILABLE(macos(10.12));
typedef NS_ENUM(NSInteger, NSWindowTabbingMode) {
NSWindowTabbingModeAutomatic, // The system automatically prefers to tab this window when appropriate
NSWindowTabbingModePreferred, // The window explicitly should prefer to tab when shown
NSWindowTabbingModeDisallowed // The window explicitly should not prefer to tab when shown
} API_AVAILABLE(macos(10.12));
typedef NS_ENUM(NSInteger, NSTitlebarSeparatorStyle) {
NSTitlebarSeparatorStyleAutomatic,
NSTitlebarSeparatorStyleNone,
NSTitlebarSeparatorStyleLine,
NSTitlebarSeparatorStyleShadow
} API_AVAILABLE(macos(11.0));
typedef NSString * NSWindowFrameAutosaveName NS_SWIFT_BRIDGED_TYPEDEF;
typedef NSString * NSWindowPersistableFrameDescriptor NS_SWIFT_BRIDGED_TYPEDEF;
typedef NSString * NSWindowTabbingIdentifier NS_SWIFT_BRIDGED_TYPEDEF;
@interface NSWindow : NSResponder <NSAnimatablePropertyContainer, NSMenuItemValidation, NSUserInterfaceValidations, NSUserInterfaceItemIdentification, NSAppearanceCustomization, NSAccessibilityElement, NSAccessibility>
+ (NSRect)frameRectForContentRect:(NSRect)cRect styleMask:(NSWindowStyleMask)style;
+ (NSRect)contentRectForFrameRect:(NSRect)fRect styleMask:(NSWindowStyleMask)style;
+ (CGFloat)minFrameWidthWithTitle:(NSString *)title styleMask:(NSWindowStyleMask)style;
@property (class, readonly) NSWindowDepth defaultDepthLimit;
- (NSRect)frameRectForContentRect:(NSRect)contentRect;
- (NSRect)contentRectForFrameRect:(NSRect)frameRect;
- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSWindowStyleMask)style backing:(NSBackingStoreType)backingStoreType defer:(BOOL)flag NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSWindowStyleMask)style backing:(NSBackingStoreType)backingStoreType defer:(BOOL)flag screen:(nullable NSScreen *)screen;
- (instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE; // Use initWithContentRect:. This method will throw an exception for coders that support allowsKeyedCoding, and is only available for compatability with non keyed coding.
@property (copy) NSString *title;
/*
Secondary text that may be displayed adjacent to or below the primary title depending on the configuration of the window.
A value of empty string will remove the subtitle from the window layout.
*/
@property (copy) NSString *subtitle API_AVAILABLE(macos(11.0));
/* See the enum values for how this property works.
*/
@property NSWindowTitleVisibility titleVisibility API_AVAILABLE(macos(10.10)); // Default value is NSWindowTitleVisible
/* When YES, the titlebar doesn't draw its background, allowing all buttons to show through, and "click through" to happen. In general, this is only useful when NSFullSizeContentViewWindowMask is set.
*/
@property BOOL titlebarAppearsTransparent API_AVAILABLE(macos(10.10));
/* Specifies how the titlebar area of the window should appear when the window displays an NSToolbar
*/
@property NSWindowToolbarStyle toolbarStyle API_AVAILABLE(macos(11.0));
/* The contentLayoutRect will return the area inside the window that is for non-obscured content. Typically, this is the same thing as the contentView's frame. However, for windows with the NSFullSizeContentViewWindowMask set, there needs to be a way to determine the portion that is not under the toolbar. The contentLayoutRect returns the portion of the layout that is not obscured under the toolbar. contentLayoutRect is in window coordinates. It is KVO compliant. */
@property (readonly) NSRect contentLayoutRect API_AVAILABLE(macos(10.10));
/* contentLayoutGuide is a corollary to contentLayoutRect. It can be used by autolayout constraints to automatically bind to the contentLayoutRect.
*/
@property (nullable, readonly) id contentLayoutGuide API_AVAILABLE(macos(10.10));
/* The following methods allow you to add accessory views to the titlebar/toolbar area of a window. See NSTitlebarAccessoryViewController for more details.
*/
@property (copy) NSArray<__kindof NSTitlebarAccessoryViewController *> *titlebarAccessoryViewControllers API_AVAILABLE(macos(10.10));
- (void)addTitlebarAccessoryViewController:(NSTitlebarAccessoryViewController *)childViewController API_AVAILABLE(macos(10.10));
- (void)insertTitlebarAccessoryViewController:(NSTitlebarAccessoryViewController *)childViewController atIndex:(NSInteger)index API_AVAILABLE(macos(10.10));
/* NOTE: you can use this method, or removeFromParentViewController, which ever is easier. */
- (void)removeTitlebarAccessoryViewControllerAtIndex:(NSInteger)index API_AVAILABLE(macos(10.10));
/* setRepresentedURL:
If url is not nil and its path is not empty, the window will show a document icon in the titlebar.
If the url represents a filename or other resource with a known icon, that icon will be used as the document icon. Otherwise the default document icon will be used. The icon can be customized using [[NSWindow standardWindowButton:NSWindowDocumentIconButton] setImage:customImage]. If url is not nil and its path is not empty, the window will have a pop-up menu which can be shown via command-click on the area containing the document icon and title. By default, this menu will display the path components of the url. The presence and contents of this menu can be controlled by the delegate method window:shouldPopUpDocumentPathMenu:If the url is nil or has an empty path, the window will not show a document icon and will not have a pop-up menu available via command-click.
*/
@property (nullable, copy) NSURL *representedURL API_AVAILABLE(macos(10.5));
@property (copy) NSString *representedFilename;
- (void)setTitleWithRepresentedFilename:(NSString *)filename;
@property (getter=isExcludedFromWindowsMenu) BOOL excludedFromWindowsMenu;
@property (nullable, strong) __kindof NSView *contentView;
@property (nullable, weak) id<NSWindowDelegate> delegate;
@property (readonly) NSInteger windowNumber;
/* NOTE: The styleMask can only be set on OS 10.6 and later. Valid styleMask settings have the same restrictions as the styleMask passed to -initWithContentRect:styleMask:backing:defer:. Some styleMask changes will cause the view hierarchy to be rebuilt, since there is a different subclass for the top level view of a borderless window than for the top level view of a titled window. */
@property NSWindowStyleMask styleMask;
- (nullable NSText *)fieldEditor:(BOOL)createFlag forObject:(nullable id)object;
- (void)endEditingFor:(nullable id)object;
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(nullable NSScreen *)screen;
- (void)setFrame:(NSRect)frameRect display:(BOOL)flag;
- (void)setContentSize:(NSSize)size;
- (void)setFrameOrigin:(NSPoint)point;
- (void)setFrameTopLeftPoint:(NSPoint)point;
- (NSPoint)cascadeTopLeftFromPoint:(NSPoint)topLeftPoint;
@property (readonly) NSRect frame;
/*! Subclasses can override \c animationResizeTime: to control the total time for the frame change.
\c newFrame is the rect passed into \c setFrame:display:animate:
*/
- (NSTimeInterval)animationResizeTime:(NSRect)newFrame;
/*! \c setFrame:display:animate: is equivalent to \c setFrame:display: if the \c animateFlag is NO.
If the \c animationFlag is YES, this method will perform a smooth resize of the window, where the total time for the resize is specified by \c -animationResizeTime:
*/
- (void)setFrame:(NSRect)frameRect display:(BOOL)displayFlag animate:(BOOL)animateFlag;
@property (readonly) BOOL inLiveResize API_AVAILABLE(macos(10.6));
@property NSSize resizeIncrements;
@property NSSize aspectRatio;
@property NSSize contentResizeIncrements;
@property NSSize contentAspectRatio;
@property BOOL viewsNeedDisplay;
- (void)displayIfNeeded;
- (void)display;
@property BOOL preservesContentDuringLiveResize;
- (void)update;
- (BOOL)makeFirstResponder:(nullable NSResponder *)responder;
/* firstResponder is Key Value Observing (KVO) compliant. */
@property (readonly, weak) NSResponder *firstResponder;
@property (readonly) NSEventModifierFlags resizeFlags;
- (void)close;
@property (getter=isReleasedWhenClosed) BOOL releasedWhenClosed;
- (void)miniaturize:(nullable id)sender;
- (void)deminiaturize:(nullable id)sender;
@property (getter=isZoomed, readonly) BOOL zoomed;
- (void)zoom:(nullable id)sender;
@property (getter=isMiniaturized, readonly) BOOL miniaturized;
- (BOOL)tryToPerform:(SEL)action with:(nullable id)object;
- (nullable id)validRequestorForSendType:(nullable NSPasteboardType)sendType returnType:(nullable NSPasteboardType)returnType;
@property (null_resettable, copy) NSColor *backgroundColor;
/* Indicates the thickness of a given border of the window. NSMinYEdge is the bottom edge of the window, while NSMaxYEdge is the top edge of the window. This method may throw an exception for values that don't apply to the current window styleMask; specifically, passing NSMaxYEdge for a non-textured window will always raise. The contentBorder does not include the titlebar or toolbar.
*/
- (void)setContentBorderThickness:(CGFloat)thickness forEdge:(NSRectEdge)edge API_AVAILABLE(macos(10.5));
- (CGFloat)contentBorderThicknessForEdge:(NSRectEdge)edge API_AVAILABLE(macos(10.5));
- (void)setAutorecalculatesContentBorderThickness:(BOOL)flag forEdge:(NSRectEdge)edge API_AVAILABLE(macos(10.5));
- (BOOL)autorecalculatesContentBorderThicknessForEdge:(NSRectEdge)edge API_AVAILABLE(macos(10.5));
/* Calling -setMovable with a flag of NO will disable server-side dragging of the window via titlebar or background. -setMovableByWindowBackground:YES is ignored on a window that returns NO from -isMovable. When a window returns NO for -isMovable, it can be assigned to a different space with its relative screen position preserved. Note that a resizable window may still be resized, and the window frame may be changed programmatically. Applications may choose to enable application-controlled window dragging after disabling server-side dragging (perhaps to achieve snapping or pinnning) by handling the mouseDown/mouseDragged/mouseUp sequence in -sendEvent: in an NSWindow subclass. Note that a non movable window will also not be moved (or resized) by the system in response to a display reconfiguration. */
@property (getter=isMovable) BOOL movable API_AVAILABLE(macos(10.6));
@property (getter=isMovableByWindowBackground) BOOL movableByWindowBackground;
@property BOOL hidesOnDeactivate;
// indicate whether a window can be hidden during -[NSApplication hide:]. Default is YES
@property BOOL canHide;
- (void)center;
- (void)makeKeyAndOrderFront:(nullable id)sender;
- (void)orderFront:(nullable id)sender;
- (void)orderBack:(nullable id)sender;
- (void)orderOut:(nullable id)sender;
- (void)orderWindow:(NSWindowOrderingMode)place relativeTo:(NSInteger)otherWin;
- (void)orderFrontRegardless;
@property (nullable, strong) NSImage *miniwindowImage;
@property (null_resettable, copy) NSString *miniwindowTitle;
@property (readonly, strong) NSDockTile *dockTile API_AVAILABLE(macos(10.5));
@property (getter=isDocumentEdited) BOOL documentEdited;
@property (getter=isVisible, readonly) BOOL visible;
@property (getter=isKeyWindow, readonly) BOOL keyWindow;
@property (getter=isMainWindow, readonly) BOOL mainWindow;
@property (readonly) BOOL canBecomeKeyWindow;
@property (readonly) BOOL canBecomeMainWindow;
- (void)makeKeyWindow;
- (void)makeMainWindow;
- (void)becomeKeyWindow;
- (void)resignKeyWindow;
- (void)becomeMainWindow;
- (void)resignMainWindow;
@property (readonly) BOOL worksWhenModal;
/* Normally, application termination is prohibited when a modal window or sheet is open, without consulting the application delegate. Some windows like the open panel or toolbar customization sheet should not prevent application termination. -setPreventsApplicationTerminationWhenModal:NO on a modal window or sheet will override the default behavior and allow application termination to proceed, either through the sudden termination path if enabled, or on to the next step of consulting the application delegate. By default, -preventsApplicationTerminationWhenModal returns YES */
@property BOOL preventsApplicationTerminationWhenModal API_AVAILABLE(macos(10.6));
/* Methods to convert window coordinates to screen coordinates */
- (NSRect)convertRectToScreen:(NSRect)rect API_AVAILABLE(macos(10.7));
- (NSRect)convertRectFromScreen:(NSRect)rect API_AVAILABLE(macos(10.7));
- (NSPoint)convertPointToScreen:(NSPoint)point API_AVAILABLE(macos(10.12));
- (NSPoint)convertPointFromScreen:(NSPoint)point API_AVAILABLE(macos(10.12));
/* Methods to convert to/from a pixel integral backing store space */
- (NSRect)convertRectToBacking:(NSRect)rect API_AVAILABLE(macos(10.7));
- (NSRect)convertRectFromBacking:(NSRect)rect API_AVAILABLE(macos(10.7));
- (NSPoint)convertPointToBacking:(NSPoint)point API_AVAILABLE(macos(10.14));
- (NSPoint)convertPointFromBacking:(NSPoint)point API_AVAILABLE(macos(10.14));
/* Use NSIntegralRectWithOptions() to produce a backing store pixel aligned rectangle from the given input rectangle in window coordinates. */
- (NSRect)backingAlignedRect:(NSRect)rect options:(NSAlignmentOptions)options API_AVAILABLE(macos(10.7));
/* Returns the scale factor representing the number of backing store pixels corresponding to each linear unit in window space on this NSWindow. This method is provided for rare cases when the explicit scale factor is needed. Please use -convert*ToBacking: methods whenever possible. */
@property (readonly) CGFloat backingScaleFactor API_AVAILABLE(macos(10.7));
- (void)performClose:(nullable id)sender;
- (void)performMiniaturize:(nullable id)sender;
- (void)performZoom:(nullable id)sender;
- (NSData *)dataWithEPSInsideRect:(NSRect)rect;
- (NSData *)dataWithPDFInsideRect:(NSRect)rect;
- (void)print:(nullable id)sender;
/*
Default is NO. Set to YES to allow a window to display tooltips even when the application is in the background. Note that, enabling tooltips in an inactive application will cause the app to do work any time the mouse passes over the window. This can degrade system performance.
Returns YES if this window displays tooltips even when the application is in the background. To configure this setting you should call setAllowsToolTipsWhenApplicationIsInactive: instead of overriding -allowsToolTipsWhenApplicationIsInactive.
*/
@property BOOL allowsToolTipsWhenApplicationIsInactive;
@property NSBackingStoreType backingType;
@property NSWindowLevel level;
@property NSWindowDepth depthLimit;
- (void)setDynamicDepthLimit:(BOOL)flag;
@property (readonly) BOOL hasDynamicDepthLimit;
/* The screen property returns the best screen for the window. If the window only intersects one screen, it returns that screen. If it intersects more than one screen, then it resolves the tie through based on what space it is mostly on. It may return nil if there are no available screens, or it is completely off screen.
*/
@property (nullable, readonly, strong) NSScreen *screen;
@property (nullable, readonly, strong) NSScreen *deepestScreen;
@property BOOL hasShadow;
- (void)invalidateShadow;
@property CGFloat alphaValue;
@property (getter=isOpaque) BOOL opaque;
/* -setSharingType: specifies whether the window content can be read and/or written from another process. The default sharing type is NSWindowSharingReadOnly, which means other processes can read the window content (eg. for window capture) but cannot modify it. If you set your window sharing type to NSWindowSharingNone, so that the content cannot be captured, your window will also not be able to participate in a number of system services, so this setting should be used with caution. If you set your window sharing type to NSWindowSharingReadWrite, other processes can both read and modify the window content.
*/
@property NSWindowSharingType sharingType API_AVAILABLE(macos(10.5));
/* Controls whether threading of view drawing should be enabled for this window. Defaults to YES. When this is set to YES, AppKit's view system is allowed to perform -drawRect: activity for the window's views on threads other than the main thread, for views that have canDrawConcurrently == YES. When this is set to NO, the window's views will be drawn serially as on 10.5 and earlier, even though some of the views may have canDrawConcurrently == YES.
*/
@property BOOL allowsConcurrentViewDrawing API_AVAILABLE(macos(10.6));
@property BOOL displaysWhenScreenProfileChanges;
/*
In recent macOS versions this method does not do anything and should not be called.
*/
- (void)disableScreenUpdatesUntilFlush;
/* This API controls whether the receiver is permitted onscreen before the user has logged in. This property is off by default. Alert panels and windows presented by input managers are examples of windows which should have this property set.
*/
@property BOOL canBecomeVisibleWithoutLogin API_AVAILABLE(macos(10.5));
@property NSWindowCollectionBehavior collectionBehavior API_AVAILABLE(macos(10.5));
/* Provides for per-window control over automatic orderFront/orderOut animation behaviors added in 10.7. Can be set to NSWindowAnimationBehaviorNone to disable Appkit's automatic animations for a given window, or to one of the other non-Default NSWindowAnimationBehavior values to override AppKit's automatic inference of appropriate animation behavior based on the window's apparent type.
*/
@property NSWindowAnimationBehavior animationBehavior API_AVAILABLE(macos(10.7));
/* Returns YES if this window is associated with the active space. For visible windows, this API indicates whether the window is currently visible on the active space. For offscreen windows, it indicates whether ordering the window onscreen would make it bring it onto the active space */
@property (getter=isOnActiveSpace, readonly) BOOL onActiveSpace API_AVAILABLE(macos(10.6));
/* toggleFullScreen: enters or exits for full screen. A window must have NSWindowCollectionBehaviorFullScreenAuxiliary or NSWindowCollectionBehaviorFullScreenPrimary included in the collectionBehavior property; if it does not, this method may simply do nothing.
*/
- (void)toggleFullScreen:(nullable id)sender API_AVAILABLE(macos(10.7));
@property (readonly, copy) NSWindowPersistableFrameDescriptor stringWithSavedFrame;
- (void)setFrameFromString:(NSWindowPersistableFrameDescriptor)string;
- (void)saveFrameUsingName:(NSWindowFrameAutosaveName)name;
// Set force=YES to use setFrameUsingName on a non-resizable window
- (BOOL)setFrameUsingName:(NSWindowFrameAutosaveName)name force:(BOOL)force;
- (BOOL)setFrameUsingName:(NSWindowFrameAutosaveName)name;
- (BOOL)setFrameAutosaveName:(NSWindowFrameAutosaveName)name;
@property (readonly, copy) NSWindowFrameAutosaveName frameAutosaveName;
+ (void)removeFrameUsingName:(NSWindowFrameAutosaveName)name;
/* NOTE: minSize/contentMinSize and maxSize/contentMaxSize are ignored when using autolayout.
*/
@property NSSize minSize;
@property NSSize maxSize;
@property NSSize contentMinSize;
@property NSSize contentMaxSize;
/* These are the min and max values for a full screen tiled window.
In general, one should not need to explicitly set the min/maxFullScreenContentSize. If an application does not change its window content upon entering full screen, then the normal auto layout min and max size will be sufficient, and one should not set these values. If an application does significantly rework the UI in full screen, then it may be necessary to set a min/maxFullScreenContentSize. This size is what is used to determine if a window can fit when it is in full screen in a tile. This property may be used even if the window does not support full screen, but are implicitly opted into supporting a full screen tile based on resizing behavior and window properties (see the collectionBehavior property). By default, the system uses auto layout to determine the min and max sizes. If auto layout is not used, contentMinSize and contentMaxSize are queried.
*/
@property NSSize minFullScreenContentSize API_AVAILABLE(macos(10.11));
@property NSSize maxFullScreenContentSize API_AVAILABLE(macos(10.11));
@property (readonly, copy) NSDictionary<NSDeviceDescriptionKey, id> *deviceDescription;
@property (nullable, weak) __kindof NSWindowController *windowController;
/*
This API presents modal-sheets on this window. It replaces NSApp's -beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:.
If the window already has a presented sheet, it will queue up sheets presented after that. Once the presented sheet is dismissed, the next queued sheet will be presented, and so forth.
Critical sheets will skip this queuing process and be immediately presented on top of existing sheets. The presented sheet will be temporarily disabled and be able to be interacted with after the critical sheet is dismissed, and will then continue as normal. Critical sheets should only be used for time-critical or important events, when the presentation of the sheet needs to be guaranteed (Critical Alerts will automatically use this API).
*/
- (void)beginSheet:(NSWindow *)sheetWindow completionHandler:(void (^ _Nullable)(NSModalResponse returnCode))handler API_AVAILABLE(macos(10.9));
- (void)beginCriticalSheet:(NSWindow *)sheetWindow completionHandler:(void (^ _Nullable)(NSModalResponse returnCode))handler API_AVAILABLE(macos(10.9));
- (void)endSheet:(NSWindow *)sheetWindow API_AVAILABLE(macos(10.9));
- (void)endSheet:(NSWindow *)sheetWindow returnCode:(NSModalResponse)returnCode API_AVAILABLE(macos(10.9));
@property (readonly, copy) NSArray<__kindof NSWindow *> *sheets API_AVAILABLE(macos(10.9)); // An ordered array of the sheets on the window. This consists of the presented sheets in top-to-bottom order, followed by queued sheets in the order they were queued. This does not include nested/sub-sheets.
@property (nullable, readonly, strong) NSWindow *attachedSheet; // Returns the top-most sheet if there is one or more sheets, or nil if there is no sheet.
@property (getter=isSheet, readonly) BOOL sheet;
/* Returns the window that the sheet is directly attached to. This is based on the logical attachment of the sheet, not visual attachment.
This relationship exists starting when the sheet is begun (using NSApplication's -beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: or NSWindow's -beginSheet:completionHandler:), and ending once it is ordered out.
Returns nil if the window is not a sheet or has no sheet parent.
*/
@property (nullable, readonly, strong) NSWindow *sheetParent API_AVAILABLE(macos(10.9));
+ (nullable NSButton *)standardWindowButton:(NSWindowButton)b forStyleMask:(NSWindowStyleMask)styleMask;
- (nullable NSButton *)standardWindowButton:(NSWindowButton)b;
- (void)addChildWindow:(NSWindow *)childWin ordered:(NSWindowOrderingMode)place;
- (void)removeChildWindow:(NSWindow *)childWin;
@property (nullable, readonly, copy) NSArray<__kindof NSWindow *> *childWindows;
@property (nullable, weak) NSWindow *parentWindow;
/// If set, the receiver will inherit the appearance of that object, as well as use KVO to observe its effectiveAppearance for changes. Typically this is used for child windows that are shown from a parent window or specific view. Defaults to NSApp.
@property (weak, null_resettable) NSObject<NSAppearanceCustomization> *appearanceSource API_AVAILABLE(macos(10.14));
@property (nullable, strong) NSColorSpace *colorSpace API_AVAILABLE(macos(10.6));
/* canRepresentDisplayGamut: returns YES if the colorSpace of the receiving window, and the colorSpace of the screen containing that window, are capable of representing the given display gamut
*/
- (BOOL)canRepresentDisplayGamut:(NSDisplayGamut)displayGamut API_AVAILABLE(macos(10.12));
/* windowNumbersWithOptions: returns an autoreleased array of NSNumbers containing windowNumbers for all visible windows satisfying options. If no options are specified, only visible windows belonging to the calling application and on the active space are included. If options include NSWindowNumberListAllApplications, visible windows belonging to all applications are included. If options include NSWindowNumberListAllSpaces, visible windows on all spaces are included. Windows on the active space are returned in z-order.
Examples:
To get an array of windowNumbers visible on the current space and belonging to the calling application:
windowNumbers = [NSWindow windowNumbersWithOptions:0];
To get an array of windowNumbers visible on any space and belonging to any application:
windowNumbers = [NSWindow windowNumbersWithOptions:NSWindowNumberListAllApplications|NSWindowNumberListAllSpaces];
To get an array of windowNumbers visible on any space and belonging to the calling application:
windowNumbers = [NSWindow windowNumbersWithOptions:NSWindowNumberListAllSpaces];
*/
+ (nullable NSArray<NSNumber *> *)windowNumbersWithOptions:(NSWindowNumberListOptions)options API_AVAILABLE(macos(10.6));
/* windowNumberAtPoint:belowWindowWithWindowNumber: returns the number of the frontmost window that would be hit by a mouseDown at the screen location "point". "windowNum" can be specified to exclude a given window along with all windows above it, and may belong to any application. If no windows are to be excluded, specify 0 for "windowNum". The windowNumber returned may correspond to a window in another application.
*/
+ (NSInteger)windowNumberAtPoint:(NSPoint)point belowWindowWithWindowNumber:(NSInteger)windowNumber API_AVAILABLE(macos(10.6));
@property (readonly) NSWindowOcclusionState occlusionState API_AVAILABLE(macos(10.9));
/* Specifies the style of separator displayed between the window's titlebar and content.
The default value is NSTitlebarSeparatorStyleAutomatic. Changing this value will override any preference made by `NSSplitViewItem`.
*/
@property NSTitlebarSeparatorStyle titlebarSeparatorStyle API_AVAILABLE(macos(11.0));
#pragma mark - NSViewController Support
/* The main content view controller for the window. This provides the contentView of the window. Assigning this value will remove the existing contentView and will make the contentViewController.view the main contentView for the window. The default value is nil. The contentViewController only controls the contentView, and not the title of the window. The window title can easily be bound to the contentViewController with the following: [window bind:NSTitleBinding toObject:contentViewController withKeyPath:@"title" options:nil]. Setting the contentViewController will cause the window to resize based on the current size of the contentViewController. Autolayout should be used to restrict the size of the window. The value of the contentViewController is encoded in the NIB. Directly assigning a contentView will clear out the contentViewController.
*/
@property (nullable, strong) NSViewController *contentViewController API_AVAILABLE(macos(10.10));
/* Convenience method for creating an autoreleased titled window with the given contentViewController. A basic NSWindow with the following attributes is made: titled, closable, resizable, miniaturizable. The window's title is automatically bound to the contentViewController's title. The size of the window can easily be controlled by utilizing autolayout and applying size constraints to the view (or its subviews). The window has isReleasedWhenClosed set to NO, and it must be explicitly retained to keep the window instance alive. To have it automatically be freed when it is closed, do the following: [window retain] and [window setReleasedWhenClosed:YES].
*/
+ (instancetype)windowWithContentViewController:(NSViewController *)contentViewController API_AVAILABLE(macos(10.10));
#pragma mark - Window Dragging
/* Call to start a drag (moving the window) in the Window Server process. In general, this can be done after a mouseDown event has come in and been examined by an application or view. The view may determine it wants to allow that portion of the window to start a window drag, and can hand off the work to the Window Server process by calling this method. This allows the window to participate in space switching, and other system features. Pass the original mouseDown event to the method. The method will return right away, and a mouseUp may not get sent.
*/
- (void)performWindowDragWithEvent:(NSEvent *)event API_AVAILABLE(macos(10.11));
#pragma mark - Keyboard UI support (Key View Loop)
@property (nullable, weak) NSView *initialFirstResponder;
- (void)selectNextKeyView:(nullable id)sender;
- (void)selectPreviousKeyView:(nullable id)sender;
- (void)selectKeyViewFollowingView:(NSView *)view;
- (void)selectKeyViewPrecedingView:(NSView *)view;
@property (readonly) NSSelectionDirection keyViewSelectionDirection;
@property (nullable, retain) NSButtonCell *defaultButtonCell;
- (void)disableKeyEquivalentForDefaultButtonCell;
- (void)enableKeyEquivalentForDefaultButtonCell;
@property BOOL autorecalculatesKeyViewLoop;
- (void)recalculateKeyViewLoop;
#pragma mark - Toolbar Support
@property (nullable, strong) NSToolbar *toolbar;
- (void)toggleToolbarShown:(nullable id)sender;
- (void)runToolbarCustomizationPalette:(nullable id)sender;
@property BOOL showsToolbarButton; // Does nothing in recent versions of the OS
#pragma mark - Automatic Window Tabbing
/* Allows automatic window tabbing when the value is YES. By default, this will be set to YES, but applications can explicitly opt out of all automatic tabbing by setting it to NO, and can still adopted explicit window tabbing, if desired.
*/
@property (class) BOOL allowsAutomaticWindowTabbing API_AVAILABLE(macos(10.12));
/* Returns the user's tabbing preference as set in System Preferences. This value should be queried anytime a new window is made to see if the user wants to automatically show it in tabs.
*/
@property (class, readonly) NSWindowUserTabbingPreference userTabbingPreference API_AVAILABLE(macos(10.12));
/* Get and set the tabbing mode for this window. This should be set before a window is shown. The default value is NSWindowTabbingModeAutomatic. When the value is NSWindowTabbingModeAutomatic, the system will look at the userTabbingPreference and automatically tab windows together based on the tabbingIdentifier, when it is appropriate to do so.
*/
@property NSWindowTabbingMode tabbingMode API_AVAILABLE(macos(10.12));
/* Windows with the same tabbingIdentifier will have the ability to be tabbed together when a window is being shown. This allows aggregation of similar windows. By default, the tabbingIdentifier will be generated based on inherent window properties, such as the window class name, the delegate class name, the window controller class name, and some additional state. Windows can be explicitly made to group together by using the same tabbingIdentifier.
*/
@property (copy) NSWindowTabbingIdentifier tabbingIdentifier API_AVAILABLE(macos(10.12));
/* Actions that can be called to perform various tabbed window behaviors. UI that is hooked up to these items can be automatically validated by calling NSWindow's validateUserInterfaceItem.
*/
- (IBAction)selectNextTab:(nullable id)sender API_AVAILABLE(macos(10.12));
- (IBAction)selectPreviousTab:(nullable id)sender API_AVAILABLE(macos(10.12));
- (IBAction)moveTabToNewWindow:(nullable id)sender API_AVAILABLE(macos(10.12));
- (IBAction)mergeAllWindows:(nullable id)sender API_AVAILABLE(macos(10.12));
- (IBAction)toggleTabBar:(nullable id)sender API_AVAILABLE(macos(10.12));
/* Toggle the Tab Picker / Tab Overview UI which is invoked via "Show All Tabs". Performs the toggle in an animated fashion. Use tabGroup.isOverviewVisible to find out if it is visible or not at a given time.
*/
- (IBAction)toggleTabOverview:(nullable id)sender API_AVAILABLE(macos(10.13));
/* This is now a cover for self.tabGroup.windows, but will return nil if the window is not showing a tab bar.
*/
@property (readonly, copy, nullable) NSArray<NSWindow *> *tabbedWindows API_AVAILABLE(macos(10.12));
/* This is now a cover for [self.tabGroup addWindow:], which allows more precise placement.
*/
- (void)addTabbedWindow:(NSWindow *)window ordered:(NSWindowOrderingMode)ordered API_AVAILABLE(macos(10.12));
/* Access the properties for this window when it is a tabbed window environment. See the NSWindowTab header and comments for more information.
*/
@property (strong, readonly) NSWindowTab *tab API_AVAILABLE(macos(10.13));
/* Represents a tab group of windows. This tabGroup is lazily created on demand.
*/
@property (readonly, weak) NSWindowTabGroup *tabGroup API_AVAILABLE(macos(10.13));
#pragma mark - Other
/* Retrieve the layout direction of the window titlebar: this includes the standard window buttons (close/minimize/maximize buttons) and the title for this window. In general, this will return "right to left" (RTL) if the primary system language is RTL. The layout direction may be RTL even in applications that do not have a RTL language localization. This value should be utilized if an application uses titlebarAppearsTransparent and places controls underneath the titlebar.
*/
@property (readonly) NSUserInterfaceLayoutDirection windowTitlebarLayoutDirection API_AVAILABLE(macos(10.12));
#pragma mark -
@end
@interface NSWindow(NSEvent)
/* Tracks events matching the supplied mask with the supplied tracking handler until the tracking handler explicitly terminates tracking. Each event is removed from the event queue then passed to the tracking handler. If a matching event does not exist in the event queue, then the main thread blocks in the specified runloop mode until an event of the requested type is received or the timeout expires. If the timeout expires, the tracking handler is called with a nil event. A negative timeout is interpreted as 0. Use NSEventDurationForever to never timeout. Tracking continues until *stop is set to YES. Calls to -nextEventMatchingMask:… are allowed inside the trackingHandler block. This method returns once tracking is terminated.
*/
- (void)trackEventsMatchingMask:(NSEventMask)mask timeout:(NSTimeInterval)timeout mode:(NSRunLoopMode)mode handler:(void (NS_NOESCAPE ^)(NSEvent *_Nullable event, BOOL *stop))trackingHandler API_AVAILABLE(macos(10.10));
- (nullable NSEvent *)nextEventMatchingMask:(NSEventMask)mask;
- (nullable NSEvent *)nextEventMatchingMask:(NSEventMask)mask untilDate:(nullable NSDate *)expiration inMode:(NSRunLoopMode)mode dequeue:(BOOL)deqFlag;
- (void)discardEventsMatchingMask:(NSEventMask)mask beforeEvent:(nullable NSEvent *)lastEvent;
- (void)postEvent:(NSEvent *)event atStart:(BOOL)flag;
- (void)sendEvent:(NSEvent *)event;
@property (nullable, readonly, strong) NSEvent *currentEvent;
@property BOOL acceptsMouseMovedEvents;
@property BOOL ignoresMouseEvents;
@property (readonly) NSPoint mouseLocationOutsideOfEventStream;
@end
@interface NSWindow(NSCursorRect)
- (void)disableCursorRects;
- (void)enableCursorRects;
- (void)discardCursorRects;
@property (readonly) BOOL areCursorRectsEnabled;
- (void)invalidateCursorRectsForView:(NSView *)view;
- (void)resetCursorRects;
@end
@interface NSWindow(NSDrag)
- (void)dragImage:(NSImage *)image at:(NSPoint)baseLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag;
- (void)registerForDraggedTypes:(NSArray<NSPasteboardType> *)newTypes;
- (void)unregisterDraggedTypes;
@end
@interface NSWindow(NSCarbonExtensions)
/* Create an NSWindow for a Carbon window - windowRef must be a Carbon WindowRef - see MacWindows.h. This method can only be called on NSWindow, and not subclasses of NSWindow. On 10.11, it will throw an exception if this is done.
*/
- (nullable NSWindow *)initWithWindowRef:(void * /* WindowRef */)windowRef;
/* return the Carbon WindowRef for this window, creating if necessary: - see MacWindows.h
*/
@property (readonly) void * /* WindowRef */windowRef NS_RETURNS_INNER_POINTER;
@end
@protocol NSWindowDelegate <NSObject>
@optional
- (BOOL)windowShouldClose:(NSWindow *)sender;
- (nullable id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(nullable id)client;
- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize;
- (NSRect)windowWillUseStandardFrame:(NSWindow *)window defaultFrame:(NSRect)newFrame;
- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame;
- (nullable NSUndoManager *)windowWillReturnUndoManager:(NSWindow *)window;
/* Tells the delegate that the window is about to show a sheet, and gives the delegate a chance to customize the location of the sheet.
*/
- (NSRect)window:(NSWindow *)window willPositionSheet:(NSWindow *)sheet usingRect:(NSRect)rect;
/* If a window has a representedURL, the window will by default show a path popup menu for a command-click on a rectangle containing the window document icon button and the window title. The window delegate may implement -window:shouldPopupDocumentPathMenu: to override NSWindow's default behavior for path popup menu. A return of NO will prevent the menu from being shown. A return of YES will cause the window to show the menu passed to this method, which by default will contain a menuItem for each path component of the representedURL. If the representedURL has no path components, the menu will have no menu items. Before returning YES, the window delegate may customize the menu by changing the menuItems. menuItems may be added or deleted, and each menuItem title, action, or target may be modified.
*/
- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu API_AVAILABLE(macos(10.5));
/* The window delegate may implement -window:shouldDragDocumentWithEvent:from:withPasteboard: to override NSWindow document icon's default drag behavior. The delegate can prohibit the drag by returning NO. Before returning NO, the delegate may implement its own dragging behavior using -[NSWindow dragImage:at:offset:event:pasteboard:source:slideBack:]. Alternatively, the delegate can enable a drag by returning YES, for example to override NSWindow's default behavior of prohibiting the drag of an edited document. Lastly, the delegate can customize the pasteboard contents before returning YES.
*/
- (BOOL)window:(NSWindow *)window shouldDragDocumentWithEvent:(NSEvent *)event from:(NSPoint)dragImageLocation withPasteboard:(NSPasteboard *)pasteboard API_AVAILABLE(macos(10.5));
- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize API_AVAILABLE(macos(10.7));
- (NSApplicationPresentationOptions)window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions API_AVAILABLE(macos(10.7));
/* The default animation between a window and its fullscreen representation is a crossfade. With knowledge of the layout of a window before and after it enters fullscreen, an application can do a much better job on the animation. The following API allows a window delegate to customize the animation by providing a custom window or windows containing layers or other effects. In order to manage windows on spaces, we need the window delegate to provide a list of windows involved in the animation. If an application does not do a custom animation, this method can be unimplemented or can return nil. window:startCustomAnimationToEnterFullScreenWithDuration: will be called only if customWindowsToEnterFullScreenForWindow: returns non-nil.
*/
- (nullable NSArray<NSWindow *> *)customWindowsToEnterFullScreenForWindow:(NSWindow *)window API_AVAILABLE(macos(10.7));
/* The system has started its animation into fullscreen, including transitioning to a new space. Start the window fullscreen animation immediately, and perform the animation with the given duration to be in sync with the system animation. This method is called only if customWindowToEnterFullScreenForWindow: returned non-nil.
*/
- (void)window:(NSWindow *)window startCustomAnimationToEnterFullScreenWithDuration:(NSTimeInterval)duration API_AVAILABLE(macos(10.7));
/* In some cases, the transition to enter fullscreen will fail, due to being in the midst of handling some other animation or user gesture. We will attempt to minimize these cases, but believe there is a need for failure handling. This method indicates that there was an error, and the application should clean up any work it may have done to prepare to enter fullscreen. This message will be sent whether or not the delegate indicated a custom animation by returning non-nil from customWindowsToEnterFullScreenForWindow:.
*/
- (void)windowDidFailToEnterFullScreen:(NSWindow *)window API_AVAILABLE(macos(10.7));
/* The window is about to exit fullscreen mode. The following API allows a window delegate to customize the animation when the window is about to exit fullscreen. In order to manage windows on spaces, we need the window delegate to provide a list of windows involved in the animation. If an application does not do a custom animation, this method can be unimplemented or can return nil. window:startCustomAnimationToExitFullScreenWithDuration: will be called only if customWindowsToExitFullScreenForWindow: returns non-nil.
*/
- (nullable NSArray<NSWindow *> *)customWindowsToExitFullScreenForWindow:(NSWindow *)window API_AVAILABLE(macos(10.7));
/* The system has started its animation out of fullscreen, including transitioning back to the desktop space. Start the window animation immediately, and perform the animation with the given duration to be in sync with the system animation. This method is called only if customWindowsToExitFullScreenForWindow: returned non-nil.
*/
- (void)window:(NSWindow *)window startCustomAnimationToExitFullScreenWithDuration:(NSTimeInterval)duration API_AVAILABLE(macos(10.7));
/* customWindowsToEnterFullScreenForWindow:onScreen: will be called in place of customWindowsToEnterFullScreenForWindow: if both are implemented */
- (nullable NSArray<NSWindow *> *)customWindowsToEnterFullScreenForWindow:(NSWindow *)window onScreen:(NSScreen *)screen API_AVAILABLE(macos(10.9));
/* window:startCustomAnimationToEnterFullScreenOnScreen:withDuration: will be called in place of window:startCustomAnimationToEnterFullScreenWithDuration: if both are implemented */
- (void)window:(NSWindow *)window startCustomAnimationToEnterFullScreenOnScreen:(NSScreen *)screen withDuration:(NSTimeInterval)duration API_AVAILABLE(macos(10.9));
/* In some cases, the transition to exit fullscreen will fail, due to being in the midst of handling some other animation or user gesture. We will attempt to minimize these cases, but believe there is a need for failure handling. This method indicates that there was an error, and the application should clean up any work it may have done to prepare to exit fullscreen. This message will be sent whether or not the delegate indicated a custom animation by returning non-nil from customWindowsToExitFullScreenForWindow:.
*/
- (void)windowDidFailToExitFullScreen:(NSWindow *)window API_AVAILABLE(macos(10.7));
/* Windows entering the version browser will be resized to the size returned by this method. If either dimension of the returned size is larger than the maxPreferredFrameSize, the window will also be scaled down to ensure it fits properly in the version browser. Returned sizes larger than maxAllowedSize will be constrained to that size. If this method is not implemented, the version browser will use -window:willUseStandardFrame: to determine the resulting window frame size.
*/
- (NSSize)window:(NSWindow *)window willResizeForVersionBrowserWithMaxPreferredSize:(NSSize)maxPreferredFrameSize maxAllowedSize:(NSSize)maxAllowedFrameSize API_AVAILABLE(macos(10.7));
/* Method called by -[NSWindow encodeRestorableStateWithCoder:] to give the delegate a chance to encode any additional state into the NSCoder. This state is available in the NSCoder passed to restoreWindowWithIdentifier:state:handler: . See the header NSWindowRestoration.h for more information.
*/
- (void)window:(NSWindow *)window willEncodeRestorableState:(NSCoder *)state API_AVAILABLE(macos(10.7));
/* Method called by -[NSWindow 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)window:(NSWindow *)window didDecodeRestorableState:(NSCoder *)state API_AVAILABLE(macos(10.7));
/* Notifications
*/
- (void)windowDidResize:(NSNotification *)notification;
- (void)windowDidExpose:(NSNotification *)notification;
- (void)windowWillMove:(NSNotification *)notification;
- (void)windowDidMove:(NSNotification *)notification;
- (void)windowDidBecomeKey:(NSNotification *)notification;
- (void)windowDidResignKey:(NSNotification *)notification;
- (void)windowDidBecomeMain:(NSNotification *)notification;
- (void)windowDidResignMain:(NSNotification *)notification;
- (void)windowWillClose:(NSNotification *)notification;
- (void)windowWillMiniaturize:(NSNotification *)notification;
- (void)windowDidMiniaturize:(NSNotification *)notification;
- (void)windowDidDeminiaturize:(NSNotification *)notification;
- (void)windowDidUpdate:(NSNotification *)notification;
- (void)windowDidChangeScreen:(NSNotification *)notification;
- (void)windowDidChangeScreenProfile:(NSNotification *)notification;
- (void)windowDidChangeBackingProperties:(NSNotification *)notification API_AVAILABLE(macos(10.7)); // added in 10.7.3
- (void)windowWillBeginSheet:(NSNotification *)notification;
- (void)windowDidEndSheet:(NSNotification *)notification;
- (void)windowWillStartLiveResize:(NSNotification *)notification API_AVAILABLE(macos(10.6));
- (void)windowDidEndLiveResize:(NSNotification *)notification API_AVAILABLE(macos(10.6));
- (void)windowWillEnterFullScreen:(NSNotification *)notification API_AVAILABLE(macos(10.7));
- (void)windowDidEnterFullScreen:(NSNotification *)notification API_AVAILABLE(macos(10.7));
- (void)windowWillExitFullScreen:(NSNotification *)notification API_AVAILABLE(macos(10.7));
- (void)windowDidExitFullScreen:(NSNotification *)notification API_AVAILABLE(macos(10.7));
- (void)windowWillEnterVersionBrowser:(NSNotification *)notification API_AVAILABLE(macos(10.7));
- (void)windowDidEnterVersionBrowser:(NSNotification *)notification API_AVAILABLE(macos(10.7));
- (void)windowWillExitVersionBrowser:(NSNotification *)notification API_AVAILABLE(macos(10.7));
- (void)windowDidExitVersionBrowser:(NSNotification *)notification API_AVAILABLE(macos(10.7));
- (void)windowDidChangeOcclusionState:(NSNotification *)notification API_AVAILABLE(macos(10.9));
@end
/* Notifications */
APPKIT_EXTERN NSNotificationName NSWindowDidBecomeKeyNotification;
APPKIT_EXTERN NSNotificationName NSWindowDidBecomeMainNotification;
APPKIT_EXTERN NSNotificationName NSWindowDidChangeScreenNotification;
APPKIT_EXTERN NSNotificationName NSWindowDidDeminiaturizeNotification;
APPKIT_EXTERN NSNotificationName NSWindowDidExposeNotification; // userInfo key: @"NSExposedRect"
APPKIT_EXTERN NSNotificationName NSWindowDidMiniaturizeNotification;
APPKIT_EXTERN NSNotificationName NSWindowDidMoveNotification;
APPKIT_EXTERN NSNotificationName NSWindowDidResignKeyNotification;
APPKIT_EXTERN NSNotificationName NSWindowDidResignMainNotification;
APPKIT_EXTERN NSNotificationName NSWindowDidResizeNotification;
APPKIT_EXTERN NSNotificationName NSWindowDidUpdateNotification;
APPKIT_EXTERN NSNotificationName NSWindowWillCloseNotification;
APPKIT_EXTERN NSNotificationName NSWindowWillMiniaturizeNotification;
APPKIT_EXTERN NSNotificationName NSWindowWillMoveNotification;
APPKIT_EXTERN NSNotificationName NSWindowWillBeginSheetNotification;
APPKIT_EXTERN NSNotificationName NSWindowDidEndSheetNotification;
/* NSWindowDidChangeBackingPropertiesNotification is posted on 10.7.3 and later, when a window's backingScaleFactor and/or its colorSpace changes. When running on a system version where this new notification is available, applications should use it instead of NSWindowDidChangeScreenProfileNotification to watch for changes to either of these backing store properties. Many applications won't have any need to watch for this notification, but those that perform sophisticated color handling or manually manage their own caches of window-resolution-and/or/colorspace-appropriate bitmapped images will find this notification useful, as a prompt to invalidate their caches or schedule other reassessment for the new resolution and/or color space as needed. The notification's userInfo dictionary specifies the window's previous backingScaleFactor and colorSpace. You can compare these with the window's new backingScaleFactor and colorSpace at the time of the notification, to determine which of these two properties (potentially both) changed.
*/
APPKIT_EXTERN NSNotificationName const NSWindowDidChangeBackingPropertiesNotification API_AVAILABLE(macos(10.7)); // added in 10.7.3; userInfo keys: NSBackingPropertyOldScaleFactorKey, NSBackingPropertyOldColorSpaceKey
APPKIT_EXTERN NSString * const NSBackingPropertyOldScaleFactorKey API_AVAILABLE(macos(10.7)); // added in 10.7.3; an NSNumber
APPKIT_EXTERN NSString * const NSBackingPropertyOldColorSpaceKey API_AVAILABLE(macos(10.7)); // added in 10.7.3; an NSColorSpace
/* NSWindowDidChangeScreenProfileNotification is posted when a window's display's color profile changes, or when the window moves to a display that has a different color profile. When running on 10.7.3 or later, this notification is still posted for compatibility, but modern applications should instead watch for NSWindowDidChangeBackingPropertiesNotification, which is posted for both color space and resolution changes, and facilitates handling both in a single update and redisplay pass.
*/
APPKIT_EXTERN NSNotificationName NSWindowDidChangeScreenProfileNotification;
/* NSWindowWillStartLiveResizeNotification is sent when the user starts a live resize operation via a mouseDown in the resize corner. The notification will be sent before the window size is changed. Note that this notification is sent once for a sequence of window resize operations */
APPKIT_EXTERN NSNotificationName const NSWindowWillStartLiveResizeNotification API_AVAILABLE(macos(10.6));
/* NSWindowDidEndLiveResizeNotification is sent after the user ends a live resize operation via a mouseUp in the resize corner. The notification will be sent after the final window size change. Note that this notification is sent once for a sequence of window resize operations */
APPKIT_EXTERN NSNotificationName const NSWindowDidEndLiveResizeNotification API_AVAILABLE(macos(10.6));
APPKIT_EXTERN NSNotificationName const NSWindowWillEnterFullScreenNotification API_AVAILABLE(macos(10.7));
APPKIT_EXTERN NSNotificationName const NSWindowDidEnterFullScreenNotification API_AVAILABLE(macos(10.7));
APPKIT_EXTERN NSNotificationName const NSWindowWillExitFullScreenNotification API_AVAILABLE(macos(10.7));
APPKIT_EXTERN NSNotificationName const NSWindowDidExitFullScreenNotification API_AVAILABLE(macos(10.7));
APPKIT_EXTERN NSNotificationName const NSWindowWillEnterVersionBrowserNotification API_AVAILABLE(macos(10.7));
APPKIT_EXTERN NSNotificationName const NSWindowDidEnterVersionBrowserNotification API_AVAILABLE(macos(10.7));
APPKIT_EXTERN NSNotificationName const NSWindowWillExitVersionBrowserNotification API_AVAILABLE(macos(10.7));
APPKIT_EXTERN NSNotificationName const NSWindowDidExitVersionBrowserNotification API_AVAILABLE(macos(10.7));
/* Upon receiving this notification, you can query the NSWindow for its current 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 NSWindowDidChangeOcclusionStateNotification API_AVAILABLE(macos(10.9));
@interface NSWindow(NSDeprecated)
- (void)cacheImageInRect:(NSRect)rect API_DEPRECATED("This method shouldn’t be used as it doesn’t work in all drawing situations; instead, a subview should be used that implements the desired drawing behavior", macos(10.0,10.13));
- (void)restoreCachedImage API_DEPRECATED("This method shouldn’t be used as it doesn’t work in all drawing situations; instead, a subview should be used that implements the desired drawing behavior", macos(10.0,10.13));
- (void)discardCachedImage API_DEPRECATED("This method shouldn’t be used as it doesn’t work in all drawing situations; instead, a subview should be used that implements the desired drawing behavior", macos(10.0,10.13));
+ (void)menuChanged:(NSMenu *)menu API_DEPRECATED("This method does not do anything and should not be called.", macos(10.0,10.11));
/* gState is unused and should not be called.
*/
- (NSInteger)gState API_DEPRECATED("This method is unused and should not be called.", macos(10.0,10.10));
/* The base/screen conversion methods are deprecated in 10.7 and later. Please use one of convertRectToScreen:, convertRectFromScreen:, convertPointToScreen:, or convertPointFromScreen: instead. */
- (NSPoint)convertBaseToScreen:(NSPoint)point API_DEPRECATED("Use -convertRectToScreen: or -convertPointToScreen: instead", macos(10.0,10.7));
- (NSPoint)convertScreenToBase:(NSPoint)point API_DEPRECATED("Use -convertRectFromScreen or -convertPointFromScreen: instead", macos(10.0,10.7));
/* This method is deprecated and should not be used by applications targeting Mac OS X 10.7 or later.
The implementation of this method will always return 1.0. Please use -convertRectToBacking: and -backingScaleFactor instead.
*/
- (CGFloat)userSpaceScaleFactor API_DEPRECATED("Use -convertRectToBacking: and -backingScaleFactor instead", macos(10.4,10.7));
- (void)useOptimizedDrawing:(BOOL)flag API_DEPRECATED("This method does not do anything and should not be called.", macos(10.0,10.10));
/* canStoreColor has not been needed or used in a while and is deprecated. */
- (BOOL)canStoreColor API_DEPRECATED("This method does not do anything and should not be called.", macos(10.0,10.10));
- (void)disableFlushWindow API_DEPRECATED("Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations.", macos(10.0,10.14));
- (void)enableFlushWindow API_DEPRECATED("Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations.", macos(10.0,10.14));
@property (getter=isFlushWindowDisabled, readonly) BOOL flushWindowDisabled API_DEPRECATED("Use +[NSAnimationContext runAnimationGroup:completionHandler:] to perform atomic updates across runloop invocations.", macos(10.0,10.14));
- (void)flushWindow API_DEPRECATED("Allow AppKit's automatic deferred display mechanism to take care of flushing any graphics contexts as needed.", macos(10.0,10.14));
- (void)flushWindowIfNeeded API_DEPRECATED("Allow AppKit's automatic deferred display mechanism to take care of flushing any graphics contexts as needed.", macos(10.0,10.14));
@property (getter=isAutodisplay) BOOL autodisplay API_DEPRECATED("Use +[NSAnimationContext runAnimationGroup:completionHandler:] to temporarily prevent AppKit's automatic deferred display mechanism from drawing.", macos(10.0,10.14));
/* Returns NSGraphicsContext used to render the receiver's content on the screen for the calling thread.
*/
@property (nullable, readonly, strong) NSGraphicsContext *graphicsContext API_DEPRECATED("Add instances of NSView to display content in a window.", macos(10.0,10.14));
@property (getter=isOneShot) BOOL oneShot API_DEPRECATED("This property does not do anything and should not be used", macos(10.0,10.14));
typedef NS_ENUM(NSUInteger, NSWindowBackingLocation) {
NSWindowBackingLocationDefault = 0, // System determines if window backing store is in VRAM or main memory
NSWindowBackingLocationVideoMemory = 1, // Window backing store is in VRAM
NSWindowBackingLocationMainMemory = 2 // Window backing store is in main memory
} API_DEPRECATED("", macos(10.5,10.14));
@property NSWindowBackingLocation preferredBackingLocation API_DEPRECATED("This property does not do anything and should not be used", macos(10.5,10.14));
@property (readonly) NSWindowBackingLocation backingLocation API_DEPRECATED("This property does not do anything and should not be used", macos(10.5,10.14));
// showsResizeIndicator is soft-deprecated in 10.14. It is ignored on 10.7 and newer, and should not be used.
@property BOOL showsResizeIndicator;
@end
/* Deprecated legacy style mask constants. Prefer to use NSWindowStyleMask values instead.
*/
static const NSWindowStyleMask NSBorderlessWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskBorderless", macos(10.0,10.12)) = NSWindowStyleMaskBorderless;
static const NSWindowStyleMask NSTitledWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskTitled", macos(10.0,10.12)) = NSWindowStyleMaskTitled;
static const NSWindowStyleMask NSClosableWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskClosable", macos(10.0,10.12)) = NSWindowStyleMaskClosable;
static const NSWindowStyleMask NSMiniaturizableWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskMiniaturizable", macos(10.0,10.12)) = NSWindowStyleMaskMiniaturizable;
static const NSWindowStyleMask NSResizableWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskResizable", macos(10.0,10.12)) = NSWindowStyleMaskResizable;
static const NSWindowStyleMask NSTexturedBackgroundWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskTexturedBackground", macos(10.0,10.12)) = NSWindowStyleMaskTexturedBackground;
static const NSWindowStyleMask NSUnifiedTitleAndToolbarWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskUnifiedTitleAndToolbar", macos(10.0,10.12)) = NSWindowStyleMaskUnifiedTitleAndToolbar;
static const NSWindowStyleMask NSFullScreenWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskFullScreen", macos(10.0,10.12)) = NSWindowStyleMaskFullScreen;
static const NSWindowStyleMask NSFullSizeContentViewWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskFullSizeContentView", macos(10.0,10.12)) = NSWindowStyleMaskFullSizeContentView;
static const NSWindowStyleMask NSUtilityWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskUtilityWindow", macos(10.0,10.12)) = NSWindowStyleMaskUtilityWindow;
static const NSWindowStyleMask NSDocModalWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskDocModalWindow", macos(10.0,10.12)) = NSWindowStyleMaskDocModalWindow;
static const NSWindowStyleMask NSNonactivatingPanelMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskNonactivatingPanel", macos(10.0,10.12)) = NSWindowStyleMaskNonactivatingPanel;
static const NSWindowStyleMask NSHUDWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskHUDWindow", macos(10.0,10.12)) = NSWindowStyleMaskHUDWindow;
static const NSWindowStyleMask NSUnscaledWindowMask API_DEPRECATED("NSUnscaledWindowMask is deprecated and has no effect. The scale factor for a window backing store is dynamic and dependent on the screen it is placed on.", macos(10.0,10.9)) = 1 << 11;
/* Deprecated window button constants
*/
static const NSWindowButton NSWindowFullScreenButton API_DEPRECATED("The standard window button for NSWindowFullScreenButton is always nil; use NSWindowZoomButton instead", macos(10.7,10.12)) = (NSWindowButton)7;
/* Deprecated window levels
*/
static const NSWindowLevel NSDockWindowLevel API_DEPRECATED("", macos(10.0,10.13)) = kCGDockWindowLevel;
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSCustomTouchBarItem.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSGlyphGenerator.h | #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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSItemProvider.h | /*
NSItemProvider.h
Application Kit
Copyright (c) 2014-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSGeometry.h>
#import <Foundation/NSItemProvider.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
// Item information support for Services-with-UI.
@interface NSItemProvider (NSItemSourceInfo)
// "sourceFrame" is the screen-space rectangle that the item’s representation occupies in the host application source window. If the item is clipped (scrolled to only partially visible, for example), this is the screen rectangle that the fully displayed item would occupy if there was no clipping. Modified by "containerFrame" (below), which defines an enclosing clip rectangle, this provides the frame the item’s representation will start from, if it is animated into the service's UI.
@property(readonly) NSRect sourceFrame API_AVAILABLE(macos(10.10));
// "containerFrame" is the screen-space rectangle of the item's enclosing clipping area. The item will be understood to be fully visible, partially clipped, or not visible at all in the source window, according to whether this rectangle contains, intersects, or does not intersect the item's "sourceFrame". The system may use this information to gradually reveal items as they are transitioned into a service UI. Items that originate from the same view will typically have the same enclosing containerFrame, but making this per-item allows for gathering items from various enclosing source areas. Defaults to NSZeroRect when an enclosing clip rectangle cannot be determined. The system interprets that to mean that the item is fully visible (not clipped at all).
@property(readonly) NSRect containerFrame API_AVAILABLE(macos(10.10));
// "preferredPresentationSize" is the suggested ideal presentation size for the item, that the service UI is encouraged to display it at if possible. This might be different from the size at which the item is depicted in the host app source window (sourceFrame.size). For an image, for example, this will be image’s natural size, since if the service UI provides editing functionality, natural size is likely to be the most appropriate or convenient scale for editing. If the item is of a type whose size can be automatically determined (image, video, PDF, etc.), this property will be automatically derived when the item's primary representation is loaded. When this is NSZeroSize, assume that the item's sourceFrame gives an appropriate size for displaying the item in the service UI.
@property(readonly) NSSize preferredPresentationSize API_AVAILABLE(macos(10.10));
@end
// UTI subtypes for data detector types. They are sub-UTIs of com.apple.structured-text which conforms to public.plain-text
APPKIT_EXTERN NSString * const NSTypeIdentifierDateText NS_AVAILABLE(10_10, 8_0); // NSTextCheckingTypeDate, com.apple.structured-text.date
APPKIT_EXTERN NSString * const NSTypeIdentifierAddressText NS_AVAILABLE(10_10, 8_0); // NSTextCheckingTypeAddress, com.apple.structured-text.address
APPKIT_EXTERN NSString * const NSTypeIdentifierPhoneNumberText NS_AVAILABLE(10_10, 8_0); // NSTextCheckingTypePhoneNumber, com.apple.structured-text.telephone-number
APPKIT_EXTERN NSString * const NSTypeIdentifierTransitInformationText NS_AVAILABLE(10_10, 8_0); // NSTextCheckingTypeTransitInformation, com.apple.structured-text.transit-information
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSFormCell.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSStatusItem.h | /*
NSStatusItem.h
Application Kit
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <AppKit/NSEvent.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
typedef NSString * NSStatusItemAutosaveName NS_SWIFT_BRIDGED_TYPEDEF;
@class NSAttributedString;
@class NSStatusBarButton;
@class NSStatusBar;
@class NSWindow;
@class NSImage;
@class NSMenu;
@class NSView;
typedef NS_OPTIONS(NSUInteger, NSStatusItemBehavior) {
/* Allow the user to remove the item. By default, an item is not removable. To provide consistency with system status items, RemovalAllowed should be set if your application remains usable without the status item. It is the application's responsibility to allow the user to re-add the item. Upon removal, -visible is set to NO. This is observable through KVO.
*/
NSStatusItemBehaviorRemovalAllowed = (1 << 1),
/* The application terminates when the user removes the item. Implies NSStatusItemBehaviorRemovalAllowed.
*/
NSStatusItemBehaviorTerminationOnRemoval = (1 << 2),
} API_AVAILABLE(macos(10.12));
@interface NSStatusItem : NSObject
/* The status bar that the receiver is displayed in.
*/
@property (readonly, weak) NSStatusBar *statusBar;
/* The amount of space in the status bar that should be allocated to the receiver. \c NSVariableStatusItemLength will adjust the length to the size of the status item's contents and \c NSSquareStatusItemLength will keep the length the same as the status bar's height.
*/
@property CGFloat length;
/* The drop down menu that is displayed when the status item is pressed or clicked.
*/
@property (nullable, strong) NSMenu *menu;
/* The button that is displayed in the status bar. This is created automatically on the creation of the StatusItem. Behavior customization for the button, such as image, target/action, tooltip, can be set with this property.
*/
@property (nullable, readonly, strong) NSStatusBarButton *button API_AVAILABLE(macos(10.10));
/* Specifies the behavior of the status item.
*/
@property (assign) NSStatusItemBehavior behavior API_AVAILABLE(macos(10.12));
/* Specifies if the status item is currently visible in the status bar, even if it is obscured by the application menu. Defaults to YES. Persisted based on the -autosaveName. This is observable through KVO.
*/
@property (assign, getter=isVisible) BOOL visible API_AVAILABLE(macos(10.12));
/* Specifies a unique name for persisting visibility information. If none is specified, one is automatically chosen. Apps with multiple status bar items should set an autosave after creation. Setting to nil resets the automatically chosen name and clears saved information.
*/
@property (null_resettable, copy) NSStatusItemAutosaveName autosaveName API_AVAILABLE(macos(10.12));
@end
@interface NSStatusItem (NSStatusItemDeprecated)
/* These methods simply forward their calls onto the button property. */
@property (nullable) SEL action API_DEPRECATED("Use the receiver's button.action instead", macos(10.0,10.14));
@property (nullable) SEL doubleAction API_DEPRECATED("Use the receiver's button.doubleAction instead", macos(10.0,10.14));
@property (nullable, weak) id target API_DEPRECATED("Use the receiver's button.target instead", macos(10.0,10.14));
@property (nullable, copy) NSString *title API_DEPRECATED("Use the receiver's button.title instead", macos(10.0,10.14));
@property (nullable, copy) NSAttributedString *attributedTitle API_DEPRECATED("Use the receiver's button.attributedTitle instead", macos(10.0,10.14));
@property (nullable, strong) NSImage *image API_DEPRECATED("Use the receiver's button.image instead", macos(10.0,10.14));
@property (nullable, strong) NSImage *alternateImage API_DEPRECATED("Use the receiver's button.alternateImage instead", macos(10.0,10.14));
@property (getter=isEnabled) BOOL enabled API_DEPRECATED("Use the receiver's button.enabled instead", macos(10.0,10.14));
@property BOOL highlightMode API_DEPRECATED("Use the receiver's button.cell.highlightsBy instead", macos(10.0,10.14));
@property (nullable, copy) NSString *toolTip API_DEPRECATED("Use the receiver's button.toolTip instead", macos(10.0,10.14));
- (NSInteger)sendActionOn:(NSEventMask)mask API_DEPRECATED("Use the receiver's button's -sendActionOn: instead", macos(10.0,10.14));
/*
Custom views should not be set on a status item.
The button property with a template image will allow proper styling of the status item in various states and contexts and should be used instead.
*/
@property (nullable, strong) NSView *view API_DEPRECATED("Use the standard button property instead", macos(10.0,10.14));
- (void)drawStatusBarBackgroundInRect:(NSRect)rect withHighlight:(BOOL)highlight API_DEPRECATED("Use the standard button instead which handles highlight drawing, making this method obsolete", macos(10.0,10.14));
- (void)popUpStatusItemMenu:(NSMenu *)menu API_DEPRECATED("Use the menu property instead", macos(10.0,10.14));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSUserInterfaceValidation.h | /*
NSUserInterfaceValidation.h
Application Kit
Copyright (c) 1999-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <AppKit/AppKitDefines.h>
/*
This file defines the protocols used by AppKit's standard user interface validation mechanism. The NSValidatedUserInterfaceItem protocol must be implemented by validated objects. The validated object should send a -validateUserInterfaceItem: message to its validator. A validator can be determined by calling the -[NSApplication targetForAction:to:from:] method from the -update method in the validated object.
You can extend this functionality by introducing a new set of protocols that are targeted to your specific validated objects. NSMenuItem protocol is one example extending this validation machinary to allow validators to modify menu items being validated. These are the steps to extend UI validation:
1) Declare a subprotocol of NSValidatedUserInterfaceItem
You can add as many features as you want for your validated objects in this protocol
i.e.
@protocol NSValidatedToobarItem <NSValidatedUserInterfaceItem>
- (NSImage *)image;
- (void)setImage:(NSImage *)image
- (NSString *)toolTip;
- (void)setToolTip:(NSString *)toolTip;
@end
2) Declare validation method for validators
You should declare your new selector that takes your object as the argument.
i.e.
@protocol NSToolbarItemValidation
- (BOOL)validateToolbarItem:(id <NSValidatedToobarItem>)item;
@end
3) Implement your -update method
You should first check if your current validator responds to your validation method,
then, the generic -validateUserInterfaceItem: method. This way, your object can be automatically
enabled/disabled by the kit's standard objects like NSTextView without any additional code.
i.e.
- (void)update {
id validator = [NSApp targetForAction:[self action] to:[self target] from:self];
if ((validator == nil) || ![validator respondsToSelector:[self action]]) {
[self setEnabled:NO];
} else if ([validator respondsToSelector:@selector(validateToolbarItem:)]) {
[self setEnabled:[validator validateToolbarItem:self]];
} else if ([validator respondsToSelector:@selector(validateUserInterfaceItem:)]) {
[self setEnabled:[validator validateUserInterfaceItem:self]];
} else {
[self setEnabled:YES];
}
}
4) Implement category methods for standard objects (Optional)
Now you can implement default validation methods for standard objects like NSTextView or NSDocument.
i.e.
@implementation NSTextView (NSToolbarItemValidation)
- (BOOL)validateToolbarItem:(id <NSValidatedToobarItem>)item {
BOOL returnValue = [self validateUserInterfaceItem:item];
// Your own validation
return returnValue;
}
@end
*/
/* Protocol implemented by validated objects */
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@protocol NSValidatedUserInterfaceItem
@property (readonly, nullable) SEL action;
@property (readonly) NSInteger tag;
@end
/* Protocol implemented by validator objects */
@protocol NSUserInterfaceValidations
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSHapticFeedback.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSMenu.h | /*
NSMenu.h
Application Kit
Copyright (c) 1996-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSMenuItem.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSEvent, NSView, NSFont;
@class NSMenu;
@protocol NSMenuDelegate;
@interface NSMenu : NSObject <NSCopying, NSCoding, NSUserInterfaceItemIdentification, NSAppearanceCustomization, NSAccessibilityElement, NSAccessibility>
/* Designated initializer. If this menu is used as a submenu of an item in the application's main menu, then the title is what appears in the menu bar. Otherwise, the title is ignored. Do not pass nil (an exception will result), but you may pass an empty string.
*/
- (instancetype)initWithTitle:(NSString *)title NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
/* Set and get the menu's title. The titles of the submenus of the application's main menu items appear in the menu bar. */
@property (copy) NSString *title;
/* Pops up the receiver as a context menu. The menu is positioned such that the top left corner lies at the given event's location, interpreted in the coordinate system of the given view. If this would cause the menu to scroll offscreen, it will be moved up to be onscreen. The event must not be nil.
If a font is specified, then it will be applied to the menu. In 10.6, the setFont: API below should be preferred.
*/
+ (void)popUpContextMenu:(NSMenu*)menu withEvent:(NSEvent*)event forView:(NSView*)view;
+ (void)popUpContextMenu:(NSMenu*)menu withEvent:(NSEvent*)event forView:(NSView*)view withFont:(nullable NSFont*)font;
/* Pops up the receiver as a popup menu. The top left or right corner of the given item (which must be present in the receiver) is positioned at the given location in the given view, interpreted in the view's own coordinate system. If item is nil, the menu is positioned such that the top left or right of the menu content frame is at the given location. If view is nil, the location is interpreted in the screen coordinate system. This allows you to pop up a menu disconnected from any window. The method returns YES if menu tracking ended because an item was selected, and NO if menu tracking was cancelled for any reason.
This method determines whether to use the top left or right corner by calling userInterfaceLayoutDirection on the view or its cell (if implemented). If not implemented, or if the view is nil, it inspects the userInterfaceLayoutDirection of the NSApplication.
*/
- (BOOL)popUpMenuPositioningItem:(nullable NSMenuItem *)item atLocation:(NSPoint)location inView:(nullable NSView *)view API_AVAILABLE(macos(10.6));
/* Determines whether the menu bar is visible for this application. Users cannot access the menu bar unless it is visible. It is visible by default. */
+ (void)setMenuBarVisible:(BOOL)visible;
+ (BOOL)menuBarVisible;
/* Getter: Returns the menu containing the item that has the receiver as a submenu, or nil if this menu is not the submenu of an item in a menu.
Setter: If a menu item has the receiver as a submenu, then this method will be called when the menu containing that item changes. You should never call this, but you may override it to take some action when the supermenu changes. */
@property (nullable, assign) NSMenu *supermenu;
/* Inserts a menu item at the given index, which must be at least zero and no more than the receiver's item count. If newItem is nil, this raises an exception. */
- (void)insertItem:(NSMenuItem *)newItem atIndex:(NSInteger)index;
/* Appends an item to the end of the menu. A nil item will raise an exception. */
- (void)addItem:(NSMenuItem *)newItem;
/* Inserts a new menu item with the given title, action, and key equivalent, at the given index. The index must be at least zero and no more than the receiver's item count. The title and key equivalent must not be nil (pass the empty string to indicate no key equivalent). This returns the new item.
*/
- (NSMenuItem *)insertItemWithTitle:(NSString *)string action:(nullable SEL)selector keyEquivalent:(NSString *)charCode atIndex:(NSInteger)index;
/* Appends a new menu item with the given properties to the end of the menu. */
- (NSMenuItem *)addItemWithTitle:(NSString *)string action:(nullable SEL)selector keyEquivalent:(NSString *)charCode;
/* Removes the item at the given index, which must be at least zero and less than the number of items. All subsequent items will shift down one index. */
- (void)removeItemAtIndex:(NSInteger)index;
/* Removes the item from the menu. If the item is nil, or is not present in the receiver, an exception will be raised. */
- (void)removeItem:(NSMenuItem *)item;
/* Same as [item setSubmenu:menu]. item may not be nil. */
- (void)setSubmenu:(nullable NSMenu *)menu forItem:(NSMenuItem *)item;
/* Removes all items. This is more efficient than removing items one by one. This does not post NSMenuDidRemoveItemNotification, for efficiency.
*/
- (void)removeAllItems API_AVAILABLE(macos(10.6));
/* Returns an array containing the receiver's menu items. This property is settable in macOS 10.14 and later. */
@property (copy) NSArray<NSMenuItem *> *itemArray;
/* Returns the number of menu items in the menu. */
@property (readonly) NSInteger numberOfItems;
/* Returns the item at the given index, which must be at least zero and less than the number of items. */
- (nullable NSMenuItem *)itemAtIndex:(NSInteger)index;
/* Returns the index of the item in the menu, or -1 if the item is not present in the menu */
- (NSInteger)indexOfItem:(NSMenuItem *)item;
/* Returns the first item in the menu that matches the given property, or -1 if no item in the menu matches. */
- (NSInteger)indexOfItemWithTitle:(NSString *)title;
- (NSInteger)indexOfItemWithTag:(NSInteger)tag;
- (NSInteger)indexOfItemWithRepresentedObject:(nullable id)object;
- (NSInteger)indexOfItemWithSubmenu:(nullable NSMenu *)submenu;
- (NSInteger)indexOfItemWithTarget:(nullable id)target andAction:(nullable SEL)actionSelector;
/* Returns the first item in the menu with the given property, or nil if no item in the menu matches. */
- (nullable NSMenuItem *)itemWithTitle:(NSString *)title;
- (nullable NSMenuItem *)itemWithTag:(NSInteger)tag;
/* Set and get whether the menu autoenables items. If a menu autoenables items, then calls to -[NSMenuItem setEnabled:] are ignored, and the enabled state is computed via the NSMenuValidation informal protocol below. Autoenabling is on by default. */
@property BOOL autoenablesItems;
/* If the receiver is set to autoenable items, then this triggers autovalidation of all menu items according to the NSMenuValidation informal protocol; otherwise this does nothing. It is normally not necessary to call this; it will be called for you at the right time. */
- (void)update;
/* Attempts to perform the given key equivalent. If the event is a key down event that matches the key equivalent of a menu item in the receiver or, recursively, any menu item in a submenu of the receiver, then this triggers that menu item's action (if the item is enabled) and returns YES. Otherwise, this returns NO.
*/
- (BOOL)performKeyEquivalent:(NSEvent *)event;
/* This method is called when a menu item's enabled state, submenu, title, attributed title, image, key equivalent, key equivalent modifier mask, alternate status, indent, tooltip, view, or visibility (via isHidden) changes. This method posts NSMenuDidChangeItemNotification. Future properties will likely not call this method when they change, because posting a notification when a property changes is rather expensive.
*/
- (void)itemChanged:(NSMenuItem *)item;
/* Triggers the action for the item at the given index in the receiver. This is useful as both an override point and something you may call directly. As an override point, this is called when the user chooses the item during normal menu tracking; subclassers can override it to take some different action. If you call it directly, it triggers the action for that item. In SnowLeopard and later, calling it directly will also highlight the menu (if present in the main menu) and trigger accessibility notifications, including VoiceOver speaking the title.
*/
- (void)performActionForItemAtIndex:(NSInteger)index;
/* Set and get the delegate for the menu. The delegate is weakly referenced for zeroing-weak compatible objects on 10.9 and later. Otherwise the behavior of this property is 'assign'. See the NSMenuDelegate protocol for methods that the delegate may implement. */
@property (nullable, weak) id<NSMenuDelegate> delegate;
/* If called on the main menu, returns the height of the menu bar in pixels. If called on any other menu, returns 0.
*/
@property (readonly) CGFloat menuBarHeight;
/* Dismisses the menu and ends all menu tracking */
- (void)cancelTracking API_AVAILABLE(macos(10.5));
/* Dismisses the menu immediately, without any fade or other effect, and ends all menu tracking */
- (void)cancelTrackingWithoutAnimation API_AVAILABLE(macos(10.6));
/* Returns the highlighted item in the menu, or nil if no item in the menu is highlighted */
@property (nullable, readonly, strong) NSMenuItem *highlightedItem API_AVAILABLE(macos(10.5));
/* Set the minimum width of the menu, in screen coordinates. The menu will prefer to not draw smaller than its minimum width, but may draw larger if it needs more space. The default value is 0.
*/
@property CGFloat minimumWidth API_AVAILABLE(macos(10.6));
/* Returns the size of the menu, in screen coordinates. The menu may draw at a smaller size when shown, depending on its positioning and display configuration.
*/
@property (readonly) NSSize size API_AVAILABLE(macos(10.6));
/* Sets the font for the menu. This also affects the font of all submenus that do not have their own font.
*/
@property (null_resettable, strong) NSFont *font API_AVAILABLE(macos(10.6));
/* Determines whether contextual menu plugins may be appended to the menu, if used as a context menu. The default is YES.
*/
@property BOOL allowsContextMenuPlugIns API_AVAILABLE(macos(10.6));
/* Determines whether the menu contains a column for the state image. The default is YES. */
@property BOOL showsStateColumn API_AVAILABLE(macos(10.5));
/* Determines the layout direction for menu items in the menu. If no layout direction is explicitly set, the menu will default to the value of [NSApp userInterfaceLayoutDirection]. */
@property NSUserInterfaceLayoutDirection userInterfaceLayoutDirection API_AVAILABLE(macos(10.11));
@end
@interface NSMenu (NSSubmenuAction)
- (void)submenuAction:(nullable id)sender;
@end
@protocol NSMenuItemValidation <NSObject>
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem;
@end
#if __swift__ < 40200
@interface NSObject (NSMenuValidation)
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem API_DEPRECATED("This is now a method of the NSMenuItemValidation protocol.", macos(10.0, 11.0));
@end
#endif
@protocol NSMenuDelegate <NSObject>
@optional
- (void)menuNeedsUpdate:(NSMenu*)menu;
- (NSInteger)numberOfItemsInMenu:(NSMenu*)menu;
- (BOOL)menu:(NSMenu*)menu updateItem:(NSMenuItem*)item atIndex:(NSInteger)index shouldCancel:(BOOL)shouldCancel;
// implement either the first one or the next two to populate the menu
- (BOOL)menuHasKeyEquivalent:(NSMenu*)menu forEvent:(NSEvent*)event target:(_Nullable id* _Nonnull)target action:(_Nullable SEL* _Nonnull)action;
// bypasses populating the menu for checking for key equivalents. set target and action on return
/* indicates that the menu is being opened (displayed) or closed (hidden). Do not modify the structure of the menu or the menu items from within these callbacks. */
- (void)menuWillOpen:(NSMenu *)menu API_AVAILABLE(macos(10.5));
- (void)menuDidClose:(NSMenu *)menu API_AVAILABLE(macos(10.5));
/* Indicates that menu is about to highlight item. Only one item per menu can be highlighted at a time. If item is nil, it means all items in the menu are about to be unhighlighted. */
- (void)menu:(NSMenu *)menu willHighlightItem:(nullable NSMenuItem *)item API_AVAILABLE(macos(10.5));
/* Given a menu that is about to be opened on the given screen, return a rect, in screen coordinates, within which the menu will be positioned. If you return NSZeroRect, or if the delegate does not implement this method, the menu will be confined to the bounds appropriate for the given screen. The returned rect may not be honored in all cases, such as if it would force the menu to be too small.
*/
- (NSRect)confinementRectForMenu:(NSMenu *)menu onScreen:(nullable NSScreen *)screen API_AVAILABLE(macos(10.6));
@end
/* The NSMenuProperties type is a bitmask used for specifying a set of menu or menu item properties, used in the following method.
*/
typedef NS_OPTIONS(NSUInteger, NSMenuProperties) {
NSMenuPropertyItemTitle = 1 << 0, // the menu item's title
NSMenuPropertyItemAttributedTitle = 1 << 1, // the menu item's attributed title
NSMenuPropertyItemKeyEquivalent = 1 << 2, // the menu item's key equivalent
NSMenuPropertyItemImage = 1 << 3, // the menu item's image
NSMenuPropertyItemEnabled = 1 << 4, // whether the menu item is enabled or disabled
NSMenuPropertyItemAccessibilityDescription = 1 << 5 // the menu item's accessibility description
};
/* The following method may be called from delegate callbacks to determine which properties need to be updated and which may be skipped. It is intended to allow more efficient updating of the menu in certain circumstances. For example, if the NSMenuPropertyItemImage bit is zero, your delegate does not need to update the images of the menu items, because the images are not needed (for example, during key equivalent matching). Calling this is optional: it is always acceptable to fully update the menu.
This may be called from the menu delegate method -menuNeedsUpdate:. Calling this at other times will raise an exception.
*/
@interface NSMenu (NSMenuPropertiesToUpdate)
@property (readonly) NSMenuProperties propertiesToUpdate API_AVAILABLE(macos(10.6));
@end
APPKIT_EXTERN NSNotificationName NSMenuWillSendActionNotification;
APPKIT_EXTERN NSNotificationName NSMenuDidSendActionNotification;
APPKIT_EXTERN NSNotificationName NSMenuDidAddItemNotification;
APPKIT_EXTERN NSNotificationName NSMenuDidRemoveItemNotification;
APPKIT_EXTERN NSNotificationName NSMenuDidChangeItemNotification;
// All three of these have a user info key NSMenuItemIndex with a NSNumber value.
APPKIT_EXTERN NSNotificationName NSMenuDidBeginTrackingNotification;
APPKIT_EXTERN NSNotificationName NSMenuDidEndTrackingNotification;
// The remainder of this file contains deprecated methods
@interface NSMenu (NSDeprecated)
- (void)setMenuRepresentation:(null_unspecified id)menuRep API_DEPRECATED("", macos(10.0,10.2));
- (null_unspecified id)menuRepresentation API_DEPRECATED("", macos(10.0,10.2));
- (void)setContextMenuRepresentation:(null_unspecified id)menuRep API_DEPRECATED("", macos(10.0,10.2));
- (null_unspecified id)contextMenuRepresentation API_DEPRECATED("", macos(10.0,10.2));
- (void)setTearOffMenuRepresentation:(null_unspecified id)menuRep API_DEPRECATED("", macos(10.0,10.2));
- (null_unspecified id)tearOffMenuRepresentation API_DEPRECATED("", macos(10.0,10.2));
/* Returns the zone used to allocate NSMenu objects. This is left in for compatibility and has returned NSDefaultMallocZone() since OS X 10.2. It is not necessary to use this - menus can be allocated the usual way. */
+ (null_unspecified NSZone *)menuZone API_DEPRECATED("", macos(10.0,10.11));
+ (void)setMenuZone:(null_unspecified NSZone *)zone API_DEPRECATED("", macos(10.0,10.2));
- (null_unspecified NSMenu *)attachedMenu API_DEPRECATED("", macos(10.0,10.2));
- (BOOL)isAttached API_DEPRECATED("", macos(10.0,10.2));
- (void)sizeToFit API_DEPRECATED("", macos(10.0,10.2));
- (NSPoint)locationForSubmenu:(null_unspecified NSMenu *)submenu API_DEPRECATED("", macos(10.0,10.2));
/* In OS X 10.6 and later, the following methods no longer do anything useful. */
@property BOOL menuChangedMessagesEnabled API_DEPRECATED("", macos(10.0,10.11));
- (void)helpRequested:(NSEvent *)eventPtr API_DEPRECATED("", macos(10.0,10.11));
@property (getter=isTornOff, readonly) BOOL tornOff API_DEPRECATED("", macos(10.0,10.11));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSCell.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSAccessibilityColor.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTableViewDiffableDataSource.h | /*
NSTableViewDiffableDataSource.h
Application Kit
Copyright (c) 2019-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSTableView.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSTableRowView;
@class NSTableCellView;
@class NSDiffableDataSourceSnapshot<SectionIdentifierType,ItemIdentifierType>;
API_AVAILABLE(macos(11.0))
@interface NSTableViewDiffableDataSource<SectionIdentifierType,ItemIdentifierType> : NSObject<NSTableViewDataSource>
typedef NSView * _Nonnull (^NSTableViewDiffableDataSourceCellProvider)(NSTableView * _Nonnull tableView, NSTableColumn * _Nonnull column, NSInteger row, id _Nonnull itemId);
- (instancetype)initWithTableView:(NSTableView*)tableView cellProvider:(NSTableViewDiffableDataSourceCellProvider)cellProvider;
- (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
// If the (optional) completion block is specified, it will be called on the main queue when the animations are completed.
- (void)applySnapshot:(NSDiffableDataSourceSnapshot<SectionIdentifierType,ItemIdentifierType> *)snapshot animatingDifferences:(BOOL)animatingDifferences;
- (void)applySnapshot:(NSDiffableDataSourceSnapshot<SectionIdentifierType,ItemIdentifierType>*)snapshot animatingDifferences:(BOOL)animatingDifferences completion:(void(^ _Nullable)(void))completion;
// Row <-> item identifier conversion
- (nullable ItemIdentifierType)itemIdentifierForRow:(NSInteger)row;
- (NSInteger)rowForItemIdentifier:(ItemIdentifierType)identifier;
// Row <-> section identifier conversion
- (nullable SectionIdentifierType)sectionIdentifierForRow:(NSInteger)row;
- (NSInteger)rowForSectionIdentifier:(SectionIdentifierType)identifier;
typedef NSTableRowView * _Nonnull (^NSTableViewDiffableDataSourceRowProvider)(NSTableView * _Nonnull tableView, NSInteger row, id _Nonnull identifier);
@property (copy,nullable) NSTableViewDiffableDataSourceRowProvider rowViewProvider;
// FIXME: GroupRow or SectionHeader?
typedef NSView * _Nonnull (^NSTableViewDiffableDataSourceSectionHeaderViewProvider)(NSTableView * _Nonnull tableView, NSInteger row, id _Nonnull sectionId);
@property (copy,nullable) NSTableViewDiffableDataSourceSectionHeaderViewProvider sectionHeaderViewProvider;
// Default value is NSTableViewAnimationEffectFade. Change takes effect on the next update.
@property NSTableViewAnimationOptions defaultRowAnimation;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSCachedImageRep.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSShadow.h | #if !__has_include(<UIFoundation/NSShadow.h>)
/*
NSShadow.h
Application Kit
Copyright (c) 2002-2021, Apple Inc.
All rights reserved.
*/
/* NSShadow stores the properties of a drop shadow to be added to drawing. */
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
#if !TARGET_OS_IPHONE
@class NSColor;
API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0)) @interface NSShadow : NSObject <NSCopying, NSSecureCoding>
- (instancetype)init NS_DESIGNATED_INITIALIZER; // designated initializer, returns a default shadow with zero offset, zero blur radius, and default color
@property NSSize shadowOffset; // offset in user space of the shadow from the original drawing, in default user space units, where positive values are up and to the right
@property CGFloat shadowBlurRadius; // blur radius of the shadow in default user space units
@property(nullable, copy) NSColor *shadowColor; // color used for the shadow (default is black with an alpha value of 1/3)
- (void)set;
@end
#endif // !TARGET_OS_IPHONE
NS_ASSUME_NONNULL_END
#else
#import <UIFoundation/NSShadow.h>
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTreeController.h | /*
NSTreeController.h
Application Kit
Copyright (c) 2003-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSObjectController.h>
#import <AppKit/AppKitDefines.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSIndexPath.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSSortDescriptor, NSTreeNode;
@interface NSTreeController : NSObjectController
- (void)rearrangeObjects; // triggers rearranging the content objects for the user interface, including sorting (and filtering if provided by subclasses); subclasses can invoke this method if any parameter that affects the arranged objects changes
@property (readonly, strong) NSTreeNode *arrangedObjects; // proxy for the root tree node
@property (nullable, copy) NSString *childrenKeyPath; // key used to find the children of a model object.
@property (nullable, copy) NSString *countKeyPath; // optional for performance
@property (nullable, copy) NSString *leafKeyPath; // optional. inserting/adding children disabled for leaf nodes
@property (copy) NSArray<NSSortDescriptor *> *sortDescriptors;
@property (nullable, strong) id content;
- (IBAction)add:(nullable id)sender; // adds a new sibling node to the end of the selected objects
- (IBAction)remove:(nullable id)sender; //removes the currently selected objects from the tree
- (IBAction)addChild:(nullable id)sender; // adds a new child node to the end of the selected objects
- (IBAction)insert:(nullable id)sender; // inserts a peer in front of first selected node
- (IBAction)insertChild:(nullable id)sender; // inserts a new first child into the children array of the first selected node
@property (readonly) BOOL canInsert;
@property (readonly) BOOL canInsertChild;
@property (readonly) BOOL canAddChild;
- (void)insertObject:(nullable id)object atArrangedObjectIndexPath:(NSIndexPath *)indexPath;
- (void)insertObjects:(NSArray *)objects atArrangedObjectIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;
- (void)removeObjectAtArrangedObjectIndexPath:(NSIndexPath *)indexPath;
- (void)removeObjectsAtArrangedObjectIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;
// functionality here is parallel to what is in array controller
@property BOOL avoidsEmptySelection; // default: YES
@property BOOL preservesSelection; // default: YES
@property BOOL selectsInsertedObjects; // default: YES
@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 a commitEditing call which fails and thus deny's the selection change).
*/
@property (readonly, copy) NSArray *selectedObjects;
- (BOOL)setSelectionIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;
@property (readonly, copy) NSArray<NSIndexPath *> *selectionIndexPaths;
- (BOOL)setSelectionIndexPath:(nullable NSIndexPath *)indexPath;
@property (nullable, readonly, copy) NSIndexPath *selectionIndexPath;
- (BOOL)addSelectionIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;
- (BOOL)removeSelectionIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;
@property (readonly, copy) NSArray<NSTreeNode *> *selectedNodes API_AVAILABLE(macos(10.5));
- (void)moveNode:(NSTreeNode *)node toIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.5));
- (void)moveNodes:(NSArray<NSTreeNode *> *)nodes toIndexPath:(NSIndexPath *)startingIndexPath API_AVAILABLE(macos(10.5));
- (nullable NSString *)childrenKeyPathForNode:(NSTreeNode *)node API_AVAILABLE(macos(10.5));
- (nullable NSString *)countKeyPathForNode:(NSTreeNode *)node API_AVAILABLE(macos(10.5));
- (nullable NSString *)leafKeyPathForNode:(NSTreeNode *)node API_AVAILABLE(macos(10.5));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSText.h | #if !__has_include(<UIFoundation/NSText.h>)
/*
NSText.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSView.h>
#import <AppKit/NSSpellProtocol.h>
#import <AppKit/AppKitDefines.h>
@class NSColor, NSFont, NSNotification;
@protocol NSTextDelegate;
NS_ASSUME_NONNULL_BEGIN
#if !TARGET_OS_IPHONE
#if !__NSTEXT_SHARED_SECTION__
#define __NSTEXT_SHARED_SECTION__ 1
#pragma mark NSTextAlignment
typedef NS_ENUM(NSInteger, NSTextAlignment) {
NSTextAlignmentLeft = 0, // Visually left aligned
#if TARGET_ABI_USES_IOS_VALUES
NSTextAlignmentCenter = 1, // Visually centered
NSTextAlignmentRight = 2, // Visually right aligned
#else /* !TARGET_ABI_USES_IOS_VALUES */
NSTextAlignmentRight = 1, // Visually right aligned
NSTextAlignmentCenter = 2, // Visually centered
#endif
NSTextAlignmentJustified = 3, // Fully-justified. The last line in a paragraph is natural-aligned.
NSTextAlignmentNatural = 4 // Indicates the default alignment for script
} API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));
#pragma mark NSWritingDirection
typedef NS_ENUM(NSInteger, NSWritingDirection) {
NSWritingDirectionNatural = -1, // Determines direction using the Unicode Bidi Algorithm rules P2 and P3
NSWritingDirectionLeftToRight = 0, // Left to right writing direction
NSWritingDirectionRightToLeft = 1 // Right to left writing direction
} API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));
#endif // __NSTEXT_SHARED_SECTION__
#endif // !TARGET_OS_IPHONE
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@interface NSText : NSView <NSChangeSpelling, NSIgnoreMisspelledWords>
- (instancetype)initWithFrame:(NSRect)frameRect NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
@property (copy) NSString *string;
- (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)string;
- (void)replaceCharactersInRange:(NSRange)range withRTF:(NSData *)rtfData;
- (void)replaceCharactersInRange:(NSRange)range withRTFD:(NSData *)rtfdData;
- (nullable NSData *)RTFFromRange:(NSRange)range;
- (nullable NSData *)RTFDFromRange:(NSRange)range;
- (BOOL)writeRTFDToFile:(NSString *)path atomically:(BOOL)flag;
- (BOOL)readRTFDFromFile:(NSString *)path;
@property (nullable, assign) id<NSTextDelegate> delegate;
@property (getter=isEditable) BOOL editable;
@property (getter=isSelectable) BOOL selectable;
@property (getter=isRichText) BOOL richText; //If NO, also clears setImportsGraphics:
@property BOOL importsGraphics; // If YES, also sets setRichText:
@property (getter=isFieldEditor) BOOL fieldEditor; // Indicates whether to end editing on CR, TAB, etc.
@property BOOL usesFontPanel;
@property BOOL drawsBackground;
@property (nullable, copy) NSColor *backgroundColor; // Default is nil. If nil, it implies -drawsBackground=NO
@property (getter=isRulerVisible, readonly) BOOL rulerVisible;
@property NSRange selectedRange;
- (void)scrollRangeToVisible:(NSRange)range;
@property (nullable, strong) NSFont *font;
@property (nullable, copy) NSColor *textColor; // Default is nil. If nil, draws with blackColor
#if !TARGET_OS_IPHONE
@property NSTextAlignment alignment;
@property NSWritingDirection baseWritingDirection;
#endif // !TARGET_OS_IPHONE
- (void)setTextColor:(nullable NSColor *)color range:(NSRange)range; // Passing nil removes NSForegroundColorAttributeName from range
- (void)setFont:(NSFont *)font range:(NSRange)range;
@property NSSize maxSize;
@property NSSize minSize;
@property (getter=isHorizontallyResizable) BOOL horizontallyResizable;
@property (getter=isVerticallyResizable) BOOL verticallyResizable;
- (void)sizeToFit;
- (void)copy:(nullable id)sender;
- (void)copyFont:(nullable id)sender;
- (void)copyRuler:(nullable id)sender;
- (void)cut:(nullable id)sender;
- (void)delete:(nullable id)sender;
- (void)paste:(nullable id)sender;
- (void)pasteFont:(nullable id)sender;
- (void)pasteRuler:(nullable id)sender;
- (void)selectAll:(nullable id)sender;
- (void)changeFont:(nullable id)sender;
- (void)alignLeft:(nullable id)sender;
- (void)alignRight:(nullable id)sender;
- (void)alignCenter:(nullable id)sender;
- (void)subscript:(nullable id)sender;
- (void)superscript:(nullable id)sender;
- (void)underline:(nullable id)sender;
- (void)unscript:(nullable id)sender;
- (void)showGuessPanel:(nullable id)sender;
- (void)checkSpelling:(nullable id)sender;
- (void)toggleRuler:(nullable id)sender;
@end
API_UNAVAILABLE_END
#if !TARGET_OS_IPHONE
/* Various important Unicode code points */
enum {
NSEnterCharacter = 0x0003,
NSBackspaceCharacter = 0x0008,
NSTabCharacter = 0x0009,
NSNewlineCharacter = 0x000a,
NSFormFeedCharacter = 0x000c,
NSCarriageReturnCharacter = 0x000d,
NSBackTabCharacter = 0x0019,
NSDeleteCharacter = 0x007f,
NSLineSeparatorCharacter = 0x2028,
NSParagraphSeparatorCharacter = 0x2029
};
/* Movement codes for movement between fields; these codes are the integer values of the NSTextMovement key in NSTextDidEndEditing notifications, and are used when completions change in the NSTextView method insertCompletion:forPartialWordRange:movement:isFinal:. Note that the value 0 is used for movements that do not fall under any of the other values, hence NSOtherTextMovement is a more appropriate name than the previous NSIllegalTextMovement.
*/
typedef NS_ENUM(NSInteger, NSTextMovement) {
NSTextMovementReturn = 0x10,
NSTextMovementTab = 0x11,
NSTextMovementBacktab = 0x12,
NSTextMovementLeft = 0x13,
NSTextMovementRight = 0x14,
NSTextMovementUp = 0x15,
NSTextMovementDown = 0x16,
NSTextMovementCancel = 0x17,
NSTextMovementOther = 0
};
/* Notifications */
APPKIT_EXTERN NSNotificationName NSTextDidBeginEditingNotification;
APPKIT_EXTERN NSNotificationName NSTextDidEndEditingNotification; // userInfo key: NSTextMovementUserInfoKey
APPKIT_EXTERN NSNotificationName NSTextDidChangeNotification;
// The user info dictionary key for NSTextDidEndEditingNotification
APPKIT_EXTERN NSString * const NSTextMovementUserInfoKey API_AVAILABLE(macos(10.13));
/* Deprecated */
// The following enum items are deprecated. Use NSTextMovement instead
enum {
NSIllegalTextMovement = 0,
NSReturnTextMovement = 0x10,
NSTabTextMovement = 0x11,
NSBacktabTextMovement = 0x12,
NSLeftTextMovement = 0x13,
NSRightTextMovement = 0x14,
NSUpTextMovement = 0x15,
NSDownTextMovement = 0x16,
NSCancelTextMovement = 0x17,
NSOtherTextMovement = 0
};
@protocol NSTextDelegate <NSObject>
@optional
- (BOOL)textShouldBeginEditing:(NSText *)textObject; // YES means do it
- (BOOL)textShouldEndEditing:(NSText *)textObject; // YES means do it
- (void)textDidBeginEditing:(NSNotification *)notification;
- (void)textDidEndEditing:(NSNotification *)notification;
- (void)textDidChange:(NSNotification *)notification; // Any keyDown or paste which changes the contents causes this
@end
/* Additional values to be added to NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft, when used with NSWritingDirectionAttributeName */
enum {
NSTextWritingDirectionEmbedding API_DEPRECATED("Use NSWritingDirectionEmbedding instead", macos(10.0,10.11)) = (0 << 1),
NSTextWritingDirectionOverride API_DEPRECATED("Use NSWritingDirectionOverride instead", macos(10.0,10.11)) = (1 << 1)
};
static const NSTextAlignment NSLeftTextAlignment API_DEPRECATED_WITH_REPLACEMENT("NSTextAlignmentLeft", macos(10.0,10.12)) = NSTextAlignmentLeft;
static const NSTextAlignment NSRightTextAlignment API_DEPRECATED_WITH_REPLACEMENT("NSTextAlignmentRight", macos(10.0,10.12)) = NSTextAlignmentRight;
static const NSTextAlignment NSCenterTextAlignment API_DEPRECATED_WITH_REPLACEMENT("NSTextAlignmentCenter", macos(10.0,10.12)) = NSTextAlignmentCenter;
static const NSTextAlignment NSJustifiedTextAlignment API_DEPRECATED_WITH_REPLACEMENT("NSTextAlignmentJustified", macos(10.0,10.12)) = NSTextAlignmentJustified;
static const NSTextAlignment NSNaturalTextAlignment API_DEPRECATED_WITH_REPLACEMENT("NSTextAlignmentNatural", macos(10.0,10.12)) = NSTextAlignmentNatural;
#endif // !TARGET_OS_IPHONE
NS_ASSUME_NONNULL_END
#else
#import <UIFoundation/NSText.h>
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSAccessibilityCustomAction.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSPasteboardItem.h | /*
NSPasteboardItem.h
Application Kit
Copyright (c) 2008-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSPasteboard.h>
#import <CoreFoundation/CFBase.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSPasteboard;
@protocol NSPasteboardItemDataProvider;
/* An NSPasteboard can contain multiple items. Any object that implements the NSPasteboardWriting and NSPasteboardReading protocols can be written and read on the pasteboard directly. This allows common pasteboard classes such as URLs, colors, images, strings, attributed strings, and sounds to be written and read without an intermediary object. The custom classes of an application can also implement these protocols for use with the pasteboard.
Sometimes, however, an application needs more fine-grained access to the types and data of a particular pasteboard item, or in the case of a delegate or subclass, needs a way to inspect and change what has already been put on the pasteboard. In these cases, it is appropriate to use pasteboard items.
There are three main uses for an NSPasteboardItem:
1. Providing data on the pasteboard: create one or more pasteboard items, set data or data providers for types, and write to the pasteboard
2. Customizing data already on the pasteboard: as a delegate or subclass, retrieve the pasteboard items currently on the pasteboard, Read the existing types and data and set new data and data providers for types as needed.
3. Retrieving data from the pasteboard: Retrieve the pasteboard items from the pasteboard. Read the data for types.
A pasteboard item can be associated with a single pasteboard. When you create a pasteboard item, it can be written to any pasteboard. When you pass in a pasteboard item to -writeObjects:, that pasteboard item becomes bound to the pasteboard it was written to. When you retrieve pasteboard items using -pasteboardItems or -readObjectsForClasses:options:, the returned pasteboard items are associated with the messaged pasteboard. Passing a pasteboard item that is aready associated with a pasteboard into -writeObjects: causes an exception to be raised.
Pasteboard items are intended to be used during a single pasteboard interaction, not held onto and used repeatedly. A pasteboard item is only valid until the owner of the pasteboard changes. If a pasteboard item is stale because the pasteboard owner has changed, it will return nil or NO values from its methods.
The pasteboard item API is very similar to the NSPasteboard API for a single item. One important difference is that NSPasteboardItem expects strings which are valid UTI strings. If a type is specified that is not a valid UTI string, the method call will fail. Similarly, all reported types are UTIs. As of 10.6, NSPasteboard.h declares a number of NSPasteboardType constants which can be used to provide the correct UTI for common pasteboard types.
*/
API_AVAILABLE(macos(10.6))
@interface NSPasteboardItem : NSObject <NSPasteboardWriting, NSPasteboardReading>
/* Returns an array of UTI strings of the data types supported by the receiver.
*/
@property (readonly, copy) NSArray<NSPasteboardType> *types;
/* Given an array of types, will return the first type contained in the pasteboard item, according to the sender's ordering of types. It will check for UTI conformance of the requested types, preferring an exact match to conformance.
*/
- (nullable NSPasteboardType)availableTypeFromArray:(NSArray<NSPasteboardType> *)types;
/* Promises the types and registers the data provider to be messaged to provide the data for that type when requested.
*/
- (BOOL)setDataProvider:(id<NSPasteboardItemDataProvider>)dataProvider forTypes:(NSArray<NSPasteboardType> *)types;
/* Sets a value for the provided UTI type string.
*/
- (BOOL)setData:(NSData *)data forType:(NSPasteboardType)type;
- (BOOL)setString:(NSString *)string forType:(NSPasteboardType)type;
- (BOOL)setPropertyList:(id)propertyList forType:(NSPasteboardType)type;
/* Returns a value for the provided UTI type string.
*/
- (nullable NSData *)dataForType:(NSPasteboardType)type;
- (nullable NSString *)stringForType:(NSPasteboardType)type;
- (nullable id)propertyListForType:(NSPasteboardType)type;
@end
@protocol NSPasteboardItemDataProvider <NSObject>
/* Implemented by the data provider of a pasteboard item, to provide the data for a particular UTI type.
*/
@required
- (void)pasteboard:(nullable NSPasteboard *)pasteboard item:(NSPasteboardItem *)item provideDataForType:(NSPasteboardType)type;
/* One data provider can provide data for more than one pasteboard item. This method is called when the pasteboard no longer needs the data provider for any of its pasteboard items. This can be either because the data provider has fulfilled all promises, or because ownership of the pasteboard has changed.
*/
@optional
- (void)pasteboardFinishedWithDataProvider:(NSPasteboard *)pasteboard;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSColorWell.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSStepper.h | /*
NSStepper.h
Application Kit
Copyright (c) 2000-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSControl.h>
#import <AppKit/AppKitDefines.h>
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@interface NSStepper : NSControl <NSAccessibilityStepper>
@property double minValue;
@property double maxValue;
@property double increment;
@property BOOL valueWraps;
@property BOOL autorepeat;
@end
API_UNAVAILABLE_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSApplicationScripting.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTextContentManager.h | #if (defined(USE_APPKIT_PUBLIC_HEADERS) && USE_APPKIT_PUBLIC_HEADERS) || !__has_include(<UIFoundation/NSTextContentManager.h>)
#include <TargetConditionals.h>
#if !TARGET_OS_IPHONE
//
// NSTextContentManager.h
// Text Kit
//
// Copyright (c) 2018-2021, Apple Inc. All rights reserved.
//
#import <Foundation/NSArray.h>
#import <Foundation/NSNotification.h>
#import <AppKit/AppKitDefines.h>
@class NSTextRange;
@class NSTextElement;
@class NSTextParagraph;
@class NSTextLayoutManager;
@class NSTextStorage;
@class NSTextContentStorage;
@protocol NSTextLocation;
@protocol NSTextContentManagerDelegate;
@protocol NSTextStorageObserving;
NS_ASSUME_NONNULL_BEGIN
#pragma mark NSTextElementProvider
typedef NS_OPTIONS(NSUInteger, NSTextContentManagerEnumerationOptions) {
NSTextContentManagerEnumerationOptionsNone = 0,
NSTextContentManagerEnumerationOptionsReverse = (1 << 0)
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
// NSTextElementProvider is a protocol conformed by NSTextContentManager and its concrete subclasses. It defines the base interface for interacting with a custom text document content type.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@protocol NSTextElementProvider <NSObject>
// Declares the starting and ending locations for the document. The subclass could use its own implementation of a location object conforming to NSTextRange.
@property (strong, readonly) NSTextRange *documentRange;
// Enumerates the text elements starting at textLocation. If textLocation=nil, it assumes self.documentRange.location for forward enumeration; uses self.documentRange.endLocation for reverse enumeration. When enumerating backward, it starts with the element preceding the one containing textLocation. If enumerated at least one element, it returns the edge of the enumerated range. Note that the enumerated range might not match the range of the last element returned. It enumerates the elements in the sequence, but it can skip a range (it can limit the maximum number of text elements enumerated for a single invocation or hide some elements from the layout). Returning NO from block breaks out of the enumeration.
- (nullable id <NSTextLocation>)enumerateTextElementsFromLocation:(nullable id <NSTextLocation>)textLocation options:(NSTextContentManagerEnumerationOptions)options usingBlock:(BOOL (NS_NOESCAPE ^)(NSTextElement *element))block;
// Replaces the characters specified by range with textElements. If the edges of range is not at existing element range boundaries, it either split the element if it allows the operation (i.e. NSTextParagraph) or adjust the replacement range. This method is intended to be used only by NSTextLayoutManager.
- (void)replaceContentsInRange:(NSTextRange *)range withTextElements:(nullable NSArray<NSTextElement *> *)textElements;
// Synchronizes changes to the backing store. If completionHandler=nil, performs the operation synchronously. completionHandler gets passed error if failed. It should block (or fail if synchronous) when there is an active transaction.
- (void)synchronizeToBackingStore:(nullable void (^)(NSError * _Nullable error))completionHandler;
@optional
// Returns a new location from location with offset. The offset value could be positive or negative indicating the logical direction. Could return nil when the inputs don't produce any legal location (i.e. out of bounds index).
- (nullable id <NSTextLocation>)locationFromLocation:(id <NSTextLocation>)location withOffset:(NSInteger)offset;
// Returns the offset between from and to. The return value could be positive or negative. Could return NSNotFound when the offset cannot be represented in an integer value (i.e. locations are not in the same document).
- (NSInteger)offsetFromLocation:(id <NSTextLocation>)from toLocation:(id <NSTextLocation>)to;
// Should be implemented if the location backing store requires manual adjustment after editing. When textRange is intersecting or following the current edited range, the method returns the range adjusted for the modification in the editing session. Returns nil, when no adjustment necessary. forEditingTextSelection indicates if textRange is for the text selection associated with the edit session.
- (nullable NSTextRange *)adjustedRangeFromRange:(NSTextRange *)textRange forEditingTextSelection:(BOOL)forEditingTextSelection;
@end
#pragma mark NSTextContentManager
// NSTextContentManager is an abstract class defining the interface for managing the text document contents and the default implementation. The concrete subclass overrides NSTextElementProvider for managing the content backing store. It is the root object strongly referencing the rest of objects in the TextKit network via an array of NSTextLayoutManager. Also, it manages the editing transaction by tracking the active NSTextLayoutManager focused to be editing.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@interface NSTextContentManager : NSObject <NSTextElementProvider, NSSecureCoding>
#pragma mark Initialization
- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
#pragma mark Basic properties
@property (weak, nullable) id <NSTextContentManagerDelegate> delegate;
#pragma mark NSTextLayoutManager management
// An array of NSTextLayoutManager. KVO-compliant
@property (copy, readonly) NSArray<NSTextLayoutManager *> *textLayoutManagers;
- (void)addTextLayoutManager:(NSTextLayoutManager *)textLayoutManager;
- (void)removeTextLayoutManager:(NSTextLayoutManager *)textLayoutManager;
// The primary NSTextLayoutManager interacting with the user allowing to edit. Setting an NSTextLayoutManager not in textLayoutManagers will reset to nil. It automatically synchronizes pending edits before switching to a new primary object. The operation is synchronous. KVO-compliant
@property (nullable, strong) NSTextLayoutManager *primaryTextLayoutManager;
// Synchronizes changes to all non-primary text layout managers. If completionHandler=nil, performs the operation synchronously. completionHandler gets passed error if failed. It should block (or fail if synchronous) when there is an active transaction.
- (void)synchronizeTextLayoutManagers:(nullable void (^)(NSError * _Nullable error))completionHandler;
#pragma mark Element access
// Returns an array of NSTextElement intersecting the specified range in sequence. It can return a set of elements not filling the entire range specified if the entire range is not synchronously available. Uses -enumerateTextElementsFromLocation:options:usingBlocK: to fill the array.
- (NSArray<NSTextElement *> *)textElementsForRange:(NSTextRange *)range;
#pragma mark Transaction
// When YES, there is an active editing transaction from primaryTextLayoutManager. the synchronization operations to non-primary text layout managers and the backing store block (or fails when synchronous) while this property is YES. Non-primary text layout managers should avoid accessing the elements while this is YES. KVO-compliant
@property (readonly) BOOL hasEditingTransaction;
// Invoked by primaryTextLayoutManager controlling the active editing transaction. Can be nested. The outer most transaction toggles hasEditingTransaction and sends synchronization messages if enabled after invoking transaction.
- (void)performEditingTransactionUsingBlock:(void (NS_NOESCAPE ^) (void))transaction NS_SWIFT_DISABLE_ASYNC;
// Records information about an edit action to the transaction. originalTextRange is the range edited before the action, and newTextRange is the corresponding range after the action. The concrete subclass should invoke this method for each edit action.
- (void)recordEditActionInRange:(NSTextRange *)originalTextRange newTextRange:(NSTextRange *)newTextRange;
// Automatically synchronizes all text layout managers when hasEditingTransaction becoming NO. YES by default.
@property BOOL automaticallySynchronizesTextLayoutManagers;
// Automatically synchronizes the backing store when hasEditingTransaction becoming NO. NO by default.
@property BOOL automaticallySynchronizesToBackingStore;
@end
#pragma mark NSTextContentManagerDelegate
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@protocol NSTextContentManagerDelegate <NSObject>
@optional
// Returns a custom element for location. When non-nil, textContentManager uses the element instead of creating based on its standard mapping logic.
- (nullable NSTextElement *)textContentManager:(NSTextContentManager *)textContentManager textElementAtLocation:(id <NSTextLocation>)location;
// Gives delegate a chance to validate textElement right before block() invocation with -enumerateTextElementsFromLocation:options:usingBlock:. Returning NO indicates textElement to be skipped from the enumeration.
- (BOOL)textContentManager:(NSTextContentManager *)textContentManager shouldEnumerateTextElement:(NSTextElement *)textElement options:(NSTextContentManagerEnumerationOptions)options;
@end
#pragma mark NSTextContentStorageDelegate
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@protocol NSTextContentStorageDelegate <NSTextContentManagerDelegate>
@optional
// Returns a custom NSTextParagraph for range in NSTextContentStorage.attributedString. When non-nil, textContentStorage uses the text paragraph instead of creating the standard NSTextParagraph with the attributed substring in range. The attributed string for a custom text paragraph must have range.length.
- (nullable NSTextParagraph *)textContentStorage:(NSTextContentStorage *)textContentStorage textParagraphWithRange:(NSRange)range;
@end
#pragma mark NSTextContentStorage
// NSTextContentStorage is a concrete subclass of NSTextContentManager providing support for NSAttributedString backing-store. It also implements NSTextStorageObserving participating as a client of NSTextStorage. The facility only supports a single NSTextContentStorage associated with a text storage. When -textStorage!=nil, -attributedString is ignored. By default, NSTextContentStorage is initialized with NSTextStorage as the backing-store.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@interface NSTextContentStorage : NSTextContentManager <NSTextStorageObserving>
#pragma mark Basic properties
@property (weak, nullable) id <NSTextContentStorageDelegate> delegate;
#pragma mark Document contents
// The document contents. KVO-compliant
@property (nullable, copy) NSAttributedString *attributedString;
#pragma mark NSAttributedString utils
// Returns a new attributed string for textElement. Returns if textElement cannot be mapped to NSAttributedString.
- (nullable NSAttributedString *)attributedStringForTextElement:(NSTextElement *)textElement;
// Returns NSTextElement corresponding to attributedString. Returns nil when attributedString contains attributes not mappable to NSTextElement.
- (nullable NSTextElement *)textElementForAttributedString:(NSAttributedString *)attributedString;
#pragma mark Optional NSTextElementProvider methods
// Returns a new location from location with offset. The offset value could be positive or negative indicating the logical direction. Could return nil when the inputs don't produce any legal location (i.e. out of bounds index).
- (nullable id <NSTextLocation>)locationFromLocation:(id <NSTextLocation>)location withOffset:(NSInteger)offset;
// Returns the offset between from and to. The return value could be positive or negative. Could return NSNotFound when the offset cannot be represented in an integer value (i.e. locations are not in the same document).
- (NSInteger)offsetFromLocation:(id <NSTextLocation>)from toLocation:(id <NSTextLocation>)to;
// Should be implemented if the location backing store requires manual adjustment after editing. When textRange is intersecting or following the current edited range, the method returns the range adjusted for the modification in the editing session. Returns nil, when no adjustment necessary. forEditingTextSelection indicates if textRange is for the text selection associated with the edit session.
- (nullable NSTextRange *)adjustedRangeFromRange:(NSTextRange *)textRange forEditingTextSelection:(BOOL)forEditingTextSelection;
@end
// Posted by NSTextContentStorage when a text attribute unsupported by NSTextContentStorage is added to the underlying text storage.
APPKIT_EXTERN NSNotificationName NSTextContentStorageUnsupportedAttributeAddedNotification API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
NS_ASSUME_NONNULL_END
#endif // !TARGET_OS_IPHONE
#else
#import <UIFoundation/NSTextContentManager.h>
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSPopover.h | /*
NSPopover.h
Application Kit
Copyright (c) 2010-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSGeometry.h>
#import <Foundation/NSObject.h>
#import <AppKit/NSNibDeclarations.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSAppearance.h>
#import <AppKit/NSResponder.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSView, NSViewController, NSWindow, NSNotification, NSString;
#pragma mark -
#pragma mark Popovers
/* A popover is a unit of content that is positioned relative to some other content on the screen. An anchor is used to express the relation between these two units of content. Each popover has an appearance that specifies its visual characteristics, as well as a behavior that determines which user interactions will cause the popover to close. A transient popover is closed in response to most user interactions, whereas a semi-transient popovers is closed when the user interacts with the window containing the popover's positioning view. Popovers with application-defined behavior are not usually closed on the developer's behalf. AppKit automatically positions each popover relative to its positioning view and moves the popover whenever its positioning view moves. A positioning rectangle within the positioning view can be specified for additional granularity. Popovers can be detached to become a separate window when they are dragged by implementing the appropriate delegate method.
*/
#pragma mark -
#pragma mark Enumerated Types
typedef NS_ENUM(NSInteger, NSPopoverAppearance) {
/// The popover will use the default, light content appearance.
NSPopoverAppearanceMinimal API_DEPRECATED("", macos(10.7,10.10)) = 0,
/// The popover will draw with a HUD appearance.
NSPopoverAppearanceHUD API_DEPRECATED("", macos(10.7,10.10)) = 1
} API_DEPRECATED("", macos(10.7,10.10));
/* AppKit supports transient, semi-transient, and application-defined behaviors. Please see the class description above for more information. The default popover behavior is NSPopoverBehaviorApplicationDefined.
*/
typedef NS_ENUM(NSInteger, NSPopoverBehavior) {
/* Your application assumes responsibility for closing the popover. AppKit will still close the popover in a limited number of circumstances. For instance, AppKit will attempt to close the popover when the window of its positioningView is closed. The exact interactions in which AppKit will close the popover are not guaranteed. You may consider implementing -cancel: to close the popover when the escape key is pressed.
*/
NSPopoverBehaviorApplicationDefined = 0,
/* AppKit will close the popover when the user interacts with a user interface element outside the popover. Note that interacting with menus or panels that become key only when needed will not cause a transient popover to close. The exact interactions that will cause transient popovers to close are not specified.
*/
NSPopoverBehaviorTransient = 1,
/* AppKit will close the popover when the user interacts with user interface elements in the window containing the popover's positioning view. Semi-transient popovers cannot be shown relative to views in other popovers, nor can they be shown relative to views in child windows. The exact interactions that cause semi-transient popovers to close are not specified.
*/
NSPopoverBehaviorSemitransient = 2
};
@protocol NSPopoverDelegate;
API_AVAILABLE(macos(10.7))
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
@interface NSPopover : NSResponder <NSAppearanceCustomization, NSAccessibilityElement, NSAccessibility>
#else
@interface NSPopover : NSResponder <NSAccessibilityElement, NSAccessibility>
#endif
- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
#pragma mark -
#pragma mark Bindings
/* NSPopover exposes the following bindings:
contentWidth (CGFloat, readonly)
contentHeight (CGFloat, readonly)
positioningRect (NSRect, readonly)
*/
#pragma mark -
#pragma mark Properties
/* All properties of NSPopover are KVO compliant.
*/
/* The delegate of the popover. The delegate is not retained.
*/
@property(nullable, weak) IBOutlet id <NSPopoverDelegate> delegate;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wavailability"
/*!
* The appearance of the popover. The popover's contentView will inherit this appearance. The default effective appearance is the NSAppearanceNameVibrantLight appearance.
* If nil is set, nil will be returned, and the effective appearance will return to the default.
* To prevent conflicts with the previous appearance property, this is only available for apps that target 10.10 and higher.
*/
@property (nullable, strong) NSAppearance *appearance API_AVAILABLE(macos(10.10));
@property (readonly, strong) NSAppearance *effectiveAppearance API_AVAILABLE(macos(10.10));
#pragma clang diagnostic pop
#else
/*!
* This NSPopoverAppearance-based property is deprecated as of 10.10 and should not be used if targeting 10.10 or higher.
* A transition to the NSAppearance-based property should be made where possible.
* The default is NSPopoverAppearanceMinimal.
*/
@property NSPopoverAppearance appearance API_DEPRECATED("", macos(10.7,10.10));
#endif
/* The behavior of the popover. The default behavior is NSPopoverBehaviorApplicationDefined. See the declaration of NSPopoverBehavior above for more information about popover behaviors.
*/
@property NSPopoverBehavior behavior;
/* Should the popover be animated when it shows, closes, or appears to transition to a detachable window. This property also controls whether the popover animates when the content view or content size changes. AppKit does not guarantee which behaviors will be animated or that this property will be respected; it is regarded as a hint. The default value is YES.
*/
@property BOOL animates;
/* The view controller that manages the content of the popover. The default value is nil. You must set the content view controller of the popover to a non-nil value before the popover is shown. Changes to the popover's content view controller while the popover is shown will animate (provided animates is YES).
*/
@property(nullable, retain) IBOutlet NSViewController *contentViewController;
/* The content size of the popover. The popover's content size is set to match the size of the content view when the content view controller is set. Changes to the content size of the popover will animate while the popover is shown (provided animates is YES).
*/
@property NSSize contentSize;
/* YES if the popover is being shown, NO otherwise. The popover is considered to be shown from the point when -showRelativeToRect:ofView:preferredEdge: is invoked until the popover is closed in response to an invocation of either -close or -performClose:.
*/
@property(readonly, getter=isShown) BOOL shown;
/// Returns \c YES if the window is detached to an implicitly created detached window, \c NO otherwise. This method does not apply when the popover is detached to a window returned with \c -detachableWindowForPopover:.
@property (readonly, getter=isDetached) BOOL detached API_AVAILABLE(macos(10.10));
/* Popovers are positioned relative to a positioning view and are automatically moved when the location or size of the positioning view changes. Sometimes it is desirable to position popovers relative to a rectangle within the positioning view. In this case, you must update the positioningRect binding whenever this rectangle changes, or use the positioningRect binding so AppKit can re-position the popover when appropriate.
*/
@property NSRect positioningRect;
#pragma mark -
#pragma mark Show and Close
/* Shows the popover positioned relative to positioningRect of positioningView (see the description of positioningRect above). The common case is to pass [positioningView bounds] for positioningRect, in which case the popover will be placed adjacent to the positioningView and there is no need to update positioningRect (AppKit will detect the the bounds of the positioning view was specified and automatically update the positioningView). preferredEdge is a hint to AppKit about the desired placement of the anchor of the popover towards the positioningRect, and is with respect to the -isFlipped state of the positioningView. Also, if positioningRect is an empty rect, the [view bounds] will automatically be used. The current (but not guaranteed) behavior is that AppKit will place the anchor towards the preferredEdge of the positioningRect unless such a placement would cause the popover not to fit on the screen of positioningView. If the anchor cannot be placed towards the preferredEdge, AppKit will (in the current implementation) attempt to place the anchor on the opposite side of the positioningRect. If that cannot be done, AppKit will attempt to place the anchor on a remaining sides of the popover, and failing that will center the popover on the screen, causing it to (at least temporarily) lose its anchor. The popover will animate onscreen and eventually animate offscreen when it is closed (unless the property animates is set to NO). This method will throw a NSInvalidArgumentException if view is nil or if view is not in a window, or if the popover's behavior is NSPopoverBehaviorSemitransient and the popover's positioningView is in a popover or child window. It will throw a NSInternalInconsistencyException if the popover's content view controller (or the view controller's view) is nil. If the popover is already being shown, this method will update to be associated with the new view and positioningRect passed. If the positioning view is not visible, this method does nothing.
*/
- (void)showRelativeToRect:(NSRect)positioningRect ofView:(NSView *)positioningView preferredEdge:(NSRectEdge)preferredEdge;
/* Attempts to close the popover. The popover will not be closed if it has a delegate and the delegate returns NO to -popoverShouldClose: (or if the popover's class implements -popoverShouldClose: to return NO). The operation will fail if it is displaying a nested popover, or if it has a child window. A window will attempt to close its popovers when it receives a -performClose: message. The popover will animate out when closed (unless the animates property is set to NO).
*/
- (IBAction)performClose:(nullable id)sender;
/* Forces the popover to close without consulting its delegate. Any popovers nested within the popovers will also receive a close message. When a window is closed in response to the -close message being sent, all of its popovers will be closed. The popover will animate out when closed (unless the animates property is set to NO).
*/
- (void)close;
@end
#pragma mark -
#pragma mark Notifications
/* Specifies the close reason. Currently used only as the userInfo key for the NSPopoverWillCloseNotification.
*/
APPKIT_EXTERN NSString * const NSPopoverCloseReasonKey API_AVAILABLE(macos(10.7));
/* Possible values for NSPopoverCloseReasonKey */
typedef NSString * NSPopoverCloseReasonValue NS_TYPED_ENUM;
/* the popover is being closed in a standard way */
APPKIT_EXTERN NSPopoverCloseReasonValue const NSPopoverCloseReasonStandard API_AVAILABLE(macos(10.7));
/* The popover has been closed because it is being detached to a window */
APPKIT_EXTERN NSPopoverCloseReasonValue const NSPopoverCloseReasonDetachToWindow API_AVAILABLE(macos(10.7));
/* Sent before the popover is shown.
*/
APPKIT_EXTERN NSNotificationName const NSPopoverWillShowNotification API_AVAILABLE(macos(10.7));
/* Sent after the popover has finished animating onscreen.
*/
APPKIT_EXTERN NSNotificationName const NSPopoverDidShowNotification API_AVAILABLE(macos(10.7));
/* Sent before the popover is closed. The userInfo key NSPopoverCloseReasonKey specifies the reason for closing. It can currently be either NSPopoverCloseReasonStandard or NSPopoverCloseReasonDetachToWindow, although more reasons for closing may be added in the future.
*/
APPKIT_EXTERN NSNotificationName const NSPopoverWillCloseNotification API_AVAILABLE(macos(10.7));
/* Sent after the popover has finished animating offscreen. This notification has the same user info keys as NSPopoverWillCloseNotification.
*/
APPKIT_EXTERN NSNotificationName const NSPopoverDidCloseNotification API_AVAILABLE(macos(10.7));
#pragma mark -
#pragma mark Delegate Methods
@protocol NSPopoverDelegate <NSObject>
@optional
/*!
* The popover invokes this method on its delegate whenever it is about to close to give the delegate a chance to veto the close.
* If the delegate does not implement this method, \c -popoverShouldClose: will also be invoked on the popover to allow the popover to veto the close.
* \return Return YES if the popover should close, NO otherwise.
*/
- (BOOL)popoverShouldClose:(NSPopover *)popover;
/*!
* Return \c YES to allow the popover to detach from its positioning view. Return \c NO if it should not. If this method is not implemented, the default behavior is \c NO.
* If this method returns YES, and \c -detachableWindowForPopover: is not implemented or returns nil, a detachable window will be created with the popover’s \c contentViewController.
* This implicit detached window will have the same appearance as the popover. If the \c contentViewController has a title, it will be bound to and displayed as the title of the detached window. Upon being released in a detached state, the popover will call \c -popoverDidDetach: on the delegate. Once the detached popover is closed, PopoverShould/Will/DidClose delegate calls and notifications will be sent with the reason \c NSPopoverCloseReasonStandard.
* \param popover The popover that may be detached
* \return YES if the popover should detach, whether to a custom window or the implicitly detached window. NO if not.
*/
- (BOOL)popoverShouldDetach:(NSPopover *)popover API_AVAILABLE(macos(10.10));
/*!
* This is called when the popover has been released in an implicitly detached state, i.e. not when detached to a custom window returned from \c -detachableWindowForPopover:.
* \param popover The popover that detached from its anchor view and is not closing.
*/
- (void)popoverDidDetach:(NSPopover *)popover API_AVAILABLE(macos(10.10));
/*!
* Return a custom window to which the popover should be detached. This should be used when the content of the detached window is wanted to be different from the content of the popover. If the same content should be used in the detached window, only \c -popoverShouldDetach: needs to be implemented.
* If implementing this method, you should not remove the popover's content view as part of your implementation of this method. The popover and the detachable window may be shown at the same time and therefore cannot share a content view (or a content view controller). If the popover and the detachable window should have the same content, you should define the content in a separate nib file and use a view controller to instantiate separate copies of the content for the popover and the detachable window. The popover will animate to appear as though it morphs into the detachable window (unless the animates property is set to NO. The exact animation used is not guaranteed). Subclasses of NSPopover may also implement this method, in which case the subclass method will be invoked only if the delegate does not implement the method.
* Not implementing this method, and just returning YES to \c -popoverShouldDetach: is recommended over providing a custom window.
* If \c -popoverShouldDetach: is not overridden or returns NO, this method will not be called and the popover will not be detachable.
* \param popover The popover that is being detached
* \return The custom window to detach to.
*/
- (nullable NSWindow *)detachableWindowForPopover:(NSPopover *)popover;
/*!
* Invoked on the delegate when the NSPopoverWillShowNotification notification is sent. This method will also be invoked on the popover.
*/
- (void)popoverWillShow:(NSNotification *)notification;
/*!
* Invoked on the delegate when the NSPopoverDidShowNotification notification is sent. This method will also be invoked on the popover.
*/
- (void)popoverDidShow:(NSNotification *)notification;
/*!
* Invoked on the delegate when the NSPopoverWillCloseNotification notification is sent. This method will also be invoked on the popover.
*/
- (void)popoverWillClose:(NSNotification *)notification;
/*!
* Invoked on the delegate when the NSPopoverDidCloseNotification notification is sent. This method will also be invoked on the popover.
*/
- (void)popoverDidClose:(NSNotification *)notification;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTabViewController.h | /*
NSTabViewController.h
Application Kit
Copyright (c) 2014-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSViewController.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSTabView.h>
#import <AppKit/NSToolbar.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
typedef NS_ENUM(NSInteger, NSTabViewControllerTabStyle) {
/// Uses an NSSegmentedControl to show the UI for the tabs. The control is on the top of the view.
NSTabViewControllerTabStyleSegmentedControlOnTop = 0,
/// Uses an NSSegmentedControl to show the UI for the tabs. The control is on the bottom of the view.
NSTabViewControllerTabStyleSegmentedControlOnBottom,
/// Automatically pushes the tabs into the window's toolbar as toolbar items, if non-nil. This style will cause the TabViewController to set its containing window's toolbar to its own and become that toolbar's delegate. The toolbar items can be customized or supplemented by overriding the relevant NSToolbarDelegate methods.
NSTabViewControllerTabStyleToolbar,
/// NSTabViewController will not provide any of its own tab control UI. Separate UI, such as a NSSegmentedControl or NSPopupButton, can be easily bound to the TabViewController. Or \c tabView.tabViewType can be changed for the TabView itself to draw the UI.
NSTabViewControllerTabStyleUnspecified = -1,
} API_AVAILABLE(macos(10.10));
/*!
* NSTabViewController is a container view controller that displays a single child view controller at a time from its \c childViewControllers.
* It provides standard tab-style UI for user selection of tabs, or allows custom UI to be easily created by providing targets for bindings.
* ChildViewControllers’ views are lazily loaded; they are only loaded once their tab is selected and visible.
* The NSTabViewController is set as the delegate of its managed NSTabView. Any overrides of NSTabViewDelegate methods must call super. Properties of the TabView such as the tabStyle can be directly manipulated, but calling methods that add and remove tabViewItems or changing the delegate is not allowed.
* NSViewController's methods \c -addChildViewController:, \c -insertViewController:atIndex:, and \c -removeChildViewControllerAtIndex: can all be used as convience methods to add children; default TabViewItems will be appropriately created or destroyed. The default NSTabViewItem created with with +[NSTabViewItem tabViewItemForViewController:].
*/
API_AVAILABLE(macos(10.10))
@interface NSTabViewController : NSViewController <NSTabViewDelegate, NSToolbarDelegate>
/// The style that this NSTabViewController displays its UI as. Defaults to \c NSTabViewControllerTabStyleSegmentedControlOnTop.
@property NSTabViewControllerTabStyle tabStyle;
/// Access to the tab view that the controller is controlling. To provide a custom NSTabView, assign the value anytime before \c self.viewLoaded is \c YES. Querying the value will create it on-demand, if needed. Check \c self.viewLoaded before querying the value to avoid prematurely creating the view. Note that the \c -tabView may not be equal to the \c viewController.view. Properties such as the tabStyle can be directly manipulated, but calling methods that add and remove tabViewItems or changing the delegate is not allowed. The NSTabViewController will be made the delegate of the NSTabView. Internally, the NSTabView is always used to switch between displayed childViewControllers, regardless of the style displayed.
@property (strong) NSTabView *tabView;
/// This defines how NSTabViewController transitions from one view to another. Transitions go through [self transitionFromViewController:toViewController:options:completionHandler:]. The default value is \c NSViewControllerTransitionCrossfade|NSViewControllerTransitionAllowUserInteraction.
@property NSViewControllerTransitionOptions transitionOptions;
/// If YES and the receiving NSTabViewController has a nil title, \c -title will return its selected child ViewController's title. If NO, it will continue to return nil. The default value is \c YES.
@property BOOL canPropagateSelectedChildViewControllerTitle;
/// The array of tab view items that correspond to the current child view controllers. After a child view controller is added to the receiving TabViewController, a NSTabViewItem with the default values will be created for it. Once the child is removed, its corresponding tabViewItem will be removed from the tabViewItems array.
@property (copy) NSArray<__kindof NSTabViewItem *> *tabViewItems;
/// Read and write the current selected TabViewItem that is being shown. This value is KVC compliant and can be the target of a binding. For instance, a NSSegmentedControl's selection can be bound to this value with: \code [segmentedControl bind:NSSelectedIndexBinding toObject:tabViewController withKeyPath:@“selectedTabViewItemIndex" options:nil];
@property NSInteger selectedTabViewItemIndex;
/*!
* Adds a TabViewItem to the end of the TabViewController. The tabViewItem’s viewController’s view will only be loaded once its tab is selected.
* \param tabViewItem The TabViewItem to add. It must have a \c viewController set by the time it is added or an exception will be thrown. An exception will also be thrown if tabViewItem is nil.
*/
- (void)addTabViewItem:(NSTabViewItem *)tabViewItem;
/*!
* Adds a TabViewItem to a given index in the TabViewController. The tabViewItem’s viewController’s view will only be loaded once its tab is selected. \c -selectedTabViewItemIndex will be adjusted if the insertion index is before it. Subclasses must call through \c -insertTabViewItem:atIndex: to add a TabViewItem.
* \param tabViewItem The TabViewItem to add. It must have a \c viewController set by the time it is added or an exception will be thrown. An exception will also be thrown if tabViewItem is nil.
* \param index The index to add the TabViewItem at. Will throw an exception if \c index < 0 or \c index > \c tabViewItems.count
*/
- (void)insertTabViewItem:(NSTabViewItem *)tabViewItem atIndex:(NSInteger)index;
/*!
* Removes a TabViewItem from the receiver. If the removed tabViewItem currently selected, the next (or previous, if there is no next) tabViewItem will become selected. If this is the only tabViewItem in the TabViewController, the selectedTabViewItemIndex will become \c -1. Subclasses must call through \c -removeTabViewItem: to remove a TabViewItem.
* \param tabViewItem The TabViewItem to remove. An exception will be thrown if \c tabViewItem is not in the NSTabViewController or if it is nil.
*/
- (void)removeTabViewItem:(NSTabViewItem *)tabViewItem;
/*!
* Convenience method for getting the associated tab view item for a particular childViewController.
* \param viewController The ViewController to look up.
* \return The corresponding TabViewItem. Returns nil if \c viewController is not a child of the TabViewController.
*/
- (nullable NSTabViewItem *)tabViewItemForViewController:(NSViewController *)viewController;
/* Overridden methods from NSViewController. These require a call to super if overriden by a subclass. Override this to set the tabView before calling super. */
- (void)viewDidLoad NS_REQUIRES_SUPER;
/* Implemented methods from NSTabViewDelegate. These require a call to super if overriden by a subclass. */
- (void)tabView:(NSTabView *)tabView willSelectTabViewItem:(nullable NSTabViewItem *)tabViewItem NS_REQUIRES_SUPER;
- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(nullable NSTabViewItem *)tabViewItem NS_REQUIRES_SUPER;
- (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(nullable NSTabViewItem *)tabViewItem NS_REQUIRES_SUPER;
/* Implemented methods from NSToolbarDelegate. These require a call to super if overriden by a subclass. */
/* NSTabViewController will create a toolbar item for each of its tabViewItems. The toolbar item's identifier will be the same as the tab view item's; similarly, the toolbar item's label, image, and toolTip are bound to those of the corresponding tab view item. */
- (nullable NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSToolbarItemIdentifier)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag NS_REQUIRES_SUPER;
/* NSTabViewController returns the identifiers for the toolbar items corresponding to its tabViewItems. Overriding these allows additional items to be added to the toolbar. For example, adding NSToolbarFlexibleSpaceItemIdentifier to the beginning and end will center the TabViewController's toolbar items. If a subclass adds custom identifiers, -toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar: must be overridden to return a toolbar item for that identifer. */
- (NSArray<NSToolbarItemIdentifier> *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar NS_REQUIRES_SUPER;
- (NSArray<NSToolbarItemIdentifier> *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar NS_REQUIRES_SUPER;
/* NSTabViewController returns all toolbar item identifiers corresponding to its tabViewItems. */
- (NSArray<NSToolbarItemIdentifier> *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar NS_REQUIRES_SUPER;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSWindowRestoration.h | /*
NSWindowRestoration.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSWindow.h>
#import <AppKit/NSDocument.h>
#import <AppKit/NSDocumentController.h>
#import <AppKit/NSApplication.h>
#import <AppKit/AppKitDefines.h>
/* NSWindowRestoration is the mechanism by which Cocoa apps can persist their user interface state, such as window frames, and integrate with the machinery of the rest of the system. */
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@protocol NSWindowRestoration <NSObject>
/* The following message is sent to request that a window be restored. If the receiver knows how to restore the identified window, it should invoke the completion handler with the window, possibly creating it. It is acceptable to invoke the completion handler with a pre-existing window, though you should not pass the same window to more than one completion handler. If the receiver cannot restore the identified window (for example, the window referenced a document that has been deleted), it should invoke the completion handler with a nil window. In Mac OS X 10.7, the error parameter is ignored.
The receiver is passed the identifier of the window, which allows the receiver to quickly check for known windows. For example, you might give your preferences window an identifier of "preferences" in the nib, and then check for that identifier in your implementation. The receiver is also passed the NSCoder containing the combined restorable state of the window, its delegate, the window controller, and any document. The receiver may decode information previously stored in the coder to determine what window to restore.
Note that the receiver may invoke the completion handler before or after the method returns, and on any queue. If you plan to invoke the completion handler after the method returns, you must copy the completion handler via the -copy method, and -release it after you invoke it. It is not necessary or recommended for implementations of this method to order restored windows onscreen (for example, the window may have been minimized, in which case it will not be ordered onscreen).
*/
+ (void)restoreWindowWithIdentifier:(NSUserInterfaceItemIdentifier)identifier state:(NSCoder *)state completionHandler:(void (^)(NSWindow * _Nullable, NSError * _Nullable))completionHandler API_AVAILABLE(macos(10.7));
@end
/* NSDocumentController implements the NSWindowRestoration protocol. It is set as the restoration class for document windows. You may subclass it and override the restoreWindowWithIdentifier:state:completionHandler: method to control how documents are restored. */
@interface NSDocumentController (NSWindowRestoration) <NSWindowRestoration>
@end
@interface NSApplication (NSWindowRestoration)
/* The following message is the funnel point for all window restoration. The default behavior is to "demux:" decode the restoration class and send it the class method restoreWindowWithIdentifier:state:completionHandler: above.
You should not call this method, but you may override it. Generally it is not necessary to override this method: it is better to set a restoration class on each window and implement the class method above. However, if some version of an app removes a class that is set as the restoration class of a window, you can override this method to detect that case and restore the window differently. Thus this method can be used to "patch up" old persistent state across changes in the class hierarchy.
Unlike the class-level counterpart, this method returns BOOL. A YES return means that the window is recognized and that the completion handler will be called (or has already been called). A NO return means that the window was not recognized and the completion handler will not be called. If you override this and return YES, it is important that the completion handler be called, even if the window you pass to it is nil; otherwise the app will never finish restoring its state.
*/
- (BOOL)restoreWindowWithIdentifier:(NSUserInterfaceItemIdentifier)identifier state:(NSCoder *)state completionHandler:(void (^)(NSWindow * _Nullable, NSError * _Nullable))completionHandler API_AVAILABLE(macos(10.7));
@end
/* NSApplicationDidFinishRestoringWindowsNotification is posted when the application is finished restoring windows, that is, when all the completion handlers from restoreWindowWithIdentifier:state:completionHandler: have been called. This is always posted after NSApplicationWillFinishLaunching, but may be posted before or after NSApplicationDidFinishLaunching, depending on whether clients copy the completion handlers and invoke them later. If there were no windows to restore, then this notification is still posted at the corresponding point in app launch (between NSApplicationWillFinishLaunchingNotification and NSApplicationDidFinishLaunchingNotification). The object is NSApplication, and there is no user info.
*/
APPKIT_EXTERN NSNotificationName const NSApplicationDidFinishRestoringWindowsNotification API_AVAILABLE(macos(10.7));
@interface NSWindow (NSUserInterfaceRestoration)
/* Determines whether the window should be restored on relaunch. By default, windows with NSTitledWindowMask set in the styleMask are restorable, and windows without it set are not.
*/
@property (getter=isRestorable) BOOL restorable API_AVAILABLE(macos(10.7));
/* Set and get the class that is responsible for restoring the window. The default implementation of -[NSWindowController setDocument:] will set the restoration class of the window to the shared NSDocumentController's class.
*/
@property (nullable, assign) Class<NSWindowRestoration> restorationClass API_AVAILABLE(macos(10.7));
/* Disable or enable snapshot restoration. While snapshot restoration is disabled, the window will not be snapshotted for restorable state. */
- (void)disableSnapshotRestoration;
- (void)enableSnapshotRestoration;
@end
@interface NSResponder (NSRestorableState)
/* Method called on the main thread to save the receiver's restorable state. The receiver is passed an NSCoder that supports keyed encoding (but not decoding), and should encode its restorable state. If you override this method, you should call through to super. You should not otherwise invoke this method. If you encode an object that implements the NSUserInterfaceItemIdentification protocol, the object itself is not archived; only its identifier is stored. Thus, for example, a window may efficiently store its firstResponder as restorable state. If you have objects which may take a long time to fetch or encode, consider implementing encodeRestorableStateWithCoder:backgroundQueue: instead of this method.
*/
- (void)encodeRestorableStateWithCoder:(NSCoder *)coder API_AVAILABLE(macos(10.7));
/* A variant of encodeRestorableStateWithCoder:. This method is also called on the main thread, and the receiver may use the provided thread-safe NSCoder to encode restorable state synchronously. In addition, the receiver may enqueue asynchronous work that will encode additional restorable state using the provided serial background NSOperationQueue, if that state is safe to be accessed and encoded in such a fashion. Encoding will be considered finished once the enqueued operations are finished. If you override this method, you should call through to super. You should not otherwise invoke this method.
*/
- (void)encodeRestorableStateWithCoder:(NSCoder *)coder backgroundQueue:(NSOperationQueue *)queue API_AVAILABLE(macos(10.13));
/* Method called to restore state. The receiver is passed an NSCoder that supports keyed decoding (but not encoding). The receiver should decode any previously stored state. If you override this method, you should call through to super. You should not otherwise invoke this method.
*/
- (void)restoreStateWithCoder:(NSCoder *)coder API_AVAILABLE(macos(10.7));
/* Method that you may call to indicate that the restorable state is invalid. At some point in the future, encodeRestorableStateWithCoder: will be called to encode the restorable state. You should not override this method.
*/
- (void)invalidateRestorableState API_AVAILABLE(macos(10.7));
/* Returns a set of key paths, representing paths of properties that should be persistent. The frameworks will observe these key paths via KVO and automatically persist their values as part of the persistent state, and restore them on relaunch. The values of the key paths should implement keyed archiving. The base implementation returns an empty array.
*/
@property (class, readonly, copy) NSArray<NSString *> *restorableStateKeyPaths API_AVAILABLE(macos(10.7));
/** When secure state restoration is used, values at restorableStateKeyPaths must support NSSecureCoding and this method will be consulted when restoring state. Any values not of an allowed class will not be set.
*/
+ (NSArray<Class> *)allowedClassesForRestorableStateKeyPath:(NSString *)keyPath API_AVAILABLE(macos(12.0));
@end
@interface NSApplication (NSRestorableStateExtension)
/* These methods allow the app to extend the period of state restoration. If the app crashes before state restoration is complete, then it may offer to discard restorable state on the next launch. If a window has some state that may take a long time to restore, such as a web page, you may use the following methods to extend the period of this crash protection beyond the default.
Typically you would call -extendStateRestoration within your implementation of +restoreWindowWithIdentifier:state:completionHandler:. You would then call -completeStateRestoration some time after the window is fully restored (e.g. the web page has loaded). If the app crashes in the interim, then it may offer to discard restorable state on the next launch.
These methods act as a counter. Each call to -extend increments the counter, and must be matched with a corresponding call to -complete which decrements it. When the counter reaches zero, the app is considered to have been fully restored, and any further calls are silently ignored.
These methods are thread safe.
*/
- (void)extendStateRestoration API_AVAILABLE(macos(10.7));
- (void)completeStateRestoration API_AVAILABLE(macos(10.7));
@end
@interface NSDocument (NSRestorableState)
/* The following method is called by the default implementation of +[NSDocumentController restoreWindowWithIdentifier:state:completionHandler:] to restore a window that was associated with a document, after that document has been reopened.
The default implementation first checks if the document has window controllers, and if not, it calls -makeWindowControllers. If there is then exactly one window controller, it invokes the completion handler with its window. If there is more than one, it searches the receiver's window controllers for a window that matches the given identifier, and then calls the completionHandler with it. If no window could be found, it invokes the completion handler with a nil window.
If your document has variable or optional windows, you may override this to create the requested window, and then call the completion handler with it. This allows you to use the default document reopening behavior, but intervene at the point of creating the windows. The parameters are the same as in the class method +restoreWindowWithIdentifier:state:completionHandler:.
*/
- (void)restoreDocumentWindowWithIdentifier:(NSUserInterfaceItemIdentifier)identifier state:(NSCoder *)state completionHandler:(void (^)(NSWindow * _Nullable, NSError * _Nullable))completionHandler API_AVAILABLE(macos(10.7));
/* NSDocument implements the NSRestorableState methods, even though it itself is not an NSResponder. */
- (void)encodeRestorableStateWithCoder:(NSCoder *)coder API_AVAILABLE(macos(10.7));
- (void)encodeRestorableStateWithCoder:(NSCoder *)coder backgroundQueue:(NSOperationQueue *)queue API_AVAILABLE(macos(10.13));
- (void)restoreStateWithCoder:(NSCoder *)coder API_AVAILABLE(macos(10.7));
- (void)invalidateRestorableState API_AVAILABLE(macos(10.7));
@property (class, readonly, copy) NSArray<NSString *> *restorableStateKeyPaths API_AVAILABLE(macos(10.7));
+ (NSArray<Class> *)allowedClassesForRestorableStateKeyPath:(NSString *)keyPath API_AVAILABLE(macos(12.0));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSPressureConfiguration.h | /*
NSPressureConfiguration.h
Application Kit
Copyright (c) 2013-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObjCRuntime.h>
#import <Foundation/NSObject.h>
#import <AppKit/NSEvent.h>
#import <AppKit/NSView.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
API_AVAILABLE(macos(10.10.3))
@interface NSPressureConfiguration : NSObject
@property(readonly) NSPressureBehavior pressureBehavior;
/* Designated initializer. An NSPressureBehavior must be inited with its behavior type and shall not change for the object's lifetime
*/
- (instancetype)initWithPressureBehavior:(NSPressureBehavior)pressureBehavior NS_DESIGNATED_INITIALIZER;
/* Sets the configuration; it will automatically be reset on mouse up or gesture end. Only takes effect during a mouse drag or pressure event sequence. However, if your application is slow to respond to the mouseDown event, the user may complete the mouse click sequence before this configuration can take effect. When possible you should configure the pressure behavior before the mouse down via NSView's pressureConfiguration property.
*/
- (void)set;
@end
@interface NSView (NSPressureConfiguration)
/* The pressure configuration a Force Click trackpad should use when the cursor is over this view. The system can set this configuration before the application receives the initial mouse down event. Does not affect an active pressure event sequence.
*/
@property(nullable, strong) NSPressureConfiguration *pressureConfiguration API_AVAILABLE(macos(10.11));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSForm.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSInputServer.h | /*
NSInputServer.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSRange.h>
#import <AppKit/AppKitDefines.h>
/* These methods must be implemented by the delegate.
*/
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@protocol NSInputServiceProvider
- (void) insertText:(null_unspecified id)string client:(null_unspecified id)sender API_DEPRECATED("", macos(10.0,10.6));
- (void) doCommandBySelector:(null_unspecified SEL)selector client:(null_unspecified id)sender API_DEPRECATED("", macos(10.0,10.6));
- (void) markedTextAbandoned:(nullable id)sender API_DEPRECATED("", macos(10.0,10.6));
- (void) markedTextSelectionChanged:(NSRange)newSel client:(null_unspecified id)sender API_DEPRECATED("", macos(10.0,10.6));
- (void) terminate:(nullable id)sender API_DEPRECATED("", macos(10.0,10.6));
/* Normally canBeDisabled returns YES and is implemented that way in the abstract NSInputServer class.
*/
- (BOOL) canBeDisabled API_DEPRECATED("", macos(10.0,10.6));
/* Many existing input servers have built-in key bindings that affect what happens within the marked region. If such an input server wants to handle ALL key events through insertText:client:conversation: and never receive doCommandBySelector:client:conversation:, then it should respond (consistently) YES to this method. The default is NO. The processing of incoming events looks at this flag as reflected in the corresponding NSInputManager, before deciding how to deal with events. A module which responds YES to this method must be prepared to deal with arbitrary strings of Unicode characters under all circumstances whenever it is active.
*/
- (BOOL) wantsToInterpretAllKeystrokes API_DEPRECATED("", macos(10.0,10.6));
/* Input servers that wants to receive mouse notifications should return YES & implement NSInputServerMouseTrackers protocol */
- (BOOL) wantsToHandleMouseEvents API_DEPRECATED("", macos(10.0,10.6));
/* This should return YES when the input method (language) prefers to delay text change notification 'till the input is actually committed.
*/
- (BOOL) wantsToDelayTextChangeNotifications API_DEPRECATED("", macos(10.0,10.6));
/* These methods are sent by current input manager when the application changes state so that the server can update its concept of who's current. The actually "active" sender is the last one to have sent a senderDidBecomeActive: message. They may not arrive in the expected order.
*/
- (void) inputClientBecomeActive:(nullable id)sender API_DEPRECATED("", macos(10.0,10.6));
- (void) inputClientResignActive:(nullable id)sender API_DEPRECATED("", macos(10.0,10.6));
/* These methods are sent by current input manger when it's enabled & the server returns YES to canBeDisabled. When disabled, the server is expected to send only insertText: or doCommandBySelector:.
*/
- (void) inputClientEnabled:(nullable id)sender API_DEPRECATED("", macos(10.0,10.6));
- (void) inputClientDisabled:(nullable id)sender API_DEPRECATED("", macos(10.0,10.6));
/* These methods are sent by input manager when the conversation within a particular sender changes.
*/
- (void) activeConversationWillChange:(null_unspecified id)sender fromOldConversation:(NSInteger)oldConversation API_DEPRECATED("", macos(10.0,10.6));
- (void) activeConversationChanged:(null_unspecified id)sender toNewConversation:(NSInteger)newConversation API_DEPRECATED("", macos(10.0,10.6));
@end
/* These methods are sent to input servers that return YES to wantsToHandleMouseEvents. point is in screen coordinate.
*/
@protocol NSInputServerMouseTracker
- (BOOL) mouseDownOnCharacterIndex:(NSUInteger)index atCoordinate:(NSPoint)point withModifier:(NSUInteger)flags client:(null_unspecified id)sender API_DEPRECATED("", macos(10.0,10.6));
- (BOOL) mouseDraggedOnCharacterIndex:(NSUInteger)index atCoordinate:(NSPoint)point withModifier:(NSUInteger)flags client:(null_unspecified id)sender API_DEPRECATED("", macos(10.0,10.6));
- (void) mouseUpOnCharacterIndex:(NSUInteger)index atCoordinate:(NSPoint)point withModifier:(NSUInteger)flags client:(null_unspecified id)sender API_DEPRECATED("", macos(10.0,10.6));
@end
API_DEPRECATED("", macos(10.0,10.6))
@interface NSInputServer : NSObject <NSInputServiceProvider, NSInputServerMouseTracker>
- (instancetype) initWithDelegate:(null_unspecified id)delegate name:(null_unspecified NSString *)name API_DEPRECATED("", macos(10.0,10.6));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSPrintOperation.h | /*
NSPrintOperation.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSGeometry.h>
#import <Foundation/NSRange.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSMutableData, NSGraphicsContext, NSPDFPanel, NSPrintPanel, NSPrintInfo, NSView, NSWindow;
/* Values for -setPageOrder:/-pageOrder.
*/
typedef NS_ENUM(NSInteger, NSPrintingPageOrder) {
NSDescendingPageOrder = -1,
NSSpecialPageOrder = 0, // Tells spooler to not rearrange
NSAscendingPageOrder = 1,
NSUnknownPageOrder = 2 // No page order written out
};
typedef NS_ENUM(NSInteger, NSPrintRenderingQuality) {
/* Render at the best quality you can regardless of how slow that may be
*/
NSPrintRenderingQualityBest,
/* Sacrifice the least possible amount of rendering quality for speed to maintain a responsive user interface.
Note: Only do this after establishing that best quality rendering does indeed make the user interface unresponsive.
*/
NSPrintRenderingQualityResponsive
} API_AVAILABLE(macos(10.7));
/* An exception that may be thrown by the factory methods described below.
*/
APPKIT_EXTERN NSExceptionName NSPrintOperationExistsException;
NS_SWIFT_UI_ACTOR
@interface NSPrintOperation : NSObject {
}
/* Factory methods that create a new NSPrintOperation for printing, copying to Portable Document Format, or copying to Encapsulated PostScript. The passed-in NSPrintInfo is copied, and the copy is retained by the new NSPrintOperation. (So, no need to copy the NSPrintInfo you pass to these.) You can get the copy with -printInfo.
*/
+ (NSPrintOperation *)printOperationWithView:(NSView *)view printInfo:(NSPrintInfo *)printInfo;
+ (NSPrintOperation *)PDFOperationWithView:(NSView *)view insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo *)printInfo;
+ (NSPrintOperation *)PDFOperationWithView:(NSView *)view insideRect:(NSRect)rect toPath:(NSString *)path printInfo:(NSPrintInfo *)printInfo;
+ (NSPrintOperation *)EPSOperationWithView:(NSView *)view insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo *)printInfo;
+ (NSPrintOperation *)EPSOperationWithView:(NSView *)view insideRect:(NSRect)rect toPath:(NSString *)path printInfo:(NSPrintInfo *)printInfo;
/* Slight conveniences, for use when the application's global NSPrintInfo is appropriate. Each of these methods invokes [NSPrintInfo sharedPrintInfo] and then invokes the like-named method listed above.
*/
+ (NSPrintOperation *)printOperationWithView:(NSView *)view;
+ (NSPrintOperation *)PDFOperationWithView:(NSView *)view insideRect:(NSRect)rect toData:(NSMutableData *)data;
+ (NSPrintOperation *)EPSOperationWithView:(NSView *)view insideRect:(NSRect)rect toData:(nullable NSMutableData *)data;
/* The current print operation for this thread. If this is nil, there is no current operation for the current thread.
*/
@property (class, nullable, strong) NSPrintOperation *currentOperation;
/* Return YES if the operation for copying to PDF or EPS, NO if it's for printing.
*/
@property (getter=isCopyingOperation, readonly) BOOL copyingOperation;
/* If the print sheet is unresponsive or sluggish due to the time is takes you to fully render a page, you can check this method in drawRect and other printing methods such as beginDocument and knowsPageRage: to determine if the print operation prefers speed over fidelity. Please see the comments for NSPrintRenderingQuality. Most applications render each page fast enough and do not need to call this method.
*/
@property (readonly) NSPrintRenderingQuality preferredRenderingQuality API_AVAILABLE(macos(10.7));
/* The title of the print job. If a job title is set it overrides anything that might be gotten by sending the printed view an [NSView(NSPrinting) printJobTitle] message.
*/
@property (nullable, copy) NSString *jobTitle API_AVAILABLE(macos(10.5));
/* Whether the print and progress panels are shown during the operation.
*/
@property BOOL showsPrintPanel;
@property BOOL showsProgressPanel;
/* The print panel to be presented by the operation when it is run, if showsProgressPanel is YES and isCopyingOperation is NO. -printPanel will create a new NSPrintPanel if one hasn't been set yet.
*/
@property (strong) NSPrintPanel *printPanel;
/* The panel to be presented by the operation when it is run, if [[self printInfo] jobDisposition] is NSPrintSaveJob and [[[self printInfo] dictionary] objectForKey:NSPrintJobSavingURL] is nil. -PDFPanel will create a new NSPDFPanel if one hasn't been set yet. NSPrintOperation will throw an exception if panel.options contains NSPDFPanelRequestsParentDirectory when it attempts to display the panel.
*/
@property (strong) NSPDFPanel *PDFPanel API_AVAILABLE(macos(10.9));
/* Whether the print operation should spawn a separate thread in which to run itself.
*/
@property BOOL canSpawnSeparateThread;
/* The page order that will be used to generate the pages in this job. This is the physical page order of the pages. It depends on the stacking order of the printer, the capability of the app to reverse page order, etc.
*/
@property NSPrintingPageOrder pageOrder;
/* Do the print operation, with panels that are document-modal to a specific window. When the operation has been completed, 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)printOperationDidRun:(NSPrintOperation *)printOperation success:(BOOL)success contextInfo:(void *)contextInfo;
This can only be invoked once. Create a new NSPrintOperation instance for each operation. When this method completes, the object is removed from being the current operation if it is the current operation.
*/
- (void)runOperationModalForWindow:(NSWindow *)docWindow delegate:(nullable id)delegate didRunSelector:(nullable SEL)didRunSelector contextInfo:(nullable void *)contextInfo;
/* Do the print operation, with application-modal panels. Return YES if the operation completed successfully, NO if there was an error or the user cancelled the operation. This can only be invoked once. Create a new NSPrintOperation instance for each operation. When this method completes, the object is removed from being the current operation if it is the current operation.
*/
- (BOOL)runOperation;
/* The view being printed.
*/
@property (nullable, readonly, strong) NSView *view;
/* The print info of the operation. -printInfo always returns a copy of the NSPrintInfo passed into the factory method used to create the print operation, unless -setPrintInfo: has been invoked, in which case it returns the exact same object passed into -setPrintInfo:. So, the factory methods listed above copy the passed-in NSPrintInfo, but -setPrintInfo: doesn't.
*/
@property (copy) NSPrintInfo *printInfo;
/* The context for the output of this operation.
*/
@property (nullable, readonly, strong) NSGraphicsContext *context;
/* The first through last one-based page numbers of the operation as it's being previewed or printed. The first page number might not be 1, and the page count might be NSIntegerMax to indicate that the number of pages is not known, depending on what the printed view returned when sent an [NSView(NSPrinting) knowsPageRange:] message.
*/
@property (readonly) NSRange pageRange API_AVAILABLE(macos(10.5));
/* The current one-based page number of the operation as it's being previewed or printed.
*/
@property (readonly) NSInteger currentPage;
/* Methods that are invoked by the print operation itself as it proceeds. You should not invoke them.
*/
- (nullable NSGraphicsContext *)createContext;
- (void)destroyContext;
- (BOOL)deliverResult;
- (void)cleanUpOperation;
@end
@interface NSPrintOperation(NSDeprecated)
- (void)setAccessoryView:(nullable NSView *)view API_DEPRECATED("Use -[NSPrintPanel addAccessoryController:] and -[NSPrintPanel removeAccessoryController:] instead", macos(10.0,10.5));
- (nullable NSView *)accessoryView API_DEPRECATED("Use -[NSPrintPanel accessoryControllers] instead", macos(10.0,10.5));
- (void)setJobStyleHint:(nullable NSString *)hint API_DEPRECATED("", macos(10.2,10.5));
- (nullable NSString *)jobStyleHint API_DEPRECATED("", macos(10.2,10.5));
- (void)setShowPanels:(BOOL)flag API_DEPRECATED("Use -setShowsPrintPanel: and -setShowsProgressPanel: instead", macos(10.0,10.4));
- (BOOL)showPanels API_DEPRECATED("Use -showsPrintPanel and -showsProgressPanel instead", macos(10.0,10.4));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSColorPicker.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSSplitView.h | /*
NSSplitView.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSView.h>
#import <AppKit/NSLayoutConstraint.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
typedef NSString * NSSplitViewAutosaveName NS_SWIFT_BRIDGED_TYPEDEF;
@class NSNotification;
@protocol NSSplitViewDelegate;
typedef NS_ENUM(NSInteger, NSSplitViewDividerStyle) {
NSSplitViewDividerStyleThick = 1,
NSSplitViewDividerStyleThin = 2,
NSSplitViewDividerStylePaneSplitter API_AVAILABLE(macos(10.6)) = 3,
} API_AVAILABLE(macos(10.5));
@interface NSSplitView : NSView
/* Set or get whether the long axes of a split view's dividers are oriented up-and-down (YES) or left-and-right (NO).
*/
@property (getter=isVertical) BOOL vertical;
/* What kind of divider to use. NSSplitViewThickDividerStyle is the default.
*/
@property NSSplitViewDividerStyle dividerStyle API_AVAILABLE(macos(10.5));
/* The name to use when autosaving the positions of dividers, and whether or not subviews are collapsed, to preferences. If this value is nil or the string is empty no autosaving is done.
*/
@property (nullable, copy) NSSplitViewAutosaveName autosaveName API_AVAILABLE(macos(10.5));
/* Set or get the delegate of the split view. The delegate will be sent NSSplitViewDelegate messages to which it responds.
For apps linked against 10.12, this property has zeroing weak memory semantics. When linked against an older SDK, or with objects that do not support zeroing weak references this falls back to having `assign` semantics.
*/
@property (nullable, weak) id<NSSplitViewDelegate> delegate;
/* Draw the divider between two of the split view's subviews. The rectangle describes the entire divider rectangle in the receiver's coordinates. You can override this method to change the appearance of dividers.
*/
- (void)drawDividerInRect:(NSRect)rect;
/* Return the color of the dividers that the split view is drawing between subviews. The default implementation of this method returns [NSColor clearColor] for the thick divider style. It will also return [NSColor clearColor] for the thin divider style when the split view is in a textured window. All other thin dividers are drawn with a color that looks good between two white panes. You can override this method to change the color of dividers.
*/
@property (readonly, copy) NSColor *dividerColor API_AVAILABLE(macos(10.5));
/* Return the thickness of the dividers that the split view is drawing between subviews. The default implementation returns a value that depends on the divider style. You can override this method to change the size of dividers.
*/
@property (readonly) CGFloat dividerThickness;
/* Set the frames of the split view's subviews so that they, plus the dividers, fill the split view. The default implementation of this method resizes all of the subviews proportionally so that the ratio of heights (in the horizontal split view case) or widths (in the vertical split view case) doesn't change, even though the absolute sizes of the subviews do change. This message should be sent to split views from which subviews have been added or removed, to reestablish the consistency of subview placement.
*/
- (void)adjustSubviews;
/* Return YES if the subview is in the collapsed state, NO otherwise.
*/
- (BOOL)isSubviewCollapsed:(NSView *)subview;
/* Divider indices are zero-based, with the topmost (in horizontal split views) or leftmost (vertical) divider having an index of 0.
*/
/* Get the minimum or maximum possible position of a divider. The position is "possible" in that it is dictated by the bounds of this view and the current position of other dividers. ("Allowable" positions are those that result from letting the delegate apply constraints to the possible positions.) You can invoke these methods to determine the range of values that can be usefully passed to -setPosition:ofDividerAtIndex:. You can also invoke them from delegate methods like -splitView:constrainSplitPosition:ofSubviewAt: to implement relatively complex behaviors that depend on the current state of the split view. The results of invoking these methods when -adjustSubviews has not been invoked recently enough for the subview frames to be valid are undefined.
*/
- (CGFloat)minPossiblePositionOfDividerAtIndex:(NSInteger)dividerIndex API_AVAILABLE(macos(10.5));
- (CGFloat)maxPossiblePositionOfDividerAtIndex:(NSInteger)dividerIndex API_AVAILABLE(macos(10.5));
/* Set the position of a divider. The default implementation of this method behaves as if the user were attempting to drag the divider to the proposed position, so the constraints imposed by the delegate are applied and one of the views adjacent to the divider may be collapsed. This method is not invoked by NSSplitView itself, so there's probably not much point in overriding it.
*/
- (void)setPosition:(CGFloat)position ofDividerAtIndex:(NSInteger)dividerIndex API_AVAILABLE(macos(10.5));
/* Sets the priority under which split view subviews hold their widths (for a vertical split view) or height (for a horizontal split view). The view with the lowest priority will be the first to take on additional width if the split view grows or shrinks. The default is NSLayoutPriorityDefaultLow.
There is no reason to use the default, but you should use priorities less than NSLayoutPriorityDragThatCannotResizeWindow (490)
*/
#if !TARGET_OS_IPHONE
- (NSLayoutPriority)holdingPriorityForSubviewAtIndex:(NSInteger)subviewIndex API_AVAILABLE(macos(10.8));
- (void)setHoldingPriority:(NSLayoutPriority)priority forSubviewAtIndex:(NSInteger)subviewIndex API_AVAILABLE(macos(10.8));
#endif
@end
@interface NSSplitView (NSSplitViewArrangedSubviews)
/*!
* Whether or not all subviews will be added as arranged views. When NO, a subview must be explicitly added as an arrangedSubview if the view should be arranged as a split pane. When YES, \c -arrangedSubviews always be identical to \c -subviews. Defaults to YES.
* Setting this from YES to NO will leave all existing subviews as \c -arrangedSubviews. Setting this from NO to YES will cause \c -arrangedSubviews to become the value of \c -subviews.
*/
@property BOOL arrangesAllSubviews API_AVAILABLE(macos(10.11));
/*!
* The list of views that are arranged as split panes in the receiver.
* They are a subset of \c -subviews, with potential difference in ordering. If \c -arrangesAllSubviews is YES, then \c -arrangedSubviews is identical to \c -subviews.
*/
@property (readonly, copy) NSArray<__kindof NSView *> *arrangedSubviews API_AVAILABLE(macos(10.11));
/*!
* Adds a view as arranged split pane. If the view is not a subview of the receiver, it will be added as one.
*/
- (void)addArrangedSubview:(NSView *)view API_AVAILABLE(macos(10.11));
/*!
* Adds a view as an arranged split pane list at the specific index.
* If the view is already an arranged split view, it will move the view the specified index (but not move the subview index).
* If the view is not a subview of the receiver, it will be added as one (not necessarily at the same index).
*/
- (void)insertArrangedSubview:(NSView *)view atIndex:(NSInteger)index API_AVAILABLE(macos(10.11));
/*!
* Removes a view as arranged split pane. If \c -arrangesAllSubviews is set to NO, this does not remove the view as a subview.
* Removing the view as a subview (either by -[view removeFromSuperview] or setting the receiver's subviews) will automatically remove it as an arranged subview.
*/
- (void)removeArrangedSubview:(NSView *)view API_AVAILABLE(macos(10.11));
@end
@protocol NSSplitViewDelegate <NSObject>
@optional
/* Divider indices are zero-based, with the topmost (in horizontal split views) or leftmost (vertical) divider having an index of 0.
*/
/* Return YES if a subview can be collapsed, NO otherwise. If a split view has no delegate, or if its delegate does not respond to this message, none of the split view's subviews can be collapsed. If a split view has a delegate, and the delegate responds to this message, it will be sent at least twice when the user clicks or double-clicks on one of the split view's dividers, once per subview on either side of the divider, and may be resent as the user continues to drag the divider. If a subview is collapsible, the current implementation of NSSplitView will collapse it when the user has dragged the divider more than halfway between the position that would make the subview its minimum size and the position that would make it zero size. The subview will become uncollapsed if the user drags the divider back past that point. The comments for -splitView:constrainMinCoordinate:ofSubviewAt: and -splitView:constrainMaxCoordinate:ofSubviewAt: describe how subviews' minimum sizes are determined. Collapsed subviews are hidden but retained by the split view. Collapsing of a subview will not change its bounds, but may set its frame to zero pixels high (in horizontal split views) or zero pixels wide (vertical).
*/
- (BOOL)splitView:(NSSplitView *)splitView canCollapseSubview:(NSView *)subview;
/* Return YES if the subview should be collapsed because the user has double-clicked on an adjacent divider. If a split view has a delegate, and the delegate responds to this message, it will be sent once for the subview before a divider when the user double-clicks on that divider, and again for the subview after the divider, but only if the delegate returned YES when sent -splitView:canCollapseSubview: for the subview in question. When the delegate indicates that both subviews should be collapsed NSSplitView's behavior is undefined.
*/
- (BOOL)splitView:(NSSplitView *)splitView shouldCollapseSubview:(NSView *)subview forDoubleClickOnDividerAtIndex:(NSInteger)dividerIndex API_DEPRECATED("NSSplitView no longer supports collapsing sections via double-click. This delegate method is never called.", macos(10.5, 10.15));
/* Given a proposed minimum allowable position for one of the dividers of a split view, return the minimum allowable position for the divider. If a split view has no delegate, or if its delegate does not respond to this message, the split view behaves as if it has a delegate that responds to this message by merely returning the proposed minimum. If a split view has a delegate, and the delegate responds to this message, it will be sent at least once when the user begins dragging one of the split view's dividers, and may be resent as the user continues to drag the divider.
Delegates that respond to this message and return a number larger than the proposed minimum position effectively declare a minimum size for the subview above or to the left of the divider in question, the minimum size being the difference between the proposed and returned minimum positions. This minimum size is only effective for the divider-dragging operation during which the -splitView:constrainMinCoordinate:ofSubviewAt: message is sent. NSSplitView's behavior is undefined when a delegate responds to this message by returning a number smaller than the proposed minimum.
*/
- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex;
/* Given a proposed maximum allowable position for one of the dividers of a split view, return the maximum allowable position for the divider. If a split view has no delegate, or if its delegate does not respond to this message, the split view behaves as if it has a delegate that responds to this message by merely returning the proposed maximum. If a split view has a delegate, and the delegate responds to this message, it will be sent at least once when the user begins dragging one of the split view's dividers, and may be resent as the user continues to drag the divider.
Delegates that respond to this message and return a number smaller than the proposed maximum position effectively declare a minimum size for the subview below or to the right of the divider in question, the minimum size being the difference between the proposed and returned maximum positions. This minimum size is only effective for the divider-dragging operation during which the -splitView:constrainMaxCoordinate:ofSubviewAt: message is sent. NSSplitView's behavior is undefined when a delegate responds to this message by returning a number larger than the proposed maximum.
*/
- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMaximumPosition ofSubviewAt:(NSInteger)dividerIndex;
/* Given a proposed position for one of the dividers of a split view, return a position at which the divider should be placed as the user drags it. If a split view has no delegate, or if its delegate does not respond to this message, the split view behaves as if it has a delegate that responds to this message by merely returning the proposed position. If a split view has a delegate, and the delegate responds to this message, it will be sent repeatedly as the user drags one of the split view's dividers.
*/
- (CGFloat)splitView:(NSSplitView *)splitView constrainSplitPosition:(CGFloat)proposedPosition ofSubviewAt:(NSInteger)dividerIndex;
/* Given that a split view has been resized but has not yet adjusted its subviews to accomodate the new size, and given the former size of the split view, adjust the subviews to accomodate the new size of the split view. If a split view has no delegate, or if its delegate does not respond to this message, the split view behaves as if it has a delegate that responds to this message by merely sending the split view an -adjustSubviews message.
Delegates that respond to this message should adjust the frames of the uncollapsed subviews so that they exactly fill the split view with room for dividers in between, taking its new size into consideration. The thickness of dividers can be determined by sending the split view a -dividerThickness message.
*/
- (void)splitView:(NSSplitView *)splitView resizeSubviewsWithOldSize:(NSSize)oldSize;
/* Given that a split view has been resized and is adjusting its subviews to accomodate the new size, return YES if -adjustSubviews can change the size of the indexed subview, NO otherwise. -adjustSubviews may change the origin of the indexed subview regardless of what this method returns. -adjustSubviews may also resize otherwise nonresizable subviews to prevent an invalid subview layout. If a split view has no delegate, or if its delegate does not respond to this message, the split view behaves as if it has a delegate that returns YES when sent this message.
*/
- (BOOL)splitView:(NSSplitView *)splitView shouldAdjustSizeOfSubview:(NSView *)view API_AVAILABLE(macos(10.6));
/* Given that a split view has been resized and is adjusting its subviews to accomodate the new size, or that the user is dragging a divider, return YES to allow the divider to be dragged or adjusted off the edge of the split view where it will not be visible. If a split view has no delegate, or if its delegate does not respond to this message, the split view behaves as if it has a delegate that returns NO when sent this message.
*/
- (BOOL)splitView:(NSSplitView *)splitView shouldHideDividerAtIndex:(NSInteger)dividerIndex API_AVAILABLE(macos(10.5));
/* Given the drawn frame of a divider (in the coordinate system established by the split view's bounds), return the frame in which mouse clicks should initiate divider dragging. If a split view has no delegate, or if its delegate does not respond to this message, the split view behaves as if it has a delegate that returns proposedEffectiveRect when sent this message. A split view with thick dividers proposes the drawn frame as the effective frame. A split view with thin dividers proposes an effective frame that's a litte larger than the drawn frame, to make it easier for the user to actually grab the divider.
*/
- (NSRect)splitView:(NSSplitView *)splitView effectiveRect:(NSRect)proposedEffectiveRect forDrawnRect:(NSRect)drawnRect ofDividerAtIndex:(NSInteger)dividerIndex API_AVAILABLE(macos(10.5));
/* Given a divider index, return an additional rectangular area (in the coordinate system established by the split view's bounds) in which mouse clicks should also initiate divider dragging, or NSZeroRect to not add one. If a split view has no delegate, or if its delegate does not respond to this message, only mouse clicks within the effective frame of a divider initiate divider dragging.
*/
- (NSRect)splitView:(NSSplitView *)splitView additionalEffectiveRectOfDividerAtIndex:(NSInteger)dividerIndex API_AVAILABLE(macos(10.5));
/* Respond as if the delegate had registered for the NSSplitViewDidResizeSubviewsNotification or NSSplitViewWillResizeSubviewsNotification notification, described below. A split view's behavior is not explicitly affected by a delegate's ability or inability to respond to these messages, though the delegate may send messages to the split view in response to these messages.
*/
- (void)splitViewWillResizeSubviews:(NSNotification *)notification;
- (void)splitViewDidResizeSubviews:(NSNotification *)notification;
@end
/* A notification that is posted to the default notification center by NSSplitView when a split view is about to resize its subviews either as a result of its own resizing or during the dragging of one of its dividers by the user. Starting in Mac OS 10.5, if the notification is being sent because the user is dragging a divider, the notification's user info dictionary contains an entry whose key is @"NSSplitViewDividerIndex" and whose value is an NSInteger-wrapping NSNumber that is the index of the divider being dragged. Starting in Mac OS 12.0, the notification will contain the user info dictionary during resize and layout events as well.
*/
APPKIT_EXTERN NSNotificationName NSSplitViewWillResizeSubviewsNotification;
/* A notification that is posted to the default notification center by NSSplitView when a split view has just resized its subviews either as a result of its own resizing or during the dragging of one of its dividers by the user. Starting in Mac OS 10.5, if the notification is being sent because the user is dragging a divider, the notification's user info dictionary contains an entry whose key is @"NSSplitViewDividerIndex" and whose value is an NSInteger-wrapping NSNumber that is the index of the divider being dragged. Starting in Mac OS 12.0, the notification will contain the user info dictionary during resize and layout events as well.
*/
APPKIT_EXTERN NSNotificationName NSSplitViewDidResizeSubviewsNotification;
@interface NSSplitView (NSDeprecated)
/* Set or get whether the split view is a "pane splitter" (YES) or "grabber" (NO) split view. In Mac OS 10.5 the value of this property has no effect. These methods are deprecated in Mac OS 10.6.
*/
- (void)setIsPaneSplitter:(BOOL)flag API_DEPRECATED("", macos(10.0,10.6));
- (BOOL)isPaneSplitter API_DEPRECATED("", macos(10.0,10.6));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSStatusBar.h | /*
NSStatusBar.h
Application Kit
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSColor;
@class NSFont;
@class NSStatusItem;
@class NSMutableArray;
static const CGFloat NSVariableStatusItemLength = -1.0;
static const CGFloat NSSquareStatusItemLength = -2.0;
@interface NSStatusBar : NSObject
@property (class, readonly, strong) NSStatusBar *systemStatusBar;
- (NSStatusItem*)statusItemWithLength:(CGFloat)length;
- (void)removeStatusItem:(NSStatusItem*)item;
@property (getter=isVertical, readonly) BOOL vertical;
@property (readonly) CGFloat thickness;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSCollectionViewCompositionalLayout.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSDictionaryController.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSImageRep.h | /*
NSImageRep.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/NSNotification.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSGraphics.h>
#import <AppKit/NSColorSpace.h>
#import <AppKit/NSPasteboard.h>
#import <AppKit/NSUserInterfaceLayout.h>
#import <ApplicationServices/ApplicationServices.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSPasteboard, NSGraphicsContext, NSURL;
typedef NSString * NSImageHintKey NS_TYPED_ENUM;
/* NSImageRepMatchesDevice indicates the value is variable, depending on the output device. It can be passed in (or received back) as the value of bitsPerSample, pixelsWide, and pixelsHigh.
*/
enum {
NSImageRepMatchesDevice = 0
};
typedef NS_ENUM(NSInteger, NSImageLayoutDirection) {
NSImageLayoutDirectionUnspecified = -1,
NSImageLayoutDirectionLeftToRight = 2,
NSImageLayoutDirectionRightToLeft = 3,
} API_AVAILABLE(macos(10.12));
@interface NSImageRep : NSObject <NSCopying, NSCoding>
- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
/* Drawing methods. draw is the only primitive.
*/
- (BOOL)draw;
- (BOOL)drawAtPoint:(NSPoint)point;
- (BOOL)drawInRect:(NSRect)rect;
- (BOOL)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));
/* Methods to return info about the image. NSImageRep provides storage for all of these; however, it's illegal to set them in some subclasses.
*/
@property NSSize size;
@property (getter=hasAlpha) BOOL alpha;
@property (getter=isOpaque) BOOL opaque;
@property (copy) NSColorSpaceName colorSpaceName;
@property NSInteger bitsPerSample;
@property NSInteger pixelsWide;
@property NSInteger pixelsHigh;
@property NSImageLayoutDirection layoutDirection API_AVAILABLE(macos(10.12)); // Default: NSImageLayoutDirectionUnspecified
/* The rest of the methods all deal with subclassers which can read/write data in files or pasteboards.
*/
/* Registry management: Subclasses which deal with file & pasteboard types should register themselves. These classes should also implement imageUnfilteredFileTypes, imageUnfilteredPasteboardTypes, initWithData:, canInitWithData:, imageRepWithData:, and, if they have the ability to read multiple images from a file, imageRepsWithData:. These last three should not do any filtering; all filtering is automatic.
*/
+ (void)registerImageRepClass:(Class)imageRepClass;
+ (void)unregisterImageRepClass:(Class)imageRepClass;
@property (class, readonly, copy) NSArray<Class> *registeredImageRepClasses;
+ (nullable Class)imageRepClassForFileType:(NSString *)type API_DEPRECATED("Use +imageRepClassForType: instead", macos(10.0,10.10));
+ (nullable Class)imageRepClassForPasteboardType:(NSPasteboardType)type API_DEPRECATED("Use +imageRepClassForType: instead", macos(10.0,10.10));
+ (nullable Class)imageRepClassForType:(NSString *)type API_AVAILABLE(macos(10.5));
+ (nullable Class)imageRepClassForData:(NSData *)data;
/* Should be overridden by subclassers to load an unfiltered image.
*/
+ (BOOL)canInitWithData:(NSData *)data;
/* Implemented by subclassers to indicate what data types they can deal with.
*/
+ (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));
/* These expand the unfiltered lists returned by imageUnfilteredFileTypes and imageUnfilteredPasteboardTypes.
*/
+ (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));
/* Implemented by subclassers to indicate what UTI-identified data types they can deal with.
*/
@property (class, readonly, copy) NSArray<NSString *> *imageUnfilteredTypes API_AVAILABLE(macos(10.5));
/* This expands the unfiltered list returned by imageUnfilteredTypes.
*/
@property (class, readonly, copy) NSArray<NSString *> *imageTypes API_AVAILABLE(macos(10.5));
/* Convenience method: Checks to see if any of the types on the pasteboard can be understood by a registered imagerep class after filtering or if the pasteboard contains a filename that can be understood by a registered imagerep class after filtering. If sent to a subclass, does this for just the types understood by the subclass.
*/
+ (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard;
/* Convenience methods: Checks to see if the provided file or pasteboard types can be understood by a registered imagerep class after filtering; if so, calls imageRepsWithData: or imageRepWithData:. If sent to a subclass, does this just for the types understood by that subclass.
*/
+ (nullable NSArray<NSImageRep *> *)imageRepsWithContentsOfFile:(NSString *)filename;
+ (nullable NSImageRep *)imageRepWithContentsOfFile:(NSString *)filename;
+ (nullable NSArray<NSImageRep *> *)imageRepsWithContentsOfURL:(NSURL *)url;
+ (nullable NSImageRep *)imageRepWithContentsOfURL:(NSURL *)url;
+ (nullable NSArray<NSImageRep *> *)imageRepsWithPasteboard:(NSPasteboard *)pasteboard;
+ (nullable NSImageRep *)imageRepWithPasteboard:(NSPasteboard *)pasteboard;
/* The parameters have the same meaning and behavior as in -[NSImage CGImageForProposedRect:context:hints:].
This method is intended to be overridden or called, though the primary caller is NSImage. At the NSImageRep level, it creates a CGImage by drawing the receiver into a new context. The passed context and hints are used as a model for the new context. If [self draw] returns NO, this method returns NULL.
If your image rep subclass naturally uses a CGImage that it can return, override this method and return it.
You should not need to take care to cache within an implementation of this method. This main caller of this method is typically NSImage, and NSImage will hold onto the resulting CGImage if appropriate.
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 *)context hints:(nullable NSDictionary<NSImageHintKey, id> *)hints API_AVAILABLE(macos(10.6)) CF_RETURNS_NOT_RETAINED;
@end
/* Notifications */
#define NSImageRepRegistryChangedNotification NSImageRepRegistryDidChangeNotification /* obsolete name */
APPKIT_EXTERN NSNotificationName NSImageRepRegistryDidChangeNotification;
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSToolbarItem.h | /*
NSToolbarItem.h
Application Kit
Copyright (c) 2000-2021, Apple Inc.
All rights reserved.
*/
#import <TargetConditionals.h>
#if !TARGET_OS_IPHONE
#import <AppKit/NSText.h>
#import <AppKit/NSMenu.h>
#import <AppKit/NSUserInterfaceValidation.h>
#endif
#import <AppKit/NSToolbar.h>
#import <Foundation/Foundation.h>
#import <Foundation/NSGeometry.h>
#if TARGET_OS_IPHONE
@class UIImage;
#endif
NS_ASSUME_NONNULL_BEGIN
@class NSMenuItem, NSView, NSImage, CKShare;
typedef NSInteger NSToolbarItemVisibilityPriority NS_TYPED_EXTENSIBLE_ENUM API_AVAILABLE(ios(13.0));
static const NSToolbarItemVisibilityPriority NSToolbarItemVisibilityPriorityStandard API_AVAILABLE(ios(13.0)) = 0;
static const NSToolbarItemVisibilityPriority NSToolbarItemVisibilityPriorityLow API_AVAILABLE(ios(13.0)) = -1000;
static const NSToolbarItemVisibilityPriority NSToolbarItemVisibilityPriorityHigh API_AVAILABLE(ios(13.0)) = 1000;
static const NSToolbarItemVisibilityPriority NSToolbarItemVisibilityPriorityUser API_AVAILABLE(ios(13.0)) = 2000;
API_AVAILABLE(ios(13.0)) NS_SWIFT_UI_ACTOR
@interface NSToolbarItem : NSObject <NSCopying>
/* Initialize the toolbar item with an identifier which is a development language string used by the toolbar and its delegate for identification purposes. */
- (instancetype)initWithItemIdentifier:(NSToolbarItemIdentifier)itemIdentifier NS_DESIGNATED_INITIALIZER;
@property (readonly, copy) NSToolbarItemIdentifier itemIdentifier;
/* Use this to determine the toolbar in which an item is currently displayed. */
@property (readonly, nullable, weak) NSToolbar *toolbar;
// ----- Setters and Getters -----
/* Use this to set the item's label that appears in the toolbar. The implication here is that the toolbar will draw the label for the item, and a redraw is triggered by this method. The toolbar is in charge of the label area. It is fine for an item to have no toolbar label. Also, developers should make sure the length of the label is appropriate and not too long. */
@property (copy) NSString *label;
/* Use this to set the item's label that appears when the item is in the customization palette. All Items must have a palette label, and for most things it is reasonable to set them to the same string as the label used in the toolbar. */
@property (copy) NSString *paletteLabel;
/* Use this to set a tooltip to be used when the item is displayed in the toolbar. (forwards to -view if it responds) */
@property (nullable, copy) NSString *toolTip;
/* The menu form of a toolbar item's purpose is twofold. First, when the window is too small to display an item, it will be clipped but remain accessible from a "clipped items" menu containing the menu item returned here. Second, in text only mode, the menu returned will be used to create the displayed items. Singleton menu items will be clickable, while submenu items will be represented as a pull down. For instance, say you want a button that allows you to switch between modes A, B, and C. You could represent this as a menu by : a menu item "mode" with three submenu items "A", "B", and "C". By default, this method returns a singleton menu item with item label as the title. For standard items, the target, action is set. */
@property (nullable, strong) NSMenuItem *menuFormRepresentation API_UNAVAILABLE(ios);
/* Tag for your own custom purpose. (forwards to -view if it responds) */
@property NSInteger tag;
/* Set and get the action of an item. (forwards to -view if it responds) */
@property (nullable, weak) id target;
/* Set and get the action of an item. For custom views, this method will call setAction:/action on the view if it responds. (forwards to -view if it responds) */
@property (nullable) SEL action;
/* Set and get the enabled flag of an item. For custom views, this method will call setEnabled:/isEnabled on the view if it responds. (forwards to -view if it responds) */
@property (getter=isEnabled) BOOL enabled;
/* Set and get the image of an item. For custom views, this method will call setImage:/image on the view if it responds. (forwards to -view if it responds) */
#if !TARGET_OS_IPHONE
@property (nullable, strong) NSImage *image;
#else
@property (nullable, strong) UIImage *image API_AVAILABLE(ios(13.0));
#endif
/* Set and get the title of an item. For custom views, this method will call setTitle:/title on the view if it responds. (forwards to -view if it responds) */
@property (copy) NSString *title API_AVAILABLE(macos(10.15), ios(13.0));
/*
When set on an item without a custom view, the button produced will have a bordered style.
Defaults to NO.
*/
@property (getter=isBordered) BOOL bordered API_AVAILABLE(macos(10.15), ios(13.0));
/*
Whether or not the item behaves as a navigation item (i.e. back/forward) in the toolbar. Navigation items may be specially positioned by the system outside the normal list of items of the toolbar in the order specified by -toolbarDefaultItemIdentifiers:.
*/
@property (getter=isNavigational) BOOL navigational API_AVAILABLE(macos(11.0), ios(14.0));
/* Use setView: if you want your toolbar item to use something other than the standard. Note that, by default, many of the set/get methods will be implemented by calls forwarded to the view you set, if it responds to it. */
@property (nullable, strong) NSView *view API_UNAVAILABLE(ios);
/*
Unless you have already set your own custom view, you should not call these methods.
The min size should be small enough to look nice in all display modes.
If you do not set a min/max size, the view's size properties will be calculated using constraints. Apps linked before 10.14 will use the view's current size.
In general, apps should rely on the automatic measurements and constraints to define min/max sizes rather than setting these properties since this will account for localizations.
*/
@property NSSize minSize API_DEPRECATED("This property is no longer recommended. Instead, let the system automatically measure the size of the view using constraints.", macos(10.0, 12.0)) API_UNAVAILABLE(ios);
@property NSSize maxSize API_DEPRECATED("This property is no longer recommended. Instead, let the system automatically measure the size of the view using constraints.", macos(10.0, 12.0)) API_UNAVAILABLE(ios);
/* When a toolbar does not have enough space to fit all its items, it must push some into the overflow menu. Items with the highest visibility priority level are choosen last for the overflow menu. The default visibilityPriority value is NSToolbarItemVisibilityPriorityStandard. To suggest that an item always remain visible, give it a value greater than NSToolbarItemVisibilityPriorityStandard, but less than NSToolbarItemVisibilityPriorityUser. In 10.7, users can no longer modify the toolbar item visibility priority. */
@property NSToolbarItemVisibilityPriority visibilityPriority;
// ----- Validation of the items -----
/* Typically you should not invoke this method. This method is called by its toolbar during validation. Standard items validate themselves by sending the validateToolbarItem: validate message to the current validator. Since items with custom views don't always have meaningful target/actions, they do nothing. So for your custom items it may be useful to override this method and invent your own validation. */
- (void)validate API_AVAILABLE(ios(13.0));
/* By default NSToolbar automatically invokes its items validate method on a regular basis. To be in complete control of when the -validate method is invoked, you can disable automatic validation on a per-item basis. In particular, if your validation code is slow, you may want to do this for performance reasons. */
@property BOOL autovalidates API_AVAILABLE(ios(13.0));
// ----- Controlling Duplicates In The Toolbar -----
/* Return YES to allow dragging duplicate items into the toolbar. By default, if an item with the same identifier is already in the toolbar, dragging in will act as a move of this item. However, for instance, the separator item drags in as a duplicate always. */
@property (readonly) BOOL allowsDuplicatesInToolbar API_UNAVAILABLE(ios);
@end
#if !TARGET_OS_IPHONE
@interface NSToolbarItem () <NSMenuItemValidation, NSValidatedUserInterfaceItem>
@end
#endif
#if !TARGET_OS_IPHONE
@protocol NSToolbarItemValidation <NSObject>
/* NSToolbarItemValidation extends the standard validation idea by introducing this new method which is sent to validators for each visible standard NSToolbarItem with a valid target/action pair. Note: This message is sent from NSToolbarItem's validate method, however validate will not send this message for items that have custom views. */
- (BOOL)validateToolbarItem:(NSToolbarItem *)item;
@end
#if __swift__ < 40200
@interface NSObject (NSToolbarItemValidation)
- (BOOL)validateToolbarItem:(NSToolbarItem *)item API_DEPRECATED("This is now a method of the NSToolbarItemValidation protocol.", macos(10.0, 11.0));
@end
#endif
@protocol NSCloudSharingValidation <NSObject>
/* NSToolbarItems created with NSToolbarCloudSharingItemIdentifier use this method for further validation after sending `-validateToolbarItem:` or `-validateUserInterfaceItem:`. The validator for the item's action should return the current CKShare corresponding to the selected item, if any. The state of the item will be changed reflect the state of the CKShare. */
- (nullable CKShare *)cloudShareForUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item;
@end
#endif
/* standard toolbar item identifiers */
APPKIT_EXTERN NSToolbarItemIdentifier NSToolbarSeparatorItemIdentifier API_DEPRECATED("This item is no longer recommended and will be ignored on 10.7 and later.", macos(10.0, 11.0)) API_UNAVAILABLE(ios);
APPKIT_EXTERN NSToolbarItemIdentifier NSToolbarSpaceItemIdentifier API_AVAILABLE(ios(13.0));
APPKIT_EXTERN NSToolbarItemIdentifier NSToolbarFlexibleSpaceItemIdentifier API_AVAILABLE(ios(13.0));
APPKIT_EXTERN NSToolbarItemIdentifier NSToolbarShowColorsItemIdentifier API_AVAILABLE(ios(13.0)); // Shows the color panel.
APPKIT_EXTERN NSToolbarItemIdentifier NSToolbarShowFontsItemIdentifier API_AVAILABLE(ios(13.0)); // Shows the font panel.
APPKIT_EXTERN NSToolbarItemIdentifier NSToolbarCustomizeToolbarItemIdentifier API_DEPRECATED("This item is no longer recommended and will be ignored on 10.7 and later.", macos(10.0, 11.0)) API_UNAVAILABLE(ios);
APPKIT_EXTERN NSToolbarItemIdentifier NSToolbarPrintItemIdentifier API_AVAILABLE(ios(13.0)); // Sends printDocument: to firstResponder, but you can change this in toolbarWillAddItem: if you need to do so.
APPKIT_EXTERN NSToolbarItemIdentifier NSToolbarToggleSidebarItemIdentifier API_AVAILABLE(macos(10.11), ios(13.0)); // A standard toolbar item identifier for sidebars. It sends -toggleSidebar: to the firstResponder.
APPKIT_EXTERN NSToolbarItemIdentifier NSToolbarCloudSharingItemIdentifier API_AVAILABLE(macos(10.12)); // A standard toolbar item identifier for cloud sharing via NSSharingServiceNameCloudSharing. It validates itself and modifies its appearance by using the NSCloudSharingValidation protocol. It sends -performCloudSharing: to the firstResponder.
/*
Creates a new NSTrackingSeparatorToolbarItem and automatically configures it to track the divider of the sidebar if one is discovered.
*/
APPKIT_EXTERN NSToolbarItemIdentifier NSToolbarSidebarTrackingSeparatorItemIdentifier API_AVAILABLE(macos(11.0)) API_UNAVAILABLE(ios);
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTreeNode.h | /*
NSTreeNode.h
AppKit
Copyright (c) 2007-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSIndexPath, NSSortDescriptor, NSTreeController;
API_AVAILABLE(macos(10.5))
@interface NSTreeNode : NSObject
+ (instancetype)treeNodeWithRepresentedObject:(nullable id)modelObject;
- (instancetype)initWithRepresentedObject:(nullable id)modelObject;
@property (nullable, readonly, strong) id representedObject;
@property (readonly, strong) NSIndexPath *indexPath; // represents the receiver's location in the entire tree
@property (getter=isLeaf, readonly) BOOL leaf; // determined by (count of child nodes == 0)
@property (nullable, readonly, copy) NSArray<NSTreeNode *> *childNodes; // traversal
@property (readonly, strong) NSMutableArray<NSTreeNode *> *mutableChildNodes; // returns a mutable proxy - parentNode of inserted/removed child nodes is automatically updated
- (nullable NSTreeNode *)descendantNodeAtIndexPath:(NSIndexPath *)indexPath; // traversal begins with receiver
@property (nullable, readonly, weak) NSTreeNode *parentNode;
// sorts the entire subtree
- (void)sortWithSortDescriptors:(NSArray<NSSortDescriptor *> *)sortDescriptors recursively:(BOOL)recursively;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSKeyValueBinding.h | /*
NSKeyValueBinding.h
Application Kit
Copyright (c) 2002-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/AppKitDefines.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <CoreData/NSManagedObjectContext.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSString, NSError, NSAttributeDescription;
typedef NSString * NSBindingName NS_TYPED_EXTENSIBLE_ENUM;
typedef NSString * NSBindingOption NS_TYPED_ENUM;
API_AVAILABLE(macos(10.14))
@interface NSBindingSelectionMarker : NSObject <NSCopying>
// Subclassing or instantiating NSBindingSelectionMarker is not supported.
- (instancetype)init NS_UNAVAILABLE;
@property (class, readonly, strong) NSBindingSelectionMarker *multipleValuesSelectionMarker API_AVAILABLE(macos(10.14));
@property (class, readonly, strong) NSBindingSelectionMarker *noSelectionMarker API_AVAILABLE(macos(10.14));
@property (class, readonly, strong) NSBindingSelectionMarker *notApplicableSelectionMarker API_AVAILABLE(macos(10.14));
+ (void)setDefaultPlaceholder:(nullable id)placeholder forMarker:(nullable NSBindingSelectionMarker *)marker onClass:(Class)objectClass withBinding:(NSBindingName)binding API_AVAILABLE(macos(10.15)); // marker can be nil or one of multipleValuesSelectionMarker, noSelectionMarker, notApplicableSelectionMarker
+ (nullable id)defaultPlaceholderForMarker:(nullable NSBindingSelectionMarker *)marker onClass:(Class)objectClass withBinding:(NSBindingName)binding API_AVAILABLE(macos(10.15)); // marker can be nil or one of multipleValuesSelectionMarker, noSelectionMarker, notApplicableSelectionMarker
@end
APPKIT_EXTERN id NSMultipleValuesMarker API_DEPRECATED_WITH_REPLACEMENT("NSBindingSelectionMarker.multipleValuesSelectionMarker", macos(10.0, 11.0));
APPKIT_EXTERN id NSNoSelectionMarker API_DEPRECATED_WITH_REPLACEMENT("NSBindingSelectionMarker.noSelectionMarker", macos(10.0, 11.0));
APPKIT_EXTERN id NSNotApplicableMarker API_DEPRECATED_WITH_REPLACEMENT("NSBindingSelectionMarker.notApplicableSelectionMarker", macos(10.0, 11.0));
APPKIT_EXTERN BOOL NSIsControllerMarker(_Nullable id object);
// keys for the returned dictionary of -infoForBinding:
typedef NSString * NSBindingInfoKey NS_TYPED_ENUM;
APPKIT_EXTERN NSBindingInfoKey NSObservedObjectKey;
APPKIT_EXTERN NSBindingInfoKey NSObservedKeyPathKey;
APPKIT_EXTERN NSBindingInfoKey NSOptionsKey;
@interface NSObject (NSKeyValueBindingCreation)
+ (void)exposeBinding:(NSBindingName)binding; // bindings specified here will be exposed automatically in -exposedBindings (unless implementations explicitly filter them out, for example in subclasses)
@property (readonly, copy) NSArray<NSBindingName> *exposedBindings; // for a new key exposed through this method, the default implementation simply falls back to key-value coding
- (nullable Class)valueClassForBinding:(NSBindingName)binding; // optional - mostly for matching transformers
/* Bindings are considered to be a property of the object which is bound (the object the following two methods are sent to) and all information related to bindings should be retained by the object; all standard bindings on AppKit objects (views, cells, table columns, controllers) unbind their bindings automatically when they are released, but if you create key-value bindings for other kind of objects, you need to make sure that you remove those bindings when you release them (observed objects don't retain their observers, so controllers/model objects might continue referencing and messaging the objects that was bound to them).
*/
- (void)bind:(NSBindingName)binding toObject:(id)observable withKeyPath:(NSString *)keyPath options:(nullable NSDictionary<NSBindingOption, id> *)options; // placeholders and value transformers are specified in options dictionary
- (void)unbind:(NSBindingName)binding;
/* Returns a dictionary with information about a binding or nil if the binding is not bound (this is mostly for use by subclasses which want to analyze the existing bindings of an object) - the dictionary contains three key/value pairs: NSObservedObjectKey: object bound, NSObservedKeyPathKey: key path bound, NSOptionsKey: dictionary with the options and their values for the bindings.
*/
- (nullable NSDictionary<NSBindingInfoKey, id> *)infoForBinding:(NSBindingName)binding;
/* Returns an array of NSAttributeDescriptions that describe the options for aBinding. The descriptions are used by Interface Builder to build the options editor UI of the bindings inspector. Each binding may have multiple options. The options and attribute descriptions have 3 properties in common:
- The option "name" is derived from the attribute description name.
- The type of UI built for the option is based on the attribute type.
- The default value shown in the options editor comes from the attribute description's defaultValue.*/
- (NSArray<NSAttributeDescription *> *)optionDescriptionsForBinding:(NSBindingName)binding API_AVAILABLE(macos(10.5));
@end
@interface NSObject (NSPlaceholders)
+ (void)setDefaultPlaceholder:(nullable id)placeholder forMarker:(nullable id)marker withBinding:(NSBindingName)binding API_DEPRECATED_WITH_REPLACEMENT("+[NSBindingSelectionMarker setDefaultPlaceholder:forMarker:onClass:withBinding:]", macos(10.0, 11.0));
+ (nullable id)defaultPlaceholderForMarker:(nullable id)marker withBinding:(NSBindingName)binding API_DEPRECATED_WITH_REPLACEMENT("+[NSBindingSelectionMarker defaultPlaceholderForMarker:onClass:withBinding:]", macos(10.0, 11.0));
@end
// methods implemented by controllers, CoreData's managed object contexts, and user interface elements
@protocol NSEditor <NSObject>
- (void)discardEditing; // forces changing to end (reverts back to the original value)
- (BOOL)commitEditing; // returns whether end editing was successful (while trying to apply changes to a model object, there might be validation problems or so that prevent the operation from being successful
/* Given that the receiver has been registered with -objectDidBeginEditing: as the editor of some object, and not yet deregistered by a subsequent invocation of -objectDidEndEditing:, attempt to commit the result of the editing. When committing has either succeeded or failed, send the selected message to the specified object with the context info as the last parameter. The method selected by didCommitSelector must have the same signature as:
- (void)editor:(id)editor didCommit:(BOOL)didCommit contextInfo:(void *)contextInfo;
If an error occurs while attempting to commit, because key-value coding validation fails for example, an implementation of this method should typically send the NSView in which editing is being done a -presentError:modalForWindow:delegate:didRecoverSelector:contextInfo: message, specifying the view's containing window.
*/
- (void)commitEditingWithDelegate:(nullable id)delegate didCommitSelector:(nullable SEL)didCommitSelector contextInfo:(nullable void *)contextInfo;
/* During autosaving, commit editing may fail, due to a pending edit. Rather than interrupt the user with an unexpected alert, this method provides the caller with the option to either present the error or fail silently, leaving the pending edit in place and the user's editing uninterrupted. This method attempts to commit editing, but if there is a failure the error is returned to the caller to be presented or ignored as appropriate. If an error occurs while attempting to commit, an implementation of this method should return NO as well as the generated error by reference. Returns YES if commit is successful.
If you have enabled autosaving in your application, and your application has custom objects that implement or override the NSEditor protocol, you must also implement this method in those NSEditors.
*/
- (BOOL)commitEditingAndReturnError:(NSError **)error API_AVAILABLE(macos(10.7));
@end
// methods implemented by controllers, CoreData's managed object contexts (and potentially documents)
@protocol NSEditorRegistration <NSObject>
@optional
- (void)objectDidBeginEditing:(id<NSEditor>)editor;
- (void)objectDidEndEditing:(id<NSEditor>)editor;
@end
#if __swift__ < 40200
@interface NSObject (NSEditor)
- (void)discardEditing API_DEPRECATED("This is now a method of the NSEditor protocol.", macos(10.0, 11.0));
- (BOOL)commitEditing API_DEPRECATED("This is now a method of the NSEditor protocol.", macos(10.0, 11.0));
- (void)commitEditingWithDelegate:(nullable id)delegate didCommitSelector:(nullable SEL)didCommitSelector contextInfo:(nullable void *)contextInfo API_DEPRECATED("This is now a method of the NSEditor protocol.", macos(10.0, 11.0));
- (BOOL)commitEditingAndReturnError:(NSError **)error API_DEPRECATED("This is now a method of the NSEditor protocol.", macos(10.7, 11.0));
@end
@interface NSObject (NSEditorRegistration)
- (void)objectDidBeginEditing:(id<NSEditor>)editor API_DEPRECATED("This is now a method of the NSEditorRegistration protocol.", macos(10.0, 11.0));
- (void)objectDidEndEditing:(id<NSEditor>)editor API_DEPRECATED("This is now a method of the NSEditorRegistration protocol.", macos(10.0, 11.0));
@end
#endif
// constants for binding names
APPKIT_EXTERN NSBindingName NSAlignmentBinding;
APPKIT_EXTERN NSBindingName NSAlternateImageBinding;
APPKIT_EXTERN NSBindingName NSAlternateTitleBinding;
APPKIT_EXTERN NSBindingName NSAnimateBinding;
APPKIT_EXTERN NSBindingName NSAnimationDelayBinding;
APPKIT_EXTERN NSBindingName NSArgumentBinding;
APPKIT_EXTERN NSBindingName NSAttributedStringBinding;
APPKIT_EXTERN NSBindingName NSContentArrayBinding;
APPKIT_EXTERN NSBindingName NSContentArrayForMultipleSelectionBinding;
APPKIT_EXTERN NSBindingName NSContentBinding;
APPKIT_EXTERN NSBindingName NSContentDictionaryBinding API_AVAILABLE(macos(10.5));
APPKIT_EXTERN NSBindingName NSContentHeightBinding;
APPKIT_EXTERN NSBindingName NSContentObjectBinding;
APPKIT_EXTERN NSBindingName NSContentObjectsBinding;
APPKIT_EXTERN NSBindingName NSContentSetBinding;
APPKIT_EXTERN NSBindingName NSContentValuesBinding;
APPKIT_EXTERN NSBindingName NSContentWidthBinding;
APPKIT_EXTERN NSBindingName NSCriticalValueBinding;
APPKIT_EXTERN NSBindingName NSDataBinding;
APPKIT_EXTERN NSBindingName NSDisplayPatternTitleBinding;
APPKIT_EXTERN NSBindingName NSDisplayPatternValueBinding;
APPKIT_EXTERN NSBindingName NSDocumentEditedBinding;
APPKIT_EXTERN NSBindingName NSDoubleClickArgumentBinding;
APPKIT_EXTERN NSBindingName NSDoubleClickTargetBinding;
APPKIT_EXTERN NSBindingName NSEditableBinding;
APPKIT_EXTERN NSBindingName NSEnabledBinding;
APPKIT_EXTERN NSBindingName NSExcludedKeysBinding API_AVAILABLE(macos(10.5));
APPKIT_EXTERN NSBindingName NSFilterPredicateBinding;
APPKIT_EXTERN NSBindingName NSFontBinding;
APPKIT_EXTERN NSBindingName NSFontBoldBinding;
APPKIT_EXTERN NSBindingName NSFontFamilyNameBinding;
APPKIT_EXTERN NSBindingName NSFontItalicBinding;
APPKIT_EXTERN NSBindingName NSFontNameBinding;
APPKIT_EXTERN NSBindingName NSFontSizeBinding;
APPKIT_EXTERN NSBindingName NSHeaderTitleBinding;
APPKIT_EXTERN NSBindingName NSHiddenBinding;
APPKIT_EXTERN NSBindingName NSImageBinding;
APPKIT_EXTERN NSBindingName NSIncludedKeysBinding API_AVAILABLE(macos(10.5));
APPKIT_EXTERN NSBindingName NSInitialKeyBinding API_AVAILABLE(macos(10.5));
APPKIT_EXTERN NSBindingName NSInitialValueBinding API_AVAILABLE(macos(10.5));
APPKIT_EXTERN NSBindingName NSIsIndeterminateBinding;
APPKIT_EXTERN NSBindingName NSLabelBinding;
APPKIT_EXTERN NSBindingName NSLocalizedKeyDictionaryBinding API_AVAILABLE(macos(10.5));
APPKIT_EXTERN NSBindingName NSManagedObjectContextBinding;
APPKIT_EXTERN NSBindingName NSMaximumRecentsBinding;
APPKIT_EXTERN NSBindingName NSMaxValueBinding;
APPKIT_EXTERN NSBindingName NSMaxWidthBinding;
APPKIT_EXTERN NSBindingName NSMinValueBinding;
APPKIT_EXTERN NSBindingName NSMinWidthBinding;
APPKIT_EXTERN NSBindingName NSMixedStateImageBinding;
APPKIT_EXTERN NSBindingName NSOffStateImageBinding;
APPKIT_EXTERN NSBindingName NSOnStateImageBinding;
APPKIT_EXTERN NSBindingName NSPositioningRectBinding API_AVAILABLE(macos(10.7));
APPKIT_EXTERN NSBindingName NSPredicateBinding;
APPKIT_EXTERN NSBindingName NSRecentSearchesBinding;
APPKIT_EXTERN NSBindingName NSRepresentedFilenameBinding;
APPKIT_EXTERN NSBindingName NSRowHeightBinding;
APPKIT_EXTERN NSBindingName NSSelectedIdentifierBinding;
APPKIT_EXTERN NSBindingName NSSelectedIndexBinding;
APPKIT_EXTERN NSBindingName NSSelectedLabelBinding;
APPKIT_EXTERN NSBindingName NSSelectedObjectBinding;
APPKIT_EXTERN NSBindingName NSSelectedObjectsBinding;
APPKIT_EXTERN NSBindingName NSSelectedTagBinding;
APPKIT_EXTERN NSBindingName NSSelectedValueBinding;
APPKIT_EXTERN NSBindingName NSSelectedValuesBinding;
APPKIT_EXTERN NSBindingName NSSelectionIndexesBinding;
APPKIT_EXTERN NSBindingName NSSelectionIndexPathsBinding;
APPKIT_EXTERN NSBindingName NSSortDescriptorsBinding;
APPKIT_EXTERN NSBindingName NSTargetBinding;
APPKIT_EXTERN NSBindingName NSTextColorBinding;
APPKIT_EXTERN NSBindingName NSTitleBinding;
APPKIT_EXTERN NSBindingName NSToolTipBinding;
APPKIT_EXTERN NSBindingName NSTransparentBinding API_AVAILABLE(macos(10.5));
APPKIT_EXTERN NSBindingName NSValueBinding;
APPKIT_EXTERN NSBindingName NSValuePathBinding;
APPKIT_EXTERN NSBindingName NSValueURLBinding;
APPKIT_EXTERN NSBindingName NSVisibleBinding;
APPKIT_EXTERN NSBindingName NSWarningValueBinding;
APPKIT_EXTERN NSBindingName NSWidthBinding;
// constants for binding options
APPKIT_EXTERN NSBindingOption NSAllowsEditingMultipleValuesSelectionBindingOption;
APPKIT_EXTERN NSBindingOption NSAllowsNullArgumentBindingOption;
APPKIT_EXTERN NSBindingOption NSAlwaysPresentsApplicationModalAlertsBindingOption;
APPKIT_EXTERN NSBindingOption NSConditionallySetsEditableBindingOption;
APPKIT_EXTERN NSBindingOption NSConditionallySetsEnabledBindingOption;
APPKIT_EXTERN NSBindingOption NSConditionallySetsHiddenBindingOption;
APPKIT_EXTERN NSBindingOption NSContinuouslyUpdatesValueBindingOption;
APPKIT_EXTERN NSBindingOption NSCreatesSortDescriptorBindingOption;
APPKIT_EXTERN NSBindingOption NSDeletesObjectsOnRemoveBindingsOption;
APPKIT_EXTERN NSBindingOption NSDisplayNameBindingOption;
APPKIT_EXTERN NSBindingOption NSDisplayPatternBindingOption;
APPKIT_EXTERN NSBindingOption NSContentPlacementTagBindingOption API_AVAILABLE(macos(10.5));
APPKIT_EXTERN NSBindingOption NSHandlesContentAsCompoundValueBindingOption;
APPKIT_EXTERN NSBindingOption NSInsertsNullPlaceholderBindingOption;
APPKIT_EXTERN NSBindingOption NSInvokesSeparatelyWithArrayObjectsBindingOption;
APPKIT_EXTERN NSBindingOption NSMultipleValuesPlaceholderBindingOption;
APPKIT_EXTERN NSBindingOption NSNoSelectionPlaceholderBindingOption;
APPKIT_EXTERN NSBindingOption NSNotApplicablePlaceholderBindingOption;
APPKIT_EXTERN NSBindingOption NSNullPlaceholderBindingOption;
APPKIT_EXTERN NSBindingOption NSRaisesForNotApplicableKeysBindingOption;
APPKIT_EXTERN NSBindingOption NSPredicateFormatBindingOption;
APPKIT_EXTERN NSBindingOption NSSelectorNameBindingOption;
APPKIT_EXTERN NSBindingOption NSSelectsAllWhenSettingContentBindingOption;
APPKIT_EXTERN NSBindingOption NSValidatesImmediatelyBindingOption;
APPKIT_EXTERN NSBindingOption NSValueTransformerNameBindingOption;
APPKIT_EXTERN NSBindingOption NSValueTransformerBindingOption;
/// NSManagedObjectContext implements the NSEditor and NSEditorRegistration protocols for use with NSControllers and NSDocument
@interface NSManagedObjectContext (NSEditorAndEditorRegistrationConformance) <NSEditor, NSEditorRegistration>
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSSlider.h | /*
NSSlider.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSControl.h>
#import <AppKit/NSSliderCell.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@interface NSSlider : NSControl <NSAccessibilitySlider>
@property NSSliderType sliderType API_AVAILABLE(macos(10.10));
@property double minValue;
@property double maxValue;
@property double altIncrementValue;
@property (readonly) CGFloat knobThickness;
- (BOOL)acceptsFirstMouse:(nullable NSEvent *)event;
@property (readwrite, getter=isVertical) BOOL vertical API_AVAILABLE(macos(10.12));
@property (nullable, copy) NSColor *trackFillColor API_AVAILABLE(macos(10.12.2)); // The color of the filled portion of the track, in appearances that support it
@end
@interface NSSlider (NSSliderVerticalGetter)
@property (readonly, getter=isVertical) BOOL vertical API_AVAILABLE(macos(10.0));
@end
@interface NSSlider(NSTickMarkSupport)
// For setting and retrieving the number of tick marks on a slider.
// 0 indicates no tick marks are present, which is the default
@property NSInteger numberOfTickMarks;
// For setting and retrieving the position tick marks will be displayed in.
// This has no effect if numberOfTickMarks is 0.
@property NSTickMarkPosition tickMarkPosition;
// For setting and retrieving whether values on the slider can be anything
// the slider normally allows, or only values that correspond to a tick mark.
// This has no effect if numberOfTickMarks is 0.
@property BOOL allowsTickMarkValuesOnly;
// Determine the slider value for a particular tick mark.
// An NSRangeException will be raised if the index is invalid.
- (double)tickMarkValueAtIndex:(NSInteger)index;
// Determine the bounding rectangle of a particular tick mark.
// An NSRangeException will be raised if the index is invalid.
- (NSRect)rectOfTickMarkAtIndex:(NSInteger)index;
// Determine whether a particular point is "near" a tick mark and return its
// index if so. NSNotFound will be returned if no tick mark is close enough
// to qualify.
- (NSInteger)indexOfTickMarkAtPoint:(NSPoint)point;
- (double)closestTickMarkValueToValue:(double)value;
@end
@interface NSSlider(NSSliderConvenience)
/*!
Creates a continuous horizontal slider over the range 0.0 to 1.0. The default value is 0.0.
@param target The target object that receives action messages from the control.
@param action The action message sent by the control.
@return An initialized slider control.
*/
+ (instancetype)sliderWithTarget:(nullable id)target action:(nullable SEL)action API_AVAILABLE(macos(10.12));
/*!
Creates a continuous horizontal slider that represents values over a specified range.
@param value The initial value displayed by the control.
@param minValue The minimum value represented by the control.
@param maxValue The maximum value represented by the control.
@param target The target object that receives action messages from the control.
@param action The action message sent by the control.
@return An initialized slider control.
*/
+ (instancetype)sliderWithValue:(double)value minValue:(double)minValue maxValue:(double)maxValue target:(nullable id)target action:(nullable SEL)action API_AVAILABLE(macos(10.12));
@end
@interface NSSlider (NSSliderDeprecated)
- (void)setTitleCell:(null_unspecified NSCell *)cell API_DEPRECATED("-setTitleCell: had no effect since 10.0", macos(10.0,10.9));
- (null_unspecified id)titleCell API_DEPRECATED("-titleCell has returned nil since 10.0", macos(10.0,10.9));
- (void)setTitleColor:(null_unspecified NSColor *)newColor API_DEPRECATED("-setTitleColor: had no effect since 10.0", macos(10.0,10.9));
- (null_unspecified NSColor *)titleColor API_DEPRECATED("-titleColor has returned nil since 10.0", macos(10.0,10.9));
- (void)setTitleFont:(null_unspecified NSFont *)fontObj API_DEPRECATED("-setTitleFont: had no effect since 10.0", macos(10.0,10.9));
- (null_unspecified NSFont *)titleFont API_DEPRECATED("-titleFont has returned nil since 10.0", macos(10.0,10.9));
- (null_unspecified NSString *)title API_DEPRECATED("-title has returned nil since 10.0", macos(10.0,10.9));
- (void)setTitle:(null_unspecified NSString *)string API_DEPRECATED("-setTitle: had no effect since 10.0", macos(10.0,10.9));
- (void)setKnobThickness:(CGFloat)thickness API_DEPRECATED("-knobThickness has returned 0 since 10.0", macos(10.0,10.9));
- (void)setImage:(null_unspecified NSImage *)backgroundImage API_DEPRECATED("-setImage: had no effect since 10.0", macos(10.0,10.9));
- (null_unspecified NSImage *)image API_DEPRECATED("-image has returned nil since 10.0", macos(10.0,10.9));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSAccessibilityConstants.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTextStorageScripting.h | /*
NSTextStorageScripting.h
AppKit Framework
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSTextStorage.h>
NS_ASSUME_NONNULL_BEGIN
#if !TARGET_OS_IPHONE
@interface NSTextStorage (Scripting)
@property (copy) NSArray<NSTextStorage *> *attributeRuns;
@property (copy) NSArray<NSTextStorage *> *paragraphs;
@property (copy) NSArray<NSTextStorage *> *words;
@property (copy) NSArray<NSTextStorage *> *characters;
@property (nullable, strong) NSFont *font;
@property (nullable, strong) NSColor *foregroundColor;
@end
#endif // !TARGET_OS_IPHONE
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTabViewItem.h | /*
NSTabViewItem.h
Application Kit
Copyright (c) 2000-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/NSView.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSColor, NSTabView, NSView, NSViewController, NSImage;
typedef NS_ENUM(NSUInteger, NSTabState) {
NSSelectedTab = 0,
NSBackgroundTab = 1,
NSPressedTab = 2
};
@interface NSTabViewItem : NSObject <NSCoding>
/*!
* Creates an autoreleased TabViewItem that wraps the provided ViewController. The viewController is set as the tab view item’s \c -viewController property, which sets several of the tab view item’s other properties.
* \param viewController The view controller to wrap, used to set the viewController property
*/
+ (instancetype)tabViewItemWithViewController:(NSViewController *)viewController API_AVAILABLE(macos(10.10));
/* By default, NSTabViewItem creates a basic NSView for you automatically.
*/
- (instancetype)initWithIdentifier:(nullable id)identifier; // identifier is retained
@property (strong, nullable) id identifier;
@property (copy) NSColor *color;
@property (copy) NSString *label;
/// Get and set the image for this tab view item. The image may only be used in certain tab view styles and options. The default value is nil.
@property (nullable, strong) NSImage *image API_AVAILABLE(macos(10.10));
@property (nullable, strong) NSView *view;
/*! The view controller wrapped by the tab view item. This property must be set if the tab view item will be added to an NSTabViewController, but can also be used if the tab view item is added to an NSTabView.
* If this is set, the tab view item will forward \c -view calls onto the viewController. Setting a viewController will also set the following properties on the tab view item: \c -identifier from the address of the viewController, \c -label from the viewController's title, and \c -image based on the classname as the view controller.
* An image named "ViewControllerClassName-TabViewItem" will be searched for first, followed by "ViewControllerClassName". It will search first using +[NSImage imageNamed:], then in \c viewController.nibBundle, and lastly in the bundle containing the view controller's class.
* As defined by: -[NSImage imageNamed:imageName], -[viewController.nibBundle imageForResource:imageName], -[[NSBundle bundleForClass:[viewController class]] imageForResource:imageName]. One pass with imageName as [NSStringFromClass([viewController class]) stringByAppendingString:@"-TabViewItem"], followed by imageName as NSStringFromClass([viewController class]).
*/
@property (nullable, strong) NSViewController *viewController API_AVAILABLE(macos(10.10));
@property (readonly) NSTabState tabState;
@property (nullable, readonly) NSTabView *tabView;
@property (nullable, weak) NSView *initialFirstResponder;
/* The following methods provide support for tooltips on the tabs a tab view. The default behavior is to use the label as a tooltip if the label is truncated due to insufficient space; this automatic tooltip is never returned by the toolTip method. If you explicitly set a non-nil tooltip, this default behavior is suppressed, and the given tooltip will be used whether or not the label is truncated.
*/
@property (nullable, copy) NSString *toolTip API_AVAILABLE(macos(10.6));
/* Tab Drawing/Measuring */
/* This method draws the tab label assuming a local coordinate system whose label axis runs along the x axis. Assume the label axis runs along the length of the label (perpendicular to the direction of the tab). 'labelRect' is the area in between the curved end caps. 'shouldTruncateLabel' is a hint that the label should be truncated. ie. if shouldTruncateLabel is YES, then labelRect.size < ceil([sizeOfLabel:NO])
*/
- (void)drawLabel:(BOOL)shouldTruncateLabel inRect:(NSRect)labelRect;
/* This method returns the minimum or nominal size of the tab label. The width of the label is measured along the label axis, and height is measured in the direction parallel to the tab direction. 'computeMin' indicates whether you should return the minimum or nominal label size. The returned value is used to compute the range of legal sizes for the tab label.
*/
- (NSSize)sizeOfLabel:(BOOL)computeMin;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSButton.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSAlignmentFeedbackFilter.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSStoryboardSegue.h | /*
NSStoryboardSegue.h
Application Kit
Copyright (c) 2013-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
typedef NSString * NSStoryboardSegueIdentifier NS_SWIFT_BRIDGED_TYPEDEF;
API_AVAILABLE(macos(10.10))
@interface NSStoryboardSegue : NSObject
// Convenience constructor for returning a segue that performs a handler block in its -perform method.
+ (instancetype)segueWithIdentifier:(NSStoryboardSegueIdentifier)identifier source:(id)sourceController destination:(id)destinationController performHandler:(void (^)(void))performHandler;
/* This is the designated initializer for NSStoryboardSegue. If a developer implements a NSStoryboardSegue subclass, they can override this method to perform init-time logic. When a segue starts, a new instance of NSStoryboardSegue will be created with this method, and then perform will subsequently be invoked. */
- (instancetype)initWithIdentifier:(NSStoryboardSegueIdentifier)identifier source:(id)sourceController destination:(id)destinationController NS_DESIGNATED_INITIALIZER;
/* NSStoryboardSegue instances have optional identifiers that can be assigned in Interface Builder. These identifiers can be used in overrides of -[NSViewController prepareForSegue:sender:] to differentiate segues. */
@property (nullable, readonly, copy) NSStoryboardSegueIdentifier identifier;
/* Subclasses of NSStoryboardSegue can use this property to access the source view or window controller that is being segued away from. */
@property (readonly, strong) id sourceController;
/* Subclasses of NSStoryboardSegue can use this property to access the destination view or window controller that's being segued to. This property is also essential for overrides of -[NSViewController prepareForSegue:sender:], which is passed to the source view controller. This property allows the receiver of -[NSViewController prepareForSegue:sender:] to access and pass configuration data to the destination controller. */
@property (readonly, strong) id destinationController;
/* This method is implemented by NSStoryboardSegue subclasses to present a custom transition between two controllers. */
- (void)perform;
@end
@protocol NSSeguePerforming <NSObject>
@optional
/* Subclasses should override this to do any necessary work preparing for the destination ViewController or WindowController.
*/
- (void)prepareForSegue:(NSStoryboardSegue *)segue sender:(nullable id)sender API_AVAILABLE(macos(10.10));
/* Performs the identified Segue created from this WindowController. Throws exception if identifier is nil or not associated with the receiver.
*/
- (void)performSegueWithIdentifier:(NSStoryboardSegueIdentifier)identifier sender:(nullable id)sender API_AVAILABLE(macos(10.10));
/* Invoked immediately prior to initiating a segue. Return NO to prevent the segue from firing. The default implementations in NSViewController and NSWindowController return YES. This method is invoked when -performSegueWithIdentifier:sender: is used.
*/
- (BOOL)shouldPerformSegueWithIdentifier:(NSStoryboardSegueIdentifier)identifier sender:(nullable id)sender API_AVAILABLE(macos(10.10));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSColorSpace.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSDockTile.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSATSTypesetter.h | #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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSQuickDrawView.h | /*
NSQuickDrawView.h
Application Kit
Copyright (c) 1999-2021, Apple Inc.
All rights reserved.
*/
#warning NSQuickDrawView is deprecated, and does not exist on 64-bit architectures. This header will be removed from the framework in a future release.
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTableColumn.h | /*
NSTableColumn.h
Application Kit
Copyright (c) 1995-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/NSUserInterfaceItemIdentification.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSTableView, NSCell, NSImage, NSSortDescriptor, NSTableHeaderCell;
/* The resizing mask controls the resizability of a table column. Values can be combined together with a bitwise or. The default value is 'NSTableColumnUserResizingMask | NSTableColumnAutoresizingMask'. Compatability note: This method replaces setResizable:.
*/
typedef NS_OPTIONS(NSUInteger, NSTableColumnResizingOptions) {
NSTableColumnNoResizing = 0, // Disallow any kind of resizing.
NSTableColumnAutoresizingMask = ( 1 << 0 ), // This column can be resized as the table is resized.
NSTableColumnUserResizingMask = ( 1 << 1 ), // The user can resize this column manually.
};
@interface NSTableColumn : NSObject <NSCoding, NSUserInterfaceItemIdentification>
/* Designated initializer for NSTableColumns. Prior to 10.7, the parameter type was 'id', but it is now an 'NSString *'. See also -setIdentifier: and -identifier, and NSUserInterfaceItemIdentification.
*/
- (instancetype)initWithIdentifier:(NSUserInterfaceItemIdentifier)identifier NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
/* Gets and sets the string identifier associated with the NSTableColumn. 'identifier' will be copied. Prior to 10.7, the type was 'id', but was changed to 'NSString *' for NSUserInterfaceItemIdentification.
*/
@property (copy) NSUserInterfaceItemIdentifier identifier;
@property (nullable, weak) NSTableView *tableView;
/* Gets and sets the current width of the NSTableColumn. The default for is 100.0. Calling setWidth: with a width that is less than the minWidth or larger than the maxWidth will automatically be constrained to minWidth or maxWidth as appropriate.
*/
@property CGFloat width;
/* Gets and sets the minimum width of the NSTableColumn. The default for is 10.0. If -[self width] is less than the 'minWidth' value when -setMinWidth: is called, the width will automatically be increased to the minWidth and [tableView tile] will be called.
Note that if the NSTableColumn is the outlineTableColumn of an NSOutlineView, minWidth will return
the maximum of the value set and NSOutlineView.indentationPerLevel.
*/
@property CGFloat minWidth;
/* Gets and sets the maximum width of the NSTableColumn. The default for is MAXFLOAT on Leopard and higher. If -[self width] is greater than the 'maxWidth' value when -setMaxWidth: is called, the width will automatically be decreased to the maxWidth and [tableView tile] will be called.
*/
@property CGFloat maxWidth;
/* Provides access to the title of this column header.
*/
@property (copy) NSString *title;
/* Gets and sets the headerCell associated with this NSTableColumn. 'cell' must be non nil, and should be a member of the NSTableHeaderCell class. The 'headerCell' is a strong reference, and will be retained.
*/
@property (strong) __kindof NSTableHeaderCell *headerCell;
/* Gets and sets the editability state of this NSTableColumn. The default value is YES. When an NSTableView wants to start editing a dataCell, the following happens: 1. Check [tableColumn isEditable]. If that returns YES, check the (optional) delegate method with tableView:shouldEditTableColumn:row:. If that returns YES, check the [dataCell isEnabled] and [isEnabled isSelectable] states before attempting to edit.
*/
@property (getter=isEditable) BOOL editable;
- (void)sizeToFit;
/* A column is considered sortable if it has a sortDescriptorPrototype. This prototype defines several things about the columns sorting. The prototype's ascending value defines the default sorting direction. Its key defines an arbitrary attribute which helps clients identify what to sort, while the selector defines how to sort. Note that, it is not required that the key be the same as the identifier. However, the key must be unique from the key used by other columns. The sortDescriptor is archived.
*/
@property (nullable, copy) NSSortDescriptor *sortDescriptorPrototype;
@property NSTableColumnResizingOptions resizingMask;
/* Get and set the Tool Tip for the NSTableColumn header that appears when hovering the mouse over the header for the NSTableColumn. The default value is 'nil', meaning there is no headerToolTip.
*/
@property (nullable, copy) NSString *headerToolTip API_AVAILABLE(macos(10.5));
/* Determines if the column is hidden or not. The isHidden value is stored out when the NSTableView automatically saves out NSTableColumn state. Note that columns which are hidden still exist in the the -[NSTableView tableColumns] array and -[NSTableView numberOfColumns] includes columns which are hidden. The default value is NO, meaning the NSTableColumn will not be hidden.
*/
@property (getter=isHidden) BOOL hidden API_AVAILABLE(macos(10.5));
@end
/*
* Deprecated Methods
*/
@interface NSTableColumn(NSDeprecated)
/* Deprecated in Mac OS 10.4. If flag is YES, calls setResizingMask:(NSTableColumnUserResizingMask | NSTableColumnAutoresizingMask). If flag is NO, calls setResizingMask:(NSTableColumnNoResizing).
*/
- (void)setResizable:(BOOL)flag API_DEPRECATED("", macos(10.0,10.4));
- (BOOL)isResizable API_DEPRECATED("", macos(10.0,10.4));
/* Cell-based NSTableViews are deprecated in Mac OS 10.10. Use view-based NSTableViews instead.
*/
@property (strong) id /* NSCell * */ dataCell; // Use a view-based NSTableView, and see the -tableView:viewForTableColumn:row: delegate method and -viewAtColumn:row:makeIfNecessary:
- (id)dataCellForRow:(NSInteger)row; // Use a view-based NSTableView, and see -viewAtColumn:row:makeIfNecessary
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSDrawer.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSDocument.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSMagnificationGestureRecognizer.h | /*
NSMagnificationGestureRecognizer.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 NSMagnificationGestureRecognizer : NSGestureRecognizer
@property CGFloat magnification;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSScrubberItemView.h | /*
NSScrubberItemView.h
Application Kit
Copyright (c) 2016-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSImageCell.h>
#import <AppKit/NSView.h>
#import <AppKit/AppKitDefines.h>
#import <os/lock.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSScrubberLayoutAttributes, NSTextField, NSImageView;
#pragma mark - Arranged View
API_AVAILABLE(macos(10.12.2))
@interface NSScrubberArrangedView : NSView
@property (getter=isSelected) BOOL selected;
@property (getter=isHighlighted) BOOL highlighted;
- (void)applyLayoutAttributes:(__kindof NSScrubberLayoutAttributes *)layoutAttributes NS_REQUIRES_SUPER;
@end
#pragma mark - Selection View
/*!
@class NSScrubberSelectionView
@abstract The base view class for all selection decorations used by the @c NSScrubber control.
*/
API_AVAILABLE(macos(10.12.2))
@interface NSScrubberSelectionView : NSScrubberArrangedView
@end
#pragma mark - Item Views
/*!
@class NSScrubberItemView
@abstract The base view class that is arranged by a @c NSScrubber control.
*/
API_AVAILABLE(macos(10.12.2))
@interface NSScrubberItemView : NSScrubberArrangedView
@end
#pragma mark Text Item
/*!
@class NSScrubberTextItemView
@abstract A simple @c NSScrubberItemView for displaying text. The -fittingSize method can be used to measure the smallest size for the view which fits the title without truncating.
*/
API_AVAILABLE(macos(10.12.2))
@interface NSScrubberTextItemView : NSScrubberItemView
@property (strong, readonly) NSTextField *textField;
@property (copy) NSString *title;
@end
#pragma mark Image Item
/*!
@class NSScrubberTextItemView
@abstract A simple @c NSScrubberItemView for displaying an image.
@discussion If the provided image is larger than the view's frame, it is scaled proportionally to fill the entire frame. The cropped portion of the image is determined by the @c imageAlignment property.
*/
API_AVAILABLE(macos(10.12.2))
@interface NSScrubberImageItemView : NSScrubberItemView
@property (strong, readonly) NSImageView *imageView;
@property (copy) NSImage *image;
@property NSImageAlignment imageAlignment;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSGestureRecognizer.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSPopoverTouchBarItem.h | /*
NSPopoverTouchBarItem.h
Application Kit
Copyright (c) 2015-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSTouchBarItem.h>
#if TARGET_OS_IPHONE
@class UIImage;
#endif
NS_ASSUME_NONNULL_BEGIN
API_AVAILABLE(macos(10.12.2), ios(13.0))
@interface NSPopoverTouchBarItem : NSTouchBarItem
/*
The NSTouchBar displayed when this item is "popped." By default this is an empty bar that cannot be customized. This property is archived.
*/
@property (strong) NSTouchBar *popoverTouchBar;
/*
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;
/*
The view displayed when the item is in its hosted NSTouchBar. By default, this is an NSButton whose target is this popover item, whose action is showPopover:, and whose image and title are bound to this item's collapsedRepresentationImage and collapsedRepresentationLabel respectively. This property is archived.
*/
@property (strong) __kindof NSView *collapsedRepresentation API_UNAVAILABLE(ios);
/*
The image displayed by the button used by default for the default collapsed representation. If the collapsedRepresentation button has been replaced by a different view, this property may not have any effect. This property is archived.
*/
#if !TARGET_OS_IPHONE
@property (strong, nullable) NSImage *collapsedRepresentationImage;
#else
@property (strong, nullable) UIImage *collapsedRepresentationImage API_AVAILABLE(ios(13.0));
#endif
/*
The localized string displayed by the button used by default for the default collapsed representation. If the collapsedRepresentation button has been replaced by a different view, this property may not have any effect. This property is archived.
*/
@property (strong) NSString *collapsedRepresentationLabel;
/*
An NSTouchBar to be used exclusively for press-and-hold popovers. This NSTouchBar can be the same as the one used for "popoverTouchBar" property, but does not have to be. When non-nil this NSTouchBar will be displayed while the user holds their finger down on the collapsed representation and released when the user raises their finger. This tracking behavior is automatic, but popovers with custom collapsed representations will still need to send -showPopover: to start tracking.
This property is archived.
*/
@property (strong, nullable) NSTouchBar *pressAndHoldTouchBar;
/*
When YES, automatically displays a close button in the popover. When NO it is the responsibility of the client to dismiss the popover.
*/
@property BOOL showsCloseButton;
/*
Replaces the main NSTouchBar with this item's popover NSTouchBar. If this item is not visible, this method will have no effect. If this item ceases to be visible, the popover NSTouchBar will automatically be ordered out.
*/
- (void)showPopover:(nullable id)sender;
/*
This method will restore the previously visible main NSTouchBar. This method can be invoked explicitly to order out a popover if interacting with an item inside it should close it.
*/
- (void)dismissPopover:(nullable id)sender;
/*
Returns a new gesture recognizer, already wired up to send this popover -showPopover:. It is the callers responsibility to attach this GR to a custom collapsedRepresentation view
*/
- (NSGestureRecognizer *)makeStandardActivatePopoverGestureRecognizer API_UNAVAILABLE(ios);
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSArrayController.h | /*
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 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSParagraphStyle.h | #if !__has_include(<UIFoundation/NSParagraphStyle.h>)
/*
NSParagraphStyle.h
Copyright (c) 1994-2021, Apple Inc. All rights reserved.
NSParagraphStyle and NSMutableParagraphStyle hold paragraph style information
NSTextTab holds information about a single tab stop
*/
#import <Foundation/NSObject.h>
#import <AppKit/NSText.h>
@class NSTextBlock;
@class NSTextList;
NS_ASSUME_NONNULL_BEGIN
#if !TARGET_OS_IPHONE
typedef NS_ENUM(NSUInteger, NSLineBreakMode) {
NSLineBreakByWordWrapping = 0, // Wrap at word boundaries, default
NSLineBreakByCharWrapping, // Wrap at character boundaries
NSLineBreakByClipping, // Simply clip
NSLineBreakByTruncatingHead, // Truncate at head of line: "...wxyz"
NSLineBreakByTruncatingTail, // Truncate at tail of line: "abcd..."
NSLineBreakByTruncatingMiddle // Truncate middle of line: "ab...yz"
} API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));
// Line break strategy describes a collection of options that can affect where line breaks are placed in a paragraph.
// This is independent from line break mode, which describes what happens when text is too long to fit within its container.
// These options won't have any effect when used with line break modes that don't support multiple lines, like clipping or truncating middle.
typedef NS_OPTIONS(NSUInteger, NSLineBreakStrategy) {
// Don't use any line break strategies
NSLineBreakStrategyNone = 0,
// Use the push out line break strategy.
// This strategy allows the text system to "push out" individual lines by some number of words to avoid an orphan word on the last line of the paragraph.
// The current implementation usually pushes out the last line by a single word.
NSLineBreakStrategyPushOut API_AVAILABLE(macos(10.11), ios(9.0)) = 1 << 0,
// When specified, it prohibits breaking between Hangul characters. It is the preferable typesetting strategy for the modern Korean documents suitable for UI strings.
NSLineBreakStrategyHangulWordPriority API_AVAILABLE(macos(11.0), ios(14.0)) = 1 << 1,
// Use the same configuration of line break strategies that the system uses for standard UI labels. This set of line break strategies is optimized for displaying shorter strings that are common in UI labels and may not be suitable for large amounts of text.
NSLineBreakStrategyStandard API_AVAILABLE(macos(11.0), ios(14.0)) = 0xFFFF
};
// NSTextTab
typedef NSString * NSTextTabOptionKey NS_TYPED_ENUM;
APPKIT_EXTERN NSTextTabOptionKey NSTabColumnTerminatorsAttributeName API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // An attribute for NSTextTab options. The value is NSCharacterSet. The character set is used to determine the tab column terminating character. The tab and newline characters are implied even if not included in the character set.
API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)) @interface NSTextTab : NSObject <NSCopying, NSCoding, NSSecureCoding>
+ (NSCharacterSet *)columnTerminatorsForLocale:(nullable NSLocale *)aLocale API_AVAILABLE(macos(10.11), ios(7.0), watchos(2.0), tvos(9.0)); // Returns the column terminators for locale. Passing nil returns an instance corresponding to +[NSLocale systemLocale]. For matching user's formatting preferences, pass +[NSLocale currentLocale]. Can be used as the value for NSTabColumnTerminatorsAttributeName to make a decimal tab stop.
- (instancetype)initWithTextAlignment:(NSTextAlignment)alignment location:(CGFloat)loc options:(NSDictionary<NSTextTabOptionKey, id> *)options NS_DESIGNATED_INITIALIZER; // Initializes a text tab with the text alignment, location, and options. The text alignment is used to determine the position of text inside the tab column.
@property (readonly) NSTextAlignment alignment; // Defines the alignment of tab column contents. NSTextAlignmentNatural and NSTextAlignmentJustified are resolved either NSTextAlignmentLeft or NSTextAlignmentRight based on the user's preferred language.
@property (readonly) CGFloat location; // Location of the tab stop inside the line fragment rect coordinate system
@property (readonly) NSDictionary<NSTextTabOptionKey, id> *options; // Optional configuration attributes
@end
// NSParagraphStyle
API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0)) @interface NSParagraphStyle : NSObject <NSCopying, NSMutableCopying, NSSecureCoding>
@property (class, readonly, copy) NSParagraphStyle *defaultParagraphStyle; // This class property returns a shared and cached NSParagraphStyle instance with the default style settings, with same value as the result of [[NSParagraphStyle alloc] init].
+ (NSWritingDirection)defaultWritingDirectionForLanguage:(nullable NSString *)languageName; // languageName is in ISO lang region format
@property (readonly) CGFloat lineSpacing; // "Leading": distance between the bottom of one line fragment and top of next (applied between lines in the same container). This value is included in the line fragment heights in layout manager.
@property (readonly) CGFloat paragraphSpacing; // Distance between the bottom of this paragraph and top of next (or the beginning of its paragraphSpacingBefore, if any).
@property (readonly) NSTextAlignment alignment;
// The following values are relative to the appropriate margin (depending on the paragraph direction)
@property (readonly) CGFloat headIndent; // Distance from margin to front edge of paragraph
@property (readonly) CGFloat tailIndent; // Distance from margin to back edge of paragraph; if negative or 0, from other margin
@property (readonly) CGFloat firstLineHeadIndent; // Distance from margin to edge appropriate for text direction
@property (readonly) CGFloat minimumLineHeight; // Line height is the distance from bottom of descenders to top of ascenders; basically the line fragment height. Does not include lineSpacing (which is added after this computation).
@property (readonly) CGFloat maximumLineHeight; // 0 implies no maximum.
@property (readonly) NSLineBreakMode lineBreakMode;
@property (readonly) NSWritingDirection baseWritingDirection;
@property (readonly) CGFloat lineHeightMultiple; // Natural line height is multiplied by this factor (if positive) before being constrained by minimum and maximum line height.
@property (readonly) CGFloat paragraphSpacingBefore; // Distance between the bottom of the previous paragraph (or the end of its paragraphSpacing, if any) and the top of this paragraph.
// Specifies the threshold for hyphenation. Valid values lie between 0.0 and 1.0 inclusive. Hyphenation will be attempted when the ratio of the text width as broken without hyphenation to the width of the line fragment is less than the hyphenation factor. When this takes on its default value of 0.0, the layout manager's hyphenation factor is used instead. When both are 0.0, hyphenation is disabled.
@property (readonly) float hyphenationFactor;
// A property controlling the hyphenation behavior for the paragraph associated with the paragraph style. The exact hyphenation logic is dynamically determined by the layout context such as language, platform, etc. When YES, it affects the return value from -hyphenationFactor when the property is set to 0.0.
@property (readonly) BOOL usesDefaultHyphenation API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0));
@property (readonly,copy) NSArray<NSTextTab *> *tabStops API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // An array of NSTextTabs. Contents should be ordered by location. The default value is an array of 12 left-aligned tabs at 28pt interval
@property (readonly) CGFloat defaultTabInterval API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // The default tab interval used for locations beyond the last element in tabStops
@property (readonly) BOOL allowsDefaultTighteningForTruncation API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0)); // Tightens inter-character spacing in attempt to fit lines wider than the available space if the line break mode is one of the truncation modes before starting to truncate. YES by default for apps linked against 10.11 and later SDK. The maximum amount of tightening performed is determined by the system based on contexts such as font, line width, etc.
// Specifies the threshold for using tightening as an alternative to truncation when -allowsDefaultTighteningForTruncation=NO. When the line break mode specifies truncation, the text system will attempt to tighten inter-character spacing as an alternative to truncation, provided that the ratio of the text width to the line fragment width does not exceed 1.0 + tighteningFactorForTruncation. Otherwise the text will be truncated at a location determined by the line break mode. The default value is 0.0 for apps linked against 10.11 and later SDK. This property is ignored when -allowsDefaultTighteningForTruncation=YES. Explicitly setting this property to 0.0 has a side effect of also setting -allowsDefaultTighteningForTruncation to NO.
@property (readonly) float tighteningFactorForTruncation;
@property (readonly, copy) NSArray<__kindof NSTextBlock *> *textBlocks; // Array to specify the text blocks containing the paragraph, nested from outermost to innermost.
@property (readonly, copy) NSArray<NSTextList *> *textLists; // Array to specify the text lists containing the paragraph, nested from outermost to innermost.
// Specifies whether the paragraph is to be treated as a header for purposes of HTML generation. Should be set to 0 (the default value) if the paragraph is not a header, or from 1 through 6 if the paragraph is to be treated as a header.
@property (readonly) NSInteger headerLevel;
// Specifies the line break strategies that may be used for laying out the paragraph. The default value is NSLineBreakStrategyNone.
@property (readonly) NSLineBreakStrategy lineBreakStrategy API_AVAILABLE(macos(10.11), ios(9.0));
@end
API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0)) @interface NSMutableParagraphStyle : NSParagraphStyle
@property CGFloat lineSpacing;
@property CGFloat paragraphSpacing;
@property NSTextAlignment alignment;
@property CGFloat firstLineHeadIndent;
@property CGFloat headIndent;
@property CGFloat tailIndent;
@property NSLineBreakMode lineBreakMode;
@property CGFloat minimumLineHeight;
@property CGFloat maximumLineHeight;
@property NSWritingDirection baseWritingDirection;
@property CGFloat lineHeightMultiple;
@property CGFloat paragraphSpacingBefore;
@property float hyphenationFactor;
@property (readwrite) BOOL usesDefaultHyphenation API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0));
@property (null_resettable, copy) NSArray<NSTextTab *> *tabStops API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
@property CGFloat defaultTabInterval API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
@property BOOL allowsDefaultTighteningForTruncation API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
- (void)addTabStop:(NSTextTab *)anObject API_AVAILABLE(macos(10.0), ios(9.0), watchos(2.0), tvos(9.0));
- (void)removeTabStop:(NSTextTab *)anObject API_AVAILABLE(macos(10.0), ios(9.0), watchos(2.0), tvos(9.0));
- (void)setParagraphStyle:(NSParagraphStyle *)obj API_AVAILABLE(macos(10.0), ios(9.0), watchos(2.0), tvos(9.0));
@property float tighteningFactorForTruncation;
@property (copy) NSArray<__kindof NSTextBlock *> *textBlocks;
@property (copy) NSArray<NSTextList *> *textLists;
@property NSInteger headerLevel;
@property NSLineBreakStrategy lineBreakStrategy API_AVAILABLE(macos(10.11), ios(9.0));
@end
/************************ Deprecated ************************/
// NSTextTabType and NSTextTab methods using the type are soft deprecated starting with OS X 10.11. It will be officially deprecated in a future release. Use NSTextAlignment-based API instead
typedef NS_ENUM(NSUInteger, NSTextTabType) {
NSLeftTabStopType = 0,
NSRightTabStopType,
NSCenterTabStopType,
NSDecimalTabStopType
};
@interface NSTextTab (NSTextTabDeprecated)
- (instancetype)initWithType:(NSTextTabType)type location:(CGFloat)loc; // Use -initWithTextAlignment:location:options:
@property (readonly) NSTextTabType tabStopType; // Use -alignment and -options
@end
#endif // !TARGET_OS_IPHONE
NS_ASSUME_NONNULL_END
#else
#import <UIFoundation/NSParagraphStyle.h>
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSWindowTabGroup.h | /*
NSWindowTabGroup.h
Application Kit
Copyright (c) 2017-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <AppKit/NSWindow.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
/* NSWindowTabGroup represents a group of windows that are shown together in one tab group. See NSWindow's tabGroup property.
*/
API_AVAILABLE(macos(10.13))
@interface NSWindowTabGroup : NSObject
/* The identifier for this group; all windows in the group will have the same identifier.
*/
@property (readonly, copy) NSWindowTabbingIdentifier identifier;
/* Returns the entire group (stack) of windows that are all visually shown together in one virtual tabbed window and associated with this particular window tab group. Operations can then be done on each window, as necessary. For instance, iterating over each window in the group and calling performClose: will close the entire stack. The order of items in the array is the same order as the tabs visually shown (leading to trailing). This property is KVO compliant
*/
@property (readonly, copy) NSArray<NSWindow *> *windows;
/* Determines if the Tab Picker / Tab Overview UI is visible, and can be set to make it explicitly visible or hidden. KVO compliant and can be observed so that UI can be updated or disabled when the tab overview is visible.
*/
@property (getter=isOverviewVisible) BOOL overviewVisible;
/* Returns YES when the tab bar is visible.
*/
@property (readonly, getter=isTabBarVisible) BOOL tabBarVisible;
/* Returns the current window that is selected. This is KVO compliant. Assignments can only work for a window in the tab group, otherwise an exception will be thrown.
*/
@property (weak) NSWindow *selectedWindow;
/* Allows adding a new window to this tab group. Adding a window will first remove it from its existing tab window group.
A window can implicitly be removed by ordering it out, or it can be explicitly be removed by calling removeWindow.
*/
- (void)addWindow:(NSWindow *)window;
- (void)insertWindow:(NSWindow *)window atIndex:(NSInteger)index;
- (void)removeWindow:(NSWindow *)window;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSImage.h | /*
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 [email protected].) 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
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSNibLoading.h | /*
NSNibLoading.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSBundle.h>
#import <AppKit/NSNib.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSString, NSDictionary;
@interface NSBundle(NSNibLoading)
- (BOOL)loadNibNamed:(NSNibName)nibName owner:(nullable id)owner topLevelObjects:(NSArray * _Nullable * _Nullable)topLevelObjects API_AVAILABLE(macos(10.8));
/* Load a nib from this bundle with the specified file name and owner. Upon success, the method returns YES and the optional out-parameter topLevelObjects is populated with the top level objects of the nib. The objects adhere to the standard Cocoa memory management rules and are autoreleased. IBOutlet properties to top level objects should be strong (retain) to demonstrate ownership and prevent deallocation. Alternatively, one may hold a strong reference to the top level objects array. */
@end
@interface NSObject (NSNibAwaking)
- (void)awakeFromNib;
/* On Mac OS X 10.6 and later, NSObject provides an implementation of awakeFromNib. This means that you can safely call through to [super awakeFromNib] in an overridden implementation when running on Mac OS X 10.6 and later. */
- (void)prepareForInterfaceBuilder API_AVAILABLE(macos(10.10));
@end
@interface NSBundle (NSNibLoadingDeprecated)
+ (BOOL)loadNibFile:(null_unspecified NSString *)fileName externalNameTable:(null_unspecified NSDictionary *)context withZone:(null_unspecified NSZone *)zone API_DEPRECATED("", macos(10.0,10.8));
+ (BOOL)loadNibNamed:(null_unspecified NSString *)nibName owner:(null_unspecified id)owner API_DEPRECATED("", macos(10.0,10.8));
- (BOOL)loadNibFile:(null_unspecified NSString *)fileName externalNameTable:(null_unspecified NSDictionary *)context withZone:(null_unspecified NSZone *)zone API_DEPRECATED("", macos(10.0,10.8));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTextView.h | /*
NSTextView.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
// NSTextView is an NSText subclass that displays the glyphs laid out in one NSTextContainer.
#import <AppKit/NSText.h>
#import <AppKit/NSInputManager.h>
#import <AppKit/NSTextAttachment.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSDragging.h>
#import <AppKit/NSUserInterfaceValidation.h>
#import <AppKit/NSTextInputClient.h>
#import <AppKit/NSNibDeclarations.h>
#import <AppKit/NSTextFinder.h>
#import <AppKit/NSLayoutManager.h>
#import <AppKit/NSSpellChecker.h>
#import <AppKit/NSPasteboard.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSTextCheckingResult.h>
#import <AppKit/NSTouchBarItem.h>
#import <AppKit/NSCandidateListTouchBarItem.h>
#import <AppKit/NSColorPanel.h>
#import <AppKit/NSMenu.h>
#import <AppKit/NSTextContent.h>
@protocol NSTextViewDelegate;
@protocol NSTextLayoutOrientationProvider;
@protocol NSTextAttachmentCell;
@protocol QLPreviewItem;
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSTextContainer;
@class NSTextStorage;
@class NSLayoutManager;
@class NSTextContentStorage;
@class NSTextLayoutManager;
@class NSRulerView;
@class NSRulerMarker;
@class NSUndoManager;
@class NSParagraphStyle;
@class NSOrthography;
@class NSSharingServicePicker;
@class NSValue;
@class NSTextAttachment;
/* Values for NSSelectionGranularity */
typedef NS_ENUM(NSUInteger, NSSelectionGranularity) {
NSSelectByCharacter = 0,
NSSelectByWord = 1,
NSSelectByParagraph = 2
};
/* Values for NSSelectionAffinity */
typedef NS_ENUM(NSUInteger, NSSelectionAffinity) {
NSSelectionAffinityUpstream = 0,
NSSelectionAffinityDownstream = 1
};
/* A meta locale identifier representing the set of Roman input sources available. You can specify [NSArray arrayWithObject: NSAllRomanInputSourcesLocaleIdentifier] to restrict allowed input sources to Roman only.
*/
APPKIT_EXTERN NSString * NSAllRomanInputSourcesLocaleIdentifier API_AVAILABLE(macos(10.5));
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12
NS_AUTOMATED_REFCOUNT_WEAK_UNAVAILABLE
#endif
@interface NSTextView : NSText <NSColorChanging, NSMenuItemValidation, NSUserInterfaceValidations, NSTextInputClient, NSTextLayoutOrientationProvider, NSDraggingSource, NSStandardKeyBindingResponding, NSTextInput, NSAccessibilityNavigableStaticText, NSTextContent>
/**************************** Initializing ****************************/
// Designated Initializer. container may be nil.
- (instancetype)initWithFrame:(NSRect)frameRect textContainer:(nullable NSTextContainer *)container NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
// This variant will create the text network (textStorage, layoutManager, and a container).
- (instancetype)initWithFrame:(NSRect)frameRect;
/***************** Get/Set the container and other stuff *****************/
// The set method should not be called directly, but you might want to override it. Gets or sets the text container for this view. Setting the text container marks the view as needing display. The text container calls the set method from its setTextView: method.
@property (nullable, assign) NSTextContainer *textContainer;
// This method should be used instead of the primitive -setTextContainer: if you need to replace a view's text container with a new one leaving the rest of the web intact. This method deals with all the work of making sure the view doesn't get deallocated and removing the old container from the layoutManager and replacing it with the new one.
- (void)replaceTextContainer:(NSTextContainer *)newContainer;
// The textContainerInset determines the padding that the view provides around the container. The container's origin will be inset by this amount from the bounds point {0,0} and padding will be left to the right and below the container of the same amount. This inset affects the view sizing in response to new layout and is used by the rectangular text containers when they track the view's frame dimensions.
@property NSSize textContainerInset;
// The container's origin in the view is determined from the current usage of the container, the container inset, and the view size. textContainerOrigin returns this point.
@property (readonly) NSPoint textContainerOrigin;
// invalidateTextContainerOrigin is sent automatically whenever something changes that causes the origin to possibly move. You usually do not need to call invalidate yourself.
- (void)invalidateTextContainerOrigin;
@property (nullable, readonly, assign) NSLayoutManager *layoutManager;
@property (nullable, readonly, assign) NSTextStorage *textStorage;
// The text views's text layout manager, if its text container is configured with one; null otherwise.
@property (nullable, readonly, weak) NSTextLayoutManager *textLayoutManager API_AVAILABLE(macos(12.0));
// The text view's text layout storage, if its text container is configured with one; null otherwise.
@property (nullable, readonly, weak) NSTextContentStorage *textContentStorage API_AVAILABLE(macos(12.0));
/************************* Key binding entry-point *************************/
- (void)insertText:(id)insertString API_DEPRECATED("Use -insertText:replacementRange: from NSTextInputClient instead. Since the method is designed to be used solely by the input system, the message should never be sent to a text view from applications. Any content modifications should be via either NSTextStorage or NSText methods.", macos(10.0,10.11));
/*************************** Sizing methods ***************************/
// Sets the frame size of the view to desiredSize constrained within min and max size.
- (void)setConstrainedFrameSize:(NSSize)desiredSize;
/***************** New miscellaneous API above and beyond NSText *****************/
// These two complete the set of range: type set methods. to be equivalent to the set of non-range taking varieties.
#if !TARGET_OS_IPHONE
- (void)setAlignment:(NSTextAlignment)alignment range:(NSRange)range;
- (void)setBaseWritingDirection:(NSWritingDirection)writingDirection range:(NSRange)range;
#endif
/*************************** New Font menu commands ***************************/
- (void)turnOffKerning:(nullable id)sender;
- (void)tightenKerning:(nullable id)sender;
- (void)loosenKerning:(nullable id)sender;
- (void)useStandardKerning:(nullable id)sender;
- (void)turnOffLigatures:(nullable id)sender;
- (void)useStandardLigatures:(nullable id)sender;
- (void)useAllLigatures:(nullable id)sender;
- (void)raiseBaseline:(nullable id)sender;
- (void)lowerBaseline:(nullable id)sender;
- (void)toggleTraditionalCharacterShape:(nullable id)sender API_DEPRECATED("Use the traditional shaped characters encoded in the Unicode standard. Access the characters via the character palette.", macos(10.0,10.11));
- (void)outline:(nullable id)sender;
/*************************** Find menu commands ***************************/
// See NSFindPanelAction for possible tags in sender
- (void)performFindPanelAction:(nullable id)sender;
/*************************** New Text commands ***************************/
- (void)alignJustified:(nullable id)sender;
- (void)changeColor:(nullable id)sender;
- (void)changeAttributes:(nullable id)sender;
- (void)changeDocumentBackgroundColor:(nullable id)sender;
- (void)orderFrontSpacingPanel:(nullable id)sender;
- (void)orderFrontLinkPanel:(nullable id)sender;
- (void)orderFrontListPanel:(nullable id)sender;
- (void)orderFrontTablePanel:(nullable id)sender;
/*************************** Ruler support ***************************/
- (void)rulerView:(NSRulerView *)ruler didMoveMarker:(NSRulerMarker *)marker;
- (void)rulerView:(NSRulerView *)ruler didRemoveMarker:(NSRulerMarker *)marker;
- (void)rulerView:(NSRulerView *)ruler didAddMarker:(NSRulerMarker *)marker;
- (BOOL)rulerView:(NSRulerView *)ruler shouldMoveMarker:(NSRulerMarker *)marker;
- (BOOL)rulerView:(NSRulerView *)ruler shouldAddMarker:(NSRulerMarker *)marker;
- (CGFloat)rulerView:(NSRulerView *)ruler willMoveMarker:(NSRulerMarker *)marker toLocation:(CGFloat)location;
- (BOOL)rulerView:(NSRulerView *)ruler shouldRemoveMarker:(NSRulerMarker *)marker;
- (CGFloat)rulerView:(NSRulerView *)ruler willAddMarker:(NSRulerMarker *)marker atLocation:(CGFloat)location;
- (void)rulerView:(NSRulerView *)ruler handleMouseDown:(NSEvent *)event;
/*************************** Fine display control ***************************/
// If flag is set, then this will attempt to avoid causing layout, if possible, when displaying the rect. If flag is not set, this is equivalent to setNeedsDisplayInRect:.
- (void)setNeedsDisplayInRect:(NSRect)rect avoidAdditionalLayout:(BOOL)flag;
@property (readonly) BOOL shouldDrawInsertionPoint;
- (void)drawInsertionPointInRect:(NSRect)rect color:(NSColor *)color turnedOn:(BOOL)flag;
// This is the override point for view background drawing.
- (void)drawViewBackgroundInRect:(NSRect)rect;
/*************************** Especially for subclassers ***************************/
- (void)updateRuler;
- (void)updateFontPanel;
- (void)updateDragTypeRegistration;
- (NSRange)selectionRangeForProposedRange:(NSRange)proposedCharRange granularity:(NSSelectionGranularity)granularity;
/*************************** Especially for subclassers ***************************/
// Cause the text view to act as if someone clicked on a piece of text with link as the value of NSLinkAttributeName. If, for instance, you have a special attachment cell that can end up following links, you can use this method to ask the text view to follow a link once you decide it should. This method is invoked by the text view during mouse tracking if the user is clicking a link as well. This sends the textView:clickedOnLink: delegation if the delegate responds.
- (void)clickedOnLink:(id)link atIndex:(NSUInteger)charIndex;
/************************* Speech support *************************/
- (void)startSpeaking:(nullable id)sender;
- (void)stopSpeaking:(nullable id)sender;
/************************* Vertical text support *************************/
#if !TARGET_OS_IPHONE
// Changes the receiver's layout orientation and invalidates the contents. Unlike other NSTextView properties, this is not shared by sibling views. It also rotates the bounds 90 degrees, swaps horizontal and vertical bits of the autoresizing mask, and reconfigures isHorizontallyResizable and isVerticallyResizable properties accordingly. Also, if -enclosingScrollView returns non-nil, it reconfigures horizontal and vertical ruler views, horizontal and vertical scrollers, and the frame.
- (void)setLayoutOrientation:(NSTextLayoutOrientation)orientation API_AVAILABLE(macos(10.7));
#endif
// An action method that calls -setLayoutOrientation: with the sender's tag as the orientation.
- (void)changeLayoutOrientation:(nullable id)sender API_AVAILABLE(macos(10.7));
/************************* Helper for subclassers *************************/
// Here point is in view coordinates, and the return value is a character index appropriate for placing a zero-length selection for an insertion point associated with the mouse at the given point. The NSTextInput method characterIndexForPoint: is not suitable for this role.
- (NSUInteger)characterIndexForInsertionAtPoint:(NSPoint)point API_AVAILABLE(macos(10.5));
/**************************** Ownership policy ****************************/
// Returns whether instances of the class operate in the object ownership policy introduced with macOS Sierra and later. When YES, the new object owner policy is used. Under the policy, each text view strongly retains its text storage and its text container weakly references the view. Also, the text views are compatible with __weak storage. The default is YES.
@property (readonly, class) BOOL stronglyReferencesTextStorage API_AVAILABLE(macos(10.12));
/*************************** Document Content Access ***************************/
#pragma mark Document Content Mutation
// Replaces the contents at the specified range with attributedString. In addition to invoking -[NSTextStorage replaceCharactersInRange:withAttributedString:], this method ensures that the change is validated with -shouldChangeTextInRange:replacementString:/-didChangeText. Returns YES if the change was validated and performed. Upon replacement, each attribute run in attributedString is complemented by the attributes at range.location.
- (BOOL)performValidatedReplacementInRange:(NSRange)range withAttributedString:(NSAttributedString *)attributedString API_AVAILABLE(macos(10.14));
/*************************** Dark Mode ***************************/
#pragma mark Dark Mode
// When YES, enables the adaptive color mapping mode. In this mode under the dark effective appearance, NSTextView maps all colors with NSColorTypeComponentBased by inverting the brightness whenever they are coming in and out of the model object, NSTextStorage. For example, when rendering, interacting with NSColorPanel and NSFontManager, and converting from/to the pasteboard and external formats, the color values are converted between the model and rendering contexts. Note that the color conversion algorithm compresses the brightness range and, therefore, does not retain the round-trip fidelity between the light and dark appearances. It may not be suitable for rich text authoring, so it is a good idea to provide a command or preference for your users to see and edit their docs without this option, or in light mode.
@property BOOL usesAdaptiveColorMappingForDarkAppearance API_AVAILABLE(macos(10.14));
@end
@interface NSTextView (NSCompletion)
/************************* Completion support *********************/
// Responder method for invoking completion. May be invoked programmatically if autocompletion is desired.
- (void)complete:(nullable id)sender;
// Usually returns the partial range from the most recent beginning of a word up to the insertion point. May be overridden by subclassers to alter the range to be completed. Returning (NSNotFound, 0) suppresses completion.
@property (readonly) NSRange rangeForUserCompletion;
// Returns an array of potential completions, in the order to be presented, representing complete words that the user might be trying to type when starting by typing the partial word at the given range. May be overridden by subclassers to modify or override this list. Returning nil or a zero-length array suppresses completion. The selected item index may optionally be set to indicate which completion should be initially selected; default is 0, and -1 indicates no selection. This method should call the delegate method textView:completions:forPartialWordRange:indexOfSelectedItem: if implemented.
- (nullable NSArray<NSString *> *)completionsForPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger *)index;
// Called with final == NO as the user moves through the potential completions, then with final == YES when a completion is definitively selected (or completion is cancelled and the original value is reinserted). The default implementation inserts the completion into the text at the appropriate location. The movement argument takes its values from the movement codes defined in NSText.h, and allows subclassers to distinguish between canceling completion and selection by arrow keys, by return, by tab, or by other means such as clicking.
- (void)insertCompletion:(NSString *)word forPartialWordRange:(NSRange)charRange movement:(NSInteger)movement isFinal:(BOOL)flag;
@end
@interface NSTextView (NSPasteboard)
/******************* Pasteboard support (mainly for subclassers) *******************/
// To implement support for writing a new type, override -writeSelectionToPasteboard:type: to support your new type (and call super if you're not going to handle it.) Then you can override -writablePasteboardTypes and optionally the +registerForServices methods to enable the new type.
// To implement support for reading a new type, override -readSelectionFromPasteboard:type: to support your new type (and call super if you're not going to handle it.) Then you can override -readablePasteboardTypes and optionally the +registerForServices and acceptableDragTypes methods to enable the new type. Advanced drag acceptance behavior can be implemented with dragOperationForDraggingInfo:type: and cleanUpAfterDragOperation.
// To implement new mechanisms that cause data to be written to the pasteboard you can call writablePasteboardTypes and writeSelectionToPasteboard:types:.
// To implement new mechanisms that cause data to be read from the pasteboard you can call preferredPasteboardTypeFromArray:restrictedToTypesFromArray: and readSelectionFromPasteboard:type:.
// Returns an array of pasteboard types that can be provided from the current selection. Overriders should copy the result from super and add their own new types.
@property (readonly, copy) NSArray<NSPasteboardType> *writablePasteboardTypes;
// Invoked automatically to write a single type to the pasteboard. The type will already have been declared to the pasteboard so this should merely write the data using the appropriate set method on the pasteboard.
- (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pboard type:(NSPasteboardType)type;
// Declares all the types to the pasteboard then calls writeSelectionToPasteboard:type: for each type in the array.
- (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pboard types:(NSArray<NSPasteboardType> *)types;
// Returns an array of types that could be read currently in order of preference. Subclassers should take care to consider the "preferred" part of the semantics of this method. Figure out where your new type should fit into the preferred order. The preferred order should usually be from the richest types down to the less rich. The default array will start with RTFD, RTF, strings, files, images, colors and so on. The ordering list really starts to lose significance after the first few elements. If the new format you are supporting is richer than RTFD, put it at the head of the list, otherwise try to find the right place for it, but don't count on the actual contents of the list you get from super either.
@property (readonly, copy) NSArray<NSPasteboardType> *readablePasteboardTypes;
// Returns the most preferred type from the available types array that it is currently possible to read. If allowedTypes is provided then only those types will be considered regardless of whether others could currently be read. You should not have to override this to support new types.
- (nullable NSPasteboardType)preferredPasteboardTypeFromArray:(NSArray<NSPasteboardType> *)availableTypes restrictedToTypesFromArray:(nullable NSArray<NSPasteboardType> *)allowedTypes;
// Invoked automatically to read a specific type from the pasteboard. The type will already have been by the preferredPasteboardTypeFromArray:restrictedToTypesFromArray: method so this should merely read the data using the appropriate accessor method on the pasteboard.
- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard type:(NSPasteboardType)type;
// Part of the services mechanism. This is implemented such that you should not need to override it to support new types. It should not be necessary to call this.
- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard;
// Automatically invoked when the first instance of NSTextView is created. Subclassing this is necessary to add support for new service types (in addition to actually supporting writing or reading the types, of course). Override it to call super and then register your own new types. You should probably never need to call this except to message super in an override.
+ (void)registerForServices;
// This method is part of the services protocol and is implemented in such a way that if you extend the type support correctly you should not need to override it. You should never need to call it either.
- (nullable id)validRequestorForSendType:(nullable NSPasteboardType)sendType returnType:(nullable NSPasteboardType)returnType;
// These methods are like paste: (from NSResponder) but they restrict the acceptable type of the pasted data. They are suitable as menu actions for appropriate "Paste As" submenu commands.
- (void)pasteAsPlainText:(nullable id)sender;
- (void)pasteAsRichText:(nullable id)sender;
@end
@interface NSTextView (NSDragging)
// Causes textview to begin dragging current selected range, returning YES if it succeeds in initiating the drag. Primarily for subclassers, who can override it to intervene at beginning of a drag.
- (BOOL)dragSelectionWithEvent:(NSEvent *)event offset:(NSSize)mouseOffset slideBack:(BOOL)slideBack;
// Used by dragSelectionWithEvent:offset:slideBack: to get an appropriate image. Returns the lower-left point of the image in view coordinates as origin. Can be called by others who need such an image, or can be overridden by subclassers to return a different image (if it returns nil, a default icon will be used).
- (nullable NSImage *)dragImageForSelectionWithEvent:(NSEvent *)event origin:(nullable NSPointPointer)origin;
// Must be overridden to support new drag types in addition to adding support for reading and writing the type. Override it to call super, then make a copy of the result and add your own new types before returning the copy. You should probably never need to call this except to message super in an override.
@property (readonly, copy) NSArray<NSPasteboardType> *acceptableDragTypes;
// This is called by draggingEntered:... and draggingUpdated:... It should return the drag operation constant appropriate to the current situation or NSDragOperationNone. It can also do any other auxiliary stuff like drawing a ghost to indicate where the dragged thing will go when it is dropped. Be aware that this is called over and over so if you're going to draw a ghost or something avoid doing it over and over unless you need to. Any state you set up in this method that needs to be cleared can be cleared by overriding the next method. You should probably never need to call this except to message super in an override. Clients should override this method rather than draggingEntered:... and draggingUpdated:... to control the drag operation. Clients overriding this method must message super to get the standard drag insertion indicator.
- (NSDragOperation)dragOperationForDraggingInfo:(id <NSDraggingInfo>)dragInfo type:(NSPasteboardType)type;
// If you set up persistent state that should go away when the drag operation finishes, you can clean it up here. Such state is usually set up in -dragOperationForDraggingInfo:type:. You should probably never need to call this except to message super in an override.
- (void)cleanUpAfterDragOperation;
@end
// The methods in this category deal with settings that need to be shared by all the NSTextViews of a single NSLayoutManager. Many of these methods are overrides of NSText or NSResponder methods.
@interface NSTextView (NSSharing)
/*************************** Selected/Marked range ***************************/
@property (copy) NSArray<NSValue *> *selectedRanges;
// These multiple-range methods supersede the corresponding single-range methods. The ranges argument must be a non-nil, non-empty array of objects responding to rangeValue. The return value of selectedRanges obeys the same restrictions, and in addition its elements are sorted, non-overlapping, non-contiguous, and (except for the case of a single range) have non-zero-length.
- (void)setSelectedRanges:(NSArray<NSValue *> *)ranges affinity:(NSSelectionAffinity)affinity stillSelecting:(BOOL)stillSelectingFlag;
- (void)setSelectedRange:(NSRange)charRange affinity:(NSSelectionAffinity)affinity stillSelecting:(BOOL)stillSelectingFlag;
@property (readonly) NSSelectionAffinity selectionAffinity;
@property NSSelectionGranularity selectionGranularity;
// Selected text attributes are applied as temporary attributes to selected text. Candidates include those attributes that do not affect layout.
@property (copy) NSDictionary<NSAttributedStringKey, id> *selectedTextAttributes;
@property (copy) NSColor *insertionPointColor;
- (void)updateInsertionPointStateAndRestartTimer:(BOOL)restartFlag;
// Marked text attributes are applied as temporary attributes to selected text. Candidates include those attributes that do not affect layout.
@property (nullable, copy) NSDictionary<NSAttributedStringKey, id> *markedTextAttributes;
// Link text attributes are applied as temporary attributes to any text with a link attribute. Candidates include those attributes that do not affect layout. Default attributes are blue color, single underline, and the pointing hand cursor.
@property (nullable, copy) NSDictionary<NSAttributedStringKey, id> *linkTextAttributes;
// If set, then text with a link attribute will automatically be treated as if it had an implicit tooltip attribute with the same value as the link attribute. An explicit tooltip attribute will take precedence over this implicit one. The textView:willDisplayToolTip:forCharacterAtIndex: delegate method affects these tooltips as it does any other.
@property BOOL displaysLinkToolTips API_AVAILABLE(macos(10.5));
/************************* Glyph info support *************************/
@property BOOL acceptsGlyphInfo;
/*************************** Other NSTextView methods ***************************/
@property BOOL usesRuler;
@property BOOL usesInspectorBar API_AVAILABLE(macos(10.7));
@property (getter=isContinuousSpellCheckingEnabled) BOOL continuousSpellCheckingEnabled;
- (void)toggleContinuousSpellChecking:(nullable id)sender;
@property (readonly) NSInteger spellCheckerDocumentTag;
// If grammar checking is enabled, then it is performed whenever spellchecking is performed, whether continuously or manually.
@property (getter=isGrammarCheckingEnabled) BOOL grammarCheckingEnabled API_AVAILABLE(macos(10.5));
- (void)toggleGrammarChecking:(nullable id)sender API_AVAILABLE(macos(10.5));
// May be called or overridden to control setting of spelling and grammar indicators. Values are those listed for NSSpellingStateAttributeName. Calls the delegate method textView:shouldSetSpellingState:range:.
- (void)setSpellingState:(NSInteger)value range:(NSRange)charRange API_AVAILABLE(macos(10.5));
@property (copy) NSDictionary<NSAttributedStringKey, id> *typingAttributes;
// These multiple-range methods supersede the corresponding single-range methods. For the first method, the affectedRanges argument obeys the same restrictions as the argument to setSelectedRanges:, and the replacementStrings array should either be nil (for attribute-only changes) or have the same number of elements as affectedRanges. For the remaining three methods, the return values obey the same restrictions as that for selectedRanges, except that they will be nil if the corresponding change is not permitted, where the corresponding single-range methods return (NSNotFound, 0).
- (BOOL)shouldChangeTextInRanges:(NSArray<NSValue *> *)affectedRanges replacementStrings:(nullable NSArray<NSString *> *)replacementStrings;
@property (nullable, readonly, copy) NSArray<NSValue *> *rangesForUserTextChange;
@property (nullable, readonly, copy) NSArray<NSValue *> *rangesForUserCharacterAttributeChange;
@property (nullable, readonly, copy) NSArray<NSValue *> *rangesForUserParagraphAttributeChange;
- (BOOL)shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(nullable NSString *)replacementString;
- (void)didChangeText;
@property (readonly) NSRange rangeForUserTextChange;
@property (readonly) NSRange rangeForUserCharacterAttributeChange;
@property (readonly) NSRange rangeForUserParagraphAttributeChange;
@property BOOL allowsDocumentBackgroundColorChange;
@property (nullable, copy) NSParagraphStyle *defaultParagraphStyle;
@property BOOL allowsUndo;
// May be called to introduce a break in the coalescing of undo actions for user typing, for example at a save point.
- (void)breakUndoCoalescing;
@property (getter=isCoalescingUndo, readonly) BOOL coalescingUndo API_AVAILABLE(macos(10.6));
// Specifies whether image attachments should permit editing of their images, if the text view is editable and the text attachment cell supports image editing.
@property BOOL allowsImageEditing API_AVAILABLE(macos(10.5));
// Applies a temporary highlighting effect, intended to indicate the result of a find operation. Clients should perform any necessary scrolling before calling this method. The effect will be removed after a certain time, or when other actions (such as scrolling) take place, but it can be removed immediately by calling this method again with a zero-length range.
- (void)showFindIndicatorForRange:(NSRange)charRange API_AVAILABLE(macos(10.5));
// Controls whether to show rollover button for extension service items inside text selection. It's enabled by default.
@property BOOL usesRolloverButtonForSelection API_AVAILABLE(macos(10.10));
/*************************** NSText methods ***************************/
@property (nullable, weak) id<NSTextViewDelegate> delegate;
@property (getter=isEditable) BOOL editable;
@property (getter=isSelectable) BOOL selectable;
@property (getter=isRichText) BOOL richText;
@property BOOL importsGraphics;
@property BOOL drawsBackground;
@property (copy) NSColor *backgroundColor;
@property (getter=isFieldEditor) BOOL fieldEditor;
@property BOOL usesFontPanel;
@property (getter=isRulerVisible) BOOL rulerVisible;
- (void)setSelectedRange:(NSRange)charRange;
// Other NSText methods are implemented in the base NSTextView implementation rather than in this category. See NSText.h for declarations.
/*************************** Input Source support ***************************/
/* Returns an array of locale identifiers representing keyboard input sources allowed to be enabled when the receiver has the keyboard focus.
*/
@property (nullable, copy) NSArray<NSString *> *allowedInputSourceLocales API_AVAILABLE(macos(10.5));
@end
@interface NSTextView (NSTextChecking)
/*************************** Smart copy/paste/delete/substitution support ***************************/
@property BOOL smartInsertDeleteEnabled;
- (NSRange)smartDeleteRangeForProposedRange:(NSRange)proposedCharRange;
- (void)toggleSmartInsertDelete:(nullable id)sender;
- (void)smartInsertForString:(NSString *)pasteString replacingRange:(NSRange)charRangeToReplace beforeString:(NSString * _Nullable * _Nullable)beforeString afterString:(NSString * _Nullable * _Nullable)afterString;
- (nullable NSString *)smartInsertBeforeStringForString:(NSString *)pasteString replacingRange:(NSRange)charRangeToReplace;
- (nullable NSString *)smartInsertAfterStringForString:(NSString *)pasteString replacingRange:(NSRange)charRangeToReplace;
@property (getter=isAutomaticQuoteSubstitutionEnabled) BOOL automaticQuoteSubstitutionEnabled API_AVAILABLE(macos(10.5));
- (void)toggleAutomaticQuoteSubstitution:(nullable id)sender API_AVAILABLE(macos(10.5));
@property (getter=isAutomaticLinkDetectionEnabled) BOOL automaticLinkDetectionEnabled API_AVAILABLE(macos(10.5));
- (void)toggleAutomaticLinkDetection:(nullable id)sender API_AVAILABLE(macos(10.5));
@property (getter=isAutomaticDataDetectionEnabled) BOOL automaticDataDetectionEnabled API_AVAILABLE(macos(10.6));
- (void)toggleAutomaticDataDetection:(nullable id)sender API_AVAILABLE(macos(10.6));
@property (getter=isAutomaticDashSubstitutionEnabled) BOOL automaticDashSubstitutionEnabled API_AVAILABLE(macos(10.6));
- (void)toggleAutomaticDashSubstitution:(nullable id)sender API_AVAILABLE(macos(10.6));
@property (getter=isAutomaticTextReplacementEnabled) BOOL automaticTextReplacementEnabled API_AVAILABLE(macos(10.6));
- (void)toggleAutomaticTextReplacement:(nullable id)sender API_AVAILABLE(macos(10.6));
@property (getter=isAutomaticSpellingCorrectionEnabled) BOOL automaticSpellingCorrectionEnabled API_AVAILABLE(macos(10.6));
- (void)toggleAutomaticSpellingCorrection:(nullable id)sender API_AVAILABLE(macos(10.6));
// These two are bulk methods for setting and getting many checking type settings at once. They will call the individual methods as necessary.
@property NSTextCheckingTypes enabledTextCheckingTypes API_AVAILABLE(macos(10.6));
// These two methods usually would not be called directly, since NSTextView itself will call them as needed, but they can be overridden.
- (void)checkTextInRange:(NSRange)range types:(NSTextCheckingTypes)checkingTypes options:(NSDictionary<NSTextCheckingOptionKey, id> *)options API_AVAILABLE(macos(10.6));
- (void)handleTextCheckingResults:(NSArray<NSTextCheckingResult *> *)results forRange:(NSRange)range types:(NSTextCheckingTypes)checkingTypes options:(NSDictionary<NSTextCheckingOptionKey, id> *)options orthography:(NSOrthography *)orthography wordCount:(NSInteger)wordCount API_AVAILABLE(macos(10.6));
- (void)orderFrontSubstitutionsPanel:(nullable id)sender API_AVAILABLE(macos(10.6));
// Ordinarily text checking will occur in the background, and results that replace text will be applied only for text that has been typed in by the user, but these last two methods cause the currently enabled text checking types to be applied immediately to the selection or the document, respectively, with results that replace text applied to all text whatever its origin.
- (void)checkTextInSelection:(nullable id)sender API_AVAILABLE(macos(10.6));
- (void)checkTextInDocument:(nullable id)sender API_AVAILABLE(macos(10.6));
@property BOOL usesFindPanel;
@property BOOL usesFindBar API_AVAILABLE(macos(10.7));
@property (getter=isIncrementalSearchingEnabled) BOOL incrementalSearchingEnabled API_AVAILABLE(macos(10.7));
@end
@interface NSTextView (NSQuickLookPreview)
/*************************** Quick Look support ***************************/
// This action message toggles the visibility state of the Quick Look preview panel if the receiver is the current Quick Look controller.
- (IBAction)toggleQuickLookPreviewPanel:(nullable id)sender API_AVAILABLE(macos(10.7));
// Returns an array of preview items within the specified character ranges. Each preview item conforms to the QLPreviewItem protocol. The NSTextView implementation returns an array of NSURL objects, each url referring to the document URL of a text attachment content if available.
- (NSArray<id<QLPreviewItem>> *)quickLookPreviewableItemsInRanges:(NSArray<NSValue *> *)ranges API_AVAILABLE(macos(10.7));
// Notifies QLPreviewPanel for possible status changes with the data source or controller. Typically invoked from selection changes.
- (void)updateQuickLookPreviewPanel API_AVAILABLE(macos(10.7));
@end
@interface NSTextView (NSTextView_SharingService)
/*************************** NSSharingService support ***************************/
// Creates a new instance of NSSharingServicePicker based on the current selection & shows to the screen. The items passed to the NSSharingServicePicker initializer are determined using -itemsForSharingServiceInRanges:. When the current selection is 0 length, the whole document is passed to the method.
- (IBAction)orderFrontSharingServicePicker:(nullable id)sender API_AVAILABLE(macos(10.8));
@end
#pragma mark NSTouchBar support
/* NSTextView provides support for text formatting and inputting NSTouchBarItems. -[NSTextView makeTouchBar] instantiates an NSTouchBar configured based on settings such as -automaticTextCompletionEnabled and -richText. NSTextView conforms to NSTouchBarDelegate and supplies NSTouchBarItems via -touchBar:makeItemForIdentifier:.
*/
@interface NSTextView (NSTextView_TouchBar) <NSCandidateListTouchBarItemDelegate, NSTouchBarDelegate>
// Enables the automatic completion NSTouchBarItem. YES by default. When YES, NSTextView displays the candidates for the text selection in its NSCandidateListTouchBarItem returned from -candidateListTouchBarItem. Invokes -updateTouchBarItemIdentifiers.
@property (getter=isAutomaticTextCompletionEnabled) BOOL automaticTextCompletionEnabled API_AVAILABLE(macos(10.12.2));
- (IBAction)toggleAutomaticTextCompletion:(nullable id)sender API_AVAILABLE(macos(10.12.2));
// When Yes, NSTouchBarItemIdentifierCharacterPicker is included in -[NSTouchBar itemIdentifiers] for the receiver's NSTouchBar. Default is YES. Invokes -updateTouchBarItemIdentifiers.
@property BOOL allowsCharacterPickerTouchBarItem API_AVAILABLE(macos(10.12.2));
// This message should be sent whenever a property affecting NSTouchBarItem states is changed. It updates -itemIdentifiers for the receiver's NSTouchBar.
- (void)updateTouchBarItemIdentifiers API_AVAILABLE(macos(10.12.2));
// Updates state of text formatting NSTouchBarItems such as NSTouchBarItemIdentifierTextStyle and NSTouchBarItemIdentifierTextAlignment for the receiver based on the current selection.
- (void)updateTextTouchBarItems API_AVAILABLE(macos(10.12.2));
// Updates the candidates for -candidateListTouchBarItem.
- (void)updateCandidates API_AVAILABLE(macos(10.12.2));
// -[NSTextView candidateListTouchBarItem] returns an NSCandidateTouchBarItem instance owned by the receiver. The NSTouchBarItem is instantiated in -[NSTextView touchBar:makeItemForIdentifier:] with NSTouchBarItemIdentifierCandidateList.
@property (nullable, readonly, strong) NSCandidateListTouchBarItem *candidateListTouchBarItem API_AVAILABLE(macos(10.12.2));
@end
#pragma mark NSTextView Factory Methods
@interface NSTextView (NSTextView_Factory)
// Instantiates a new text view enclosed in a scroll view. As with -[NSTextView init*] methods, the objects created with this factory method is configured suitable for UI elements typically used in inspectors. Access the text view via -[NSScrollView documentView].
+ (NSScrollView *)scrollableTextView API_AVAILABLE(macos(10.14));
// Instantiates a new text view configured as a field editor.
+ (instancetype)fieldEditor API_AVAILABLE(macos(10.14));
// Instantiates a new text view configured for displaying the document contents enclosed in a scroll view. Access the text view via -[NSScrollView documentView].
+ (NSScrollView *)scrollableDocumentContentTextView API_AVAILABLE(macos(10.14));
+ (NSScrollView *)scrollablePlainDocumentContentTextView API_AVAILABLE(macos(10.14));
@end
@interface NSTextView (NSDeprecated)
// toggleBaseWritingDirection: will be deprecated in favor of the new NSResponder methods makeBaseWritingDirectionNatural:, makeBaseWritingDirectionLeftToRight:, and makeBaseWritingDirectionRightToLeft:, which NSTextView now implements.
- (void)toggleBaseWritingDirection:(nullable id)sender API_DEPRECATED("Use NSResponder's makeBaseWritingDirectionNatural:, makeBaseWritingDirectionLeftToRight:, and makeBaseWritingDirectionRightToLeft: instead", macos(10.3,10.6));
@end
// Note that all delegation messages come from the first textView
@protocol NSTextViewDelegate <NSTextDelegate>
@optional
// Delegate only.
- (BOOL)textView:(NSTextView *)textView clickedOnLink:(id)link atIndex:(NSUInteger)charIndex;
// Delegate only.
- (void)textView:(NSTextView *)textView clickedOnCell:(id <NSTextAttachmentCell>)cell inRect:(NSRect)cellFrame atIndex:(NSUInteger)charIndex;
// Delegate only.
- (void)textView:(NSTextView *)textView doubleClickedOnCell:(id <NSTextAttachmentCell>)cell inRect:(NSRect)cellFrame atIndex:(NSUInteger)charIndex;
// Delegate only. Allows the delegate to take over attachment dragging altogether.
- (void)textView:(NSTextView *)view draggedCell:(id <NSTextAttachmentCell>)cell inRect:(NSRect)rect event:(NSEvent *)event atIndex:(NSUInteger)charIndex;
// Delegate only. If the previous method is not used, this method and the next allow the textview to take care of attachment dragging and pasting, with the delegate responsible only for writing the attachment to the pasteboard. In this method, the delegate should return an array of types that it can write to the pasteboard for the given attachment.
- (NSArray<NSPasteboardType> *)textView:(NSTextView *)view writablePasteboardTypesForCell:(id<NSTextAttachmentCell>)cell atIndex:(NSUInteger)charIndex;
// Delegate only. In this method, the delegate should attempt to write the given attachment to the pasteboard with the given type, and return success or failure.
- (BOOL)textView:(NSTextView *)view writeCell:(id<NSTextAttachmentCell>)cell atIndex:(NSUInteger)charIndex toPasteboard:(NSPasteboard *)pboard type:(NSPasteboardType)type;
// Delegate only. Will not be called if textView:willChangeSelectionFromCharacterRanges:toCharacterRanges: is implemented. Effectively prevents multiple selection.
- (NSRange)textView:(NSTextView *)textView willChangeSelectionFromCharacterRange:(NSRange)oldSelectedCharRange toCharacterRange:(NSRange)newSelectedCharRange;
// Delegate only. Supersedes textView:willChangeSelectionFromCharacterRange:toCharacterRange:. Return value must be a non-nil, non-empty array of objects responding to rangeValue.
- (NSArray<NSValue *> *)textView:(NSTextView *)textView willChangeSelectionFromCharacterRanges:(NSArray<NSValue *> *)oldSelectedCharRanges toCharacterRanges:(NSArray<NSValue *> *)newSelectedCharRanges;
// Delegate only. Supersedes textView:shouldChangeTextInRange:replacementString:. The affectedRanges argument obeys the same restrictions as selectedRanges, and the replacementStrings argument will either be nil (for attribute-only changes) or have the same number of elements as affectedRanges.
- (BOOL)textView:(NSTextView *)textView shouldChangeTextInRanges:(NSArray<NSValue *> *)affectedRanges replacementStrings:(nullable NSArray<NSString *> *)replacementStrings;
// Delegate only. The delegate should return newTypingAttributes to allow the change, oldTypingAttributes to prevent it, or some other dictionary to modify it.
- (NSDictionary<NSAttributedStringKey, id> *)textView:(NSTextView *)textView shouldChangeTypingAttributes:(NSDictionary<NSString *, id> *)oldTypingAttributes toAttributes:(NSDictionary<NSAttributedStringKey, id> *)newTypingAttributes;
- (void)textViewDidChangeSelection:(NSNotification *)notification;
- (void)textViewDidChangeTypingAttributes:(NSNotification *)notification;
// Delegate only. Allows delegate to modify the tooltip that will be displayed from that specified by the NSToolTipAttributeName, or to suppress display of the tooltip (by returning nil).
- (nullable NSString *)textView:(NSTextView *)textView willDisplayToolTip:(NSString *)tooltip forCharacterAtIndex:(NSUInteger)characterIndex;
// Delegate only. Allows delegate to modify the list of completions that will be presented for the partial word at the given range. Returning nil or a zero-length array suppresses completion. Optionally may specify the index of the initially selected completion; default is 0, and -1 indicates no selection.
- (NSArray<NSString *> *)textView:(NSTextView *)textView completions:(NSArray<NSString *> *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(nullable NSInteger *)index;
// Delegate only. If characters are changing, replacementString is what will replace the affectedCharRange. If attributes only are changing, replacementString will be nil. Will not be called if textView:shouldChangeTextInRanges:replacementStrings: is implemented.
- (BOOL)textView:(NSTextView *)textView shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(nullable NSString *)replacementString;
- (BOOL)textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector;
// Delegate only. Allows delegate to control the setting of spelling and grammar indicators. Values are those listed for NSSpellingStateAttributeName.
- (NSInteger)textView:(NSTextView *)textView shouldSetSpellingState:(NSInteger)value range:(NSRange)affectedCharRange API_AVAILABLE(macos(10.5));
// Delegate only. Allows delegate to control the context menu returned by menuForEvent:. The menu parameter is the context menu NSTextView would otherwise return; charIndex is the index of the character that was right-clicked.
- (nullable NSMenu *)textView:(NSTextView *)view menu:(NSMenu *)menu forEvent:(NSEvent *)event atIndex:(NSUInteger)charIndex API_AVAILABLE(macos(10.5));
// Delegate only. Called by checkTextInRange:types:options:, this method allows control over text checking options (via the return value) or types (by modifying the flags pointed to by the inout parameter checkingTypes).
- (NSDictionary<NSTextCheckingOptionKey, id> *)textView:(NSTextView *)view willCheckTextInRange:(NSRange)range options:(NSDictionary<NSTextCheckingOptionKey, id> *)options types:(NSTextCheckingTypes *)checkingTypes API_AVAILABLE(macos(10.6));
// Delegate only. Called by handleTextCheckingResults:forRange:orthography:wordCount:, this method allows observation of text checking, or modification of the results (via the return value).
- (NSArray<NSTextCheckingResult *> *)textView:(NSTextView *)view didCheckTextInRange:(NSRange)range types:(NSTextCheckingTypes)checkingTypes options:(NSDictionary<NSTextCheckingOptionKey, id> *)options results:(NSArray<NSTextCheckingResult *> *)results orthography:(NSOrthography *)orthography wordCount:(NSInteger)wordCount API_AVAILABLE(macos(10.6));
// Returns an URL representing the document contents for textAttachment. The returned NSURL object is utilized by NSTextView for providing default behaviors involving text attachments such as Quick Look and double-clicking. -[NSTextView quickLookPreviewableItemsInRanges:] uses this method for mapping text attachments to their corresponding document URLs. NSTextView invokes -[NSWorkspace openURL:] with the URL returned from this method when the delegate has no -textView:doubleClickedOnCell:inRect:atPoint: implementation.
- (nullable NSURL *)textView:(NSTextView *)textView URLForContentsOfTextAttachment:(NSTextAttachment *)textAttachment atIndex:(NSUInteger)charIndex API_AVAILABLE(macos(10.7));
// Delegate only. Returns a sharing service picker created for items right before shown to the screen inside -orderFrontSharingServicePicker: method. The delegate specify a delegate for the NSSharingServicePicker instance. Also, it is allowed to return its own NSSharingServicePicker instance instead.
- (nullable NSSharingServicePicker *)textView:(NSTextView *)textView willShowSharingServicePicker:(NSSharingServicePicker *)servicePicker forItems:(NSArray *)items API_AVAILABLE(macos(10.8));
- (nullable NSUndoManager *)undoManagerForTextView:(NSTextView *)view;
// Delegate only. Invoked from -updateTouchBarItemIdentifiers before setting the item identifiers for textView's NSTouchBar.
- (NSArray<NSTouchBarItemIdentifier> *)textView:(NSTextView *)textView shouldUpdateTouchBarItemIdentifiers:(NSArray<NSTouchBarItemIdentifier> *)identifiers API_AVAILABLE(macos(10.12.2));
// Delegate only. Provides customized list of candidates to textView.candidateListTouchBarItem. Invoked from -updateCandidates. NSTextView uses the candidates returned from this method and suppress its built-in candidate generation. Returning nil from this delegate method allows NSTextView to query candidates from NSSpellChecker.
- (nullable NSArray *)textView:(NSTextView *)textView candidatesForSelectedRange:(NSRange)selectedRange API_AVAILABLE(macos(10.12.2));
// Delegate only. Allows customizing the candidate list queried from NSSpellChecker.
- (NSArray<NSTextCheckingResult *> *)textView:(NSTextView *)textView candidates:(NSArray<NSTextCheckingResult *> *)candidates forSelectedRange:(NSRange)selectedRange API_AVAILABLE(macos(10.12.2));
// Delegate only. Notifies the delegate that the user selected the candidate at index in -[NSCandidateListTouchBarItem candidates] for textView.candidateListTouchBarItem. When no candidate selected, index is NSNotFound. Returning YES allows textView to insert the candidate into the text storage if it's NSString, NSAttributedString, or NSTextCheckingResult.
- (BOOL)textView:(NSTextView *)textView shouldSelectCandidateAtIndex:(NSUInteger)index API_AVAILABLE(macos(10.12.2));
// The following delegate-only methods are deprecated in favor of the more verbose ones above.
- (BOOL)textView:(NSTextView *)textView clickedOnLink:(null_unspecified id)link API_DEPRECATED("Use -textView:clickedOnLink:atIndex: instead", macos(10.0,10.6));
- (void)textView:(NSTextView *)textView clickedOnCell:(null_unspecified id <NSTextAttachmentCell>)cell inRect:(NSRect)cellFrame API_DEPRECATED("Use -textView:clickedOnCell:inRect:atIndex: instead", macos(10.0,10.6));
- (void)textView:(NSTextView *)textView doubleClickedOnCell:(null_unspecified id <NSTextAttachmentCell>)cell inRect:(NSRect)cellFrame API_DEPRECATED("Use -textView:doubleClickedOnCell:inRect:atIndex: instead", macos(10.0,10.6));
- (void)textView:(NSTextView *)view draggedCell:(null_unspecified id <NSTextAttachmentCell>)cell inRect:(NSRect)rect event:(null_unspecified NSEvent *)event API_DEPRECATED("Use -textView:draggedCell:inRect:event:atIndex: instead", macos(10.0,10.6));
@end
#pragma mark NSTouchBarItemIdentifiers
/* Standard NSTouchBarItemIdentifiers */
// An NSTouchBarItemIdentifier for a control selecting special characters (i.e. Emoji). -[NSTouchBar itemForIdentifier:] recognizes the identifier.
APPKIT_EXTERN NSTouchBarItemIdentifier const NSTouchBarItemIdentifierCharacterPicker API_AVAILABLE(macos(10.12.2));
/* Identifiers recognized by -[NSTextView touchBar:makeItemForIdentifier:] */
// An NSTouchBarItemIdentifier for a control selecting the text color.
APPKIT_EXTERN NSTouchBarItemIdentifier const NSTouchBarItemIdentifierTextColorPicker API_AVAILABLE(macos(10.12.2));
// An NSTouchBarItemIdentifier for a control selecting the text style.
APPKIT_EXTERN NSTouchBarItemIdentifier const NSTouchBarItemIdentifierTextStyle API_AVAILABLE(macos(10.12.2));
// An NSTouchBarItemIdentifier for a control selecting the text alignment. -[NSTextView touchBarItemForIdentifier:] returns an NSPopoverTouchBarItem.
APPKIT_EXTERN NSTouchBarItemIdentifier const NSTouchBarItemIdentifierTextAlignment API_AVAILABLE(macos(10.12.2));
// An NSTouchBarItemIdentifier for a control inserting the text list style. -[NSTextView touchBarItemForIdentifier:] returns an NSPopoverTouchBarItem.
APPKIT_EXTERN NSTouchBarItemIdentifier const NSTouchBarItemIdentifierTextList API_AVAILABLE(macos(10.12.2));
// An NSTouchBarItemIdentifier for a group of text format controls.
APPKIT_EXTERN NSTouchBarItemIdentifier const NSTouchBarItemIdentifierTextFormat API_AVAILABLE(macos(10.12.2));
// NSOldNotifyingTextView -> the old view, NSNewNotifyingTextView -> the new view. The text view delegate is not automatically registered to receive this notification because the text machinery will automatically switch over the delegate to observe the new first text view as the first text view changes.
APPKIT_EXTERN NSNotificationName NSTextViewWillChangeNotifyingTextViewNotification;
// NSOldSelectedCharacterRange -> NSValue with old range.
APPKIT_EXTERN NSNotificationName NSTextViewDidChangeSelectionNotification;
APPKIT_EXTERN NSNotificationName NSTextViewDidChangeTypingAttributesNotification;
APPKIT_EXTERN NSNotificationName NSTextViewWillSwitchToNSLayoutManagerNotification;
APPKIT_EXTERN NSNotificationName NSTextViewDidSwitchToNSLayoutManagerNotification;
/* These constants are deprecated in favor of their NSTextFinder equivalents. */
/* Values for NSFindPanelAction */
typedef NS_ENUM(NSUInteger, NSFindPanelAction) {
NSFindPanelActionShowFindPanel = 1,
NSFindPanelActionNext = 2,
NSFindPanelActionPrevious = 3,
NSFindPanelActionReplaceAll = 4,
NSFindPanelActionReplace = 5,
NSFindPanelActionReplaceAndFind = 6,
NSFindPanelActionSetFindString = 7,
NSFindPanelActionReplaceAllInSelection = 8,
NSFindPanelActionSelectAll = 9,
NSFindPanelActionSelectAllInSelection = 10
};
/* Values for NSFindPanel search metadata */
APPKIT_EXTERN NSPasteboardType NSFindPanelSearchOptionsPboardType API_AVAILABLE(macos(10.5));
typedef NSString * NSPasteboardTypeFindPanelSearchOptionKey NS_TYPED_ENUM;
APPKIT_EXTERN NSPasteboardTypeFindPanelSearchOptionKey NSFindPanelCaseInsensitiveSearch API_AVAILABLE(macos(10.5)); // BOOL
APPKIT_EXTERN NSPasteboardTypeFindPanelSearchOptionKey NSFindPanelSubstringMatch API_AVAILABLE(macos(10.5)); // NSNumber containing NSFindPanelSubstringMatchType
typedef NS_ENUM(NSUInteger, NSFindPanelSubstringMatchType) {
NSFindPanelSubstringMatchTypeContains = 0,
NSFindPanelSubstringMatchTypeStartsWith = 1,
NSFindPanelSubstringMatchTypeFullWord = 2,
NSFindPanelSubstringMatchTypeEndsWith = 3
};
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSInputManager.h | /*
NSInputManager.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSRange.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSArray, NSAttributedString, NSEvent, NSInputServer, NSImage;
/* NSTextInput is deprecated in Mac OS X 10.6. Use NSTextInputClient instead.
*/
@protocol NSTextInput
- (void) insertText:(null_unspecified id)string API_DEPRECATED("", macos(10.0,10.6)); // instead of keyDown: string can be NSString or NSAttributedString
- (void) doCommandBySelector:(null_unspecified SEL)selector API_DEPRECATED("", macos(10.0,10.6));
// setMarkedText: cannot take a nil first argument. string can be NSString or NSAttributedString
- (void) setMarkedText:(null_unspecified id)string selectedRange:(NSRange)selRange API_DEPRECATED("", macos(10.0,10.6));
- (void) unmarkText API_DEPRECATED("", macos(10.0,10.6));
- (BOOL) hasMarkedText API_DEPRECATED("", macos(10.0,10.6));
- (NSInteger) conversationIdentifier API_DEPRECATED("", macos(10.0,10.6));
/* Returns attributed string at the range. This allows input mangers to query any range in backing-store. May return nil.
*/
- (null_unspecified NSAttributedString *) attributedSubstringFromRange:(NSRange)range API_DEPRECATED("", macos(10.0,10.6));
/* This method returns the range for marked region. If hasMarkedText == false, it'll return NSNotFound location & 0 length range.
*/
- (NSRange) markedRange API_DEPRECATED("", macos(10.0,10.6));
/* This method returns the range for selected region. Just like markedRange method, its location field contains char index from the text beginning.
*/
- (NSRange) selectedRange API_DEPRECATED("", macos(10.0,10.6));
/* This method returns the first frame of rects for range in screen coordindate system.
*/
- (NSRect) firstRectForCharacterRange:(NSRange)range API_DEPRECATED("", macos(10.0,10.6));
/* This method returns the index for character that is nearest to point. thPoint is in screen coordinate system.
*/
- (NSUInteger)characterIndexForPoint:(NSPoint)point API_DEPRECATED("", macos(10.0,10.6));
/* This method is the key to attribute extension. We could add new attributes through this method. NSInputServer examines the return value of this method & constructs appropriate attributed string.
*/
- (null_unspecified NSArray*) validAttributesForMarkedText API_DEPRECATED("", macos(10.0,10.6));
@end
/* NSInputManager is deprecated in Mac OS X 10.6. Use NSTextInputContext instead.
*/
API_DEPRECATED("Use NSTextInputContext instead", macos(10.0,10.6))
@interface NSInputManager : NSObject <NSTextInput>
/* The "current input manager" is the one that is receiving input events at the time this method is called. It may change out from under you, so don't cache the return value.
*/
+ (null_unspecified NSInputManager *) currentInputManager API_DEPRECATED("", macos(10.0,10.6));
/* Cycle through list of input managers. Called from NSKeyBindingManager via doCommandBySelector:.
*/
+ (void)cycleToNextInputLanguage:(nullable id)sender API_DEPRECATED("", macos(10.0,10.6));
+ (void)cycleToNextInputServerInLanguage:(nullable id)sender API_DEPRECATED("", macos(10.0,10.6));
- (null_unspecified NSInputManager *)initWithName:(null_unspecified NSString *)inputServerName host:(null_unspecified NSString *)hostName API_DEPRECATED("", macos(10.0,10.6));
- (null_unspecified NSString *)localizedInputManagerName API_DEPRECATED("", macos(10.0,10.6));
/* These messages are sent by Views that conform to the NSTextInput protocol TO the Current Input Manager when things happen via user or programmatic action. E.g., when the mouse moves outside the marked range, send markedTextWillBeAbandoned:. If the user selects some new text or moves the mouse within the marked region, send markedTextSelectionChanged:. Not all input manager/server combinations will allow all changes, but abandoning of the marked region cannot be aborted.
*/
- (void)markedTextAbandoned:(null_unspecified id)cli API_DEPRECATED("", macos(10.0,10.6)); /* send after abandoning */
- (void)markedTextSelectionChanged:(NSRange)newSel client:(null_unspecified id)cli API_DEPRECATED("", macos(10.0,10.6)); /* send after changing */
/* This corresponds to a server method for input managers that demand to do their own interepretation of command keys as long as they're active. This will typically be called by a key binder to find out whether it shouldn't just pass along strings.
*/
- (BOOL)wantsToInterpretAllKeystrokes API_DEPRECATED("", macos(10.0,10.6));
- (null_unspecified NSString*)language API_DEPRECATED("", macos(10.0,10.6));
- (null_unspecified NSImage *)image API_DEPRECATED("", macos(10.0,10.6));
- (null_unspecified NSInputServer *) server API_DEPRECATED("", macos(10.0,10.6));
/* If corresponding input server wants to handle mouse events within marked region, this should return YES. In that case, handleMouseEvent is sent. Otherwiese, mouse events are handled by first responder.
*/
- (BOOL)wantsToHandleMouseEvents API_DEPRECATED("", macos(10.0,10.6));
- (BOOL)handleMouseEvent:(null_unspecified NSEvent*)mouseEvent API_DEPRECATED("", macos(10.0,10.6));
/* This should return YES when the input method (language) prefers to delay text change notification 'till the input is actually committed.
*/
- (BOOL)wantsToDelayTextChangeNotifications API_DEPRECATED("", macos(10.0,10.6));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSViewController.h | /*
NSViewController.h
Application Kit
Copyright (c) 2006-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSKeyValueBinding.h>
#import <AppKit/NSNib.h>
#import <AppKit/NSNibDeclarations.h>
#import <AppKit/NSResponder.h>
#import <AppKit/NSPopover.h>
#import <AppKit/NSStoryboard.h>
#import <AppKit/NSStoryboardSegue.h>
#import <AppKit/NSUserInterfaceItemIdentification.h>
#import <AppKit/AppKitDefines.h>
@protocol NSExtensionRequestHandling;
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSBundle, NSPointerArray, NSView;
@protocol NSViewControllerPresentationAnimator;
typedef NS_OPTIONS(NSUInteger, NSViewControllerTransitionOptions) {
/* No animation (the default). Specifying any animation from the options below negates the "None" option.
*/
NSViewControllerTransitionNone = 0x0,
/* Basic animation type (optional). This option can be combined with any Slide* option below.
*/
NSViewControllerTransitionCrossfade = 0x1, // Fades the new view in and the old view out.
/* Slide animation (optional). Up and Down are disjoint and can't be combined. Left and Right are disjoint and can't be combined.
*/
NSViewControllerTransitionSlideUp = 0x10, // Animates by sliding the old view up while the new view comes from the bottom.
NSViewControllerTransitionSlideDown = 0x20, // Animates by sliding the old view down while the new view comes from the top.
NSViewControllerTransitionSlideLeft = 0x40, // Animates by sliding the old view to the left while the new view comes in from the right (both views move left).
NSViewControllerTransitionSlideRight = 0x80, // Animates by sliding the old view to the right while the new view comes in from the left (both views move right).
NSViewControllerTransitionSlideForward = 0x140, // Same as "Left", but automatically flips to be "Right" when NSApp.userInterfaceLayoutDirection is Right-to-Left.
NSViewControllerTransitionSlideBackward = 0x180, // Same as "Right", but automatically flips to be "Left" when NSApp.userInterfaceLayoutDirection is Right-to-Left.
NSViewControllerTransitionAllowUserInteraction = 0x1000, // Allow user interaction during the transaction; normally it is prevented for the parent view controller while the transition is happening.
} API_AVAILABLE(macos(10.10));
API_AVAILABLE(macos(10.5))
@interface NSViewController : NSResponder <NSEditor, NSSeguePerforming, NSUserInterfaceItemIdentification>
/* The designated initializer. The specified nib should typically have the class of the file's owner set to NSViewController, or a subclass of yours, with the "view" outlet connected to a view. If you pass in a nil nib name then -nibName will return nil. -loadView can be used to assign a view before -view is invoked. If you pass in a nil bundle then -nibBundle will return nil and -loadView will interpret it using the same rules as -[NSNib initWithNibNamed:bundle:].
On 10.10 and higher, a nil nibName can be used, and NSViewController will automatically attempt to load a view with the same class name. See loadView for more information.
*/
- (instancetype)initWithNibName:(nullable NSNibName)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
/* Return the name of the nib to be loaded to instantiate the view. The default implementation returns whatever value was passed to the initializer.
*/
@property (nullable, copy, readonly) NSNibName nibName;
/* Return the bundle that the nib will be loaded from. The default implementation returns whatever value was passed to the initializer.
*/
@property (nullable, strong, readonly) NSBundle *nibBundle;
/* The object whose value is being presented in the view. The default implementation of -setRepresentedObject: doesn't copy the passed-in object, it retains it. (In another words, "representedObject" is a to-one relationship, not an attribute.) This class is key-value coding and key-value observing compliant for "representedObject" so when you use it as the file's owner of a view's nib you can bind controls to the file's owner using key paths that start with "representedObject."
*/
@property (nullable, strong) id representedObject;
/* The localized title of the view. This class doesn't actually do anything with the value of this property other than hold onto it, and be KVC and KVO compliant for "title." The default implementation of -setTitle: copies the passed-in object ("title" is an attribute). This property is here because so many anticipated uses of this class will involve letting the user choose among multiple named views using a pulldown menu or something like that.
*/
@property (nullable, copy) NSString *title;
/* The default implementation of the getter first invokes [self loadView] if the view hasn't been set yet. After -loadView is called, -viewDidLoad will be called. The setter can be used to assign a view that's created in a different manner than what -view's default implementation would do.
*/
@property (strong) IBOutlet NSView *view;
/* The default implementation of this method invokes [self nibName] and [self nibBundle] and then uses the NSNib class to load the nib with this object as the file's owner. If the "view" outlet of the file's owner in the nib is properly connected, the regular nib loading machinery will send this object a -setView: message. You can override this method to customize how nib loading is done, including merely adding new behavior immediately before or immediately after nib loading done by the default implementation. One can also use viewDidLoad to modify things after the view has been loaded. You should not invoke this method from other objects unless you take care to avoid redundant invocations; NSViewController's default implement can handle them but overrides in subclasses might not. (Typically other objects should instead invoke -view and let the view controller do whatever it takes to fulfill the request.) In general, you should not call this method, and let NSViewController call it when needed. If you need it called, simply call [viewController view].
Prior to 10.10, -loadView would not have well defined behavior if [self nibName] returned nil. On 10.10 and later, if nibName is nil, NSViewController will automatically try to load a nib with the same name as the classname. This allows a convenience of doing [[MyViewController alloc] init] (which has a nil nibName) and having it automatically load a nib with the name "MyViewController".
*/
- (void)loadView;
/* Conformance to KVB's NSEditor informal protocol. The default implementations of these methods pass on the message to each registered editor, which are typically controls in the nib that are bound to the nib file's owner. You can override these methods to customize what is done when your view's presentation to the user is about to end because, for example, the user has selected another of a set of views or hit a panel's OK button (committing time) or because the user has hit a panel's Cancel button (discarding time). This class also conforms to KVB's NSEditorRegistration protocol, but you're not encouraged to override those methods.
*/
- (void)commitEditingWithDelegate:(nullable id)delegate didCommitSelector:(nullable SEL)didCommitSelector contextInfo:(nullable void *)contextInfo;
- (BOOL)commitEditing;
- (void)discardEditing;
/* Called after the view has been loaded. For view controllers created in code, this is after -loadView. For view controllers unarchived from a nib, this is after the view is set. Default does nothing.
*/
- (void)viewDidLoad API_AVAILABLE(macos(10.10));
/* Returns whether the view has been loaded or not.
*/
@property (readonly, getter=isViewLoaded) BOOL viewLoaded API_AVAILABLE(macos(10.10));
/* Called when the view is about to appear, meaning it is going from a state of being "hidden" or having a hidden ancestor, and/or not being in a window or being in a window that is ordered out, to a state where none of these conditions is true. Default does nothing. In general, it is good practice to call [super viewWillAppear] in case a superclass implements this method. Causing a view to become hidden or removed from its window, or causing its window to be ordered out, in response to -viewWillAppear is not recommended and may result in an exception being raised. When such responses are necessary, defer them to a future runloop cycle.
*/
- (void)viewWillAppear API_AVAILABLE(macos(10.10));
/* Called when the view has been fully transitioned onto the screen, meaning it is not "hidden", does not have a hidden ancestor, and is in a window that's ordered in. Default does nothing. In general, it is good practice to call [super viewDidAppear] in case a superclass implements this method.
*/
- (void)viewDidAppear API_AVAILABLE(macos(10.10));
/* Called when the view is about to disappear, meaning it is going from a state of not being "hidden", nor having a hidden ancestor, nor having a nil window or being in a window that's ordered out, to a state where at least one of these conditions is true. Default does nothing. In general, it is good practice to call [super viewWillDisappear] in case a superclass implements this method. Causing a view to become unhidden, or causing its window to be ordered in, in response to -viewWillDisappear is not recommended and may result in an exception being raised. When such responses are necessary, defer them to a future runloop cycle.
*/
- (void)viewWillDisappear API_AVAILABLE(macos(10.10));
/* Called after the view has been fully transitioned off the screen, meaning it is now "hidden" or has a hidden ancestor, or it not in a window, or is in a window that is ordered out. Default does nothing. In general, it is good practice to call [super viewDidDisappear] in case a superclass implements this method.
*/
- (void)viewDidDisappear API_AVAILABLE(macos(10.10));
/* Expresses the view's desired size. May be consulted by a parent ViewController when performing layout.
*/
@property NSSize preferredContentSize API_AVAILABLE(macos(10.10));
/* The base implementation sends -updateConstraints to the view. When a view has a view controller, this message is sent to the view controller during the autolayout updateConstraints pass in lieu of sending updateConstraints directly to the view. You may override this method in a NSViewController subclass for updating custom constraints instead of subclassing your view and overriding -[NSView updateConstraints]. Overrides must call super or send -updateConstraints to the view. This method is only called for applications that link on 10.10 and higher.
*/
- (void)updateViewConstraints API_AVAILABLE(macos(10.10));
/* Called just before the view controller's view's layout method is invoked. Subclasses can implement as necessary. The default is a no-op.
*/
- (void)viewWillLayout API_AVAILABLE(macos(10.10));
/* Called just after the view controller's view's layout method is invoked. Subclasses can implement as necessary. The default is a no-op.
*/
- (void)viewDidLayout API_AVAILABLE(macos(10.10));
@end
@interface NSViewController (NSViewControllerPresentation)
/* Presents the viewController with a specific animator that handles both the presentation and dismissal of the viewController. The animator is held onto until dismissViewController: is called. This is the fundamental primitive for displaying view controllers that block interaction in some way. The method will assert if animator is nil. In general, you will not directly call this method unless you have a custom animator. Instead, you will use one of the standard cover methods that provide the animator: [NSViewController presentViewControllerAsSheet:], [NSViewController presentViewControllerAsModalWindow:], [NSViewController presentViewController:asPopoverRelativeToRect:...]
*/
- (void)presentViewController:(NSViewController *)viewController animator:(id <NSViewControllerPresentationAnimator>)animator API_AVAILABLE(macos(10.10));
/* Dismisses the viewController that was previously presented with the same animator that presented the viewController. This is the generic way to close a given viewController, no matter how it was presented.
*/
- (void)dismissViewController:(NSViewController *)viewController API_AVAILABLE(macos(10.10));
/* Dismisses the receiver. If the receiver’s presenter is an NSViewController, it will be sent a -dismissViewController: message with this receiver as the parameter. Does nothing if the receiver is not currently presented.
*/
- (IBAction)dismissController:(nullable id)sender API_AVAILABLE(macos(10.10));
/* The view controllers that were presented by this view controller. In other words, 'self' displayed each of the items in the array. This is a one-to-many relationship.
*/
@property (nullable, readonly) NSArray<__kindof NSViewController *> *presentedViewControllers API_AVAILABLE(macos(10.10));
/* The view controller that presented this view controller (or its farthest ancestor). In other words, 'presentingViewController' is the one that displayed 'self' to screen.
*/
@property (nullable, readonly, assign) NSViewController *presentingViewController API_AVAILABLE(macos(10.10));
@end
@interface NSViewController(NSViewControllerPresentationAndTransitionStyles)
/* Presents the viewController as a sheet. The viewController is made the delegate and contentViewController of the sheet while it is shown. This method calls [self presentViewController:viewController animator:] with an animator that controls the sheet animation. Call [presentingViewController dismissViewController:viewController] to close the viewController that was previously shown as a sheet.
*/
- (void)presentViewControllerAsSheet:(NSViewController *)viewController API_AVAILABLE(macos(10.10));
/* Presents the viewController as a modal window (also known as an alert). The viewController is made the delegate and contentViewController of the window while it is shown. NSWindow delegate methods can be used to prevent closing of the window (if needed). This method calls [self presentViewController:viewController animator:] with an animator that controls the displaying of the window. Call [presentingViewController dismissViewController:viewController] to close the viewController that was previously shown as a modal window.
*/
- (void)presentViewControllerAsModalWindow:(NSViewController *)viewController API_AVAILABLE(macos(10.10));
/* Presents the viewController as a popover. The viewController is made the delegate and contentViewController of the popover while it is shown. NSPopover delegate methods can be used to customize the popover. This method calls [self presentViewController:viewController animator:] with an animator that controls the displaying of the popover. Call [presentingViewController dismissViewController:viewController] to close the viewController that was previously shown as a popover.
*/
- (void)presentViewController:(NSViewController *)viewController asPopoverRelativeToRect:(NSRect)positioningRect ofView:(NSView *)positioningView preferredEdge:(NSRectEdge)preferredEdge behavior:(NSPopoverBehavior)behavior API_AVAILABLE(macos(10.10));
/* This method can be used to transition between sibling child view controllers. The receiver of this method is their common parent view controller. (Use [NSViewController addChildViewController:] to create the parent/child relationship.) This method will add the toViewController's view to the superview of the fromViewController's view. The fromViewController's view will be removed from the parent at the appropriate time. It is important to allow this method to add and remove the views. This method will throw an exception/assertion if the parent view controllers are not the same as the receiver, or if fromViewController.view does not have a superview.
*/
- (void)transitionFromViewController:(NSViewController *)fromViewController toViewController:(NSViewController *)toViewController options:(NSViewControllerTransitionOptions)options completionHandler:(void (^ _Nullable)(void))completion API_AVAILABLE(macos(10.10));
@end
@interface NSViewController(NSViewControllerContainer)
/* Returns the ancestor of this view controller. Can return nil if this is the contentViewController, or there is no parent for the given view controller.
*/
@property (nullable, readonly) NSViewController *parentViewController API_AVAILABLE(macos(10.10));
/* An array of children view controllers. Assignment of the array filters all additions and removals through the insert and remove API below.
*/
@property (copy) NSArray<__kindof NSViewController *> *childViewControllers API_AVAILABLE(macos(10.10));
/* A convenience method for adding a child view controller; this simply calls insertChildViewController:atIndex: at the end of the array.
*/
- (void)addChildViewController:(NSViewController *)childViewController API_AVAILABLE(macos(10.10));
/* Removes the child controller from this parent controller. This method simply calls [self.parentViewController removeChildViewControllerAtIndex:index] with the appropriate index in the array.
*/
- (void)removeFromParentViewController API_AVAILABLE(macos(10.10));
/* Primitive method to insert a child view controller in the childViewControllers array. If the child controller has a different parent controller, it will first be removed from its current parent by calling [childViewController removeFromParentViewController]. If this method is overridden then the super implementation should be called. This is the primitive to override for performing insert operations in a container class, and has little value in itself if the parent doesn't do something with the children.
*/
- (void)insertChildViewController:(NSViewController *)childViewController atIndex:(NSInteger)index API_AVAILABLE(macos(10.10));
/* Primitive method to remove a child view controller in the childViewControllers array. This method can be overridden to do additional work when a child is removed. If it is overridden, then the super implementation should be called. This is the primitive to override for performing insert operations in a container class, and has little value in itself if the parent doesn't do something with the children. */
- (void)removeChildViewControllerAtIndex:(NSInteger)index API_AVAILABLE(macos(10.10));
/* Sent to a view controller when the `preferredContentSize` property of one of its child or presented view controllers changes.
*/
- (void)preferredContentSizeDidChangeForViewController:(NSViewController *)viewController API_AVAILABLE(macos(10.10));
/* Sent to a service view controller when its view is about to be resized. Override this, if desired, to perform relayout in response to the resize, potentially in an animated way.
*/
- (void)viewWillTransitionToSize:(NSSize)newSize API_AVAILABLE(macos(10.10));
@end
/* A presentation animator is responsible for both presenting and dismissing a view controller's view. It can be presented in any way the animator wishes. Normally you do not need to implement this protocol, unless you want to have a custom presentation.
*/
@protocol NSViewControllerPresentationAnimator <NSObject>
@required
/* Called when the view controller is going to be presented. Implement presentation in this method when it is called.
*/
- (void)animatePresentationOfViewController:(NSViewController *)viewController fromViewController:(NSViewController *)fromViewController API_AVAILABLE(macos(10.10));
/* Called to dismiss a previously shown view controller.
*/
- (void)animateDismissalOfViewController:(NSViewController *)viewController fromViewController:(NSViewController *)fromViewController API_AVAILABLE(macos(10.10));
@end
/* These methods are used to support using Storyboards with your app.
*/
@interface NSViewController (NSViewControllerStoryboardingMethods)
/* The Storyboard the ViewController was loaded from. Returns nil if the ViewController was not loaded from a Storyboard.
*/
@property(nullable, readonly, strong) NSStoryboard *storyboard API_AVAILABLE(macos(10.10));
@end
@interface NSViewController(NSExtensionAdditions) <NSExtensionRequestHandling>
/* Returns the extension context. Also acts as a convenience method for a view controller to check if it participating in an extension request.
*/
@property (nullable, readonly,retain) NSExtensionContext *extensionContext API_AVAILABLE(macos(10.10));
/* For services that vend UI. Identifies the view (if any) in the service’s UI that displays the source image. Defaults to nil. When your service loads its UI (or in your service UI's xib file), you can set this to point to an image view, or some containing border view, that’s a descendant of the ViewController’s view. Doing so helps the system to position and animate the service’s UI with respect to the source item representation. If your service UI doesn't display the source item at its original screen position and size, leave this set to nil.
*/
@property(nullable, strong) IBOutlet NSView *sourceItemView API_AVAILABLE(macos(10.10));
/* For services that vend UI. Set this to position the service UI's lower-left corner in screen space. (Use the `preferredContentSize` property to specify the service UI's desired size, in screen units.)
*/
@property NSPoint preferredScreenOrigin API_AVAILABLE(macos(10.10));
/* For services that vend UI. Expresses the smallest allowable size for the service’s root view, in screen units. A service should return the minimum dimensions its root view can accommodate, based on the items the service has been sent. This defaults to a small but non-empty size.
*/
@property(readonly) NSSize preferredMinimumSize API_AVAILABLE(macos(10.10));
/* For services that vend UI. Expresses the largest allowable size for the service’s root view, in screen units. A service should return the maximum dimensions that are potentially useful for its root view, based on the items the service has been sent. This defaults to a large or infinite size.
*/
@property(readonly) NSSize preferredMaximumSize API_AVAILABLE(macos(10.10));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSCIImageRep.h | /*
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
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.