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/NSDataAsset.h | /*
NSDataAsset.h
Application Kit
Copyright (c) 2015-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
#if !TARGET_OS_IPHONE
typedef NSString * NSDataAssetName NS_SWIFT_BRIDGED_TYPEDEF API_AVAILABLE(ios(9.0), macos(10.11), tvos(9.0), watchos(2.0));
/* An NSDataAsset instance provides access to a data entry in an asset catalog such as Images.xcassets. Data entries and image entries in asset catalogs do not share the same namespace. For example, if an asset catalog contains an image entry named @"foo" but no data entry named @"foo", [[NSDataAsset alloc] initWithName:@"foo"] will return nil.
*/
API_AVAILABLE(ios(9.0), macos(10.11), tvos(9.0), watchos(2.0)) @interface NSDataAsset : NSObject<NSCopying>
- (instancetype)init NS_UNAVAILABLE;
/// Equivalent to -initWithName:name bundle:[NSBundle mainBundle];
- (nullable instancetype)initWithName:(NSDataAssetName)name;
/// Create a data asset with the given name from the given bundle. Returns nil if the asset was not found.
- (nullable instancetype)initWithName:(NSDataAssetName)name bundle:(NSBundle *)bundle NS_DESIGNATED_INITIALIZER;
/// The name used to reference the data asset
@property (readonly, copy) NSDataAssetName name;
/// The data for this asset, as stored in the asset catalog
@property (readonly, copy) NSData *data;
/// The Uniform Type Identifier for this data object.
@property (readonly, copy) NSString *typeIdentifier;
@end
#endif // !TARGET_OS_IPHONE
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSPanel.h | /*
NSPanel.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSWindow.h>
#import <AppKit/AppKitDefines.h>
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@interface NSPanel : NSWindow
@property (getter=isFloatingPanel) BOOL floatingPanel;
@property BOOL becomesKeyOnlyIfNeeded;
@property BOOL worksWhenModal;
@end
/* Deprecated API */
APPKIT_EXTERN NSInteger NSRunAlertPanelRelativeToWindow(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, ...) API_DEPRECATED("Use NSAlert, and present it with -[NSAlert beginSheetModalForWindow:completionHandler:] instead", macos(10.0,10.0));
APPKIT_EXTERN NSInteger NSRunInformationalAlertPanelRelativeToWindow(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, ...) API_DEPRECATED("Use NSAlert with a style of NSAlertStyleInformational, and present it with -[NSAlert beginSheetModalForWindow:completionHandler:] instead", macos(10.0,10.0));
APPKIT_EXTERN NSInteger NSRunCriticalAlertPanelRelativeToWindow(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, ...) API_DEPRECATED("Use NSAlert with a style of NSAlertStyleCritical, and present it with -[NSAlert beginSheetModalForWindow:completionHandler:] instead", macos(10.0,10.0));
APPKIT_EXTERN NSInteger NSRunAlertPanel(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...) NS_FORMAT_FUNCTION(2,6) API_DEPRECATED("Use NSAlert instead", macos(10.0,10.10));
APPKIT_EXTERN NSInteger NSRunInformationalAlertPanel(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...) NS_FORMAT_FUNCTION(2,6) API_DEPRECATED("Use NSAlert with a style of NSAlertStyleInformational, and present it with -[NSAlert runModal] instead", macos(10.0,10.10));
APPKIT_EXTERN NSInteger NSRunCriticalAlertPanel(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...) NS_FORMAT_FUNCTION(2,6) API_DEPRECATED("Use NSAlert with a style of NSAlertStyleCritical, and present it with -[NSAlert runModal] instead", macos(10.0,10.10));
APPKIT_EXTERN void NSBeginAlertSheet(NSString *title, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, id modalDelegate, SEL didEndSelector, SEL didDismissSelector, void *contextInfo, NSString *msgFormat, ...) NS_FORMAT_FUNCTION(10,11) API_DEPRECATED("Use NSAlert, and present it with -[NSAlert beginSheetModalForWindow:completionHandler:] instead", macos(10.0,10.10));
APPKIT_EXTERN void NSBeginInformationalAlertSheet(NSString *title, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, id modalDelegate, SEL didEndSelector, SEL didDismissSelector, void *contextInfo, NSString *msgFormat, ...)NS_FORMAT_FUNCTION(10,11) API_DEPRECATED("Use NSAlert with a style of NSAlertStyleInformational, and present it with -[NSAlert beginSheetModalForWindow:completionHandler:] instead", macos(10.0,10.10));
APPKIT_EXTERN void NSBeginCriticalAlertSheet(NSString *title, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, id modalDelegate, SEL didEndSelector, SEL didDismissSelector, void *contextInfo, NSString *msgFormat, ...) NS_FORMAT_FUNCTION(10,11) API_DEPRECATED("Use NSAlert with a style of NSAlertStyleCritical, and present it with -[NSAlert beginSheetModalForWindow:completionHandler:] instead", macos(10.0,10.10));
APPKIT_EXTERN id NSGetAlertPanel(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...) NS_FORMAT_FUNCTION(2,6) API_DEPRECATED("Use NSAlert", macos(10.0,10.10));
APPKIT_EXTERN id NSGetInformationalAlertPanel(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...) NS_FORMAT_FUNCTION(2,6) API_DEPRECATED("Use NSAlert with a style of NSAlertStyleInformational instead", macos(10.0,10.10));
APPKIT_EXTERN id NSGetCriticalAlertPanel(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...) NS_FORMAT_FUNCTION(2,6) API_DEPRECATED("Use NSAlert with a style of NSAlertStyleCritical instead", macos(10.0,10.10));
APPKIT_EXTERN void NSReleaseAlertPanel(id panel) API_DEPRECATED("Use NSAlert instead", macos(10.0,10.10));
/*
These constants are used by deprecated NSRunAlertPanel() and NSGetAlertPanel() functions.
Modern NSAlert API uses NSAlertFirstButtonReturn, etc.
*/
enum {
NSAlertDefaultReturn API_DEPRECATED("Use NSAlertFirstButtonReturn with an NSAlert presentation instead", macos(10.0,10.10)) = 1,
NSAlertAlternateReturn API_DEPRECATED("Use NSAlertFirstButtonReturn and other NSModalResponses with an NSAlert presentation instead", macos(10.0,10.10)) = 0,
NSAlertOtherReturn API_DEPRECATED("Use NSAlertFirstButtonReturn and other NSModalResponses with an NSAlert presentation instead", macos(10.0,10.10)) = -1,
NSAlertErrorReturn API_DEPRECATED("Use NSAlertFirstButtonReturn and other NSModalResponses with an NSAlert presentation instead", macos(10.0,10.10)) = -2
};
enum {
NSOKButton API_DEPRECATED_WITH_REPLACEMENT("NSModalResponseOK", macos(10.0,10.10)) = NSModalResponseOK,
NSCancelButton API_DEPRECATED_WITH_REPLACEMENT("NSModalResponseCancel", macos(10.0,10.10)) = NSModalResponseCancel,
};
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/NSGradient.h | /*
NSGradient.h
Application Kit
Copyright (c) 2006-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSBezierPath, NSColor, NSColorSpace;
typedef NS_OPTIONS(NSUInteger, NSGradientDrawingOptions) {
NSGradientDrawsBeforeStartingLocation = (1 << 0),
NSGradientDrawsAfterEndingLocation = (1 << 1),
};
/* An NSGradient defines a transition between colors. The transition is defined over a range from 0.0 to 1.0 inclusive. A gradient typically contains a color at location 0.0, and one at location 1.0 with additional colors assigned to locations between 0.0 and 1.0.
An NSGradient is a drawing primitive that can draw itself as a linear or radial gradient. The color value at location 0.0 is considered the starting color, the color value at location 1.0 is considered the ending color. A primitive drawing method is provided for both linear and radial gradients. Each primitive drawing method provides flexibility in specifying the location of its respective gradient. These primitive drawing methods perform no clipping before drawing.
In addition, convenience drawing methods take a rectangle or path, and automatically calculate staring and ending locations and perform clipping to provide a convenient means for drawing gradient fills. Two of the convenience methods are demonstrated below:
The following code will fill a rectangle with a 45 degree linear gradient, from black to white:
NSRect rect; // assume this exists
NSGradient *gradient = [[NSGradient alloc] initWithStartingColor: [NSColor blackColor] endingColor: [NSColor whiteColor]];
[gradient drawInRect: rect angle: 45.0];
[gradient release];
The following code will fill an arbitrary bezier path with a radial gradient, from the center of the path's bounding box, that transitions through three colors, evenly distributed in the gradient from 0.0 to 1.0.
NSBezierPath *path // assume this exists
NSArray *colorArray = [NSArray arrayWithObjects: [NSColor blueColor], [NSColor yellowColor], [NSColor orangeColor], nil];
NSGradient *gradient = [[NSGradient alloc] initWithColors: colorArray];
[gradient drawInBezierPath: path relativeCenterPosition: NSZeroPoint];
[gradient release];
An NSGradient has a color space. When initialized, all colors provided are converted to that color space, and interpolation of colors occurs using the components of that color space. The designated initializer takes a color space argument, all other initializers use the default generic RGB color space.
*/
API_AVAILABLE(macos(10.5))
@interface NSGradient : NSObject <NSCopying, NSSecureCoding>
/* Initializes a gradient with starting color at location 0.0 and ending color at location 1.0 The color space returned by [NSColorSpace genericRGBColorSpace] is used.
*/
- (nullable instancetype)initWithStartingColor:(NSColor *)startingColor endingColor:(NSColor *)endingColor;
/* Initializes a gradient with the first color in the array at 0.0, the last color in the array at 1.0, and intervening colors at equal intervals in between. The color space returned by [NSColorSpace genericRGBColorSpace] is used.
*/
- (nullable instancetype)initWithColors:(NSArray<NSColor *> *)colorArray;
/* This initializer takes the first color, then the first location as a CGFloat, then an alternating list of colors and CGFloats, terminated by nil. If no color is provided for 0.0 or 1.0, the created color gradient will use the color provided at the locations closest to 0.0 and 1.0 for those values. The color space returned by [NSColorSpace genericRGBColorSpace] is used.
For example:
NSGradient *gradient = [[NSGradient alloc] initWithColorsAndLocations: [NSColor blackColor], 0.0, [NSColor blueColor], 0.33, [NSColor cyanColor], 0.45, [NSColor orangeColor], 0.72, [NSColor redColor], 1.0, nil];
*/
- (nullable instancetype)initWithColorsAndLocations:(NSColor *)firstColor, ... NS_REQUIRES_NIL_TERMINATION;
/* Initializes a gradient by pairing the colors provided in the color array with the locations provided in the locations array. Each location should be a CGFloat between 0.0 and 1.0. The color array and location array should not be empty, and should contain the same number of items. If no color is provided for 0.0 or 1.0, the created color gradient will use the color provided at the locations closest to 0.0 and 1.0 for those values. This is the designated initializer.
*/
- (nullable instancetype)initWithColors:(NSArray<NSColor *> *)colorArray atLocations:(nullable const CGFloat *)locations colorSpace:(NSColorSpace *)colorSpace NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
/* DRAWING LINEAR GRADIENTS */
/* Draws a linear gradient from start point to end point. The option flags control whether the gradient draws itself before the start point, or after the end point. The gradient is drawn in the current graphics context without performing any additinal clipping. This is the primitive method for drawing a linear gradient.
*/
- (void)drawFromPoint:(NSPoint)startingPoint toPoint:(NSPoint)endingPoint options:(NSGradientDrawingOptions)options;
/* Convenience method for drawing a linear gradient to fill a rectangle. Draws a linear gradient clipped to the provided rect. The start point and end point are calculated with respect to the provided rect so that the gradient is drawn at the provided angle in degrees. The end points are located such that both the start and end color in the gradient are visible in the rect.
*/
- (void)drawInRect:(NSRect)rect angle:(CGFloat)angle;
/* Convenience method for drawing a linear gradient to fill a path. Draws a linear gradient clipped by the provided path. The start point and end point are calculated with respect to the provided path so that the gradient is drawn at the provided angle in degrees. The end points are located such that both the start and end color in the gradient are visible in the path.
*/
- (void)drawInBezierPath:(NSBezierPath *)path angle:(CGFloat)angle;
/* DRAWING RADIAL GRADIENTS */
/* Draws a radial gradient between two circles defined by the center point and radius of each circle. The option flags control whether the gradient draws itself before the start point, or after the end point. The gradient is drawn in the current graphics context without performing any additinal clipping. This is the primitive method for drawing a radial gradient.
*/
- (void)drawFromCenter:(NSPoint)startCenter radius:(CGFloat)startRadius toCenter:(NSPoint)endCenter radius:(CGFloat)endRadius options:(NSGradientDrawingOptions)options;
/* Convenience method for drawing a radial gradient to fill a rect. Draws a radial gradient clipped by the provided rect. The starting circle is always a single point located at the center of the ending circle which encloses the drawn rect. The radius of the ending circle is determined by the relative center position.
The relative center position proportionally adjusts the center location of the radial gradient. It maps the four corners of the rectangle to (-1.0, -1.0), (1.0, -1.0), (1.0, 1.0) and (-1.0, 1.0), with (0.0, 0.0) in the center of the rectangle. Use NSZeroPoint to center the radial gradient in the rect. The radius of the ending circle is the distance from the relative center to the opposite corner of the rect.
*/
- (void)drawInRect:(NSRect)rect relativeCenterPosition:(NSPoint)relativeCenterPosition;
/* Convenience method for drawing a radial gradient to fill a path. Draws a radial gradient clipped by the provided path. The starting circle is always a single point located at the center of the ending circle which encloses the drawn path. The radius of the ending circle is determined by the relative center position.
The relative center position proportionally adjusts the center location of the radial gradient. It maps the four corners of the path bounding rect to (-1.0, -1.0), (1.0, -1.0), (1.0, 1.0) and (-1.0, 1.0), with (0.0, 0.0) in the center of path bounding rect. Use NSZeroPoint to center the radial gradient in the path bounding rect. The radius of the ending circle is the distance from the relative center to the opposite corner of the path bounding rect.
*/
- (void)drawInBezierPath:(NSBezierPath *)path relativeCenterPosition:(NSPoint)relativeCenterPosition;
/* These methods are primarily for the use of controls which manipulate the color gradient.
*/
/* Returns the color space of the gradient */
@property (readonly, strong) NSColorSpace *colorSpace;
/* The number of color stops in the color gradient */
@property (readonly) NSInteger numberOfColorStops;
/* Returns the color and location at a particular index in the color gradient */
- (void)getColor:(NSColor * _Nonnull * _Nullable)color location:(nullable CGFloat *)location atIndex:(NSInteger)index;
/* This method will return the interpolated gradient value at the given location. For example, in a two color gradient with white at location 0.0 and black at location 1.0, the interpolated color at location 0.5 would be 50% gray.
You should not need to override this method, it reports the color value of the gradient at a particular location, and does not affect the drawn color values.
*/
- (NSColor *)interpolatedColorAtLocation:(CGFloat)location;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTouchBar.h | /*
NSTouchBar.h
Application Kit
Copyright (c) 2015-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSTouchBarItem.h>
#if !TARGET_OS_IPHONE
#import <AppKit/NSApplication.h>
#import <AppKit/NSResponder.h>
#endif
NS_ASSUME_NONNULL_BEGIN
typedef NSString * NSTouchBarCustomizationIdentifier NS_SWIFT_BRIDGED_TYPEDEF API_AVAILABLE(ios(13.0));
@protocol NSTouchBarDelegate, NSTouchBarProvider;
API_AVAILABLE(macos(10.12.2), ios(13.0)) NS_SWIFT_UI_ACTOR
@interface NSTouchBar : NSObject <NSCoding>
/*
-init is a designated initializer.
*/
- (instancetype)init NS_DESIGNATED_INITIALIZER;
/*
-initWithCoder: is also a designated initializer.
*/
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
/*
A string uniquely identifying this bar for customization purposes. All bars with this identifier will have their items coordinated automatically during customization or instantiation.
NSTouchBars lacking a customizationIdentifier are not customizable.
This property is archived.
*/
@property (copy, nullable) NSTouchBarCustomizationIdentifier customizationIdentifier;
/*
The items that are presented in the customization palette for the user to add to the NSTouchBar. These items will be presented to the user in the order specified in this array.
This property is archived.
*/
@property (copy) NSArray<NSTouchBarItemIdentifier> *customizationAllowedItemIdentifiers;
/*
Some items are too important to be removed. The corresponding item identifiers should be listed here. During customization the user will be prevented from removing these items from the NSTouchBar.
This property is archived.
*/
@property (copy) NSArray<NSTouchBarItemIdentifier> *customizationRequiredItemIdentifiers;
/*
An array of identifiers specifying the items in this NSTouchBar. When constructing the instantiated items array, the identifiers in this array will be fed through the -itemForIdentifier: method.
Item identifiers should be globally unique, excepting NSTouchBarItemIdentifierFixedSpaceSmall, NSTouchBarItemIdentifierFixedSpaceLarge, NSTouchBarItemIdentifierFlexibleSpace, and NSTouchBarItemIdentifierOtherItemsProxy.
This array also corresponds to the item ordering for the receiver in the “default set” in the customization palette.
This property is archived.
*/
@property (copy) NSArray<NSTouchBarItemIdentifier> *defaultItemIdentifiers;
/*
The resolved array of item identifiers. If the bar has not been customized this will match the defaultItemIdentifiers.
This property is not archived.
*/
@property (copy, readonly) NSArray<NSTouchBarItemIdentifier> *itemIdentifiers;
/*
Specifying a principal item identifier communicates that the item with that identifier has special significance to this NSTouchBar. Currently, that item will be placed in the center of the resolved row. Note that multiple visible bars may each specify a principal item identifier - but only one of them can have the request honored.
This property is archived.
*/
@property (copy, nullable) NSTouchBarItemIdentifier principalItemIdentifier;
/*
An item identifier designating an item that replaces the standard system escape key. The item may be located in the templateItems set, or provided by the delegate.
This property is not archived.
*/
@property (copy, nullable) NSTouchBarItemIdentifier escapeKeyReplacementItemIdentifier;
/*
Items in this set are the first step in resolving instantiated items from their identifiers. If an item identifier is specified in the itemIdentifiers array, and an item with that identifier is in this set, it will be added to the items array in the corresponding location.
This property is archived.
*/
@property (copy) NSSet<NSTouchBarItem *> *templateItems;
/*
The NSTouchBar delegate. The delegate can dynamically create items.
This property is conditionally archived (see -encodeConditionalObject:forKey:.)
*/
@property (nullable, weak) id <NSTouchBarDelegate> delegate;
/*
Returns an instantiated NSTouchBarItem for the given identifier. Items are resolved from the following locations, in order:
* items already in the instantiated items array
* items in the defaultTouchBarItems set
* items returned from the delegate's -touchBar:makeItemForIdentifier: method
* some special identifiers are handled automatically
NSTouchBarItemIdentifierFixedSpaceSmall -> NSTouchBar will automatically create a standard small space
NSTouchBarItemIdentifierFixedSpaceLarge -> NSTouchBar will automatically create a standard large space
NSTouchBarItemIdentifierFlexibleSpace -> NSTouchBar will automatically create a standard flexible space
NSTouchBarItemIdentifierOtherItemsProxy -> NSTouchBar will automatically create a special item that acts as a proxy for the items of NSTouchBar closer to the first responder.
*/
- (nullable __kindof NSTouchBarItem *)itemForIdentifier:(NSTouchBarItemIdentifier)identifier;
/*
When YES, the NSTouchBar is attached to an eligible NSTouchBar provider, and its items are displayable, assuming adequate space.
This property is key value observable.
*/
@property (readonly, getter=isVisible) BOOL visible;
/*
Convenience method for the NSApp's automaticCustomizeTouchBarMenuItemEnabled property.
*/
@property (class, getter=isAutomaticCustomizeTouchBarMenuItemEnabled) BOOL automaticCustomizeTouchBarMenuItemEnabled API_AVAILABLE(macos(10.15), ios(13.0));
@end
API_AVAILABLE(ios(13.0))
@protocol NSTouchBarDelegate <NSObject>
@optional
/*
When constructing the items array, this delegate method will be invoked to construct an NSTouchBarItem if that item cannot be found in the `templateItems` set.
*/
- (nullable NSTouchBarItem *)touchBar:(NSTouchBar *)touchBar makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier;
@end
/*
Instances of NSTouchBar are discovered by searching certain well known components of the application for objects that conform to the NSTouchBarProvider protocol.
Some specific objects in a process are searched to discover NSTouchBar providers. In order, these objects are:
* the application delegate
* the application object itself
* the main window’s window controller
* the main window’s delegate
* the main window itself
* the main window’s first responder
* the key window’s window controller
* the key window’s delegate
* the key window itself
* the key window’s first responder
If any of these objects are an NSResponder or a subclass of NSResponder, the responder chain anchored at that object is also searched.
For example in a complicated, but otherwise standard application, that chain might look like this.
* Application delegate
* Application
* key window controller
* key window delegate
* key window
* view controller (closest to root of window)
* view (closest to root of window)
* intermediate view controllers and views
* key window’s first responder’s view controller
* key window’s first responder
NSTouchBars can be nested by including the special NSTouchBarItemIdentifierOtherItemsProxy item identifier. This allows more broadly scoped NSTouchBars (closer to the app delegate) to also display the contents of more narrowly scoped NSTouchBars (closer to the first responder.) If an NSTouchBar omits the special NSTouchBarItemIdentifierOtherItemsProxy item identifier, it will be hidden if a more narrowly scoped NSTouchBar is provided.
*/
API_AVAILABLE(ios(13.0))
@protocol NSTouchBarProvider <NSObject>
@required
/*
The basic method for providing an NSTouchBar. AppKit will key value observe this property, if for some reason you wish to replace a live NSTouchBar wholesale.
Note that many subclasses of NSResponder already implement this method and conform to this protocol.
*/
@property (strong, readonly, nullable) NSTouchBar *touchBar API_AVAILABLE(macos(10.12.2));
@end
#if !TARGET_OS_IPHONE
@interface NSResponder (NSTouchBarProvider) <NSTouchBarProvider>
/*
The NSTouchBar object associated with this responder. If no NSTouchBar is explicitly set, NSResponder will send -makeTouchBar to itself to create the default NSTouchBar for this responder. This property is archived.
*/
@property (strong, readwrite, nullable) NSTouchBar *touchBar API_AVAILABLE(macos(10.12.2));
/*
Subclasses should over-ride this method to create and configure the default NSTouchBar for this responder.
*/
- (nullable NSTouchBar *)makeTouchBar API_AVAILABLE(macos(10.12.2));
@end
@interface NSApplication (NSTouchBarCustomization)
/// Whether or not a menu item to customize the NSTouchBar can be automatically added to the main menu. It will only actually be added when Touch Bar hardware or simulator is present. Defaults to NO. Setting this property to YES is the recommended way to add the customization menu item. But if non-standard placement of the menu item is needed, creating a menu item with an action of `toggleTouchBarCustomizationPalette:` can be used instead.
@property (getter=isAutomaticCustomizeTouchBarMenuItemEnabled) BOOL automaticCustomizeTouchBarMenuItemEnabled API_AVAILABLE(macos(10.12.2));
/// Show or dismiss the customization palette for the currently displayed NSTouchBars. NSApplication validates this selector against whether the current NSTouchBars are customizable and, if configured on a menu item, will standardize and localize the title. If the current system does not have Touch Bar support, the menu item will be automatically hidden.
- (IBAction)toggleTouchBarCustomizationPalette:(nullable id)sender API_AVAILABLE(macos(10.12.2));
@end
#endif
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/NSFontDescriptor.h | /*
NSFontDescriptor.h
Application Kit
Copyright (c) 2003-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSSet.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
/* Symbolic Font Traits */
typedef uint32_t NSFontSymbolicTraits; // Deprecated. Use NSFontDescriptorSymbolicTraits instead
typedef NS_OPTIONS(uint32_t, NSFontDescriptorSymbolicTraits) {
NSFontDescriptorTraitItalic = 1u << 0,
NSFontDescriptorTraitBold = 1u << 1,
NSFontDescriptorTraitExpanded = 1u << 5,
NSFontDescriptorTraitCondensed = 1u << 6,
NSFontDescriptorTraitMonoSpace = 1u << 10,
NSFontDescriptorTraitVertical = 1u << 11,
NSFontDescriptorTraitUIOptimized = 1u << 12,
NSFontDescriptorTraitTightLeading = 1u << 15,
NSFontDescriptorTraitLooseLeading = 1u << 16,
NSFontDescriptorTraitEmphasized API_UNAVAILABLE(macos) = NSFontDescriptorTraitBold,
NSFontDescriptorClassMask = 0xF0000000,
NSFontDescriptorClassUnknown = 0u << 28,
NSFontDescriptorClassOldStyleSerifs = 1u << 28,
NSFontDescriptorClassTransitionalSerifs = 2u << 28,
NSFontDescriptorClassModernSerifs = 3u << 28,
NSFontDescriptorClassClarendonSerifs = 4u << 28,
NSFontDescriptorClassSlabSerifs = 5u << 28,
NSFontDescriptorClassFreeformSerifs = 7u << 28,
NSFontDescriptorClassSansSerif = 8u << 28,
NSFontDescriptorClassOrnamentals = 9u << 28,
NSFontDescriptorClassScripts = 10u << 28,
NSFontDescriptorClassSymbolic = 12u << 28
};
@class NSAffineTransform;
typedef NSString * NSFontDescriptorAttributeName NS_TYPED_EXTENSIBLE_ENUM;
typedef NSString * NSFontDescriptorTraitKey NS_TYPED_ENUM;
typedef NSString * NSFontDescriptorVariationKey NS_TYPED_ENUM;
typedef NSString * NSFontDescriptorFeatureKey NS_TYPED_EXTENSIBLE_ENUM;
typedef CGFloat NSFontWeight NS_TYPED_EXTENSIBLE_ENUM;
typedef NSString * NSFontDescriptorSystemDesign NS_TYPED_ENUM;
typedef NSString * NSFontTextStyle NS_TYPED_ENUM API_AVAILABLE(macos(11.0));
typedef NSString * NSFontTextStyleOptionKey NS_TYPED_ENUM API_AVAILABLE(macos(11.0));
@interface NSFontDescriptor: NSObject <NSCopying, NSSecureCoding>
/* Core attribute access */
@property (nullable, readonly, copy) NSString *postscriptName;
@property (readonly) CGFloat pointSize;
@property (nullable, readonly, copy) NSAffineTransform *matrix;
@property (readonly) NSFontDescriptorSymbolicTraits symbolicTraits;
/* YES indicates that any fonts matching the descriptor needs to be downloaded prior to instantiating a font. To ensure that the matching fonts are available before use, use NSFontAssetRequest to download. NO indicates that the descriptor is not available for download, has already been downloaded, or is backed by an installed font.
*/
@property (readonly) BOOL requiresFontAssetRequest API_AVAILABLE(macos(10.13));
- (nullable id)objectForKey:(NSFontDescriptorAttributeName)attribute;
@property (readonly, copy) NSDictionary<NSFontDescriptorAttributeName, id> *fontAttributes;
/* Instantiation */
+ (NSFontDescriptor *)fontDescriptorWithFontAttributes:(nullable NSDictionary<NSFontDescriptorAttributeName, id> *)attributes;
+ (NSFontDescriptor *)fontDescriptorWithName:(NSString *)fontName size:(CGFloat)size;
+ (NSFontDescriptor *)fontDescriptorWithName:(NSString *)fontName matrix:(NSAffineTransform *)matrix;
- (instancetype)initWithFontAttributes:(nullable NSDictionary<NSFontDescriptorAttributeName, id> *)attributes;
/* Instance conversion */
/* Returns "normalized" font descriptors matching the receiver. mandatoryKeys is an NSSet instance containing keys that are required to be identical in order to be matched. mandatoryKeys can be nil.
*/
- (NSArray<NSFontDescriptor *> *)matchingFontDescriptorsWithMandatoryKeys:(nullable NSSet<NSFontDescriptorAttributeName> *)mandatoryKeys;
/* Returns a "normalized" font descriptor matching the receiver. It is the first element returned from -matchingFontDescriptorsWithMandatoryKeys:. mandatoryKeys is an NSSet instance containing keys that are required to be identical in order to be matched. mandatoryKeys can be nil.
*/
- (nullable NSFontDescriptor *)matchingFontDescriptorWithMandatoryKeys:(nullable NSSet<NSFontDescriptorAttributeName> *)mandatoryKeys API_AVAILABLE(macos(10.5));
- (NSFontDescriptor *)fontDescriptorByAddingAttributes:(NSDictionary<NSFontDescriptorAttributeName, id> *)attributes; // the new attributes take precedence over the existing ones in the receiver
- (NSFontDescriptor *)fontDescriptorWithSymbolicTraits:(NSFontDescriptorSymbolicTraits)symbolicTraits;
- (NSFontDescriptor *)fontDescriptorWithSize:(CGFloat)newPointSize;
- (NSFontDescriptor *)fontDescriptorWithMatrix:(NSAffineTransform *)matrix;
- (NSFontDescriptor *)fontDescriptorWithFace:(NSString *)newFace;
- (NSFontDescriptor *)fontDescriptorWithFamily:(NSString *)newFamily;
- (nullable instancetype)fontDescriptorWithDesign:(NSFontDescriptorSystemDesign)design API_AVAILABLE(macos(10.15));
@end
/* Predefined font attributes not defined in NSAttributedString.h */
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontFamilyAttribute;
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontNameAttribute;
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontFaceAttribute;
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontSizeAttribute;
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontVisibleNameAttribute;
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontMatrixAttribute ; // An NSAffineTransform instance. (default: identity matrix)
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontVariationAttribute ; // An NSDictionary instance describing variation axis (default: supplied by font)
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontCharacterSetAttribute ; // An NSCharacterSet instance representing a set of Unicode characters covered by the font. (default: supplied by font)
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontCascadeListAttribute ; // An NSArray instance. Each member of the array is a sub-descriptor. (default: the system default cascading list for user's locale)
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontTraitsAttribute ; // An NSDictionary instance fully describing font traits. (default: supplied by font)
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontFixedAdvanceAttribute ; // A float represented as an NSNumber. The value overrides glyph advancement specified by the font. (default: 0.0)
APPKIT_EXTERN NSFontDescriptorAttributeName NSFontFeatureSettingsAttribute API_AVAILABLE(macos(10.5)); // An array of dictionaries representing non-default font feature settings. Each dictionary contains NSFontFeatureTypeIdentifierKey and NSFontFeatureSelectorIdentifierKey.
/* Font traits keys */
/* This key is used with a trait dictionary to get the symbolic traits value as an NSNumber.
*/
APPKIT_EXTERN NSFontDescriptorTraitKey NSFontSymbolicTrait;
/* This key is used with a trait dictionary to get the normalized weight value as an NSNumber. The valid value range is from -1.0 to 1.0. The value of 0.0 corresponds to the regular or medium font weight.
*/
APPKIT_EXTERN NSFontDescriptorTraitKey NSFontWeightTrait;
/* This key is used with a trait dictionary to get the relative inter-glyph spacing value as an NSNumber. The valid value range is from -1.0 to 1.0. The value of 0.0 corresponds to the regular glyph spacing.
*/
APPKIT_EXTERN NSFontDescriptorTraitKey NSFontWidthTrait;
/* This key is used with a trait dictionary to get the relative slant angle value as an NSNumber. The valid value range is from -1.0 to 1.0. The value or 0.0 corresponds to 0 degree clockwise rotation from the vertical and 1.0 corresponds to 30 degrees clockwise rotation.
*/
APPKIT_EXTERN NSFontDescriptorTraitKey NSFontSlantTrait;
/* Font variation keys */
/* This key is used with a variation axis dictionary to get the axis identifier value as an NSNumber.
*/
APPKIT_EXTERN NSFontDescriptorVariationKey NSFontVariationAxisIdentifierKey;
/* This key is used with a variation axis dictionary to get the minimum axis value as an NSNumber.
*/
APPKIT_EXTERN NSFontDescriptorVariationKey NSFontVariationAxisMinimumValueKey;
/* This key is used with a variation axis dictionary to get the maximum axis value as an NSNumber.
*/
APPKIT_EXTERN NSFontDescriptorVariationKey NSFontVariationAxisMaximumValueKey;
/* This key is used with a variation axis dictionary to get the default axis value as an NSNumber.
*/
APPKIT_EXTERN NSFontDescriptorVariationKey NSFontVariationAxisDefaultValueKey;
/* This key is used with a variation axis dictionary to get the localized variation axis name.
*/
APPKIT_EXTERN NSFontDescriptorVariationKey NSFontVariationAxisNameKey;
/* Font feature keys */
/* A number object specifying font feature type such as ligature, character shape, etc. Refer to ATS/SFNTLayoutTypes.h for predefined feature types.
*/
APPKIT_EXTERN NSFontDescriptorFeatureKey NSFontFeatureTypeIdentifierKey API_AVAILABLE(macos(10.5));
/* A number object specifying font feature selector such as common ligature off, traditional character shape, etc. Refer to ATS/SFNTLayoutTypes.h for predefined feature selectors.
*/
APPKIT_EXTERN NSFontDescriptorFeatureKey NSFontFeatureSelectorIdentifierKey API_AVAILABLE(macos(10.5));
/* Font weight trait */
/* Predefined symbolic weight values used for NSFontWeightTrait and +[NSFont systemFontOfSize:weight:].
*/
APPKIT_EXTERN const NSFontWeight NSFontWeightUltraLight API_AVAILABLE(macos(10.11));
APPKIT_EXTERN const NSFontWeight NSFontWeightThin API_AVAILABLE(macos(10.11));
APPKIT_EXTERN const NSFontWeight NSFontWeightLight API_AVAILABLE(macos(10.11));
APPKIT_EXTERN const NSFontWeight NSFontWeightRegular API_AVAILABLE(macos(10.11));
APPKIT_EXTERN const NSFontWeight NSFontWeightMedium API_AVAILABLE(macos(10.11));
APPKIT_EXTERN const NSFontWeight NSFontWeightSemibold API_AVAILABLE(macos(10.11));
APPKIT_EXTERN const NSFontWeight NSFontWeightBold API_AVAILABLE(macos(10.11));
APPKIT_EXTERN const NSFontWeight NSFontWeightHeavy API_AVAILABLE(macos(10.11));
APPKIT_EXTERN const NSFontWeight NSFontWeightBlack API_AVAILABLE(macos(10.11));
APPKIT_EXTERN NSFontDescriptorSystemDesign const NSFontDescriptorSystemDesignDefault API_AVAILABLE(macos(10.15));
APPKIT_EXTERN NSFontDescriptorSystemDesign const NSFontDescriptorSystemDesignSerif API_AVAILABLE(macos(10.15));
APPKIT_EXTERN NSFontDescriptorSystemDesign const NSFontDescriptorSystemDesignMonospaced API_AVAILABLE(macos(10.15));
APPKIT_EXTERN NSFontDescriptorSystemDesign const NSFontDescriptorSystemDesignRounded API_AVAILABLE(macos(10.15));
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleLargeTitle API_AVAILABLE(macos(11.0));
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleTitle1 API_AVAILABLE(macos(11.0));
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleTitle2 API_AVAILABLE(macos(11.0));
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleTitle3 API_AVAILABLE(macos(11.0));
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleHeadline API_AVAILABLE(macos(11.0));
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleSubheadline API_AVAILABLE(macos(11.0));
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleBody API_AVAILABLE(macos(11.0));
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleCallout API_AVAILABLE(macos(11.0));
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleFootnote API_AVAILABLE(macos(11.0));
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleCaption1 API_AVAILABLE(macos(11.0));
APPKIT_EXTERN NSFontTextStyle const NSFontTextStyleCaption2 API_AVAILABLE(macos(11.0));
// Deprecated
typedef uint32_t NSFontFamilyClass; // Deprecated. Use NSFontDescriptorSymbolicTraits instead
// The following enum items are deprecated. Use NSFontDescriptorSymbolicTraits instead
enum {
NSFontUnknownClass = 0 << 28,
NSFontOldStyleSerifsClass = 1 << 28,
NSFontTransitionalSerifsClass = 2 << 28,
NSFontModernSerifsClass = 3 << 28,
NSFontClarendonSerifsClass = 4 << 28,
NSFontSlabSerifsClass = 5 << 28,
NSFontFreeformSerifsClass = 7 << 28,
NSFontSansSerifClass = 8 << 28,
NSFontOrnamentalsClass = 9 << 28,
NSFontScriptsClass = 10 << 28,
NSFontSymbolicClass = 12 << 28
};
enum {
NSFontFamilyClassMask = 0xF0000000
};
enum {
NSFontItalicTrait = (1 << 0),
NSFontBoldTrait = (1 << 1),
NSFontExpandedTrait = (1 << 5),
NSFontCondensedTrait = (1 << 6),
NSFontMonoSpaceTrait = (1 << 10),
NSFontVerticalTrait = (1 << 11),
NSFontUIOptimizedTrait = (1 << 12)
};
APPKIT_EXTERN NSString * NSFontColorAttribute API_DEPRECATED("", macos(10.3,10.4)); // This attribute is obsolete. Use NSForegroundColorAttributeName instead.
@interface NSFontDescriptor (NSFontDescriptor_TextStyles)
// Returns a font descriptor containing the text style.
+ (NSFontDescriptor *)preferredFontDescriptorForTextStyle:(NSFontTextStyle)style options:(NSDictionary<NSFontTextStyleOptionKey, id> *)options API_AVAILABLE(macos(11.0));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGLView.h | /*
NSOpenGLView.h
Application Kit
Copyright (c) 2000-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSView.h>
#import <AppKit/NSOpenGL.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSOpenGLContext, NSOpenGLPixelFormat;
NS_OPENGL_CLASS_DEPRECATED("Please use MTKView instead.", 10.0, 10.14)
@interface NSOpenGLView : NSView
+ (NSOpenGLPixelFormat*)defaultPixelFormat;
- (nullable instancetype)initWithFrame:(NSRect)frameRect pixelFormat:(nullable NSOpenGLPixelFormat*)format;
@property (nullable, strong) NSOpenGLContext *openGLContext;
- (void)clearGLContext;
- (void)update NS_REQUIRES_SUPER; // moved or resized
- (void)reshape NS_REQUIRES_SUPER; // scrolled, moved or resized
@property (nullable, strong) NSOpenGLPixelFormat *pixelFormat;
- (void)prepareOpenGL NS_REQUIRES_SUPER;
@property BOOL wantsBestResolutionOpenGLSurface NS_OPENGL_DEPRECATED(10.7, 10.14);
@property BOOL wantsExtendedDynamicRangeOpenGLSurface NS_OPENGL_DEPRECATED(10.11, 10.14);
@end
@interface NSView (NSOpenGLSurfaceResolution)
/* Specifies whether a given view instance wants, and is capable of correctly handling, an OpenGL backing surface (framebuffer) with resolution greater than 1 pixel per point. This property is relevant only for views to which an NSOpenGLContext is bound (including, but not limited to, NSOpenGLViews); its value does not affect the behavior of other views, including CALayer-backed views (which may choose to render at a higher surface resolution independent of this property's value. For compatibility, wantsBestResolutionOpenGLSurface defaults to NO, providing a 1 pixel per point framebuffer regardless of the backing scale factor for the display the view occupies. (When the backing scale factor is > 1.0, the rendered surface contents are scaled up to the appropriate apparent size.) Setting this property to YES for a given view gives AppKit permission to allocate a higher-resolution framebuffer when appropriate for the backing scale factor and target display. AppKit may vary the surface resolution when the display mode is changed or the view is moved to a different display, but with this property set to YES it is capable of allocating a surface of greater than 1 pixel per point for the view.
To function correctly with wantsBestResolutionOpenGLSurface set to YES, a view must take care to perform correct conversions between view units and pixel units when needed. For example: The common practice of passing the width and height of [self bounds] to glViewport() will yield incorrect results (partial instead of complete coverage of the render surface) at backing scale factors other than 1.0, since the parameters to glViewport() must be expressed in pixels. When wantsBestResolutionOpenGLSurface is set to YES, glViewPort will automatically be called before update and reshape. If you wish to call it yourself (for backwards compatibility, or to draw to a subrect of the surface) use the dimensions of [self convertRectToBacking:[self bounds]], which are in appropriate (pixel) units.
This property is archived (keyed archiving required).
*/
@property BOOL wantsBestResolutionOpenGLSurface API_DEPRECATED("Use NSOpenGLView instead.", macos(10.7,10.14));
@end
@interface NSView (NSExtendedDynamicRange)
/* When set to YES on a view with an attached OpenGL context, the NSScreen in which that views resides may have its maximumExtendedDynamicRangeColorComponentValue increased. When composited by the Window Server, color values rendered by this OpenGL surface will be clamped to the NSScreen’s maximumExtendedDynamicRangeColorComponentValue rather than 1.0.
*/
@property BOOL wantsExtendedDynamicRangeOpenGLSurface API_DEPRECATED("Use NSOpenGLView instead.", macos(10.11,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/NSGridView.h | /*
NSGridView.h
Application Kit
Copyright (c) 2015-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSView.h>
#import <AppKit/NSLayoutAnchor.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSLayoutConstraint, NSGridCell, NSGridColumn, NSGridRow;
typedef NS_ENUM(NSInteger, NSGridCellPlacement) {
NSGridCellPlacementInherited = 0,
NSGridCellPlacementNone,
NSGridCellPlacementLeading,
NSGridCellPlacementTop = NSGridCellPlacementLeading,
NSGridCellPlacementTrailing,
NSGridCellPlacementBottom = NSGridCellPlacementTrailing,
NSGridCellPlacementCenter,
NSGridCellPlacementFill
} API_AVAILABLE(macos(10.12));
typedef NS_ENUM(NSInteger, NSGridRowAlignment) {
NSGridRowAlignmentInherited = 0,
NSGridRowAlignmentNone,
NSGridRowAlignmentFirstBaseline,
NSGridRowAlignmentLastBaseline
} API_AVAILABLE(macos(10.12));
APPKIT_EXTERN const CGFloat NSGridViewSizeForContent API_AVAILABLE(macos(10.12)); // Default value for row & column size, indicating it should automatically fit the content views.
/*
NSGridView is a layout container for aligning views in spreadsheet-like rows & columns, indexed from the top left starting at 0. Rows and columns are sized to fit their largest content (unless an explicit size has been set), but all cells in a given column will be the same width and all cells in a row will be the same height.
NSGridPlacement is used to specify the positioning of the contentView within the cell. The content placement can be configured separately for the X & Y axes to align the content with either edge or to center it. Placement properties on rows, columns, and cells default to 'inherited' so that the grid-level properties will effect all cells. Content placement can be overridden for individual rows, columns, or cells by simply changing the appropriate property to a value other than 'inherited'.
*/
API_AVAILABLE(macos(10.12))
@interface NSGridView : NSView
- (instancetype)initWithFrame:(NSRect)frameRect NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
+ (instancetype)gridViewWithNumberOfColumns:(NSInteger)columnCount rows:(NSInteger)rowCount; // Convenience initializer for gridview with specific dimensions.
+ (instancetype)gridViewWithViews:(NSArray<NSArray<NSView *> *> *)rows; // Convenience initializer for an autoreleased GridView large enough to hold the provided rows. Each element in 'rows' is an array of views for that row.
@property (readonly) NSInteger numberOfRows;
@property (readonly) NSInteger numberOfColumns;
// Cells are arranged in rows and columns, which allow for configuration of content alignment on a row/column basis.
- (NSGridRow *)rowAtIndex:(NSInteger)index;
- (NSInteger)indexOfRow:(NSGridRow *)row; // Finds the index of the given row. O(numberOfRows) time.
- (NSGridColumn *)columnAtIndex:(NSInteger)index;
- (NSInteger)indexOfColumn:(NSGridColumn *)column; // Finds the index of the given column. O(numberOfColumns) time.
- (NSGridCell*)cellAtColumnIndex:(NSInteger)columnIndex rowIndex:(NSInteger)rowIndex;
- (nullable NSGridCell *)cellForView:(NSView*)view; // returns the cell from the receiver that contains the given view or one of its ancestors.
// Rows & columns can be inserted & removed dynamically. The grid will be enlarged to hold the specified views, if needed.
- (NSGridRow *)addRowWithViews:(NSArray<NSView *> *)views;
- (NSGridRow *)insertRowAtIndex:(NSInteger)index withViews:(NSArray<NSView *> *)views;
- (void)moveRowAtIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex;
- (void)removeRowAtIndex:(NSInteger)index;
- (NSGridColumn *)addColumnWithViews:(NSArray<NSView *> *)views;
- (NSGridColumn *)insertColumnAtIndex:(NSInteger)index withViews:(NSArray<NSView *> *)views;
- (void)moveColumnAtIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex;
- (void)removeColumnAtIndex:(NSInteger)index;
// Grid-level layout properties will be used by cells that don't have the properties defined themselves or at the column/row level. They default to bottom-leading placement, with no alignment.
@property NSGridCellPlacement xPlacement;
@property NSGridCellPlacement yPlacement;
@property NSGridRowAlignment rowAlignment;
// Grid-level property values for row & column spacing are added to the padding properties on rows & columns. Defaults to 6pt.
@property CGFloat rowSpacing;
@property CGFloat columnSpacing;
// Expands the cell at the top-leading corner of the given range to cover the entire area. Other cells in the range become invalid: they will no longer maintain any layout, constraints, or content views. Cell merging has no effect on the base cell coordinate system of the gridview, and cell references within a merged region will all refer to the single merged cell. This is intended to be used to configure the grid geometry before installing views, but in the event that the cells being merged contain contentViews, only the top-leading will be kept.
- (void)mergeCellsInHorizontalRange:(NSRange)hRange verticalRange:(NSRange)vRange;
@end
// NSGridRow represents a row of cells in the grid view, and allows content placement to be specified on a per-row basis.
API_AVAILABLE(macos(10.12)) NS_SWIFT_UI_ACTOR
@interface NSGridRow : NSObject <NSCoding>
@property (readonly,weak) NSGridView *gridView;
@property (readonly) NSInteger numberOfCells;
- (NSGridCell *)cellAtIndex:(NSInteger)index;
// Row level placement properties will be used by cells whose Y-axis properties are set to 'inherited'. These also default to 'inherited', falling back to the GridView level properties.
@property NSGridCellPlacement yPlacement;
@property NSGridRowAlignment rowAlignment;
@property CGFloat height; // Height of this row, or NSGridViewSizeForContent (the default) to fit content automatically.
@property CGFloat topPadding; // Padding is extra space between this row and an adjacent one. Defaults to 0. Total inter-row-space is firstRow.bottomPadding + grid.rowSpacing + secondRow.topPadding
@property CGFloat bottomPadding;
@property (getter=isHidden) BOOL hidden; // Hidden rows/columns will collapse to 0 size and hide all their contentViews.
- (void)mergeCellsInRange:(NSRange)range;
@end
// NSGridColumn represents a column of cells in the grid view, and allows content placement to be specified on a per-column basis.
API_AVAILABLE(macos(10.12)) NS_SWIFT_UI_ACTOR
@interface NSGridColumn : NSObject <NSCoding>
@property (readonly,weak) NSGridView *gridView;
@property (readonly) NSInteger numberOfCells;
- (NSGridCell *)cellAtIndex:(NSInteger)index;
// Column level placement will be used by cells whose xPlacement is set to 'inherited'. This also defaults to 'inherited', falling back to the NSGridView property.
@property NSGridCellPlacement xPlacement;
@property CGFloat width; // Width of this column, or NSGridViewSizeForContent (the default) to fit content automatically.
@property CGFloat leadingPadding; // Padding is extra space between this column and an adjacent one. Defaults to 0. Total inter-column-space is firstColumn.trailingPadding + grid.columnSpacing + secondColumn.leadingPadding
@property CGFloat trailingPadding;
@property (getter=isHidden) BOOL hidden; // Hidden rows/columns will collapse to 0 size and hide all their contentViews.
- (void)mergeCellsInRange:(NSRange)range;
@end
// NSGridCell represents a single cell in the grid. The cell will maintain the necessary constraints for positioning out whichever contentView is set.
API_AVAILABLE(macos(10.12)) NS_SWIFT_UI_ACTOR
@interface NSGridCell : NSObject <NSCoding>
@property (strong,nullable) __kindof NSView *contentView; // The view whose placement will be managed by this cell.
@property (class, readonly, strong) NSView *emptyContentView; // This view is used as a marker in NSGridView's "...WithViews:" methods to indicate a cell whose contentView should be nil.
@property (readonly,weak) NSGridRow *row;
@property (readonly,weak) NSGridColumn *column;
// These properties control how the content view is placed in the cell. Placement is configured independently for each axis. Baseline alignment within a row is handled separately. Properties set to the default value of 'inherited' will "fall back" to properties defined on the row/column, or to the GridView itself if needed. Properties set to 'none' will cause the corresponding aspect of content layout to be left unmanaged by the grid view. Handling of baseline alignment is special: all cells within a row that specify a rowAlignment (i.e., not "None") are considered to be 'aligned'. The contentViews of such cells will be aligned by the specified baseline for each cell. This creates the potential for unsatisfiable constraints in combination with the yPlacement properties on the aligned views. Therefore, the entire baseline-aligned group is placed using the yPlacement of the first cell with a value other than NSGridCellPlaceNone. The yPlacement properties of the remaining cells are overridden by their rowAlignment.
@property NSGridCellPlacement xPlacement;
@property NSGridCellPlacement yPlacement;
@property NSGridRowAlignment rowAlignment;
// Set these constraints to provide custom placement for the cell's content view. NSGridView will activate the constraints when the cell is visible, and deactivate them when it is hidden. Note that it is usually also necessary to set the xPlacement and/or yPlacement to 'Custom' in order to prevent NSGridView from adding its own placement constraints in one or both axes (which is likely to cause unsatisfiable constraints in combination with the custom ones).
@property (copy) NSArray<NSLayoutConstraint *> *customPlacementConstraints;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTextFieldCell.h | /*
NSTextFieldCell.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSActionCell.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
typedef NS_ENUM(NSUInteger, NSTextFieldBezelStyle) {
NSTextFieldSquareBezel = 0,
NSTextFieldRoundedBezel = 1
};
@class NSColor;
@interface NSTextFieldCell : NSActionCell
- (instancetype)initTextCell:(NSString *)string NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
- (instancetype)initImageCell:(nullable NSImage *)image NS_UNAVAILABLE; // Use the designated initializer initTextCell:
@property (nullable, copy) NSColor *backgroundColor;
@property BOOL drawsBackground;
@property (nullable, copy) NSColor *textColor;
- (NSText *)setUpFieldEditorAttributes:(NSText *)textObj;
@property NSTextFieldBezelStyle bezelStyle;
@property (nullable, copy) NSString *placeholderString;
@property (nullable, copy) NSAttributedString *placeholderAttributedString;
- (void)setWantsNotificationForMarkedText:(BOOL)flag API_AVAILABLE(macos(10.5));
/* 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
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/NSUserInterfaceCompression.h | /*
NSUserInterfaceCompression.h
Application Kit
Copyright (c) 2015-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObjCRuntime.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSArray.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
API_AVAILABLE(macos(10.13))
@interface NSUserInterfaceCompressionOptions : NSObject <NSCopying, NSCoding>
/*
Returns an option with an empty set of identifiers. This represents the absence of any options.
*/
- (instancetype)init NS_DESIGNATED_INITIALIZER;
/*
-initWithCoder: is a designated initializer
*/
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
/*
Returns a singleton option with the given identifier.
*/
- (instancetype)initWithIdentifier:(NSString *)identifier NS_DESIGNATED_INITIALIZER;
/*
Returns a singleton option which is the union of the given set of options.
*/
- (instancetype)initWithCompressionOptions:(NSSet<NSUserInterfaceCompressionOptions *> *)options NS_DESIGNATED_INITIALIZER;
/*
Returns YES if the all the given options are present in the receiver's options.
*/
- (BOOL)containsOptions:(NSUserInterfaceCompressionOptions *)options;
/*
Returns YES if at least one of the given options are present in the receiver's options.
*/
- (BOOL)intersectsOptions:(NSUserInterfaceCompressionOptions *)options;
/*
Returns YES if the option is equivalent to the empty set option.
*/
@property (readonly, getter=isEmpty) BOOL empty;
/*
Returns a new NSCompressibleUserInterfaceOptions object which is the union of the caller and the provided options.
*/
- (NSUserInterfaceCompressionOptions *)optionsByAddingOptions:(NSUserInterfaceCompressionOptions *)options;
/*
Returns a new NSCompressibleUserInterfaceOptions object with the given options removed from the receiver's set of options.
*/
- (NSUserInterfaceCompressionOptions *)optionsByRemovingOptions:(NSUserInterfaceCompressionOptions *)options;
/*
Option specifying views should hide their images if applicable.
*/
@property (class, readonly, copy) NSUserInterfaceCompressionOptions *hideImagesOption;
/*
Option specifying views should hide their text if applicable.
*/
@property (class, readonly, copy) NSUserInterfaceCompressionOptions *hideTextOption;
/*
Option specifying views should reduce their internal metrics when possible to reduce padding around contents.
*/
@property (class, readonly, copy) NSUserInterfaceCompressionOptions *reduceMetricsOption;
/*
Option specifying views will no longer maintain equal widths. This is handled by the system and no action is required by the views.
*/
@property (class, readonly, copy) NSUserInterfaceCompressionOptions *breakEqualWidthsOption;
/*
Option which is the composite of all standard options provided by AppKit.
*/
@property (class, readonly, copy) NSUserInterfaceCompressionOptions *standardOptions;
@end
/*
NSButton, NSSegmentedControl, and NSSliderTouchBarItem's view currently conform to this protocol
*/
@protocol NSUserInterfaceCompression
@required
/*
Called when the view should apply the provided compression options, if applicable.
Options handled by the system are not included.
Subclasses that do not recognize a provided option should provide that option in a call to super.
In case of conflict where one or more options are mutually exclusive, they should be satisfied in the order given.
Options that are not supported by the client can be left unhandled.
*/
- (void)compressWithPrioritizedCompressionOptions:(NSArray<NSUserInterfaceCompressionOptions *> *)prioritizedOptions;
/*
Returns the minimum size alignment rect a view can achieve by applying the provided compression options.
Options handled by the system are not included.
Subclasses that do not recognize a provided option should provide that option in a call to super.
In case of conflict where one or more options are mutually exclusive, they should be satisfied in the order given.
*/
- (NSSize)minimumSizeWithPrioritizedCompressionOptions:(NSArray<NSUserInterfaceCompressionOptions *> *)prioritizedOptions;
/*
Returns the NSCompressibleUserInterfaceOptions currently applied to the view.
Only options that have been applied and are actively being respected are included.
*/
@property (readonly, copy) NSUserInterfaceCompressionOptions *activeCompressionOptions;
@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/NSStringDrawing.h | #if !__has_include(<UIFoundation/NSStringDrawing.h>)
/*
NSStringDrawing.h
Copyright (c) 1994-2021, Apple Inc. All rights reserved.
*/
#import <Foundation/NSString.h>
#import <AppKit/NSAttributedString.h>
@class NSStringDrawingContext;
NS_ASSUME_NONNULL_BEGIN
#if !TARGET_OS_IPHONE
// When attributes=nil, the methods declared here uses the default behavior for each attribute described in <AppKit/NSAttributedString.h>. When stringDrawingContext=nil, it's equivalent of passing the default instance initialized with [[NSStringDrawingContext alloc] init].
API_AVAILABLE(macos(10.11), ios(6.0), watchos(2.0), tvos(9.0)) @interface NSStringDrawingContext : NSObject
// Minimum scale factor for drawWithRect:options:context: and boundingRectWithSize:options:context: methods. If this property is set, the extended string drawing methods will attempt to draw the attributed string in the given bounds by proportionally scaling the font(s) in the attributed string
@property CGFloat minimumScaleFactor;
// actual scale factor used by the last drawing call where minimum scale factor was specified
@property (readonly) CGFloat actualScaleFactor;
// bounds of the string drawn by the previous invocation of drawWithRect:options:context:
@property (readonly) NSRect totalBounds;
@end
@interface NSString(NSStringDrawing)
- (NSSize)sizeWithAttributes:(nullable NSDictionary<NSAttributedStringKey, id> *)attrs API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
- (void)drawAtPoint:(NSPoint)point withAttributes:(nullable NSDictionary<NSAttributedStringKey, id> *)attrs API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
- (void)drawInRect:(NSRect)rect withAttributes:(nullable NSDictionary<NSAttributedStringKey, id> *)attrs API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
@end
@interface NSAttributedString(NSStringDrawing)
- (NSSize)size API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));
- (void)drawAtPoint:(NSPoint)point API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));
- (void)drawInRect:(NSRect)rect API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));
@end
typedef NS_OPTIONS(NSInteger, NSStringDrawingOptions) {
NSStringDrawingUsesLineFragmentOrigin = 1 << 0, // The specified origin is the line fragment origin, not the base line origin
NSStringDrawingUsesFontLeading = 1 << 1, // Uses the font leading for calculating line heights
NSStringDrawingUsesDeviceMetrics = 1 << 3, // Uses image glyph bounds instead of typographic bounds
NSStringDrawingTruncatesLastVisibleLine API_AVAILABLE(macos(10.5), ios(6.0), watchos(2.0), tvos(9.0)) = 1 << 5, // Truncates and adds the ellipsis character to the last visible line if the text doesn't fit into the bounds specified. Ignored if NSStringDrawingUsesLineFragmentOrigin is not also set.
NSStringDrawingDisableScreenFontSubstitution API_DEPRECATED("", macos(10.0,10.11)) = (1 << 2),
NSStringDrawingOneShot API_DEPRECATED("", macos(10.0,10.11)) = (1 << 4)
} API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));
// NOTE: All of the following methods will default to drawing on a baseline, limiting drawing to a single line.
// To correctly draw and size multi-line text, pass NSStringDrawingUsesLineFragmentOrigin in the options parameter.
@interface NSString (NSExtendedStringDrawing)
- (void)drawWithRect:(NSRect)rect options:(NSStringDrawingOptions)options attributes:(nullable NSDictionary<NSAttributedStringKey, id> *)attributes context:(nullable NSStringDrawingContext *)context API_AVAILABLE(macos(10.11), ios(7.0), watchos(2.0), tvos(9.0));
- (NSRect)boundingRectWithSize:(NSSize)size options:(NSStringDrawingOptions)options attributes:(nullable NSDictionary<NSAttributedStringKey, id> *)attributes context:(nullable NSStringDrawingContext *)context API_AVAILABLE(macos(10.11), ios(7.0), watchos(2.0), tvos(9.0));
@end
@interface NSAttributedString (NSExtendedStringDrawing)
- (void)drawWithRect:(NSRect)rect options:(NSStringDrawingOptions)options context:(nullable NSStringDrawingContext *)context API_AVAILABLE(macos(10.11), ios(6.0), watchos(2.0), tvos(9.0));
- (NSRect)boundingRectWithSize:(NSSize)size options:(NSStringDrawingOptions)options context:(nullable NSStringDrawingContext *)context API_AVAILABLE(macos(10.11), ios(6.0), watchos(2.0), tvos(9.0));
@end
/************************ Deprecated ************************/
// Following NSStringDrawing methods are soft deprecated starting with OS X 10.11. It will be officially deprecated in a future release. Use corresponding API with NSStringDrawingContext instead
@interface NSString (NSStringDrawingDeprecated)
- (void)drawWithRect:(NSRect)rect options:(NSStringDrawingOptions)options attributes:(nullable NSDictionary<NSAttributedStringKey, id> *)attributes; // Use -drawWithRect:options:attributes:context: instead
- (NSRect)boundingRectWithSize:(NSSize)size options:(NSStringDrawingOptions)options attributes:(nullable NSDictionary<NSAttributedStringKey, id> *)attributes; // Use -boundingRectWithSize:options:attributes:context: instead
@end
@interface NSAttributedString (NSStringDrawingDeprecated)
- (void)drawWithRect:(NSRect)rect options:(NSStringDrawingOptions)options; // Use -drawWithRect:options:context: instead
- (NSRect)boundingRectWithSize:(NSSize)size options:(NSStringDrawingOptions)options; // Use -boundingRectWithSize:options:context: instead
@end
#endif // !TARGET_OS_IPHONE
NS_ASSUME_NONNULL_END
#else
#import <UIFoundation/NSStringDrawing.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/NSSavePanel.h | /*
NSSavePanel.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSNibDeclarations.h>
#import <AppKit/NSPanel.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSBox, NSTextField, NSTextView, NSView, NSURL, NSProgressIndicator, NSControl;
@protocol NSOpenSavePanelDelegate;
@class UTType;
/* Return codes from the open/save panel.
*/
enum {
NSFileHandlingPanelCancelButton API_DEPRECATED_WITH_REPLACEMENT("NSModalResponseCancel", macos(10.0,10.13)) = NSModalResponseCancel,
NSFileHandlingPanelOKButton API_DEPRECATED_WITH_REPLACEMENT("NSModalResponseOK", macos(10.0,10.13)) = NSModalResponseOK,
};
@interface NSSavePanel : NSPanel
/* Creates a new instance of the NSSavePanel. This class is not a singleton.
*/
+ (NSSavePanel *)savePanel;
#pragma mark -
#pragma mark Result Properties
/* NSSavePanel: Returns the URL to save the file at. A file may already exist at 'URL' if the user choose to overwrite it.
NSOpenPanel: Returns the single filename selected by the user. Note: if -allowsMultipleSelection is set, you should use the -URLs on NSOpenPanel instead.
*/
@property (nullable, readonly, copy) NSURL *URL;
#pragma mark -
#pragma mark Configuration Properties
/* NSSavePanel/NSOpenPanel: Gets and sets the directoryURL shown. A value of nil indicates that the last directory shown to the user will be used. This method will not block to resolve the URL, and the directory will asyncronously be set, if required.
*/
@property (nullable, copy) NSURL *directoryURL API_AVAILABLE(macos(10.6));
/*
NSSavePanel: An array of UTTypes specifying the file types the user can save the file as. An empty value indicates that any file type can be used. If no extension is given by the user, the first preferred extension from the array will be used as the extension for the save panel. If the user specifies a type not in the array, and 'allowsOtherFileTypes' is YES, they will be presented with another dialog when prompted to save. The default value is the empty array.
NSOpenPanel: This property determines which files should be enabled in the open panel. Using the deprecated methods to show the open panel (the ones that take a "types:" parameter) will overwrite this value, and should not be used. The allowedContentTypes can be changed while the panel is running (ie: from an accessory view). This is also known as the "enabled file types". An empty value indicates that all files should be enabled.
*/
@property (copy) NSArray<UTType *> *allowedContentTypes API_AVAILABLE(macos(11.0));
/* NSSavePanel: Returns a BOOL value that indicates whether the receiver allows the user to save files with an extension that's not in the list of 'allowedFileTypes'.
NSOpenPanel: Not used.
*/
@property BOOL allowsOtherFileTypes;
/* Gets and sets the accessory view shown in the panel. For applications that link on SnowLeopard and higher, the accessoryView's frame will be observed, and any changes the programmer makes to the frame will automatically be reflected in the panel (including animated changes to the frame height).
*/
@property (nullable, strong) NSView *accessoryView;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wincompatible-property-type"
/* Gets and sets the delegate.
*/
@property (nullable, weak) id<NSOpenSavePanelDelegate> delegate;
#pragma clang diagnostic pop
/* NSSavePanel: Returns YES if the panel is expanded. Defaults to NO, and persists in the user defaults.
NSOpenPanel: Not used.
*/
@property (getter=isExpanded, readonly) BOOL expanded;
/* NSSavePanel/NSOpenPanel: Set to YES to allow the "New Folder" button to be shown.
*/
@property BOOL canCreateDirectories;
/* NSSavePanel: Set to YES to show the extension-hiding checkbox.
NSOpenPanel: Should not be used.
*/
@property BOOL canSelectHiddenExtension;
/* NSSavePanel: Set to YES if the extension-hiding checkbox should checked. The value persists in the user defaults specific for the application.
NSOpenPanel: Should not be used.
*/
@property (getter=isExtensionHidden) BOOL extensionHidden;
/* NSSavePanel/NSOpenPanel: If set to YES, the user can open into file packages, as though they were directories.
*/
@property BOOL treatsFilePackagesAsDirectories;
/* NSSavePanel/NSOpenPanel: Sets the text shown on the Open or Save button. If set to an empty string, it will show a localized "Open" for the NSOpenPanel and "Save" for the NSSavePanel. The default value will be the correct localized prompt for the open or save panel, as appropriate.
*/
@property (null_resettable, copy) NSString *prompt;
/* NSSavePanel/NSOpenPanel: Gets and sets the title for the panel shown at the top of the window.
*/
@property (null_resettable, copy) NSString *title;
/* NSSavePanel: Gets and sets the text shown to the left of the "name field". Default value is a localized "Save As:" string.
NSOpenPanel: Not used.
*/
@property (null_resettable, copy) NSString *nameFieldLabel;
/* NSSavePanel: Gets and sets the user-editable file name shown in the name field. 'value' must not be nil. NOTE: calling the deprecated methods that take a "name:" parameter will overwrite any values set before the panel was shown. Note that 'value' may have the file extension stripped, if [panel isExtensionHidden] is set to YES.
NSOpenPanel: Not used.
*/
@property (copy) NSString *nameFieldStringValue API_AVAILABLE(macos(10.6));
/* NSSavePanel/NSOpenPanel: Gets and sets the message shown under title of the panel. 'message' must not be nil.
*/
@property (null_resettable, copy) NSString *message;
- (void)validateVisibleColumns;
/* NSSavePanel/NSOpenPanel: If showsHiddenFiles is set to YES, files that are normally hidden from the user are displayed. This method was published in Mac OS 10.6, but has existed since Mac OS 10.4. This property is KVO compliant. The user may invoke the keyboard shortcut (cmd-shift-.) to show or hide hidden files. Any user interface shown in an an accessory view should be updated by using key value observing (KVO) to watch for changes of this property. Alternatively, the user interface can be directly bound to this property. The default value is NO.
*/
@property BOOL showsHiddenFiles;
/* NSSavePanel: Shows or hides the "Tags" field in the receiver. By passing YES, you become responsible for setting Tag names on the resulting file after saving is complete.
NSOpenPanel: Should not be used.
*/
@property BOOL showsTagField API_AVAILABLE(macos(10.9));
/* NSSavePanel: When -showsTagField returns YES, set any initial Tag names to be displayed, if necessary, prior to displaying the receiver. Also, if the user clicks "Save", take the result of -tagNames, and set them on the resulting file after saving is complete. Tag names are NSStrings, arrays of which can be used directly with the NSURLTagNamesKey API for getting and setting tags on files. Passing nil or an empty array to -setTagNames: will result in no initial Tag names appearing in the receiver. When -showsTagField returns YES, -tagNames always returns a non-nil array, and when NO, -tagNames always returns nil.
NSOpenPanel: Should not be used.
*/
@property (nullable, copy) NSArray<NSString *> *tagNames API_AVAILABLE(macos(10.9));
#pragma mark -
#pragma mark Actions
- (IBAction)ok:(nullable id)sender;
- (IBAction)cancel:(nullable id)sender;
#pragma mark -
#pragma mark Displaying/Showing
/* NSSavePanel/NSOpenPanel: Presents the panel as a sheet modal to 'window' and returns immediately. Desired properties of the panel should be properly setup before calling this method. The completion handler block will be called after the user has closed the panel, however, the open/save panel sheet may still be on screen. If you require the sheet to be offscreen (for example, to show an alert), first call [savePanel orderOut:nil] to close it. The passed in 'result' will be NSModalResponseOK==1 or NSModalResponseCancel==0.
*/
- (void)beginSheetModalForWindow:(NSWindow *)window completionHandler:(void (^)(NSModalResponse result))handler API_AVAILABLE(macos(10.6));
/* NSSavePanel/NSOpenPanel: Presents the panel as a modeless window and returns immediately. Desired properties of the panel should be properly setup before calling this method. The completion handler block will be called after the user has closed the panel. The passed in 'result' will be NSModalResponseOK==1 or NSModalResponseCancel==0.
*/
- (void)beginWithCompletionHandler:(void (^)(NSModalResponse result))handler API_AVAILABLE(macos(10.6));
/* NSSavePanel/NSOpenPanel: Presents the panel as an application modal window. It returns only after the user has closed the panel. The return value is NSModalResponseOK==1 or NSModalResponseCancel==0.
*/
- (NSModalResponse)runModal;
@end
@protocol NSOpenSavePanelDelegate <NSObject>
@optional
/* Optional - enabled URLs.
NSOpenPanel: Return YES to allow the 'url' to be enabled in the panel. Delegate implementations should be fast to avoid stalling the UI. Applications linked on Mac OS 10.7 and later should be prepared to handle non-file URL schemes.
NSSavePanel: This method is not called; all urls are always disabled.
*/
- (BOOL)panel:(id)sender shouldEnableURL:(NSURL *)url API_AVAILABLE(macos(10.6));
/* Optional - URL validation for saving and opening files.
NSSavePanel: The method is called once by the save panel when the user chooses the Save button. The user is intending to save a file at 'url'. Return YES if the 'url' is a valid location to save to. Note that an item at 'url' may not physically exist yet, unless the user decided to overwrite an existing item. Return NO and fill in the 'outError' with a user displayable error message for why the 'url' is not valid. If a recovery option is provided by the error, and recovery succeeded, the panel will attempt to close again.
NSOpenPanel: The method is called once for each selected filename (or directory) when the user chooses the Open button. Return YES if the 'url' is acceptable to open. Return NO and fill in the 'outError' with a user displayable message for why the 'url' is not valid for opening. You would use this method over panel:shouldEnableURL: if the processing of the selected item takes a long time. If a recovery option is provided by the error, and recovery succeeded, the panel will attempt to close again.
*/
- (BOOL)panel:(id)sender validateURL:(NSURL *)url error:(NSError **)outError API_AVAILABLE(macos(10.6));
/* Optional - Sent when the user has changed the selected directory to the directory located at 'url'. 'url' may be nil, if the current directory can't be represented by an NSURL object (ie: the media sidebar directory, or the "Computer").
*/
- (void)panel:(id)sender didChangeToDirectoryURL:(nullable NSURL *)url API_AVAILABLE(macos(10.6));
/* Optional - Filename customization for the NSSavePanel. Allows the delegate to customize the filename entered by the user, before the extension is appended, and before the user is potentially asked to replace a file.
*/
- (nullable NSString *)panel:(id)sender userEnteredFilename:(NSString *)filename confirmed:(BOOL)okFlag;
/* Optional - Sent when the user clicks the disclosure triangle to expand or collapse the file browser while in NSOpenPanel.
*/
- (void)panel:(id)sender willExpand:(BOOL)expanding;
/* Optional - Sent when the user has changed the selection.
*/
- (void)panelSelectionDidChange:(nullable id)sender;
@end
@interface NSObject(NSSavePanelDelegateDeprecated)
- (BOOL)panel:(id)sender isValidFilename:(NSString *)filename API_DEPRECATED("Use -panel:validateURL:error: instead", macos(10.0,10.6));
- (void)panel:(id)sender directoryDidChange:(NSString *)path API_DEPRECATED("Use -panel:didChangeToDirectoryURL: instead", macos(10.3,10.6));
- (NSComparisonResult)panel:(id)sender compareFilename:(NSString *)name1 with:(NSString *)name2 caseSensitive:(BOOL)caseSensitive API_DEPRECATED("Filenames in the save panel should not have a custom sort. This method is never called on 10.14, and rarely called after 10.6", macos(10.0,10.6));
- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename API_DEPRECATED("Use -panel:shouldEnableURL: instead", macos(10.0,10.6));
@end
@interface NSSavePanel(NSDeprecated)
- (NSString *)filename API_DEPRECATED("Use -URL instead", macos(10.0,10.6));
- (NSString *)directory API_DEPRECATED("Use -directoryURL instead", macos(10.0,10.6));
- (void)setDirectory:(nullable NSString *)path API_DEPRECATED("Use -setDirectoryURL: instead", macos(10.0,10.6));
- (nullable NSString *)requiredFileType API_DEPRECATED("Use -allowedFileTypes instead", macos(10.0,10.6));
- (void)setRequiredFileType:(nullable NSString *)type API_DEPRECATED("Use -setAllowedFileTypes: instead", macos(10.0,10.6));
- (void)beginSheetForDirectory:(NSString *)path file:(nullable NSString *)name modalForWindow:(nullable NSWindow *)docWindow modalDelegate:(nullable id)delegate didEndSelector:(nullable SEL)didEndSelector contextInfo:(nullable void *)contextInfo API_DEPRECATED("Use beginSheetModalForWindow:completionHandler: instead. The following parameters are replaced by properties: 'path' is replaced by 'directoryURL' and 'name' by 'nameFieldStringValue'.", macos(10.0,10.6));
- (NSInteger)runModalForDirectory:(nullable NSString *)path file:(nullable NSString *)name API_DEPRECATED("Use -runModal instead. The following parameters are replaced by properties: 'path' is replaced by 'directoryURL' and 'name' by 'nameFieldStringValue'.", macos(10.0,10.6));
- (IBAction)selectText:(nullable id)sender API_DEPRECATED("Default implementation does nothing.", macos(10.0,10.3));
/*
NSSavePanel: An array of NSStrings specifying the file types the user can save the file as. The file type can be a common file extension, or a UTI. A nil value indicates that any file type can be used. If the array is not nil and the array contains no items, an exception will be raised. If no extension is given by the user, the first item in the allowedFileTypes will be used as the extension for the save panel. If the user specifies a type not in the array, and 'allowsOtherFileTypes' is YES, they will be presented with another dialog when prompted to save. The default value is 'nil'.
NSOpenPanel: On versions less than 10.6, this property is ignored. For applications that link against 10.6 and higher, this property will determine which files should be enabled in the open panel. Using the deprecated methods to show the open panel (the ones that take a "types:" parameter) will overwrite this value, and should not be used. The allowedFileTypes can be changed while the panel is running (ie: from an accessory view). The file type can be a common file extension, or a UTI. This is also known as the "enabled file types". A nil value indicates that all files should be enabled.
*/
@property (nullable, copy) NSArray<NSString *> *allowedFileTypes API_DEPRECATED("Use -allowedContentTypes instead", macos(10.3,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/NSSpellProtocol.h | /*
NSSpellProtocol.h
Application Kit
Copyright (c) 1990-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <AppKit/AppKitDefines.h>
/*
SpellCheckable objects can respond to this method if they want to support not only spell-checking, but spell correction. This message is sent down the responder chain. The receiver should ask the sender for its selectedCell's stringValue (the correct spelling of the word) and replace its selection if appropriate.
*/
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@protocol NSChangeSpelling
- (void)changeSpelling:(nullable id)sender;
@end
/*
SpellCheckable objects can respond to this method if they wish to be able to ignore words. This message is sent down the responder chain. To enable ignoring you should implement this method like this: [[NSSpellChecker sharedSpellChecker] ignoreWord:[sender stringValue] inSpellDocumentWithTag:<document tag>]. Each document in your app which can be spell checked should have a unique tag. This tag is used here to tell the spell checker what document to ignore the word in, and you also pass it as an argument to the checkSpellingOfString:... method when you initiate a spell check. Unique tags can be generated by the NSSpellChecker factory with the +uniqueSpellDocumentTag method.
*/
@protocol NSIgnoreMisspelledWords
- (void)ignoreSpelling:(nullable id)sender;
@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/NSColorSampler.h | /*
NSColorSampler.h
Application Kit
Copyright (c) 2018-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSColor;
/*!
* Manages a color sampling interface to allow the user to select a color from their screen.
*/
NS_CLASS_AVAILABLE_MAC(10_15)
@interface NSColorSampler : NSObject
/*!
* The primary method for NSColorSampler.
*
* Begins or attaches to an existing color sampling session which presents UI to the user for selecting a color from their screen. The handler will be called on the main thread when the user completes the session (either by selection, or cancelation). In the event of user-cancellation, `colorSelectionHandler` will be called with `nil`.
*
* The calling NSColorSampler instance is retained until the sampling session is completed.
*/
- (void)showSamplerWithSelectionHandler:(void (^)(NSColor * _Nullable selectedColor))selectionHandler NS_SWIFT_ASYNC_NAME(sample());
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSFontPanel.h | /*
NSFontPanel.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSPanel.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSFontPanel, NSMutableDictionary, NSFontManager, NSMutableArray, NSTableView, NSFontDescriptor, NSFont;
typedef NS_OPTIONS(NSUInteger, NSFontPanelModeMask) {
NSFontPanelModeMaskFace = 1 << 0,
NSFontPanelModeMaskSize = 1 << 1,
NSFontPanelModeMaskCollection = 1 << 2,
NSFontPanelModeMaskUnderlineEffect = 1<<8,
NSFontPanelModeMaskStrikethroughEffect = 1<<9,
NSFontPanelModeMaskTextColorEffect = 1<< 10,
NSFontPanelModeMaskDocumentColorEffect = 1<<11,
NSFontPanelModeMaskShadowEffect = 1<<12,
NSFontPanelModeMaskAllEffects = 0XFFF00,
NSFontPanelModesMaskStandardModes = 0xFFFF,
NSFontPanelModesMaskAllModes = 0xFFFFFFFF
};
@protocol NSFontChanging <NSObject>
@optional
/* This is the message that's propagated up the responder chain.
*/
- (void)changeFont:(nullable NSFontManager *)sender;
- (NSFontPanelModeMask)validModesForFontPanel:(NSFontPanel *)fontPanel;
@end
#if __swift__ < 40200
@interface NSObject (NSFontPanelValidationAdditions)
- (NSFontPanelModeMask)validModesForFontPanel:(NSFontPanel *)fontPanel API_DEPRECATED("This is now an optional method of the NSFontChanging protocol.", macos(10.0, 11.0));
@end
#endif
@interface NSFontPanel : NSPanel
@property (class, readonly, strong) NSFontPanel *sharedFontPanel;
@property (class, readonly) BOOL sharedFontPanelExists;
@property (nullable, strong) NSView *accessoryView;
- (void)setPanelFont:(NSFont *)fontObj isMultiple:(BOOL)flag;
- (NSFont *)panelConvertFont:(NSFont *)fontObj;
@property BOOL worksWhenModal;
@property (getter=isEnabled) BOOL enabled;
/* This method triggers a re-load to the default state, so that the delegate will be called, and have an opportunity to scrutinize the default list of fonts to be displayed in the panel.
*/
- (void) reloadDefaultFontFamilies;
@end
// The following enum items are deprecated. Use NSFontPanelModeMask instead
enum {
NSFontPanelFaceModeMask = 1 << 0,
NSFontPanelSizeModeMask = 1 << 1,
NSFontPanelCollectionModeMask = 1 << 2,
NSFontPanelUnderlineEffectModeMask = 1<<8,
NSFontPanelStrikethroughEffectModeMask = 1<<9,
NSFontPanelTextColorEffectModeMask = 1<< 10,
NSFontPanelDocumentColorEffectModeMask = 1<<11,
NSFontPanelShadowEffectModeMask = 1<<12,
NSFontPanelAllEffectsModeMask = 0XFFF00,
NSFontPanelStandardModesMask = 0xFFFF,
NSFontPanelAllModesMask = 0xFFFFFFFF
};
/* Tags of views in the FontPanel
THESE ARE ALL OBSOLETE and should not be used.
*/
enum {
NSFPPreviewButton = 131,
NSFPRevertButton = 130,
NSFPSetButton = 132,
NSFPPreviewField = 128,
NSFPSizeField = 129,
NSFPSizeTitle = 133,
NSFPCurrentField = 134
} API_DEPRECATED("", macos(10.0,10.0));
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSFilePromiseReceiver.h | /*
NSFilePromiseReceiver.h
Application Kit
Copyright (c) 2015-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSPasteboard.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSOperationQueue;
API_AVAILABLE(macos(10.12))
@interface NSFilePromiseReceiver : NSObject <NSPasteboardReading>
/* A view must register what types it accepts via -registerForDraggedTypes:. Use this class method to get the file promise drag types that NSFilePromiseReceiver can accept, in order to register a view to accept promised files.
*/
@property (class, readonly, copy) NSArray<NSString *> *readableDraggedTypes;
/* The UTI of the file types promised (Note: The count of fileTypes should tell you the number of promised files, however, that is not guaranteed. Historically, some legacy file promisers only list each unique fileType once and write one or more files per type.
*/
@property(copy, readonly) NSArray<NSString*> *fileTypes;
/* The file names of the promised files that are being written to the destination location. Note: This property returns an empty array until the file promise is called in via receivePromisedFilesAtDestination.
Note: This is an array, because legacy promises are an array of files on one pasteboard item.
*/
@property(copy, readonly) NSArray<NSString*> *fileNames;
/* This effectively calls in the promises. Therefore, only call once you are accepting the file promise.
All file promisesReceiver's in a drag must specify the same destination location.
This is an array, because legacy promises are an array of files on one pasteboard item.
The reader block is called on the supplied operationQueue when the promised file is ready to be read. When the source is an NSFilePromiseProvider, the readerBlock call is wrapped in an NSFileCoordination read. Otherwise, a heuristic is used to determine when the promised file is ready to be read.
The options dictionary is ignored for now.
Note: Writing of the promised file may be cancelled or fail. When either occurs, the readerBlock is still called, but with a non-nil NSError. When NSError is non-nil, fileURL should be ignored.
*/
- (void)receivePromisedFilesAtDestination:(NSURL *)destinationDir options:(NSDictionary *)options operationQueue:(NSOperationQueue *)operationQueue reader:(void(^)(NSURL *fileURL, NSError * _Nullable errorOrNil))reader;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSDocumentController.h | /*
NSDocumentController.h
Application Kit
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSNibDeclarations.h>
#import <AppKit/NSMenu.h>
#import <AppKit/NSUserInterfaceValidation.h>
#import <AppKit/AppKitDefines.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDate.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSDocument, NSError, NSMenuItem, NSMutableDictionary, NSOpenPanel, NSURL, NSWindow;
NS_SWIFT_UI_ACTOR
@interface NSDocumentController : NSObject<NSCoding, NSMenuItemValidation, NSUserInterfaceValidations>
#pragma mark *** The Shared Document Controller ***
/* Return the application's shared document controller. This method will create an instance of NSDocumentController if there is no shared document controller yet. Because the first instance of NSDocumentController to be allocate and initialized during application launch is used as the shared document controller, you have two options for installing an instance of a custom subclass of NSDocumentController as the shared document controller:
1) Instantiate your NSDocumentController subclass in the application's main nib, or
2) Allocate and initialize an instance of your subclass in your application delegate's applicationWillFinishLaunching: method.
*/
@property (class, readonly, strong) __kindof NSDocumentController *sharedDocumentController;
/* The designated initializer. The first instance of NSDocumentController to be allocate and initialized during application launch is used as the shared document controller.
*/
- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
#pragma mark *** Currently Open Documents ***
/* Return an array of all open documents.
*/
@property (readonly, copy) NSArray<__kindof NSDocument *> *documents;
/* Return the active document, or nil if there is no active document. The "active" document is the one corresponding to the key window, or the one corresponding to the main window if the key window has no document.
*/
@property (nullable, readonly, strong) __kindof NSDocument *currentDocument;
/* Return the path of the directory containing the active document's file or file package, if there is an active document and it has a file or file package. Return nil otherwise. The default implementation of -URLsFromRunningOpenPanel invokes this to find the current directory to set in the open panel before presenting it.
*/
@property (nullable, readonly, copy) NSString *currentDirectory;
/* Given a URL, return the open document whose file or file package is located by the URL, or nil if there is no such open document. The default implementation of this method queries each open document to find one whose URL matches, and returns the first one whose URL does match.
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self documentForFileName:[url path]] if -documentForFileName: is overridden and the URL uses the "file:" scheme.
*/
- (nullable __kindof NSDocument *)documentForURL:(NSURL *)url;
/* Given a window, return the document corresponding to the window, nil if no document corrresponds to the window.
*/
- (nullable __kindof NSDocument *)documentForWindow:(NSWindow *)window;
/* Add or remove a document from the list of open documents. You can override these methods if your application needs to customize what is done when documents are opened and closed. -addDocument is invoked by the default implementations of all NSDocumentController methods whose names start with "open." Your application can invoke -addDocument: manually if it creates a document using something other than one of NSDocument's "open" methods. -removeDocument is invoked by the default implementation of -[NSDocument close].
*/
- (void)addDocument:(NSDocument *)document;
- (void)removeDocument:(NSDocument *)document;
#pragma mark *** Document Creation ***
/* The action of the File menu's New item in a document-based application. The default implementation of this method invokes -openUntitledDocumentAndDisplay:error: and, if nil is returned, presents the error in an application-modal panel.
*/
- (IBAction)newDocument:(nullable id)sender;
/* Create a new untitled document, present its user interface if displayDocument is YES, and return the document if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why a new untitled document could not be created. The default implementation of this method invokes [self defaultType] to determine the type of new document to create, invokes -makeUntitledDocumentOfType:error: to create it, then invokes -addDocument: to record its opening. If displayDocument is YES, it then sends the new document -makeWindowControllers and -showWindows messages.
The default implementation of this method uses the file coordination mechanism that was added to the Foundation framework in Mac OS 10.7. It passes the document to +[NSFileCoordinator addFilePresenter:] right after -addDocument: is invoked. (The balancing invocation of +[NSFileCoordinator removeFilePresenter:] is in -[NSDocument close]).
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self openUntitledDocumentOfType:[self defaultType] display:displayDocument] if -openUntitledDocumentOfType:display: is overridden.
*/
- (nullable __kindof NSDocument *)openUntitledDocumentAndDisplay:(BOOL)displayDocument error:(NSError **)outError;
/* Instantiate a new untitled document of the specified type and return it if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why a new untitled document could not be instantiated. The default implementation of this method invokes -documentClassForType: to find out the class of document to instantiate, allocates a document object, and initializes it by sending it an -initWithType:error: message.
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self makeUntitledDocumentOfType:typeName] if -makeUntitledDocumentOfType: is overridden.
*/
- (nullable __kindof NSDocument *)makeUntitledDocumentOfType:(NSString *)typeName error:(NSError **)outError;
#pragma mark *** Document Opening ***
/* The action of the File menu's Open... item in a document-based application. The default implementation of this method invokes -beginOpenPanelWithCompletionHandler:, unless -fileNamesFromRunningOpenPanel is overridden, in which case that method is invoked instead for backward binary compatibility with Mac OS 10.3 and earlier. If an array other than nil is obtained from that call, it invokes -openDocumentWithContentsOfURL:display:completionHandler: for each URL and, if an error is signaled for any of them, presents the error in an application-modal panel.
*/
- (IBAction)openDocument:(nullable id)sender;
/* Present an application-modal open panel to the user and, if the user selects one or more files and indicates that they are to be opened, return an array of those files' URLs. Return nil otherwise. The default implementation of this method invokes -runModalOpenPanel:forTypes: after it has set up an open panel.
*/
- (nullable NSArray<NSURL *> *)URLsFromRunningOpenPanel;
/* Present the application-modal open panel to the user, specifying a list of UTIs (in Mac OS 10.5), file name extensions, and encoded HFS file types for openable files. Return NSOKButton or NSCancelButton depending on how the user dismisses the panel.
*/
- (NSInteger)runModalOpenPanel:(NSOpenPanel *)openPanel forTypes:(nullable NSArray<NSString *> *)types;
/* Present an open panel, which may or may not be application-modal, to the user and, if the user selects one or more files and indicates that they are to be opened, invoke the completion handler with an array of those files' URLs. Invoke the completion handler with nil otherwise. The default implementation of this method invokes -beginOpenPanel:forTypes:completionHandler:. However, for backward binary compatibility, it invokes -runModalOpenPanel:forTypes: instead if you override it in a subclass and not -beginOpenPanel:forTypes:completionHandler:.
If you override -[NSDocumentController openDocument:], you would typically want to invoke this method instead of -beginOpenPanel:forTypes:completionHandler: or -URLsFromRunningOpenPanel directly. You typically would not override this method without calling super.
*/
- (void)beginOpenPanelWithCompletionHandler:(void (^)(NSArray<NSURL *> * _Nullable))completionHandler API_AVAILABLE(macos(10.8));
/* Present an open panel, which will always be non-modal, to the user, specifying a list of UTIs for openable files. Invoke the completion handler with NSOKButton or NSCancelButton depending on how the user dismisses the panel.
You typically would not invoke this method directly. You can override it though if you need to customize the open panel before it gets displayed.
*/
- (void)beginOpenPanel:(NSOpenPanel *)openPanel forTypes:(nullable NSArray<NSString *> *)inTypes completionHandler:(void (^)(NSInteger result))completionHandler API_AVAILABLE(macos(10.8));
/* Open a document located by a URL, present its user interface if displayDocument is YES, and invoke the passed-in completion handler at some point in the future, perhaps after the method invocation has returned. The completion handler must be invoked on the main thread. If successful, pass the document to the completion handler, and also whether the document was already open or being opened before this method was invoked. If not successful, pass a nil document and an NSError that encapsulates the reason why the document could not be opened.
The default implementation of this method checks to see if the document is already open or being opened, and if it is not determines the type of the document, invokes -makeDocumentWithContentsOfURL:ofType:error: to instantiate it, invokes -addDocument: to record its opening, and sends the document -makeWindowControllers and -showWindows messages if displayDocument is YES. If the document is already open it is just sent a -showWindows message if displayDocument is YES. If the relevant document class returns YES when sent +canConcurrentlyReadDocumentsOfType: then the invocation of -makeDocumentWithContentsOfURL:ofType:error: is done on a thread other than the main one and when that has returned the rest of the operation is done on the main thread.
The default implementation of this method uses the file coordination mechanism that was added to the Foundation framework in Mac OS 10.7. All of the work it does is one big coordinated read, and it passes the document to +[NSFileCoordinator addFilePresenter:] right after -addDocument: is invoked. (The balancing invocation of +[NSFileCoordinator removeFilePresenter:] is in -[NSDocument close]).
You can override this method to customize how documents are opened. Its implemention however is somewhat complex so unless your customization is to do additional work before invoking super, or to invoke super with a completion handler that does additional work before invoking the original completion handler, you should investigate overriding one of the methods that it invokes instead. If you do override this method you should investigate whether you should also override -reopenDocumentForURL:withContentsOfURL:display:completionHandler: to apply the same customization. In either cause take care to always invoke the completion handler on the main thread.
You can of course invoke this method to open a document.
For backward binary compatibility with Mac OS 10.6 and earlier, the default implementation of this method invokes [self openDocumentWithContentsOfURL:url display:displayDocument error:&anError] if that method or the even older -openDocumentWithContentsOfFile:display: method is overridden and this one is not, instead of invoking -makeDocumentWithContentsOfURL:ofType:error: and all the rest.
*/
- (void)openDocumentWithContentsOfURL:(NSURL *)url display:(BOOL)displayDocument completionHandler:(void (^)(NSDocument * _Nullable document, BOOL documentWasAlreadyOpen, NSError * _Nullable error))completionHandler API_AVAILABLE(macos(10.7));
/* Instantiate a document located by a URL, of a specified type, and return it if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why the document could not be instantiated. The default implementation of this method invokes -documentClassForType: to find out the class of document to instantiate, allocates a document object, and initializes it by sending it an -initWithContentsOfURL:ofType:error: message.
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self makeDocumentWithContentsOfFile:[url path] ofType:typeName] if -makeDocumentWithContentsOfFile:ofType: is overridden and the URL uses the "file:" scheme.
*/
- (nullable __kindof NSDocument *)makeDocumentWithContentsOfURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError;
#pragma mark *** Document Reopening ***
/* Reopen a document, perhaps located by a URL, perhaps not, by reading the contents for the document from another URL, which may or may not be a different URL, present its user interface if displayDocument is YES, and invoke the passed-in completion handler at some point in the future, perhaps after the method invocation has returned. The completion handler must be invoked on the main thread. If successful, pass the document to the completion handler, and also whether the document was already open or being opened before this method was invoked. If not successful, pass a nil document and an NSError that encapsulates the reason why the document could not be opened. A nil URL indicates that the opened document is to have no fileURL, much like an untitled document has.
The default implementation of this method is very similar to -openDocumentWithContentsOfURL:display:completionHandler:'s, the primary difference being that it invokes -makeDocumentForURL:withContentsOfURL:ofType:error: instead of -makeDocumentWithContentsOfURL:ofType:error:.
You can override this method to customize how documents are reopened during application launching by the restorable state mechanism that was added to the AppKit framework in Mac OS 10.7. Its implemention however is somewhat complex so unless your customization is to do additional work before invoking super, or to invoke super with a completion handler that does additional work before invoking the original completion handler, you should investigate overriding one of the methods that it invokes instead.
We don't anticipate any uses for an application to invoke this method directly, but you may discover one.
For backward binary compatibility with Mac OS 10.6 and earlier, the default implementation of this method invokes [self reopenDocumentForURL:url withContentsOfURLcontentsURL error:&anError] if that method is overridden and this one is not, instead of invoking -makeDocumentForURL:withContentsOfURL:ofType:error: and all the rest.
*/
- (void)reopenDocumentForURL:(nullable NSURL *)urlOrNil withContentsOfURL:(NSURL *)contentsURL display:(BOOL)displayDocument completionHandler:(void (^)(NSDocument * _Nullable document, BOOL documentWasAlreadyOpen, NSError * _Nullable error))completionHandler API_AVAILABLE(macos(10.7));
/* Instantiate a document, perhaps located by a URL, perhaps not, by reading the contents for the document from another URL, which may or may not be a different URL, and return it if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why the document could not be instantiated. The default implementation of this method invokes -documentClassForType: to find out the class of document to instantiate, allocates a document object, and initializes it by sending it an -initForURL:withContentsOfURL:ofType:error: message.
*/
- (nullable __kindof NSDocument *)makeDocumentForURL:(nullable NSURL *)urlOrNil withContentsOfURL:(NSURL *)contentsURL ofType:(NSString *)typeName error:(NSError **)outError;
#pragma mark *** Document Autosaving ***
/* The time interval in seconds for periodic autosaving. A value of 0 indicates that periodic autosaving should not be done at all. NSDocument will use this number as the minimum amount of time to wait between detecting that a document has unautosaved changes and sending the document an -autosaveDocumentWithDelegate:didAutosaveSelector:contextInfo: message. The default value is 0. You can change it to enable periodic autosaving.
*/
@property NSTimeInterval autosavingDelay;
#pragma mark *** Document Saving ***
/* The action of the File menu's Save All item in a document-based application. The default implementation of this method sends each modified document a -saveDocumentWithDelegate:didSaveSelector:contextInfo: message.
*/
- (IBAction)saveAllDocuments:(nullable id)sender;
#pragma mark *** Document Closing ***
/* Return YES if any open document is modified, NO otherwise. This method is invoked at application quitting time, to determine whether -reviewUnsavedDocumentsWithAlertTitle:cancellable:delegate:didReviewAllSelector:contextInfo: should be invoked.
*/
@property (readonly) BOOL hasEditedDocuments;
/* If there is more than one modified document, present an application-modal alert panel telling the user that there are unsaved documents and giving the option of canceling, not saving the documents, or saving the documents. If the user indicates that saving should be done, or if there was only one modified document in the first place, invoke -closeAllDocumentsWithDelegate:didCloseAllSelector:didReviewAll:contextInfo: to attempt to close all modified documents, doing whatever saving is necessary to not lose data. Finally, send the message selected by didReviewAllSelector to the delegate, with the contextInfo as the last argument. The default implementation of this method ignores the passed-in title string (which is passed in only as the result of a historical quirk). The method selected by didReviewAllSelector must have the same signature as:
- (void)documentController:(NSDocumentController *)documentController didReviewAll:(BOOL)didReviewAll contextInfo:(void *)contextInfo;
*/
- (void)reviewUnsavedDocumentsWithAlertTitle:(nullable NSString *)title cancellable:(BOOL)cancellable delegate:(nullable id)delegate didReviewAllSelector:(nullable SEL)didReviewAllSelector contextInfo:(nullable void *)contextInfo;
/* For each open, modified, document present a document-modal alert panel asking whether the document should be saved and giving the option of canceling, not saving the document, or saving the document. Stop presenting alert panels if the user indicates cancellation in any one of them. The default implementation of this merely sends each open document -canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo: and -close messages until one of them cannot be closed. The method selected by didCloseAllSelector must have the same signature as:
- (void)documentController:(NSDocumentController *)documentController didCloseAll:(BOOL)didCloseAll contextInfo:(void *)contextInfo;
*/
- (void)closeAllDocumentsWithDelegate:(nullable id)delegate didCloseAllSelector:(nullable SEL)didCloseAllSelector contextInfo:(nullable void *)contextInfo;
#pragma mark *** Document Duplicating ***
/* Create a new document that will not yet have a location by reading the contents for the document from another URL, present its user interface, and return the document if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why a new document could not be created. If duplicateByCopying is YES then first copy the contents located at the passed-in URL into a file located in the same directory that is used for the autosaved contents of untitled documents and with the same sort of name. if displayNameOrNil is not nil then use that value to derive a display name for the new document that does not match one that is already in use by an open document.
The default implementation of this method copies the file if specified, determines the type of the document, invokes -makeDocumentForURL:withContentsOfURL:ofType:error: to instantiate it, sends the document -setDisplayName: to name it if displayNameOrNil is not nil, invokes -addDocument: to record its opening, and sends the document -makeWindowControllers and -showWindows messages.
The default implementation of this method uses the file coordination mechanism that was added to the Foundation framework in Mac OS 10.7. It passes the document to +[NSFileCoordinator addFilePresenter:] right after -addDocument: is invoked. (The balancing invocation of +[NSFileCoordinator removeFilePresenter:] is in -[NSDocument close]).
You can override this method to customize how documents are duplicated. It is invoked by -[NSDocument duplicateAndReturnError:]. It may however also be invoked from other places in AppKit.
We don't anticipate any uses for your application to invoke this method directly, but you may discover one.
*/
- (nullable __kindof NSDocument *)duplicateDocumentWithContentsOfURL:(NSURL *)url copying:(BOOL)duplicateByCopying displayName:(nullable NSString *)displayNameOrNil error:(NSError **)outError API_AVAILABLE(macos(10.7));
#pragma mark *** Document Sharing ***
/* If YES, allows automatic insertion of a Share menu in the File menu.
By default, this will be YES if your application has any NSDocument subclasses for which autosavesInPlace is YES. To disable the Share menu entirely, or to enable custom placement or construction of the Share menu, applications can explicitly opt out of automatic share menu insertion by overriding this property to return NO.
Be aware that even if allowsAutomaticShareMenu is YES, NSDocumentController may choose not to insert the Share menu if it detects that the application already has a Share menu.
*/
@property (readonly) BOOL allowsAutomaticShareMenu API_AVAILABLE(macos(10.13));
/* A menu item that can be used for sharing the current document. You would typically only use this if you make your NSDocument subclass return NO for allowsAutomaticShareMenu to do custom placement of the Share menu.
*/
- (NSMenuItem *)standardShareMenuItem API_AVAILABLE(macos(10.13));
#pragma mark *** Error Presentation ***
/* Methods that are declared by NSResponder and also implemented by NSDocumentController, even though for historical reasons NSDocumentController is not a subclass of NSResponder. NSDocumentController's default implementations are equivalent to NSResponder's while treating the application object as the "next responder" and forwarding error presentation messages to it.
NSDocument has overrides of -presentError:modalForWindow:delegate:didPresentSelector:contextInfo: and -presentError: that treat the shared document controller as the "next responder" and forward these messages it.
The default implementations of several NSDocumentController methods invoke -presentError:.
You can customize the presentation of errors for all kinds of documents by overriding -willPresentError:. Your override should follow the advice given for overriding of -[NSResponder willPresentError:].
*/
- (void)presentError:(NSError *)error modalForWindow:(NSWindow *)window delegate:(nullable id)delegate didPresentSelector:(nullable SEL)didPresentSelector contextInfo:(nullable void *)contextInfo;
- (BOOL)presentError:(NSError *)error;
- (NSError *)willPresentError:(NSError *)error;
#pragma mark *** The Open Recent Menu ***
/* Return the maximum number of items that may be presented in the standard Open Recent menu. A value of 0 indicates that NSDocumentController will not attempt to add an Open Recent menu to your application's File menu, though NSDocumentController will not attempt to remove any Open Recent menu item if there is one already there. The default implementation returns a value that is subject to change and may or may not be derived from a setting made by the user in a System Preferences panel.
*/
@property (readonly) NSUInteger maximumRecentDocumentCount;
/* The action of the Open Recent menu's Clear Menu item.
*/
- (IBAction)clearRecentDocuments:(nullable id)sender;
/* Add an item corresponding to a document to the Open Recent menu, or replace an existing item for the same document.
*/
- (void)noteNewRecentDocument:(NSDocument *)document;
/* Add an item corresponding to the data located by a URL to the Open Recent menu, or replace an existing item with the same URL. You can use this even in non-NSDocument-based applications.
*/
- (void)noteNewRecentDocumentURL:(NSURL *)url;
/* Return an array of URLs for the entries currently appearing in the Open Recent menu.
*/
@property (readonly, copy) NSArray<NSURL *> *recentDocumentURLs;
#pragma mark *** Document Types ***
/* Return the name of the document type that should be used when creating new documents. The default implementation of this method returns the first Editor type declared in the application's Info.plist, or returns nil if no Editor type is declared. You can override it to customize the type of document that is created when, for instance, the user chooses New in the File menu.
*/
@property (nullable, readonly) NSString *defaultType;
/* Given a URL, return the name of the document type that should be used when opening the document at that location, if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why the document's type could not be determined, or the fact that the document's type is just unrecognized. The default implementation of this method merely returns the URL's NSURLTypeIdentifierKey resource value. You can override this to customize type determination for documents being opened.
For backward binary compatibility with Mac OS 10.4 and earlier, the default implementation of this method actually first does the same thing that it did in Mac OS 10.4 (invoke -typeFromFileExtension:, possibly twice, passing an HFS file type string for the second invocation) if there are any CFBundleDocumentTypes Info.plist entries that don't have LSItemContentTypes subentries, and only gets the URL's NSURLTypeIdentifierKey resource value if that does not succeed.
*/
- (nullable NSString *)typeForContentsOfURL:(NSURL *)url error:(NSError **)outError;
/* Return the names of NSDocument subclasses supported by this application. The default implementation of this method returns information derived from the application's Info.plist. You can override it to return the names of document classes that are dynamically loaded from plugins.
*/
@property (readonly, copy) NSArray<NSString *> *documentClassNames;
/* Given a document type name, return the subclass of NSDocument that should be instantiated when opening a document of that type, or nil for failure.
*/
- (nullable Class)documentClassForType:(NSString *)typeName;
/* Given a document type name, return a string describing the document type that is fit to present to the user, or nil for failure.
*/
- (nullable NSString *)displayNameForType:(NSString *)typeName;
#pragma mark *** Menu Item Validation ***
/* Conformance to the NSUserInterfaceValidations protocol. NSDocumentController's implementation of this method conditionally enables menu items for all of the action methods listed in this header file, as well as the private action method for Open Recent menu items.
*/
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item;
@end
@interface NSDocumentController(NSDeprecated)
#pragma mark *** Backward Compatibility
/* Methods that were deprecated in Mac OS 10.7. See the comments above for information about when your overrides of them are still invoked, for backward binary compatibility.
*/
- (nullable id)openDocumentWithContentsOfURL:(NSURL *)url display:(BOOL)displayDocument error:(NSError **)outError API_DEPRECATED("Use -openDocumentWithContentsOfURL:display:completionHandler: instead", macos(10.4,10.7));
- (BOOL)reopenDocumentForURL:(nullable NSURL *)url withContentsOfURL:(NSURL *)contentsURL error:(NSError **)outError API_DEPRECATED("Use -reopenDocumentForURL:withContentsOfURL:display:completionHandler: instead", macos(10.4,10.7));
/* Methods that were deprecated in Mac OS 10.5, and don't work well in applications whose document types are declared with UTIs. In general, if each of the application's CFBundleDocumentTypes Info.plist entries has a valid LSItemContentTypes subentry, and the application doesn't invoke deprecated methods like -fileNamesFromRunningOpenPanel, then these methods will never be invoked from within Cocoa.
*/
- (nullable NSArray *)fileExtensionsFromType:(NSString *)typeName API_DEPRECATED("", macos(10.0,10.5));
- (nullable NSString *)typeFromFileExtension:(NSString *)fileNameExtensionOrHFSFileType API_DEPRECATED("", macos(10.0,10.5));
/* Methods that were deprecated in Mac OS 10.4. See the comments above for information about when your overrides of them are still invoked, for backward binary compatibility.
*/
- (nullable id)documentForFileName:(NSString *)fileName API_DEPRECATED("", macos(10.0,10.4));
- (nullable NSArray *)fileNamesFromRunningOpenPanel API_DEPRECATED("", macos(10.0,10.4));
- (nullable id)makeDocumentWithContentsOfFile:(NSString *)fileName ofType:(NSString *)type API_DEPRECATED("", macos(10.0,10.4));
- (nullable id)makeDocumentWithContentsOfURL:(NSURL *)url ofType:(null_unspecified NSString *)type API_DEPRECATED("", macos(10.0,10.4));
- (nullable id)makeUntitledDocumentOfType:(NSString *)type API_DEPRECATED("", macos(10.0,10.4));
- (nullable id)openDocumentWithContentsOfFile:(NSString *)fileName display:(BOOL)display API_DEPRECATED("", macos(10.0,10.4));
- (nullable id)openDocumentWithContentsOfURL:(NSURL *)url display:(BOOL)display API_DEPRECATED("", macos(10.0,10.4));
- (nullable id)openUntitledDocumentOfType:(NSString*)type display:(BOOL)display API_DEPRECATED("", macos(10.0,10.4));
- (void)setShouldCreateUI:(BOOL)flag API_DEPRECATED("", macos(10.0,10.4));
- (BOOL)shouldCreateUI API_DEPRECATED("", macos(10.0,10.4));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSSpeechSynthesizer.h | /*
NSSpeechSynthesizer.h
Application Kit
Copyright (c) 2003-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/AppKitDefines.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSRange.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSString, NSURL, NSError;
@protocol NSSpeechSynthesizerDelegate;
typedef NSString * NSSpeechSynthesizerVoiceName NS_TYPED_ENUM;
typedef NSString * NSVoiceAttributeKey NS_TYPED_ENUM;
APPKIT_EXTERN NSVoiceAttributeKey const NSVoiceName;
APPKIT_EXTERN NSVoiceAttributeKey const NSVoiceIdentifier;
APPKIT_EXTERN NSVoiceAttributeKey const NSVoiceAge;
APPKIT_EXTERN NSVoiceAttributeKey const NSVoiceGender;
APPKIT_EXTERN NSVoiceAttributeKey const NSVoiceDemoText;
APPKIT_EXTERN NSVoiceAttributeKey const NSVoiceLocaleIdentifier API_AVAILABLE(macos(10.5));
APPKIT_EXTERN NSVoiceAttributeKey const NSVoiceSupportedCharacters API_AVAILABLE(macos(10.5));
APPKIT_EXTERN NSVoiceAttributeKey const NSVoiceIndividuallySpokenCharacters API_AVAILABLE(macos(10.5));
// Use with addSpeechDictionary:
typedef NSString * NSSpeechDictionaryKey NS_TYPED_ENUM;
APPKIT_EXTERN NSSpeechDictionaryKey const NSSpeechDictionaryLocaleIdentifier API_AVAILABLE(macos(10.5)); // NSString
APPKIT_EXTERN NSSpeechDictionaryKey const NSSpeechDictionaryModificationDate API_AVAILABLE(macos(10.5)); // NSString
APPKIT_EXTERN NSSpeechDictionaryKey const NSSpeechDictionaryPronunciations API_AVAILABLE(macos(10.5)); // NSArray
APPKIT_EXTERN NSSpeechDictionaryKey const NSSpeechDictionaryAbbreviations API_AVAILABLE(macos(10.5)); // NSArray
APPKIT_EXTERN NSSpeechDictionaryKey const NSSpeechDictionaryEntrySpelling API_AVAILABLE(macos(10.5)); // NSString
APPKIT_EXTERN NSSpeechDictionaryKey const NSSpeechDictionaryEntryPhonemes API_AVAILABLE(macos(10.5)); // NSString
// Values for NSVoiceGender voice attribute
typedef NSString * NSVoiceGenderName NS_TYPED_ENUM;
APPKIT_EXTERN NSVoiceGenderName const NSVoiceGenderNeuter;
APPKIT_EXTERN NSVoiceGenderName const NSVoiceGenderMale;
APPKIT_EXTERN NSVoiceGenderName const NSVoiceGenderFemale;
// Synthesizer Properties (including object type)
typedef NSString * NSSpeechPropertyKey NS_TYPED_ENUM;
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechStatusProperty API_AVAILABLE(macos(10.5)); // NSDictionary, see keys below
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechErrorsProperty API_AVAILABLE(macos(10.5)); // NSDictionary, see keys below
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechInputModeProperty API_AVAILABLE(macos(10.5)); // NSString: NSSpeechModeTextProperty or NSSpeechModePhonemeProperty
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechCharacterModeProperty API_AVAILABLE(macos(10.5)); // NSString: NSSpeechModeNormalProperty or NSSpeechModeLiteralProperty
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechNumberModeProperty API_AVAILABLE(macos(10.5)); // NSString: NSSpeechModeNormalProperty or NSSpeechModeLiteralProperty
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechRateProperty API_AVAILABLE(macos(10.5)); // NSNumber
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechPitchBaseProperty API_AVAILABLE(macos(10.5)); // NSNumber
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechPitchModProperty API_AVAILABLE(macos(10.5)); // NSNumber
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechVolumeProperty API_AVAILABLE(macos(10.5)); // NSNumber
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechSynthesizerInfoProperty API_AVAILABLE(macos(10.5)); // NSDictionary, see keys below
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechRecentSyncProperty API_AVAILABLE(macos(10.5)); // NSNumber
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechPhonemeSymbolsProperty API_AVAILABLE(macos(10.5)); // NSDictionary, see keys below
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechCurrentVoiceProperty API_AVAILABLE(macos(10.5)); // NSString
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechCommandDelimiterProperty API_AVAILABLE(macos(10.5)); // NSDictionary, see keys below
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechResetProperty API_AVAILABLE(macos(10.5));
APPKIT_EXTERN NSSpeechPropertyKey const NSSpeechOutputToFileURLProperty API_AVAILABLE(macos(10.5)); // NSURL
// NSVoiceLanguage has been replaced by NSVoiceLocaleIdentifier
APPKIT_EXTERN NSVoiceAttributeKey const NSVoiceLanguage API_DEPRECATED("", macos(10.0,10.5));
// Values for NSSpeechBoundary
typedef NS_ENUM(NSUInteger, NSSpeechBoundary) {
NSSpeechImmediateBoundary = 0,
NSSpeechWordBoundary,
NSSpeechSentenceBoundary
} API_AVAILABLE(macos(10.5));
@interface NSSpeechSynthesizer : NSObject
- (nullable instancetype)initWithVoice:(nullable NSSpeechSynthesizerVoiceName)voice;
- (BOOL)startSpeakingString:(NSString *)string;
- (BOOL)startSpeakingString:(NSString *)string toURL:(NSURL *)url;
@property (getter=isSpeaking, readonly) BOOL speaking;
- (void)stopSpeaking;
- (void)stopSpeakingAtBoundary:(NSSpeechBoundary)boundary API_AVAILABLE(macos(10.5));
- (void)pauseSpeakingAtBoundary:(NSSpeechBoundary)boundary API_AVAILABLE(macos(10.5));
- (void)continueSpeaking API_AVAILABLE(macos(10.5));
@property (nullable, weak) id<NSSpeechSynthesizerDelegate> delegate;
- (nullable NSSpeechSynthesizerVoiceName)voice;
- (BOOL)setVoice:(nullable NSSpeechSynthesizerVoiceName)voice;
@property float rate API_AVAILABLE(macos(10.5));
@property float volume API_AVAILABLE(macos(10.5));
@property BOOL usesFeedbackWindow;
- (void)addSpeechDictionary:(NSDictionary<NSSpeechDictionaryKey, id> *)speechDictionary API_AVAILABLE(macos(10.5));
- (NSString *)phonemesFromText:(NSString *)text API_AVAILABLE(macos(10.5));
- (nullable id)objectForProperty:(NSSpeechPropertyKey)property error:(NSError **)outError API_AVAILABLE(macos(10.5));
- (BOOL)setObject:(nullable id)object forProperty:(NSSpeechPropertyKey)property error:(NSError **)outError API_AVAILABLE(macos(10.5));
@property (class, readonly, getter=isAnyApplicationSpeaking) BOOL anyApplicationSpeaking;
@property (class, readonly, copy) NSSpeechSynthesizerVoiceName defaultVoice;
@property (class, readonly, copy) NSArray<NSSpeechSynthesizerVoiceName> *availableVoices;
+ (NSDictionary<NSVoiceAttributeKey, id> *)attributesForVoice:(NSSpeechSynthesizerVoiceName)voice;
@end
@protocol NSSpeechSynthesizerDelegate <NSObject>
@optional
- (void)speechSynthesizer:(NSSpeechSynthesizer *)sender didFinishSpeaking:(BOOL)finishedSpeaking;
- (void)speechSynthesizer:(NSSpeechSynthesizer *)sender willSpeakWord:(NSRange)characterRange ofString:(NSString *)string;
- (void)speechSynthesizer:(NSSpeechSynthesizer *)sender willSpeakPhoneme:(short)phonemeOpcode;
- (void)speechSynthesizer:(NSSpeechSynthesizer *)sender didEncounterErrorAtIndex:(NSUInteger)characterIndex ofString:(NSString *)string message:(NSString *)message API_AVAILABLE(macos(10.5));
- (void)speechSynthesizer:(NSSpeechSynthesizer *)sender didEncounterSyncMessage:(NSString *)message API_AVAILABLE(macos(10.5));
@end
typedef NSString * NSSpeechMode NS_TYPED_ENUM;
// Speaking Modes for NSSpeechInputModeProperty
APPKIT_EXTERN NSSpeechMode const NSSpeechModeText API_AVAILABLE(macos(10.5));
APPKIT_EXTERN NSSpeechMode const NSSpeechModePhoneme API_AVAILABLE(macos(10.5));
// Speaking Modes for NSSpeechInputModeProperty and NSSpeechNumberModeProperty
APPKIT_EXTERN NSSpeechMode const NSSpeechModeNormal API_AVAILABLE(macos(10.5));
APPKIT_EXTERN NSSpeechMode const NSSpeechModeLiteral API_AVAILABLE(macos(10.5));
// Dictionary keys returned by NSSpeechStatusProperty
typedef NSString * NSSpeechStatusKey NS_TYPED_ENUM;
APPKIT_EXTERN NSSpeechStatusKey const NSSpeechStatusOutputBusy API_AVAILABLE(macos(10.5)); // NSNumber
APPKIT_EXTERN NSSpeechStatusKey const NSSpeechStatusOutputPaused API_AVAILABLE(macos(10.5)); // NSNumber
APPKIT_EXTERN NSSpeechStatusKey const NSSpeechStatusNumberOfCharactersLeft API_AVAILABLE(macos(10.5)); // NSNumber
APPKIT_EXTERN NSSpeechStatusKey const NSSpeechStatusPhonemeCode API_AVAILABLE(macos(10.5)); // NSNumber
// Dictionary keys returned by NSSpeechErrorProperty
typedef NSString * NSSpeechErrorKey NS_TYPED_ENUM;
APPKIT_EXTERN NSSpeechErrorKey const NSSpeechErrorCount API_AVAILABLE(macos(10.5)); // NSNumber
APPKIT_EXTERN NSSpeechErrorKey const NSSpeechErrorOldestCode API_AVAILABLE(macos(10.5)); // NSNumber
APPKIT_EXTERN NSSpeechErrorKey const NSSpeechErrorOldestCharacterOffset API_AVAILABLE(macos(10.5)); // NSNumber
APPKIT_EXTERN NSSpeechErrorKey const NSSpeechErrorNewestCode API_AVAILABLE(macos(10.5)); // NSNumber
APPKIT_EXTERN NSSpeechErrorKey const NSSpeechErrorNewestCharacterOffset API_AVAILABLE(macos(10.5)); // NSNumber
// Dictionary keys returned by NSSpeechSynthesizerInfoProperty
typedef NSString * NSSpeechSynthesizerInfoKey NS_TYPED_ENUM;
APPKIT_EXTERN NSSpeechSynthesizerInfoKey const NSSpeechSynthesizerInfoIdentifier API_AVAILABLE(macos(10.5)); // NSString
APPKIT_EXTERN NSSpeechSynthesizerInfoKey const NSSpeechSynthesizerInfoVersion API_AVAILABLE(macos(10.5)); // NSString
// Dictionary keys returned by NSSpeechPhonemeSymbolsProperty
typedef NSString * NSSpeechPhonemeInfoKey NS_TYPED_ENUM;
APPKIT_EXTERN NSSpeechPhonemeInfoKey const NSSpeechPhonemeInfoOpcode API_AVAILABLE(macos(10.5)); // NSNumber
APPKIT_EXTERN NSSpeechPhonemeInfoKey const NSSpeechPhonemeInfoSymbol API_AVAILABLE(macos(10.5)); // NSString
APPKIT_EXTERN NSSpeechPhonemeInfoKey const NSSpeechPhonemeInfoExample API_AVAILABLE(macos(10.5)); // NSString
APPKIT_EXTERN NSSpeechPhonemeInfoKey const NSSpeechPhonemeInfoHiliteStart API_AVAILABLE(macos(10.5)); // NSNumber
APPKIT_EXTERN NSSpeechPhonemeInfoKey const NSSpeechPhonemeInfoHiliteEnd API_AVAILABLE(macos(10.5)); // NSNumber
// Dictionary keys returned by NSSpeechCommandDelimiterProperty
typedef NSString * NSSpeechCommandDelimiterKey NS_TYPED_ENUM;
APPKIT_EXTERN NSSpeechCommandDelimiterKey const NSSpeechCommandPrefix API_AVAILABLE(macos(10.5)); // NSString
APPKIT_EXTERN NSSpeechCommandDelimiterKey const NSSpeechCommandSuffix API_AVAILABLE(macos(10.5)); // NSString
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/NSAttributedString.h | #if !__has_include(<UIFoundation/NSAttributedString.h>)
/*
NSAttributedString.h
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
This file defines Application Kit extensions to NSAttributedString and NSMutableAttributedString.
*/
#import <Foundation/NSAttributedString.h>
#import <Foundation/NSItemProvider.h>
#import <AppKit/NSFontManager.h>
#import <AppKit/NSText.h>
#import <AppKit/NSPasteboard.h>
#import <AppKit/AppKitDefines.h>
@class NSTextBlock, NSTextTable, NSTextList;
@class NSFileWrapper;
@class NSURL;
NS_ASSUME_NONNULL_BEGIN
#if !TARGET_OS_IPHONE
/************************ Attributes ************************/
// Predefined character attributes for text. If the key is not present in the dictionary, it indicates the default value described below.
APPKIT_EXTERN NSAttributedStringKey NSFontAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0)); // NSFont, default Helvetica(Neue) 12
APPKIT_EXTERN NSAttributedStringKey NSParagraphStyleAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0)); // NSParagraphStyle, default defaultParagraphStyle
APPKIT_EXTERN NSAttributedStringKey NSForegroundColorAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0)); // NSColor, default blackColor
APPKIT_EXTERN NSAttributedStringKey NSBackgroundColorAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0)); // NSColor, default nil: no background
APPKIT_EXTERN NSAttributedStringKey NSLigatureAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0)); // NSNumber containing integer, default 1: default ligatures, 0: no ligatures
APPKIT_EXTERN NSAttributedStringKey NSKernAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0)); // NSNumber containing floating point value, in points; amount to modify default kerning. 0 means kerning is disabled.
APPKIT_EXTERN NSAttributedStringKey NSTrackingAttributeName API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0)); // NSNumber containing floating point value, in points; amount to modify default tracking. 0 means tracking is disabled.
APPKIT_EXTERN NSAttributedStringKey NSStrikethroughStyleAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0)); // NSNumber containing integer, default 0: no strikethrough
APPKIT_EXTERN NSAttributedStringKey NSUnderlineStyleAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0)); // NSNumber containing integer, default 0: no underline
APPKIT_EXTERN NSAttributedStringKey NSStrokeColorAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0)); // NSColor, default nil: same as foreground color
APPKIT_EXTERN NSAttributedStringKey NSStrokeWidthAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0)); // NSNumber containing floating point value, in percent of font point size, default 0: no stroke; positive for stroke alone, negative for stroke and fill (a typical value for outlined text would be 3.0)
APPKIT_EXTERN NSAttributedStringKey NSShadowAttributeName API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0)); // NSShadow, default nil: no shadow
APPKIT_EXTERN NSAttributedStringKey const NSTextEffectAttributeName API_AVAILABLE(macos(10.10), ios(7.0), watchos(2.0), tvos(9.0)); // NSString, default nil: no text effect
APPKIT_EXTERN NSAttributedStringKey NSAttachmentAttributeName API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // NSTextAttachment, default nil
APPKIT_EXTERN NSAttributedStringKey NSLinkAttributeName API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // NSURL (preferred) or NSString
APPKIT_EXTERN NSAttributedStringKey NSBaselineOffsetAttributeName API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // NSNumber containing floating point value, in points; offset from baseline, default 0
APPKIT_EXTERN NSAttributedStringKey NSUnderlineColorAttributeName API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // NSColor, default nil: same as foreground color
APPKIT_EXTERN NSAttributedStringKey NSStrikethroughColorAttributeName API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // NSColor, default nil: same as foreground color
APPKIT_EXTERN NSAttributedStringKey NSObliquenessAttributeName API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // NSNumber containing floating point value; skew to be applied to glyphs, default 0: no skew
APPKIT_EXTERN NSAttributedStringKey NSExpansionAttributeName API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // NSNumber containing floating point value; log of expansion factor to be applied to glyphs, default 0: no expansion
APPKIT_EXTERN NSAttributedStringKey NSWritingDirectionAttributeName API_AVAILABLE(macos(10.6), ios(7.0), watchos(2.0), tvos(9.0)); // NSArray of NSNumbers representing the nested levels of writing direction overrides as defined by Unicode LRE, RLE, LRO, and RLO characters. The control characters can be obtained by masking NSWritingDirection and NSWritingDirectionFormatType values. LRE: NSWritingDirectionLeftToRight|NSWritingDirectionEmbedding, RLE: NSWritingDirectionRightToLeft|NSWritingDirectionEmbedding, LRO: NSWritingDirectionLeftToRight|NSWritingDirectionOverride, RLO: NSWritingDirectionRightToLeft|NSWritingDirectionOverride,
APPKIT_EXTERN NSAttributedStringKey NSVerticalGlyphFormAttributeName API_AVAILABLE(macos(10.7), ios(6.0), watchos(2.0), tvos(9.0)); // An NSNumber containing an integer value. 0 means horizontal text. 1 indicates vertical text. If not specified, it could follow higher-level vertical orientation settings. Currently on iOS, it's always horizontal. The behavior for any other value is undefined.
APPKIT_EXTERN NSAttributedStringKey NSCursorAttributeName; // NSCursor, default IBeamCursor
APPKIT_EXTERN NSAttributedStringKey NSToolTipAttributeName; // NSString, default nil: no tooltip
APPKIT_EXTERN NSAttributedStringKey NSMarkedClauseSegmentAttributeName; // Clause segment index NSNumber (intValue). This attribute is used in marked text indicating clause segments
APPKIT_EXTERN NSAttributedStringKey NSTextAlternativesAttributeName API_AVAILABLE(macos(10.8)); // An NSTextAlternatives object. Used primarily as a temporary attribute, with primaryString equal to the substring for the range to which it is attached, and alternativeStrings representing alternatives for that string that may be presented to the user.
APPKIT_EXTERN NSAttributedStringKey NSSpellingStateAttributeName; // NSSpellingStateAttributeName is used and recognized only as a temporary attribute (see NSLayoutManager.h). It indicates that spelling and/or grammar indicators should be shown for the specified characters, default 0: no spelling or grammar indicator
APPKIT_EXTERN NSAttributedStringKey NSSuperscriptAttributeName; // NSNumber containing integer, default 0
APPKIT_EXTERN NSAttributedStringKey NSGlyphInfoAttributeName; // NSGlyphInfo specifying glyph for the associated attribute range
/************************ Attribute values ************************/
// This defines currently supported values for NSUnderlineStyleAttributeName and NSStrikethroughStyleAttributeName. These values are or'ed together to produce an underline style.
// Underlines will be drawn with a solid pattern by default, so NSUnderlineStylePatternSolid does not need to be specified.
typedef NS_OPTIONS(NSInteger, NSUnderlineStyle) {
NSUnderlineStyleNone = 0x00,
NSUnderlineStyleSingle = 0x01,
NSUnderlineStyleThick API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)) = 0x02,
NSUnderlineStyleDouble API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)) = 0x09,
NSUnderlineStylePatternSolid API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)) = 0x0000,
NSUnderlineStylePatternDot API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)) = 0x0100,
NSUnderlineStylePatternDash API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)) = 0x0200,
NSUnderlineStylePatternDashDot API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)) = 0x0300,
NSUnderlineStylePatternDashDotDot API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)) = 0x0400,
NSUnderlineStyleByWord API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)) = 0x8000
} API_AVAILABLE(macos(10.0), ios(6.0), watchos(2.0), tvos(9.0));
// NSWritingDirectionFormatType values used by NSWritingDirectionAttributeName. It is or'ed with either NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft. Can specify the formatting controls defined by Unicode Bidirectional Algorithm.
typedef NS_ENUM(NSInteger, NSWritingDirectionFormatType) {
NSWritingDirectionEmbedding = (0 << 1),
NSWritingDirectionOverride = (1 << 1)
} API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
// NSTextEffectAttributeName values
typedef NSString * NSTextEffectStyle NS_TYPED_ENUM;
APPKIT_EXTERN NSTextEffectStyle const NSTextEffectLetterpressStyle API_AVAILABLE(macos(10.10), ios(7.0), watchos(2.0), tvos(9.0));
// Flag values supported for NSSpellingStateAttributeName as of Mac OS X version 10.5. Prior to 10.5, any non-zero value caused the spelling indicator to be shown.
typedef NS_ENUM(NSInteger, NSSpellingState) {
NSSpellingStateSpellingFlag API_AVAILABLE(macos(10.5)) = (1 << 0),
NSSpellingStateGrammarFlag API_AVAILABLE(macos(10.5)) = (1 << 1)
};
/************************ Attribute fixing ************************/
@interface NSMutableAttributedString (NSAttributedStringAttributeFixing)
// This method fixes attribute inconsistencies inside range. It ensures NSFontAttributeName covers the characters, NSParagraphStyleAttributeName is only changing at paragraph boundaries, and NSTextAttachmentAttributeName is assigned to NSAttachmentCharacter. NSTextStorage automatically invokes this method via -ensureAttributesAreFixedInRange:.
- (void)fixAttributesInRange:(NSRange)range API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
- (void)fixFontAttributeInRange:(NSRange)range;
- (void)fixParagraphStyleAttributeInRange:(NSRange)range;
- (void)fixAttachmentAttributeInRange:(NSRange)range;
@end
/************************ Document formats ************************/
typedef NSString * NSAttributedStringDocumentType NS_TYPED_EXTENSIBLE_ENUM;
// Supported document types for the NSDocumentTypeDocumentAttribute key in the document attributes dictionary.
APPKIT_EXTERN NSAttributedStringDocumentType NSPlainTextDocumentType API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
APPKIT_EXTERN NSAttributedStringDocumentType NSRTFTextDocumentType API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
APPKIT_EXTERN NSAttributedStringDocumentType NSRTFDTextDocumentType API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
APPKIT_EXTERN NSAttributedStringDocumentType NSHTMLTextDocumentType API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
APPKIT_EXTERN NSAttributedStringDocumentType NSMacSimpleTextDocumentType;
APPKIT_EXTERN NSAttributedStringDocumentType NSDocFormatTextDocumentType;
APPKIT_EXTERN NSAttributedStringDocumentType NSWordMLTextDocumentType;
APPKIT_EXTERN NSAttributedStringDocumentType NSWebArchiveTextDocumentType;
APPKIT_EXTERN NSAttributedStringDocumentType NSOfficeOpenXMLTextDocumentType API_AVAILABLE(macos(10.5));
APPKIT_EXTERN NSAttributedStringDocumentType NSOpenDocumentTextDocumentType API_AVAILABLE(macos(10.5));
typedef NSString * NSTextLayoutSectionKey NS_TYPED_ENUM;
// Keys for NSLayoutOrientationSectionsAttribute.
APPKIT_EXTERN NSTextLayoutSectionKey NSTextLayoutSectionOrientation API_AVAILABLE(macos(10.7), ios(7.0), watchos(2.0), tvos(9.0)); // NSNumber containing NSTextLayoutOrientation value. default: NSTextLayoutOrientationHorizontal
APPKIT_EXTERN NSTextLayoutSectionKey NSTextLayoutSectionRange API_AVAILABLE(macos(10.7), ios(7.0), watchos(2.0), tvos(9.0)); // NSValue containing NSRange representing a character range. default: a range covering the whole document
// Supported values for NSTextScalingDocumentAttribute, NSSourceTextScalingDocumentAttribute, NSTargetTextScalingDocumentOption, NSSourceTextScalingDocumentOption
typedef NS_ENUM(NSInteger, NSTextScalingType) {
NSTextScalingStandard = 0, // Font sizes throughout the document should appear visually similar to how they would render on macOS and non-Apple platforms
NSTextScalingiOS // Font sizes throughout the document should appear visually similar to how they would render on iOS
} API_AVAILABLE(macos(10.15), ios(13.0));
typedef NSString * NSAttributedStringDocumentAttributeKey NS_TYPED_EXTENSIBLE_ENUM;
// Keys for options and document attributes dictionaries. They are in and out document properties used by both read/write methods.
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSDocumentTypeDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // @"DocumentType", one of the document types declared above. For reader methods, this key in options can specify the document type for interpreting the contents. Upon return, the document attributes can contain this key for indicating the actual format used to read the contents. For write methods, this key specifies the format for generating the data.
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSConvertedDocumentAttribute; // @"Converted", NSNumber containing integer; if missing, or 0, the file was originally in the format specified by document type; if negative, the file was originally in the format specified by document type, but the conversion to NSAttributedString may have been lossy; if 1 or more, it was converted to the specified type by a filter service
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSCocoaVersionDocumentAttribute; // @"CocoaRTFVersion", NSNumber containing integer. Stores the version of Cocoa the file was created with. NSNumber containing float. Absence of this value indicates file not labelled as being created by Cocoa or its predecessors. Values less than 100 are pre-Mac OS X; 100 is Mac OS X 10.0 and 10.1; 102 is Mac OS X 10.2 and 10.3; values greater than 102 correspond to values of NSAppKitVersionNumber on 10.4 and later systems.
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSFileTypeDocumentAttribute API_AVAILABLE(macos(10.6)); // NSString indicating which document type was used to interpret the document, specified as a UTI; for reading, this is available along with NSDocumentTypeDocumentAttribute, but for writing the two are mutually exclusive
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSTitleDocumentAttribute; // NSString containing document title
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSCompanyDocumentAttribute; // NSString containing company or organization name
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSCopyrightDocumentAttribute; // NSString containing document copyright info
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSSubjectDocumentAttribute; // NSString containing subject of document
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSAuthorDocumentAttribute; // NSString containing author name (not necessarily same as "last editor," see below)
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSKeywordsDocumentAttribute; // NSArray of NSString, containing keywords
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSCommentDocumentAttribute; // NSString containing document comments
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSEditorDocumentAttribute; // NSString containing name of person who last edited the document
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSCreationTimeDocumentAttribute; // NSDate containing the creation date of the document; note that this is not the file system creation date of the file, but of the document, as stored in the document
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSModificationTimeDocumentAttribute; // NSDate containing the modification date of the document contents
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSManagerDocumentAttribute API_AVAILABLE(macos(10.5)); // NSString containing name of the author's manager
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSCategoryDocumentAttribute API_AVAILABLE(macos(10.6)); // NSString containing the document category
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSAppearanceDocumentAttribute API_AVAILABLE(macos(10.14)); // NSAppearance used to evaluate named NSColors when saving. The appearance itself is not written out; it is just used to determine the generated color component values. If not specified the canonical default light appearance is used.
// NSPlainTextDocumentType document attributes
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSCharacterEncodingDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // @"CharacterEncoding", NSNumber containing integer specifying NSStringEncoding for the file; default for plain text is the default encoding. This key in options can specify the string encoding for reading the data. Upon return, the document attributes can contain the actual encoding used. For writing methods, this value is used for generating the plain text data.
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSDefaultAttributesDocumentAttribute API_AVAILABLE(macos(10.11), ios(7.0), watchos(2.0), tvos(9.0)); // @"DefaultAttributes", NSDictionary containing attributes to be applied to plain files. Used by reader methods. This key in options can specify the default attributes applied to the entire document contents. The document attributes can contain this key indicating the actual attributes used.
// NSRTFTextDocumentType and NSRTFDTextDocumentType document attributes
// Document dimension
// They are document attributes used by read/write methods.
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSPaperSizeDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // @"PaperSize", NSValue containing NSSize (in points)
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSLeftMarginDocumentAttribute; // @"LeftMargin", NSNumber containing floating point value (in points)
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSRightMarginDocumentAttribute; // @"RightMargin", NSNumber containing floating point value (in points)
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSTopMarginDocumentAttribute; // @"TopMargin", NSNumber containing floating point value (in points)
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSBottomMarginDocumentAttribute; // @"BottomMargin", NSNumber containing floating point value (in points)
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSViewSizeDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // @"ViewSize", NSValue containing NSSize (in points)
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSViewZoomDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // @"ViewZoom", NSNumber containing floating point value (100 == 100% zoom)
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSViewModeDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // @"ViewMode", NSNumber containing integer; 0 = normal; 1 = page layout
// Document settings
// They are document attributes used by read/write methods.
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSReadOnlyDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // @"ReadOnly", NSNumber containing integer; if missing, or 0 or negative, not readonly; 1 or more, readonly. Note that this has nothing to do with the file system protection on the file, but instead, on how the file should be displayed to the user
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSBackgroundColorDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // @"BackgroundColor", NSColor, representing the document-wide page background color
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSHyphenationFactorDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // @"HyphenationFactor", NSNumber containing floating point value (0=off, 1=full hyphenation)
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSDefaultTabIntervalDocumentAttribute API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0)); // @"DefaultTabInterval", NSNumber containing floating point value, representing the document-wide default tab stop interval, in points
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSTextLayoutSectionsAttribute API_AVAILABLE(macos(10.7), ios(7.0), watchos(2.0), tvos(9.0)); // NSArray of dictionaries. Each dictionary describing a layout orientation section. The dictionary can have two attributes: NSTextLayoutSectionOrientation and NSTextLayoutSectionRange. When there is a gap between sections, it's assumed to have NSTextLayoutOrientationHorizontal.
// NSHTMLTextDocumentType document attributes
// Additional document attributes added in 10.4, for HTML writing only. These provide control over the form of generated HTML. NSExcludedElementsDocumentAttribute allows control over the tags used. The recognized values in the NSExcludedElementsDocumentAttribute array are (case-insensitive) HTML tags, plus DOCTYPE (representing a doctype declaration) and XML (representing an XML declaration). By default, if this attribute is not present, the excluded elements will be those deprecated in HTML 4 (APPLET, BASEFONT, CENTER, DIR, FONT, ISINDEX, MENU, S, STRIKE, and U) plus XML. If XML is on the list, HTML forms will be used; if XML is not on the list, XHTML forms will be used where there is a distinction. Either NSCharacterEncodingDocumentAttribute or NSTextEncodingNameDocumentAttribute may be used to control the encoding used for generated HTML; character entities will be used for characters not representable in the specified encoding. Finally, NSPrefixSpacesDocumentAttribute allows some control over formatting.
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSExcludedElementsDocumentAttribute; // for HTML writing only; NSArray containing NSStrings, representing HTML elements not to be used in generated HTML
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSTextEncodingNameDocumentAttribute; // for HTML writing only; NSString containing the name, IANA or otherwise, of a text encoding to be used; mutually exclusive with NSCharacterEncodingDocumentAttribute
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey NSPrefixSpacesDocumentAttribute; // for HTML writing only; NSNumber containing integer, default 0, representing the number of spaces per level by which to indent certain nested HTML elements
// Document text scaling
// They are document attributes used by read/write methods.
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey const NSTextScalingDocumentAttribute API_AVAILABLE(macos(10.15), ios(13.0)); // @"TextScaling", one of the text scaling types declared above. Only affects RTF documents. For reading methods, this indicates the type of text scaling used in the returned attributed string. For write methods, this attribute can be used in two different ways: (1) Passing only this attribute will overwrite the text scaling metadata in the document, but will not perform any conversion on the font sizes in the document, or (2) Passing both this attribute and NSSourceTextScalingDocumentAttribute will convert the font sizes in the document from the source text scaling type to the text scaling type specified by this attribute.
APPKIT_EXTERN NSAttributedStringDocumentAttributeKey const NSSourceTextScalingDocumentAttribute API_AVAILABLE(macos(10.15), ios(13.0)); // @"SourceTextScaling", one of the text scaling types declared above. Only affects RTF documents. For writing methods, this indicates the type of text scaling in the attributed string that will be used as the base type for conversion. Use this in conjunction with NSTextScalingDocumentAttribute to convert font point sizes between text scalings when writing attributed strings to RTF. This attribute is optional and does nothing unless NSTextScalingDocumentAttribute is also specified.
// The following are keys for various options that can be specified in the options dictionaries for the text import APIs below. Except for NSTextSizeMultiplierDocumentOption and NSFileTypeDocumentOption, the values have been recognized for some time, but the actual identifier shown below was added in 10.4. If you want your app to run on earlier systems, you need to continue using the actual string value that these identifiers represent. The actual string value is specified in the comments below.
typedef NSString * NSAttributedStringDocumentReadingOptionKey NS_TYPED_EXTENSIBLE_ENUM;
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSDocumentTypeDocumentOption; // @"DocumentType", NSString indicating a document type to be forced when loading the document, specified as one of the NSDocumentTypeDocumentAttribute constants listed above
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSDefaultAttributesDocumentOption; // @"DefaultAttributes", for plain text only; NSDictionary containing attributes to be applied to plain files
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSCharacterEncodingDocumentOption; // @"CharacterEncoding", for plain text and HTML; NSNumber containing integer specifying NSStringEncoding to be used to interpret the file
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSTextEncodingNameDocumentOption; // @"TextEncodingName", for HTML only; NSString containing a name, IANA or otherwise, specifying an encoding to be used to interpret the file; mutually exclusive with NSCharacterEncodingDocumentOption
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSBaseURLDocumentOption; // @"BaseURL", for HTML only; NSURL containing a URL to be treated as the base URL for the document
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSTimeoutDocumentOption; // @"Timeout", for HTML only; NSNumber containing floating point value; time in seconds to wait for a document to finish loading; if not present or not positive, a default timeout will be used
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSWebPreferencesDocumentOption; // @"WebPreferences", for HTML only; WebPreferences; specifies a WebPreferences object describing a set of preferences; if not present, a default set of preferences will be used
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSWebResourceLoadDelegateDocumentOption; // @"WebResourceLoadDelegate", for HTML only; NSObject; specifies an object to serve as the WebResourceLoadDelegate; if not present, a default delegate will be used that will permit the loading of subsidiary resources but will not respond to authentication challenges
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSTextSizeMultiplierDocumentOption; // for HTML only; NSNumber containing floating point value, default 1.0; specifies a scale factor for font sizes, corresponding to WebView's textSizeMultiplier
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey NSFileTypeDocumentOption API_AVAILABLE(macos(10.6)); // NSString indicating a document type to be forced when loading the document, specified as a UTI string; mutually exclusive with NSDocumentTypeDocumentOption
// In Mac OS X 10.4 and later, WebKit is always used for HTML documents, and all of the above options are recognized. In Mac OS X 10.3, there is an additional options key, @"UseWebKit" (NSNumber containing integer; if present and positive, specifies that WebKit-based HTML importing is to be used). In Mac OS X 10.3, the Timeout, WebPreferences, and WebResourceLoadDelegate options are recognized only when WebKit-based HTML importing is used.
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey const NSTargetTextScalingDocumentOption API_AVAILABLE(macos(10.15), ios(13.0)); // @"TargetTextScaling", one of the text scaling types declared above. Only affects RTF documents. For reading methods, you can pass this option to request that the returned attributed string uses the specified scaling. The font point sizes in the document may be converted if necessary. If this option is not provided, the system will deduce the target text scaling type based on application framework and platform.
APPKIT_EXTERN NSAttributedStringDocumentReadingOptionKey const NSSourceTextScalingDocumentOption API_AVAILABLE(macos(10.15), ios(13.0)); // @"SourceTextScaling", one of the text scaling types declared above. Only affects RTF documents. For reading methods, you can pass this option to indicate the source text scaling type of the RTF document being read. Use this in conjunction with NSTargetTextScalingDocumentOption to control text scaling conversions on the font point sizes in the returned attributed string. This option does nothing unless NSTargetTextScalingDocumentOption is also specified. If this option is not provided, the system will deduce the source text scaling type based on the information in the document.
@interface NSAttributedString (NSAttributedStringDocumentFormats)
// Methods initializing the receiver contents with an external document data. options specify document attributes for interpreting the document contents. NSDocumentTypeDocumentAttribute, NSCharacterEncodingDocumentAttribute, and NSDefaultAttributesDocumentAttribute are supported options key. When they are not specified, these methods will examine the data and do their best to detect the appropriate attributes. If dict is non-NULL, it will return a dictionary with various document-wide attributes accessible via NS...DocumentAttribute keys.
- (nullable instancetype)initWithURL:(NSURL *)url options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)options documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict error:(NSError **)error API_AVAILABLE(macos(10.4), ios(9.0), watchos(2.0), tvos(9.0));
- (nullable instancetype)initWithData:(NSData *)data options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)options documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict error:(NSError **)error API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
// Generates an NSData object for the receiver contents in range. It requires a document attributes dict specifying at least the NSDocumentTypeDocumentAttribute to determine the format to be written.
- (nullable NSData *)dataFromRange:(NSRange)range documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> *)dict error:(NSError **)error API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
// Returns an NSFileWrapper object for the receiver contents in range. It requires a document attributes dict specifying at least the NSDocumentTypeDocumentAttribute to determine the format to be written. The method returns a directory file wrapper for those document types represented by a file package such as NSRTFDTextDocumentType; otherwise, it returns a regular-file file wrapper.
- (nullable NSFileWrapper *)fileWrapperFromRange:(NSRange)range documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> *)dict error:(NSError **)error API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
- (nullable instancetype)initWithRTF:(NSData *)data documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict;
- (nullable instancetype)initWithRTFD:(NSData *)data documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict;
- (nullable instancetype)initWithHTML:(NSData *)data documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict;
- (nullable instancetype)initWithHTML:(NSData *)data baseURL:(NSURL *)base documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict;
- (nullable instancetype)initWithDocFormat:(NSData *)data documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict;
- (nullable instancetype)initWithHTML:(NSData *)data options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)options documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict;
- (nullable instancetype)initWithRTFDFileWrapper:(NSFileWrapper *)wrapper documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict;
- (nullable NSData *)RTFFromRange:(NSRange)range documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> *)dict;
- (nullable NSData *)RTFDFromRange:(NSRange)range documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> *)dict;
- (nullable NSFileWrapper *)RTFDFileWrapperFromRange:(NSRange)range documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> *)dict;
- (nullable NSData *)docFormatFromRange:(NSRange)range documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> *)dict;
@end
@interface NSMutableAttributedString (NSMutableAttributedStringDocumentFormats)
// Methods replacing the receiver contents with an external document data. options specify document attributes for interpreting the document contents. NSDocumentTypeDocumentAttribute, NSCharacterEncodingDocumentAttribute, and NSDefaultAttributesDocumentAttribute are supported options key. When they are not specified, these methods will examine the data and do their best to detect the appropriate attributes. If dict is non-NULL, it will return a dictionary with various document-wide attributes accessible via NS...DocumentAttribute keys.
- (BOOL)readFromURL:(NSURL *)url options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)opts documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict error:(NSError **)error API_AVAILABLE(macos(10.5), ios(9.0), watchos(2.0), tvos(9.0));
- (BOOL)readFromData:(NSData *)data options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)opts documentAttributes:(NSDictionary<NSAttributedStringDocumentAttributeKey, id> * _Nullable * _Nullable)dict error:(NSError **)error API_AVAILABLE(macos(10.0), ios(7.0), watchos(2.0), tvos(9.0));
@end
/************************ Misc methods ************************/
@interface NSAttributedString (NSAttributedStringKitAdditions)
// Attributes which should be copied/pasted with "copy font".
- (NSDictionary<NSAttributedStringKey, id> *)fontAttributesInRange:(NSRange)range;
// Attributes which should be copied/pasted with "copy ruler".
- (NSDictionary<NSAttributedStringKey, id> *)rulerAttributesInRange:(NSRange)range;
// Returns YES if the receiver contains a property configured (NSAttachmentAttributeName with NSAttachmentCharacter) in range
- (BOOL)containsAttachmentsInRange:(NSRange)range API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
// Returns NSNotFound if no line break location found in the specified range; otherwise returns the index of the first character that should go on the NEXT line.
- (NSUInteger)lineBreakBeforeIndex:(NSUInteger)location withinRange:(NSRange)aRange;
- (NSUInteger)lineBreakByHyphenatingBeforeIndex:(NSUInteger)location withinRange:(NSRange)aRange;
- (NSRange)doubleClickAtIndex:(NSUInteger)location;
- (NSUInteger)nextWordFromIndex:(NSUInteger)location forward:(BOOL)isForward;
// Convenience methods for calculating the range of an individual text block, range of an entire table, range of a list, and the index within a list.
- (NSRange)rangeOfTextBlock:(NSTextBlock *)block atIndex:(NSUInteger)location;
- (NSRange)rangeOfTextTable:(NSTextTable *)table atIndex:(NSUInteger)location;
- (NSRange)rangeOfTextList:(NSTextList *)list atIndex:(NSUInteger)location;
- (NSInteger)itemNumberInTextList:(NSTextList *)list atIndex:(NSUInteger)location;
@end
@interface NSAttributedString (NSAttributedStringPasteboardAdditions) <NSPasteboardReading, NSPasteboardWriting>
// Methods to determine what types can be loaded as NSAttributedStrings.
@property(class, readonly, copy) NSArray<NSString *> *textTypes API_AVAILABLE(macos(10.5));
@property(class, readonly, copy) NSArray<NSString *> *textUnfilteredTypes API_AVAILABLE(macos(10.5));
@end
@interface NSMutableAttributedString (NSMutableAttributedStringKitAdditions)
- (void)superscriptRange:(NSRange)range;
- (void)subscriptRange:(NSRange)range;
- (void)unscriptRange:(NSRange)range;
- (void)applyFontTraits:(NSFontTraitMask)traitMask range:(NSRange)range;
- (void)setAlignment:(NSTextAlignment)alignment range:(NSRange)range;
- (void)setBaseWritingDirection:(NSWritingDirection)writingDirection range:(NSRange)range;
@end
/************************ Deprecated ************************/
// NSUnderlineByWord and the NSUnderlinePattern* values are soft deprecated starting with macOS 10.14/iOS 12 and will be officially deprecated in a future release. Please use the NSUnderlineStyle* equivalents instead.
// Underlines will be drawn with a solid pattern by default, so NSUnderlinePatternSolid does not need to be specified.
static const NSUnderlineStyle NSUnderlinePatternSolid = NSUnderlineStylePatternSolid;
static const NSUnderlineStyle NSUnderlinePatternDot = NSUnderlineStylePatternDot;
static const NSUnderlineStyle NSUnderlinePatternDash = NSUnderlineStylePatternDash;
static const NSUnderlineStyle NSUnderlinePatternDashDot = NSUnderlineStylePatternDashDot;
static const NSUnderlineStyle NSUnderlinePatternDashDotDot = NSUnderlineStylePatternDashDotDot;
static const NSUnderlineStyle NSUnderlineByWord = NSUnderlineStyleByWord;
APPKIT_EXTERN NSAttributedStringKey NSCharacterShapeAttributeName API_DEPRECATED("This attribute is bound to a specific implementation of ATS feature and not generically supported by wide range of fonts. The majority of characters accessed through this API are now encoded in the Unicode standard. Use the CTFont feature API for fine control over character shape choices.", macos(10.0,10.11));
APPKIT_EXTERN NSAttributedStringKey NSUsesScreenFontsDocumentAttribute API_DEPRECATED("", macos(10.8,10.11));
enum {
NSNoUnderlineStyle API_DEPRECATED("Use NSUnderlineStyleNone instead", macos(10.0,10.9)) = 0,
NSSingleUnderlineStyle API_DEPRECATED("Use NSUnderlineStyleSingle instead", macos(10.0,10.9))
};
APPKIT_EXTERN NSUInteger NSUnderlineStrikethroughMask API_DEPRECATED("Use NSStrikethroughStyleAttributeName instead", macos(10.0,10.9));
APPKIT_EXTERN NSUInteger NSUnderlineByWordMask API_DEPRECATED("Use NSUnderlineByWord instead", macos(10.0,10.11));
@interface NSAttributedString(NSDeprecatedKitAdditions)
// This property is soft deprecated starting with OS X 10.11. It will be officially deprecated in a future release. Use -containsAttachmentsInRange: instead
@property (readonly) BOOL containsAttachments;
+ (NSArray *)textFileTypes API_DEPRECATED("", macos(10.1,10.5));
+ (NSArray *)textPasteboardTypes API_DEPRECATED("", macos(10.1,10.5));
+ (NSArray *)textUnfilteredFileTypes API_DEPRECATED("", macos(10.1,10.5));
+ (NSArray *)textUnfilteredPasteboardTypes API_DEPRECATED("", macos(10.1,10.5));
- (nullable instancetype)initWithURL:(NSURL *)url documentAttributes:(NSDictionary* _Nullable * _Nullable)dict API_DEPRECATED("Use -initWithURL:options:documentAttributes:error: instead", macos(10.0,10.11));
- (nullable instancetype)initWithPath:(NSString *)path documentAttributes:(NSDictionary* _Nullable * _Nullable)dict API_DEPRECATED("Use -initWithURL:options:documentAttributes:error: instead", macos(10.0,10.11));
- (nullable NSURL *)URLAtIndex:(NSUInteger)location effectiveRange:(NSRangePointer)effectiveRange API_DEPRECATED("Use NSDataDetector instead", macos(10.5,10.11));
@end
@interface NSMutableAttributedString (NSDeprecatedKitAdditions)
- (BOOL)readFromURL:(NSURL *)url options:(NSDictionary *)options documentAttributes:(NSDictionary* _Nullable * _Nullable)dict API_DEPRECATED("Use -readFromURL:options:documentAttributes:error: instead", macos(10.0,10.11));
- (BOOL)readFromData:(NSData *)data options:(NSDictionary *)options documentAttributes:(NSDictionary* _Nullable * _Nullable)dict API_DEPRECATED("Use -readFromData:options:documentAttributes:error: instead", macos(10.0,10.11));
@end
#endif // !TARGET_OS_IPHONE
NS_ASSUME_NONNULL_END
#else
#import <UIFoundation/NSAttributedString.h>
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h | /*
NSGraphics.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSColor, NSView;
/* Operation types for composite operators */
typedef NS_ENUM(NSUInteger, NSCompositingOperation) {
/* Porter-Duff compositing operations */
/* https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators */
NSCompositingOperationClear,
NSCompositingOperationCopy,
NSCompositingOperationSourceOver,
NSCompositingOperationSourceIn,
NSCompositingOperationSourceOut,
NSCompositingOperationSourceAtop,
NSCompositingOperationDestinationOver,
NSCompositingOperationDestinationIn,
NSCompositingOperationDestinationOut,
NSCompositingOperationDestinationAtop,
NSCompositingOperationXOR,
NSCompositingOperationPlusDarker,
NSCompositingOperationHighlight API_DEPRECATED("Use NSCompositingOperationSourceOver instead", macos(10.0,10.0)),
NSCompositingOperationPlusLighter,
/* Separable blend-modes */
/* https://www.w3.org/TR/compositing-1/#blendingseparable */
NSCompositingOperationMultiply API_AVAILABLE(macos(10.10)),
NSCompositingOperationScreen API_AVAILABLE(macos(10.10)),
NSCompositingOperationOverlay API_AVAILABLE(macos(10.10)),
NSCompositingOperationDarken API_AVAILABLE(macos(10.10)),
NSCompositingOperationLighten API_AVAILABLE(macos(10.10)),
NSCompositingOperationColorDodge API_AVAILABLE(macos(10.10)),
NSCompositingOperationColorBurn API_AVAILABLE(macos(10.10)),
NSCompositingOperationSoftLight API_AVAILABLE(macos(10.10)),
NSCompositingOperationHardLight API_AVAILABLE(macos(10.10)),
NSCompositingOperationDifference API_AVAILABLE(macos(10.10)),
NSCompositingOperationExclusion API_AVAILABLE(macos(10.10)),
/* Non-separable blend-modes */
/* https://www.w3.org/TR/compositing-1/#blendingnonseparable */
NSCompositingOperationHue API_AVAILABLE(macos(10.10)),
NSCompositingOperationSaturation API_AVAILABLE(macos(10.10)),
NSCompositingOperationColor API_AVAILABLE(macos(10.10)),
NSCompositingOperationLuminosity API_AVAILABLE(macos(10.10)),
};
static const NSCompositingOperation NSCompositeClear API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationClear", macos(10.0,10.12)) = NSCompositingOperationClear;
static const NSCompositingOperation NSCompositeCopy API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationCopy", macos(10.0,10.12)) = NSCompositingOperationCopy;
static const NSCompositingOperation NSCompositeSourceOver API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationSourceOver", macos(10.0,10.12)) = NSCompositingOperationSourceOver;
static const NSCompositingOperation NSCompositeSourceIn API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationSourceIn", macos(10.0,10.12)) = NSCompositingOperationSourceIn;
static const NSCompositingOperation NSCompositeSourceOut API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationSourceOut", macos(10.0,10.12)) = NSCompositingOperationSourceOut;
static const NSCompositingOperation NSCompositeSourceAtop API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationSourceAtop", macos(10.0,10.12)) = NSCompositingOperationSourceAtop;
static const NSCompositingOperation NSCompositeDestinationOver API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationDestinationOver", macos(10.0,10.12)) = NSCompositingOperationDestinationOver;
static const NSCompositingOperation NSCompositeDestinationIn API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationDestinationIn", macos(10.0,10.12)) = NSCompositingOperationDestinationIn;
static const NSCompositingOperation NSCompositeDestinationOut API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationDestinationOut", macos(10.0,10.12)) = NSCompositingOperationDestinationOut;
static const NSCompositingOperation NSCompositeDestinationAtop API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationDestinationAtop", macos(10.0,10.12)) = NSCompositingOperationDestinationAtop;
static const NSCompositingOperation NSCompositeXOR API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationXOR", macos(10.0,10.12)) = NSCompositingOperationXOR;
static const NSCompositingOperation NSCompositePlusDarker API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationPlusDarker", macos(10.0,10.12)) = NSCompositingOperationPlusDarker;
static const NSCompositingOperation NSCompositeHighlight API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationSourceOver", macos(10.0,10.0)) = NSCompositingOperationHighlight;
static const NSCompositingOperation NSCompositePlusLighter API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationPlusLighter", macos(10.0,10.12)) = NSCompositingOperationPlusLighter;
static const NSCompositingOperation NSCompositeMultiply API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationMultiply", macos(10.0,10.12)) = NSCompositingOperationMultiply;
static const NSCompositingOperation NSCompositeScreen API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationScreen", macos(10.0,10.12)) = NSCompositingOperationScreen;
static const NSCompositingOperation NSCompositeOverlay API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationOverlay", macos(10.0,10.12)) = NSCompositingOperationOverlay;
static const NSCompositingOperation NSCompositeDarken API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationDarken", macos(10.0,10.12)) = NSCompositingOperationDarken;
static const NSCompositingOperation NSCompositeLighten API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationLighten", macos(10.0,10.12)) = NSCompositingOperationLighten;
static const NSCompositingOperation NSCompositeColorDodge API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationColorDodge", macos(10.0,10.12)) = NSCompositingOperationColorDodge;
static const NSCompositingOperation NSCompositeColorBurn API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationColorBurn", macos(10.0,10.12)) = NSCompositingOperationColorBurn;
static const NSCompositingOperation NSCompositeSoftLight API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationSoftLight", macos(10.0,10.12)) = NSCompositingOperationSoftLight;
static const NSCompositingOperation NSCompositeHardLight API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationHardLight", macos(10.0,10.12)) = NSCompositingOperationHardLight;
static const NSCompositingOperation NSCompositeDifference API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationDifference", macos(10.0,10.12)) = NSCompositingOperationDifference;
static const NSCompositingOperation NSCompositeExclusion API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationExclusion", macos(10.0,10.12)) = NSCompositingOperationExclusion;
static const NSCompositingOperation NSCompositeHue API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationHue", macos(10.0,10.12)) = NSCompositingOperationHue;
static const NSCompositingOperation NSCompositeSaturation API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationSaturation", macos(10.0,10.12)) = NSCompositingOperationSaturation;
static const NSCompositingOperation NSCompositeColor API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationColor", macos(10.0,10.12)) = NSCompositingOperationColor;
static const NSCompositingOperation NSCompositeLuminosity API_DEPRECATED_WITH_REPLACEMENT("NSCompositingOperationLuminosity", macos(10.0,10.12)) = NSCompositingOperationLuminosity;
/* Types of window backing stores.
*/
typedef NS_ENUM(NSUInteger, NSBackingStoreType) {
/* NSBackingStoreRetained and NSBackingStoreNonretained have effectively been synonyms of NSBackingStoreBuffered since OS X Mountain Lion. Please switch to the equivalent NSBackingStoreBuffered.
*/
NSBackingStoreRetained API_DEPRECATED_WITH_REPLACEMENT("NSBackingStoreBuffered", macos(10.0,10.13)) = 0,
NSBackingStoreNonretained API_DEPRECATED_WITH_REPLACEMENT("NSBackingStoreBuffered", macos(10.0,10.13)) = 1,
NSBackingStoreBuffered = 2,
};
/* ways to order windows */
typedef NS_ENUM(NSInteger, NSWindowOrderingMode) {
NSWindowAbove = 1,
NSWindowBelow = -1,
NSWindowOut = 0
};
/* order in which to draw focus ring - above or below graphic or just draw ring */
typedef NS_ENUM(NSUInteger, NSFocusRingPlacement) {
NSFocusRingOnly = 0,
NSFocusRingBelow = 1,
NSFocusRingAbove = 2
};
/* used by NSView and NSCell to configure if and how the control should draw its focus ring */
typedef NS_ENUM(NSUInteger, NSFocusRingType) {
NSFocusRingTypeDefault = 0,
NSFocusRingTypeNone = 1,
NSFocusRingTypeExterior = 2
};
// values interchangeable with CGColorRenderingIntent values
typedef NS_ENUM(NSInteger, NSColorRenderingIntent) {
NSColorRenderingIntentDefault, // = kCGRenderingIntentDefault,
NSColorRenderingIntentAbsoluteColorimetric, // = kCGRenderingIntentAbsoluteColorimetric,
NSColorRenderingIntentRelativeColorimetric, // = kCGRenderingIntentRelativeColorimetric,
NSColorRenderingIntentPerceptual, // = kCGRenderingIntentPerceptual,
NSColorRenderingIntentSaturation // = kCGRenderingIntentSaturation
} API_AVAILABLE(macos(10.5));
typedef NSString * NSColorSpaceName NS_TYPED_ENUM;
/* Predefined colorspace names.
*/
APPKIT_EXTERN NSColorSpaceName NSCalibratedWhiteColorSpace; /* 1.0 == white */
APPKIT_EXTERN NSColorSpaceName NSCalibratedRGBColorSpace;
APPKIT_EXTERN NSColorSpaceName NSDeviceWhiteColorSpace; /* 1.0 == white */
APPKIT_EXTERN NSColorSpaceName NSDeviceRGBColorSpace;
APPKIT_EXTERN NSColorSpaceName NSDeviceCMYKColorSpace;
APPKIT_EXTERN NSColorSpaceName NSNamedColorSpace; /* Used for "catalog" colors */
APPKIT_EXTERN NSColorSpaceName NSPatternColorSpace;
APPKIT_EXTERN NSColorSpaceName NSCustomColorSpace; /* Used to indicate a custom gstate in images */
/* Prefer colorspaces where 1.0 means white.
*/
APPKIT_EXTERN NSColorSpaceName NSCalibratedBlackColorSpace /* 1.0 == black */ API_DEPRECATED("", macos(10.0,10.6));
APPKIT_EXTERN NSColorSpaceName NSDeviceBlackColorSpace /* 1.0 == black */ API_DEPRECATED("", macos(10.0,10.6));
/* NSWindowDepth defines the values used in setting window depth limits. "0" indicates default depth. Window depths should not be made persistent as they will not be the same across systems. Use the functions NSBitsPerSampleFromDepth(), NSColorSpaceFromDepth(), NSBitsPerPixelFromDepth(), and NSPlanarFromDepth() to extract info from an NSWindowDepth
On Mac OS X 10.5 and earlier, use NSBestDepth() to compute window depths. NSBestDepth() will try to accomodate all the parameters (match or better); if there are multiple matches, it gives the closest, with matching colorSpace first, then bps, then planar, then bpp. bpp is "bits per pixel"; 0 indicates default (same as the number of bits per plane, either bps or bps * NSNumberOfColorComponents()); other values maybe used as hints to provide backing stores of different configuration; for instance, 8 bit color. exactMatch is optional and indicates whether all the parameters matched exactly.
On Mac OS X 10.6 and later, you can pass one of the explicit bit depths below to -[NSWindow setDepthLimit:]. NSWindowDepthTwentyfourBitRGB is the default.
*/
typedef NS_ENUM(int32_t, NSWindowDepth) {
NSWindowDepthTwentyfourBitRGB = 0x208,
NSWindowDepthSixtyfourBitRGB = 0x210,
NSWindowDepthOnehundredtwentyeightBitRGB = 0x220
} API_AVAILABLE(macos(10.6));
APPKIT_EXTERN NSWindowDepth NSBestDepth (NSColorSpaceName colorSpace, NSInteger bps, NSInteger bpp, BOOL planar, BOOL * _Nullable exactMatch);
APPKIT_EXTERN BOOL NSPlanarFromDepth (NSWindowDepth depth);
APPKIT_EXTERN NSColorSpaceName _Nullable NSColorSpaceFromDepth (NSWindowDepth depth);
APPKIT_EXTERN NSInteger NSBitsPerSampleFromDepth(NSWindowDepth depth);
APPKIT_EXTERN NSInteger NSBitsPerPixelFromDepth(NSWindowDepth depth);
APPKIT_EXTERN NSInteger NSNumberOfColorComponents(NSColorSpaceName colorSpaceName);
APPKIT_EXTERN const NSWindowDepth *NSAvailableWindowDepths(void); /* returns pointer to 0-terminated array */
/* Standard gray values for the 2-bit deep grayscale colorspace.
*/
APPKIT_EXTERN const CGFloat NSWhite;
APPKIT_EXTERN const CGFloat NSLightGray;
APPKIT_EXTERN const CGFloat NSDarkGray;
APPKIT_EXTERN const CGFloat NSBlack;
/* Approximate color gamut for use by NSScreen and NSWindow
*/
typedef NS_ENUM(NSInteger, NSDisplayGamut) {
NSDisplayGamutSRGB = 1,
NSDisplayGamutP3
} API_AVAILABLE(macos(10.12));
/* Keys for deviceDescription dictionaries.
*/
typedef NSString * NSDeviceDescriptionKey NS_TYPED_EXTENSIBLE_ENUM;
APPKIT_EXTERN NSDeviceDescriptionKey NSDeviceResolution; /* NSValue containing NSSize, basically dpi */
APPKIT_EXTERN NSDeviceDescriptionKey NSDeviceColorSpaceName; /* NSString */
APPKIT_EXTERN NSDeviceDescriptionKey NSDeviceBitsPerSample; /* NSValue containing int */
APPKIT_EXTERN NSDeviceDescriptionKey NSDeviceIsScreen; /* "YES" or not there */
APPKIT_EXTERN NSDeviceDescriptionKey NSDeviceIsPrinter; /* "YES" or not there */
APPKIT_EXTERN NSDeviceDescriptionKey NSDeviceSize; /* NSValue containing NSSize */
/* Graphics functions
*/
APPKIT_EXTERN void NSRectFill(NSRect rect);
APPKIT_EXTERN void NSRectFillList(const NSRect *rects, NSInteger count);
APPKIT_EXTERN void NSRectFillListWithGrays(const NSRect *rects, const CGFloat *grays, NSInteger num);
APPKIT_EXTERN void NSRectFillListWithColors(const NSRect *rects, NSColor * const _Nonnull * _Nonnull colors, NSInteger num);
APPKIT_EXTERN void NSRectFillUsingOperation(NSRect rect, NSCompositingOperation op);
APPKIT_EXTERN void NSRectFillListUsingOperation(const NSRect *rects, NSInteger count, NSCompositingOperation op);
APPKIT_EXTERN void NSRectFillListWithColorsUsingOperation(const NSRect *rects, NSColor * const _Nonnull * _Nonnull colors, NSInteger num, NSCompositingOperation op);
APPKIT_EXTERN void NSFrameRect(NSRect rect);
APPKIT_EXTERN void NSFrameRectWithWidth(NSRect rect, CGFloat frameWidth);
APPKIT_EXTERN void NSFrameRectWithWidthUsingOperation(NSRect rect, CGFloat frameWidth, NSCompositingOperation op);
APPKIT_EXTERN void NSRectClip(NSRect rect);
APPKIT_EXTERN void NSRectClipList(const NSRect *rects, NSInteger count);
APPKIT_EXTERN NSRect NSDrawTiledRects(NSRect boundsRect, NSRect clipRect, const NSRectEdge *sides, const CGFloat *grays, NSInteger count);
APPKIT_EXTERN void NSDrawGrayBezel(NSRect rect, NSRect clipRect);
APPKIT_EXTERN void NSDrawGroove(NSRect rect, NSRect clipRect);
APPKIT_EXTERN void NSDrawWhiteBezel(NSRect rect, NSRect clipRect);
APPKIT_EXTERN void NSDrawButton(NSRect rect, NSRect clipRect);
APPKIT_EXTERN void NSEraseRect(NSRect rect);
APPKIT_EXTERN NSColor * _Nullable NSReadPixel(NSPoint passedPoint) API_DEPRECATED("Use -[NSBitmapImageRep colorAtX:y:] to interrogate pixel values. If necessary, use -[NSView cacheDisplayInRect:toBitmapImageRep:] to snapshot a view hierarchy into an NSBitmapImageRep.", macos(10.0,10.14));
APPKIT_EXTERN void NSDrawBitmap(NSRect rect, NSInteger width, NSInteger height, NSInteger bps, NSInteger spp, NSInteger bpp, NSInteger bpr, BOOL isPlanar, BOOL hasAlpha, NSColorSpaceName colorSpaceName, const unsigned char *const _Nullable data[_Nonnull 5]);
APPKIT_EXTERN void NSHighlightRect(NSRect rect) API_DEPRECATED("", macos(10.0,10.0));
APPKIT_EXTERN void NSBeep(void);
/* gets performance stats about window server memory usage */
APPKIT_EXTERN NSInteger NSGetWindowServerMemory(NSInteger context, NSInteger *virtualMemory, NSInteger *windowBackingMemory, NSString * _Nonnull * _Nonnull windowDumpString) API_DEPRECATED("Doesn't return anything useful since 10.0", macos(10.0,10.14));
APPKIT_EXTERN NSRect NSDrawColorTiledRects(NSRect boundsRect, NSRect clipRect, const NSRectEdge *sides, NSColor * _Nonnull * _Nonnull colors, NSInteger count);
APPKIT_EXTERN void NSDrawDarkBezel(NSRect rect, NSRect clipRect);
APPKIT_EXTERN void NSDrawLightBezel(NSRect rect, NSRect clipRect);
APPKIT_EXTERN void NSDottedFrameRect(NSRect rect);
APPKIT_EXTERN void NSDrawWindowBackground(NSRect rect);
APPKIT_EXTERN void NSSetFocusRingStyle(NSFocusRingPlacement placement);
APPKIT_EXTERN void NSDisableScreenUpdates(void) API_DEPRECATED("As of 10.11 it is not generally necessary to take explicit action to achieve visual atomicity. +[NSAnimationContext runAnimationGroup:] and other similar methods can be used when a stronger than normal need for visual atomicity is required. The NSAnimationContext methods do not suffer from the same performance problems as NSDisableScreenUpdates.", macos(10.0,10.11));
APPKIT_EXTERN void NSEnableScreenUpdates(void) API_DEPRECATED("As of 10.11 it is not generally necessary to take explicit action to achieve visual atomicity. +[NSAnimationContext runAnimationGroup:] and other similar methods can be used when a stronger than normal need for visual atomicity is required. The NSAnimationContext methods do not suffer from the same performance problems as NSEnableScreenUpdates.", macos(10.0,10.11));
/* Runs one of the standard system animation effects (display and sound).
** 'centerLocation' represents the center, in screen coordinates, to show the effect.
** 'size' specifies how big the effect should be. Use NSZeroSize to get the default size.
** 'animationDelegate' is optionally, an object that wants to know when the effect has completed.
** 'didEndSelector' will be invoked in the animationDelegate when the animation has completed.
**
** The didEndSelector should have the following signature:
** - (void)animationEffectDidEnd:(void *)contextInfo;
*/
typedef NS_ENUM(NSUInteger, NSAnimationEffect) {
// The default effect used to indicate removal of an item from a collection,
// such as toolbar (indicates removal, without destroying the underlying data).
NSAnimationEffectDisappearingItemDefault = 0,
// An effect showing a puff of smoke.
NSAnimationEffectPoof = 10
};
APPKIT_EXTERN void NSShowAnimationEffect(NSAnimationEffect animationEffect, NSPoint centerLocation, NSSize size, _Nullable id animationDelegate, _Nullable SEL didEndSelector, void * _Nullable contextInfo);
APPKIT_EXTERN void NSCountWindows(NSInteger *count) API_DEPRECATED("Use +[NSWindow windowNumbersWithOptions:] instead", macos(10.0,10.6));
APPKIT_EXTERN void NSWindowList(NSInteger size, NSInteger list[_Nonnull]) API_DEPRECATED("Use +[NSWindow windowNumbersWithOptions:] instead", macos(10.0,10.6));
APPKIT_EXTERN void NSCountWindowsForContext(NSInteger context, NSInteger *count) API_DEPRECATED("Use +[NSWindow windowNumbersWithOptions:] instead", macos(10.0,10.6));
APPKIT_EXTERN void NSWindowListForContext(NSInteger context, NSInteger size, NSInteger list[_Nonnull]) API_DEPRECATED("Use +[NSWindow windowNumbersWithOptions:] instead", macos(10.0,10.6));
APPKIT_EXTERN void NSCopyBits(NSInteger srcGState, NSRect srcRect, NSPoint destPoint) API_DEPRECATED("", macos(10.0,10.10));
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSCollectionView.h | /*
NSCollectionView.h
Application Kit
Copyright (c) 2005-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSView.h>
#import <AppKit/NSViewController.h>
#import <AppKit/NSDragging.h>
#import <AppKit/AppKitDefines.h>
#import <Foundation/NSArray.h>
typedef NS_ENUM(NSInteger, NSCollectionViewDropOperation) {
NSCollectionViewDropOn = 0,
NSCollectionViewDropBefore = 1,
} API_AVAILABLE(macos(10.6));
typedef NS_ENUM(NSInteger, NSCollectionViewItemHighlightState) {
NSCollectionViewItemHighlightNone = 0,
NSCollectionViewItemHighlightForSelection = 1,
NSCollectionViewItemHighlightForDeselection = 2,
NSCollectionViewItemHighlightAsDropTarget = 3,
} API_AVAILABLE(macos(10.11));
/* Used with NSCollectionView's -selectItemsAtIndexPaths:scrollPosition: and -scrollToItemsAtIndexPaths:scrollPosition: to specify how the bounding box of the specified items should be positioned within the CollectionView's visibleRect. NSCollectionView will try to satisfy this request as closely as feasible, while staying within the enclosing ClipView's scrollable range.
*/
typedef NS_OPTIONS(NSUInteger, NSCollectionViewScrollPosition) {
NSCollectionViewScrollPositionNone = 0,
/* The vertical positions are mutually exclusive to each other, but are bitwise or-able with the horizontal scroll positions. Combining positions from the same grouping (horizontal or vertical) will result in an NSInvalidArgumentException.
*/
NSCollectionViewScrollPositionTop = 1 << 0,
NSCollectionViewScrollPositionCenteredVertically = 1 << 1,
NSCollectionViewScrollPositionBottom = 1 << 2,
NSCollectionViewScrollPositionNearestHorizontalEdge = 1 << 9, /* Nearer of Top,Bottom */
/* Likewise, the horizontal positions are mutually exclusive to each other.
*/
NSCollectionViewScrollPositionLeft = 1 << 3,
NSCollectionViewScrollPositionCenteredHorizontally = 1 << 4,
NSCollectionViewScrollPositionRight = 1 << 5,
NSCollectionViewScrollPositionLeadingEdge = 1 << 6, /* Left if LTR, Right if RTL */
NSCollectionViewScrollPositionTrailingEdge = 1 << 7, /* Right if LTR, Left, if RTL */
NSCollectionViewScrollPositionNearestVerticalEdge = 1 << 8, /* Nearer of Leading,Trailing */
};
typedef NSString * NSCollectionViewSupplementaryElementKind NS_SWIFT_BRIDGED_TYPEDEF;
@class NSButton, NSCollectionView, NSCollectionViewLayout, NSCollectionViewLayoutAttributes, NSCollectionViewTransitionLayout, NSDraggingImageComponent, NSImageView, NSIndexSet, NSMutableIndexSet, NSNib, NSTextField;
@protocol NSCollectionViewDataSource, NSCollectionViewDelegate, NSCollectionViewPrefetching;
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
/* NSCollectionViewElement declares functionality shared by (1) NSCollectionViewItems and (2) "supplementary" or "decoration" views that can be added to an NSCollectionView. Each such reusable entity has the ability to be reset to its initial state by being sent -prepareForReuse, the ability to take size, position, and other state from an NSCollectionViewLayoutAttributes instance, and the ability to respond to transitions from one layout to another. Note that, since these methods are all optional and invoked only when found to be present, all existing NSView classes can be considered conforming, and are therefore eligible to be used a supplementary and decorative views. NSView and NSCollectionViewElement both conform to NSUserInterfaceItemIdentification, which provides an "identifier" property that CollectionView uses to track an item or supplementary/decoration view's kind.
*/
@protocol NSCollectionViewElement <NSObject, NSUserInterfaceItemIdentification>
@optional
/* Called by the NSCollectionView before the instance is returned from the reuse queue. Subclassers must call super. NSCollectionViewItem's implementation of this method sends -prepareForReuse to the ViewController's view.
*/
- (void)prepareForReuse API_AVAILABLE(macos(10.11));
/* Classes that want to support custom layout attributes specific to a given NSCollectionViewLayout subclass can apply them here. This allows the view to work in conjunction with a layout class that returns a custom subclass of NSCollectionViewLayoutAttributes from -layoutAttributesForItem: or the corresponding layoutAttributesForHeader/Footer methods. -applyLayoutAttributes: is then called after the view is added to the collection view and just before the view is returned from the reuse queue. Note that -applyLayoutAttributes: is only called when attributes change, as defined by -isEqual:.
*/
- (void)applyLayoutAttributes:(NSCollectionViewLayoutAttributes *)layoutAttributes API_AVAILABLE(macos(10.11));
/* Override points for participating in layout transitions. These messages are sent to a reusable part before and after the transition to a new layout occurs.
*/
- (void)willTransitionFromLayout:(NSCollectionViewLayout *)oldLayout toLayout:(NSCollectionViewLayout *)newLayout API_AVAILABLE(macos(10.11));
- (void)didTransitionFromLayout:(NSCollectionViewLayout *)oldLayout toLayout:(NSCollectionViewLayout *)newLayout API_AVAILABLE(macos(10.11));
/* Invoked when present to give a reusable entity the opportunity to make any desired final adjustments to its layout.
*/
- (NSCollectionViewLayoutAttributes *)preferredLayoutAttributesFittingAttributes:(NSCollectionViewLayoutAttributes *)layoutAttributes API_AVAILABLE(macos(10.11));
@end
/* Section header views can conform to this protocol, to enable a CollectionView to find the section collapse toggle button (when present).
*/
@protocol NSCollectionViewSectionHeaderView <NSCollectionViewElement>
@optional
/* If your header contains a button that's set up to toggle section collapse, wire this outlet to it. This enables CollectionView to automatically show and hide the button, based on whether the section's items all fit.
*/
@property (nullable, weak) IBOutlet NSButton *sectionCollapseButton API_AVAILABLE(macos(10.12));
@end
/* An NSCollectionViewItem associates a visual representation (view subtree) with a representedObject of arbitrary type. It also tracks whether the representedObject is part of the enclosing NSCollectionView's current selection. Note that NSCollectionViewItem inherits some useful properties -- in particular, "representedObject" and "view" -- from NSViewController.
*/
API_AVAILABLE(macos(10.5))
@interface NSCollectionViewItem : NSViewController <NSCopying, NSCollectionViewElement>
/* Non-retained backlink to the containing CollectionView.
*/
@property (readonly, nullable, weak) NSCollectionView *collectionView;
/* Whether the item is part of its collectionView's current selection.
*/
@property (getter=isSelected) BOOL selected;
/* Whether the item should be shown as highlighted for proposed selection, deselection, as a drop target, or not highlighted.
*/
@property NSCollectionViewItemHighlightState highlightState API_AVAILABLE(macos(10.11));
/* Convenience outlet to the item's primary NSImageView (if any).
*/
@property (nullable, weak) IBOutlet NSImageView *imageView API_AVAILABLE(macos(10.7));
/* Convenience outlet to the item's primary NSTextField (if any).
*/
@property (nullable, weak) IBOutlet NSTextField *textField API_AVAILABLE(macos(10.7));
/* Multi-image drag and drop support. The default implementation will return an array of up to two NSDraggingImageComponent instances -- one for the imageView and another for the textField (if not nil). This methods can be subclassed and overridden to provide a custom set of NSDraggingImageComponents to create the drag image. Note: the component frames are relative to a coordinate system that has its origin at the bottom left, so you need to take into account the flippedness of your view when computing the component frames.
*/
@property (readonly) NSArray<NSDraggingImageComponent *> *draggingImageComponents API_AVAILABLE(macos(10.7));
@end
/* An NSCollectionView presents an ordered collection of items, with flexible, customizable appearance and layout. The user may be permitted to select items, and/or drag items into and out of the CollectionView.
*/
API_AVAILABLE(macos(10.5))
@interface NSCollectionView : NSView <NSDraggingSource, NSDraggingDestination>
#pragma mark *** Data Source / Model Objects ***
/* A non-retained data source object, that the CollectionView will consult to obtain information about the model objects to be represented and the number of sections to divide them among, and to make (recycle or instantiate) items and supplementary views. See the NSCollectionViewDataSource protocol, declared below, for the methods this delegate should implement.
Defaults to nil, which makes the CollectionView look to its "content" property or NSContentBinding for model object information. The "content" property should only be used with the default "Grid" collectionViewLayout and legacy -newItemForRepresentedObject: / itemPrototype mechanisms for instantiating items.
To get the new capabilities and behaviors, and use the new NSCollectionView APIs added in OS X 10.11, you must specify a dataSource. Setting dataSource != nil causes the CollectionView to empty its "content" array, and attempting to set "content" to a non-empty array while dataSource != nil is considered a programming error that will cause an exception to be raised.
*/
@property (nullable, weak) id<NSCollectionViewDataSource> dataSource API_AVAILABLE(macos(10.11));
/* An optional assistant to the CollectionView's 'dataSource' (potentially the same object), that receives notifications conducive to managing item data pre-fetching.
*/
@property (nullable, weak) id<NSCollectionViewPrefetching> prefetchDataSource API_AVAILABLE(macos(10.13));
/* The array of model objects that will be shown as "items" in this CollectionView. The objects may be of any type(s). If you prefer not to give the CollectionView a "dataSource", you can set its "content" property explicitly, or bind the CollectionView's NSContentBinding to an NSArrayController's arrangedObjects property, to provide the CollectionView with its model objects. A CollectionView whose content is provided in this way cannot have more than one section.
Each corresponding "item" instantiated by the CollectionView will have its representedObject property wired to the corresponding model object from this "content" array. Attempts to set "content" to nil are ignored on OS X 10.10 and earlier. On OS X 10.11 and later, setting "content" to nil raises an exception. (Set "content" to an empty NSArray instead, if you want to empty the CollectionView.)
*/
@property (copy) NSArray<id> *content;
/* Call this method to reload all of the items in the collection view. This causes the collection view to discard any currently visible items and redisplay them. For efficiency, the collection view only displays those items and supplementary views that are visible. If the collection data shrinks as a result of the reload, the collection view adjusts its scroll position accordingly. You should not call this method in the middle of animation blocks where items are being inserted or deleted. Insertions and deletions automatically cause the table’s data to be updated appropriately.
*/
- (void)reloadData API_AVAILABLE(macos(10.11));
#pragma mark *** Delegate ***
/* An optional, non-retained delegate object, that will have the opportunity to influence the CollectionView's drag-and-drop, selection, highlighting, and layout transitioning behaviors. See the NSCollectionViewDelegate protocol, declared below, for the methods this delegate may implement. Defaults to nil, which leaves the CollectionView to determine its own behaviors.
*/
@property (nullable, weak) id<NSCollectionViewDelegate> delegate;
#pragma mark *** Decoration ***
/* An optional background view that's positioned underneath all of the CollectionView's content. Defaults to nil. The backgroundView's scrolling behavior and frame are determined by the "backgroundViewScrollsWithContent" property, as described below. If "backgroundColors" are also specified for the CollectionView, backgroundColor[0] is drawn anywhere the backgroundView's content allows it to show through.
*/
@property (nullable, strong) NSView *backgroundView API_AVAILABLE(macos(10.11));
/* When YES, the CollectionView's backgroundView (if any) will match the CollectionView's frame and scroll with the CollectionView's items and other content. When NO (the default, compatible with the behavior on OS X 10.11), the backgroundView is made to fill the CollectionView's visible area, and remains stationary when the CollectionView's content is scrolled. Archived with the CollectionView's other persistent properties.
*/
@property BOOL backgroundViewScrollsWithContent API_AVAILABLE(macos(10.12));
#pragma mark *** Layout ***
/* The layout object that determines how the NSCollectionView's items will be sized and positioned. Defaults to an instance of NSCollectionViewGridLayout whose maxNumberOfRows, maxNumberOfColumns, minItemSize, maxItemSize, and backgroundColors properties mirror the NSCollectionView's. Replace this object, or change the values of its parameters, to change the layout. collectionViewLayout may be set to nil for an NSCollectionView that is not using the dataSource-based API.
To get an animated transition to the new layout, use [[collectionView animator] setCollectionViewLayout:]. You can use NSAnimationContext's completionHandler provisions to notify you when the transition is complete.
*/
@property (nullable, strong) __kindof NSCollectionViewLayout *collectionViewLayout API_AVAILABLE(macos(10.11));
/* Returns the layout information for the item at the specified index path (or nil if no such item exists). Use this method to retrieve the layout information for a particular item. You should always use this method instead of querying the layout object directly.
*/
- (nullable NSCollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
/* Returns the layout information for the specified supplementary view.
Use this method to retrieve the layout information for a particular supplementary view. You should always use this method instead of querying the layout object directly.
*/
- (nullable NSCollectionViewLayoutAttributes *)layoutAttributesForSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)kind atIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
/* Returns the frame calculated by the receiver where it intends to place the subview for the NSCollectionViewItem at the given index. You can use this method in the draggingImage methods to determine which views are in the visible portion of the enclosing scroll view. Overriding this method will have no effect on the receiver's subview layout. For apps that target OS X 10.11 and later, you may want to use -layoutAttributesForItemAtIndexPath: instead, which provides more than just the item's frame. This method raises an exception if invoked for a CollectionView that has more than one section. Use -layoutAttributesForItemAtIndexPath: instead.
*/
- (NSRect)frameForItemAtIndex:(NSUInteger)index API_AVAILABLE(macos(10.6));
/* Returns the frame calculated by the receiver where it would place a subview for an NSCollectionViewItem at the given index in a collection with the given number of items. You should use this method when updating NSDraggingItem frames when your collection is a drag destination. You should not use -frameForItemAtIndex:, since a drag and drop operation may change the number of items in the collection, which affects the layout of the item views. This method raises an exception if invoked for a CollectionView that has more than one section. Use -layoutAttributesForItemAtIndexPath: instead.
*/
- (NSRect)frameForItemAtIndex:(NSUInteger)index withNumberOfItems:(NSUInteger)numberOfItems API_AVAILABLE(macos(10.7));
/* The first background color in the array is used as the background of the entire collection view. Passing nil resets the background colors back to the default.
*/
@property (null_resettable, copy) NSArray<NSColor *> *backgroundColors;
#pragma mark *** Section and Item Counts ***
/* The number of sections displayed by the collection view.
*/
@property(readonly) NSInteger numberOfSections API_AVAILABLE(macos(10.11));
/* Returns the number of items in the specified "section".
*/
- (NSInteger)numberOfItemsInSection:(NSInteger)section API_AVAILABLE(macos(10.11));
#pragma mark *** Selection State ***
/* Whether the CollectionView is its window's current firstResponder. This bindable property is useful for determining appropriate appearance for selected items.
*/
@property (getter=isFirstResponder, readonly) BOOL firstResponder;
/* Whether the user can select items in the CollectionView. Defaults to NO. Changing this from YES to NO clears the CollectionView's current selection (if any), causing selectionIndexes to become an empty index set.
*/
@property (getter=isSelectable) BOOL selectable;
/* Whether the CollectionView allows its selection to become empty. Defaults to YES. When this is set to NO and "selectable" is YES, the CollectionView will attempt to always leave at least one item selected, when the CollectionView has at least one item.
*/
@property BOOL allowsEmptySelection API_AVAILABLE(macos(10.11));
/* Whether the user can simultaneously select multiple items in the CollectionView. Defaults to NO, which means only one item at a time (or none) may be selected. Changing this from YES to NO causes the CollectionView's selection to be reduced to the selected item with the lowest index in the section with the lowest index, if more than one item was selected.
*/
@property BOOL allowsMultipleSelection;
/* (Soft-Deprecated) The indexes of the items that are currently "selected", indicating that user operations should target the "content" objects having these indexes. Getting or setting this property raises an exception on 10.11 and later, if the CollectionView has more than one section. Use "selectionIndexPaths" instead.
*/
@property (copy) NSIndexSet *selectionIndexes;
/* A set of of NSIndexPath values, that identify the currently selected items by (section,indexInSection). When using the new NSCollectionView APIs on 10.11 and later, use this property instead of "selectionIndexes". You can change the set of selected items by setting this property. To request an animated transition of affected items between their selected and deselected appearances, you can set this property via the CollectionView's "animator" proxy: [[collectionView animator] setSelectionIndexPaths:newIndexPaths]. CollectionView will raise an exception if any of the given indexPaths is out-of-bounds. This property is Key-Value Observable.
*/
@property (copy) NSSet<NSIndexPath *> *selectionIndexPaths API_AVAILABLE(macos(10.11));
/* Adds the specified items to the selection, and optionally scrolls their bounding box into view according to the value of "scrollPosition". This method does not cause any selection-related delegate methods to be invoked.
To animate the scroll (if any) and the view property changes that indicate selected state, use [[collectionView animator] selectItemsAtIndexPaths:scrollPosition:].
*/
- (void)selectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths scrollPosition:(NSCollectionViewScrollPosition)scrollPosition API_AVAILABLE(macos(10.11));
/* Removes the specified items from the selection, potentially in an animated way. This method does not cause any selection-related delegate methods to be invoked.
To animate the view property changes that indicate deselected state, use [[collectionView animator] deselectItemsAtIndexPaths:].
*/
- (void)deselectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
/* Selects all of the CollectionView's items, if and only if it is "selectable" and it "allowsMultipleSelection", and notifies the CollectionView's delegate about any newly selected items. If either "selectable" or "allowsMultipleSelection" is NO, this action silently does nothing (and its associated user interface item does not validate).
*/
- (IBAction)selectAll:(nullable id)sender;
/* Clears the CollectionView's selection (if any), if and only if it is "selectable", and notifies the CollectionView's delegate about any newly deselected items. If "selectable" is NO, this action silently does nothing (and its associated user interface item does not validate).
*/
- (IBAction)deselectAll:(nullable id)sender;
/* For each item identifier that the collection view will use, register either a nib or class from which to instantiate an item, or provide a nib file or class whose name matches the identifier you plan to use. If a nib is registered, it must contain exactly one top-level NSCollectionViewItem. If a class is registered instead of a nib, it will be instantiated via alloc/init.
*/
- (void)registerClass:(nullable Class)itemClass forItemWithIdentifier:(NSUserInterfaceItemIdentifier)identifier API_AVAILABLE(macos(10.11));
- (void)registerNib:(nullable NSNib *)nib forItemWithIdentifier:(NSUserInterfaceItemIdentifier)identifier API_AVAILABLE(macos(10.11));
/* For each supplementary view identifier that the collection view will use, register either a nib or class from which to instantiate a view, or provide a nib file or class whose name matches the identifier you plan to use. If a nib is registered, it must contain exactly one top-level view, that conforms to the NSCollectionViewElement protocol. If a class is registered instead of a nib, it will be instantiated via alloc/initWithFrame:.
*/
- (void)registerClass:(nullable Class)viewClass forSupplementaryViewOfKind:(NSCollectionViewSupplementaryElementKind)kind withIdentifier:(NSUserInterfaceItemIdentifier)identifier API_AVAILABLE(macos(10.11));
- (void)registerNib:(nullable NSNib *)nib forSupplementaryViewOfKind:(NSCollectionViewSupplementaryElementKind)kind withIdentifier:(NSUserInterfaceItemIdentifier)identifier API_AVAILABLE(macos(10.11));
/* Call this method from your data source object when asked to provide a new item for the collection view. This method dequeues an existing item if one is available or creates a new one based on the nib file or class you previously registered. If you have not registered a nib file or class for the given identifier, CollectionView will try to load a nib file named identifier.nib, or (failing that) find and instantiate an NSCollectionViewItem subclass named "identifier".
If a new item must be created from a class, this method initializes the item by invoking its -init method. For nib-based items, this method loads the item from the provided nib file. If an existing item was available for reuse, this method invokes the item's -prepareForReuse method instead.
*/
- (__kindof NSCollectionViewItem *)makeItemWithIdentifier:(NSUserInterfaceItemIdentifier)identifier forIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
/* Call this method from your data source object when asked to provide a new supplementary view for the collection view. This method dequeues an existing view if one is available or creates a new one based on the nib file or class you previously registered. If you have not registered a nib file or class for the given identifier, CollectionView will try to load a nib file named identifier.nib, or (failing that) find and instantiate an NSView subclass named "identifier".
If a new view must be created from a class, this method initializes the view by invoking its -initWithFrame: method. For nib-based views, this method loads the view from the provided nib file. If an existing view was available for reuse, this method invokes the view's -prepareForReuse method instead.
*/
- (__kindof NSView *)makeSupplementaryViewOfKind:(NSCollectionViewSupplementaryElementKind)elementKind withIdentifier:(NSUserInterfaceItemIdentifier)identifier forIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
#pragma mark *** Finding Items ***
/* (Soft-Deprecated) Returns the NSCollectionViewItem associated with the represented object at the given index. Sending this to a CollectionView that has more than one section raises an exception. Use -itemAtIndexPath: instead.
*/
- (nullable NSCollectionViewItem *)itemAtIndex:(NSUInteger)index API_AVAILABLE(macos(10.6));
/* Returns the NSCollectionViewItem (if any) associated with the represented object at the given indexPath. This method returns nil if the CollectionView isn't currently maintaining an NSCollectionViewItem instance for the given indexPath, as may be the case if the specified item is outside the CollectionView's visibleRect.
*/
- (nullable NSCollectionViewItem *)itemAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
/* Returns the NSCollectionViewItems that the CollectionView has instantiated and is managing as currently active. Each such item is associated with an item indexPath, and its view is part of the currently displayed view hierarchy. Note that this list may include items whose views fall outside the CollectionView's current visibleRect (for example, recently visible items that have been scrolled out of view, or items that the CollectionView anticipates may soon be visible). To determine which of these items may actually be visible to the user, test each item.view.frame for intersection with the CollectionView's visibleRect.
*/
- (NSArray<NSCollectionViewItem *> *)visibleItems API_AVAILABLE(macos(10.11));
/* Returns the index paths of the items that are currently displayed by the CollectionView. Note that these indexPaths correspond to the same items as "visibleItems", and thus may include items whose views fall outside the CollectionView's current "visibleRect".
*/
- (NSSet<NSIndexPath *> *)indexPathsForVisibleItems API_AVAILABLE(macos(10.11));
/* Returns the index path of the specified item (or nil if the specified item is not in the collection view).
*/
- (nullable NSIndexPath *)indexPathForItem:(NSCollectionViewItem *)item API_AVAILABLE(macos(10.11));
/* Returns the index path of the item at the specified point in the collection view.
This method relies on the layout information provided by the associated layout object to determine which item contains the point. It does not take opacity of the item's displayed content at that point into account.
*/
- (nullable NSIndexPath *)indexPathForItemAtPoint:(NSPoint)point API_AVAILABLE(macos(10.11));
#pragma mark *** Finding Supplementary Views ***
/* Returns the supplementary view (if any) of the given elementKind that's associated with the given indexPath. Returns nil if no such supplementary view is currently instantiated.
*/
- (nullable NSView<NSCollectionViewElement> *)supplementaryViewForElementKind:(NSCollectionViewSupplementaryElementKind)elementKind atIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
/* Returns the supplementary views that the CollectionView has instantiated and is managing as currently active. Each such supplementary view is associated with an indexPath, and is part of the currently displayed view hierarchy. Note that this list may include supplementary views that fall outside the CollectionView's current visibleRect (for example, recently visible section header or footer views that have been scrolled out of view, or section header or footer views that the CollectionView anticipates may soon be visible). To determine which of these views may actually be visible to the user, test each view.frame for intersection with the CollectionView's visibleRect.
*/
- (NSArray<NSView<NSCollectionViewElement> *> *)visibleSupplementaryViewsOfKind:(NSCollectionViewSupplementaryElementKind)elementKind API_AVAILABLE(macos(10.11));
/* Returns the index paths of the supplementary views of the given elementKind that are currently displayed by the CollectionView. Note that these indexPaths correspond to the same supplementary views that "visibleSupplementaryViewsOfKind:" reports, and thus may include supplementary views that fall outside the CollectionView's current "visibleRect".
*/
- (NSSet<NSIndexPath *> *)indexPathsForVisibleSupplementaryElementsOfKind:(NSCollectionViewSupplementaryElementKind)elementKind API_AVAILABLE(macos(10.11));
#pragma mark *** Modifying Items and Sections ***
/* Use the following methods to communicate imminent model changes to a dataSource-based CollectionView. Their function is similar to that of NSOutlineView's insert/move/remove methods.
When invoking any of these methods, you can request an animated instead of immediate layout update by messaging the CollectionView's animator. For example: [[collectionView animator] insertItemsAtIndexPaths:indexPaths]
*/
/* Use this method to insert one or more sections into the collection view. This method adds the sections, and it is up to your data source to report the number of items in each section when asked for the information. The collection view then uses that information to get updated layout attributes for the newly inserted sections and items. If the insertions cause a change in the collection view’s visible content, those changes are animated into place.
You can also call this method from a block passed to the performBatchUpdates:completionHandler: method when you want to animate multiple separate changes into place at the same time. See the description of that method for more information.
Raises an exception if "sections" is nil.
*/
- (void)insertSections:(NSIndexSet *)sections API_AVAILABLE(macos(10.11));
/* Use this method to remove the sections and their items from the collection view. You might do this when you remove the sections from your data source object or in response to user interactions with the collection view. The collection view updates the layout of the remaining sections and items to account for the deletions, animating the remaining items into position as needed.
You can also call this method from a block passed to the performBatchUpdates:completionHandler: method when you want to animate multiple separate changes into place at the same time. See the description of that method for more information.
Raises an exception if "sections" is nil.
*/
- (void)deleteSections:(NSIndexSet *)sections API_AVAILABLE(macos(10.11));
/* Call this method to selectively reload only the objects in the specified sections. This causes the collection view to discard any items associated with those objects and redisplay them.
Raises an exception if "sections" is nil.
*/
- (void)reloadSections:(NSIndexSet *)sections API_AVAILABLE(macos(10.11));
/* Use this method to reorganize existing sections and their contained items. You might do this when you rearrange sections within your data source object or in response to user interactions with the collection view. The collection view updates the layout as needed to account for the move, animating new views into position as needed.
You can also call this method from a block passed to the performBatchUpdates:completionHandler: method when you want to animate multiple separate changes into place at the same time. See the description of that method for more information.
*/
- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection API_AVAILABLE(macos(10.11));
/* Call this method to insert one or more new items into the collection view. You might do this when your data source object receives data for new items or in response to user interactions with the collection view. The collection view gets the layout information for the new items as part of calling this method. And if the layout information indicates that the items should appear onscreen, the collection view asks your data source to provide the appropriate views, animating them into position as needed.
You can also call this method from a block passed to the performBatchUpdates:completionHandler: method when you want to animate multiple separate changes into place at the same time. See the description of that method for more information.
Raises an exception if "indexPaths" is nil.
*/
- (void)insertItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
/* Use this method to remove items from the collection view. You might do this when you remove the represented objects from your data source object or in response to user interactions with the collection view. The collection view updates the layout of the remaining items to account for the deletions, animating the remaining items into position as needed.
You can also call this method from a block passed to the performBatchUpdates:completionHandler: method when you want to animate multiple separate changes into place at the same time. See the description of that method for more information.
Raises an exception if "indexPaths" is nil.
*/
- (void)deleteItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
/* Call this method to selectively reload only the specified objects. This causes the collection view to discard any items associated with those objects and redisplay them.
Raises an exception if "indexPaths" is nil.
*/
- (void)reloadItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
/* Use this method to reorganize existing data items. You might do this when you rearrange the represented objects within your data source object or in response to user interactions with the collection view. You can move items between sections or within the same section. The collection view updates the layout as needed to account for the move, animating items into position as needed.
You can also call this method from a block passed to the performBatchUpdates:completionHandler: method when you want to animate multiple separate changes into place at the same time. See the description of that method for more information.
Raises an exception if "indexPath" or "newIndexPath" is nil.
*/
- (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath API_AVAILABLE(macos(10.11));
/* Animates multiple insert, delete, reload, and move operations as a group.
You can use this method in cases where you want to make multiple changes to the collection view in one single animated operation, as opposed to in several separate animations. You might use this method to insert, delete, reload or move items or use it to change the layout parameters associated with one or more items. Use the block passed in the "updates" parameter to specify all of the operations you want to perform.
Deletes are processed before inserts in batch operations. This means the indexes for the insertions are processed relative to the indexes of the state before the batch operation, and the indexes for the deletions are processed relative to the indexes of the state after all the insertions in the batch operation.
Invocations of this method can be nested.
*/
- (void)performBatchUpdates:(void (NS_NOESCAPE ^_Nullable)(void))updates completionHandler:(void (^_Nullable)(BOOL finished))completionHandler API_AVAILABLE(macos(10.11));
#pragma mark *** Section Collapse ***
/* Toggles collapse of the CollectionView section that the sender resides in. Typically you'll wire this action from a section header view's "sectionCollapse" button. (See the NSCollectionViewSectionHeaderView protocol.)
*/
- (IBAction)toggleSectionCollapse:(id)sender API_AVAILABLE(macos(10.12));
#pragma mark *** Scrolling ***
/* Scrolls the collection view contents until the bounding box of the specified items is visible. The final position of that bounding box within the scrollable area is determined by "scrollPosition".
To request an animated scroll, use [[collectionView animator] scrollToItemsAtIndexPaths:scrollPosition:]. You can use NSAnimationContext's completionHandler provisions to notify you when the animated scroll has finished.
*/
- (void)scrollToItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths scrollPosition:(NSCollectionViewScrollPosition)scrollPosition API_AVAILABLE(macos(10.11));
#pragma mark *** Drag and Drop ***
/* Configures the value returned from -draggingSourceOperationMaskForLocal:. An isLocal value of YES indicates that 'dragOperationMask' applies when the destination object is in the same application. By default, NSDragOperationEvery will be returned. An isLocal value of NO indicates that 'dragOperationMask' applies when the destination object is in an application outside the receiver's application. By default, NSDragOperationNone is returned. NSCollectionView will save the values you set for each isLocal setting. You typically will invoke this method, and not override it.
*/
- (void)setDraggingSourceOperationMask:(NSDragOperation)dragOperationMask forLocal:(BOOL)localDestination API_AVAILABLE(macos(10.6));
/* This method computes and returns an image to use for dragging. You can override this to return a custom drag image, or call it from the delegate method to get the default drag image. 'indexPaths' contains the NSIndexPaths of the items being dragged. 'event' is a reference to the mouse down event that began the drag. 'dragImageOffset' is an in/out parameter. This method will be called with dragImageOffset set to NSZeroPoint, but it can be modified to re-position the returned image. A dragImageOffset of NSZeroPoint will cause the image to be centered under the mouse. By default, an image will be created that contains a rendering of the visible portions of the views for each item. If the delegate implements the equivalent delegate method, it will be preferred over this method.
*/
- (NSImage *)draggingImageForItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset API_AVAILABLE(macos(10.11));
/* Old Form (Single Section Only) */
/* This is an older variant of -draggingImageForItemsAtIndexPaths:withEvent:offset:. It assumes all of the indexes are in section 0. New code should use -draggingImageForItemsAtIndexPaths:withEvent:offset: instead.
*/
- (NSImage *)draggingImageForItemsAtIndexes:(NSIndexSet *)indexes withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset API_AVAILABLE(macos(10.6));
@end
@protocol NSCollectionViewDataSource <NSObject>
@required
/* Asks the data source for the number of items in the specified section.
*/
- (NSInteger)collectionView:(NSCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section API_AVAILABLE(macos(10.11));
/* Asks the data source to provide an NSCollectionViewItem for the specified represented object.
Your implementation of this method is responsible for creating, configuring, and returning the appropriate item for the given represented object. You do this by sending -makeItemWithIdentifier:forIndexPath: method to the collection view and passing the identifier that corresponds to the item type you want. Upon receiving the item, you should set any properties that correspond to the data of the corresponding model object, perform any additional needed configuration, and return the item.
You do not need to set the location of the item's view inside the collection view’s bounds. The collection view sets the location of each item automatically using the layout attributes provided by its layout object.
This method must always return a valid item instance.
*/
- (NSCollectionViewItem *)collectionView:(NSCollectionView *)collectionView itemForRepresentedObjectAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
@optional
/* Asks the data source for the number of sections in the collection view.
If you do not implement this method, the collection view assumes it has only one section.
*/
- (NSInteger)numberOfSectionsInCollectionView:(NSCollectionView *)collectionView API_AVAILABLE(macos(10.11));
/* Asks the data source to provide a view for the specified supplementary element.
Your implementation of this method is responsible for creating, configuring, and returning an appropriate view. You do this by sending -makeSupplementaryViewOfKind:withIdentifier:forIndexPath: to the collection view and passing the identifier that corresponds to the supplementary view type you want. Upon receiving the view, you should set any desired appearance properties, perform any additional needed configuration, and return the item.
You do not need to set the location of the view inside the collection view’s bounds. The collection view sets the location of each supplementary view automatically using the layout attributes provided by its layout object.
This method must always return a valid view.
*/
- (NSView *)collectionView:(NSCollectionView *)collectionView viewForSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)kind atIndexPath:(NSIndexPath *)indexPath;
@end
@protocol NSCollectionViewPrefetching <NSObject>
@required
/* Notifies your 'prefetchDataSource' that items at the specified 'indexPaths' are likely to be instantiated and displayed soon. The CollectionView sends this as early as possible, to give your 'prefetchDataSource' the opportunity to begin acquiring any resources such as thumbnail images or metadata that you might need in order to prepare the item's content for display. The given 'indexPaths' are sorted by the order in which they are likely to be needed.
*/
- (void)collectionView:(NSCollectionView *)collectionView prefetchItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;
@optional
/* Notifies your 'prefetchDataSource' that items at the specified 'indexPaths', for which the CollectionView previously sent -collectionView:prefetchItemsAtIndexPaths:, are no longer expected to be displayed. This is a good opportunity to cancel any pending resource fetches you've initiated for the items, if possible and worthwhile. This is only sent for items that don't end up being displayed; CollectionView doesn't cancel prefetching for items that it actually instantiates and shows.
*/
- (void)collectionView:(NSCollectionView *)collectionView cancelPrefetchingForItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths;
@end
@protocol NSCollectionViewDelegate <NSObject>
@optional
/* Drag and drop support */
/* To enable dealing with (section,item) NSIndexPaths now that NSCollectionView supports sections, many of the drag-and-drop delegate methods have been replaced with new versions that take NSIndexPath and array-of-NSIndexPath parameters. In each such case, NSCollectionView will look for and invoke the newer method first. If the delegate doesn't respond to the newer version, NSCollectionView will look for the old method, provided that the NSCollectionView has only a single section. The old methods will not be invoked for a multi-section NSCollectionView.
*/
/* The return value indicates whether the collection view can attempt to initiate a drag for the given event and items. If the delegate does not implement this method, the collection view will act as if it returned YES.
*/
- (BOOL)collectionView:(NSCollectionView *)collectionView canDragItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths withEvent:(NSEvent *)event API_AVAILABLE(macos(10.11));
/* Old Form (Single Section Only) */
- (BOOL)collectionView:(NSCollectionView *)collectionView canDragItemsAtIndexes:(NSIndexSet *)indexes withEvent:(NSEvent *)event API_AVAILABLE(macos(10.6));
/* This method is called after it has been determined that a drag should begin, but before the drag has been started. To refuse the drag, return NO. To start the drag, declare the pasteboard types that you support with -[NSPasteboard declareTypes:owner:], place your data for the items at the given index paths on the pasteboard, and return YES from the method. The drag image and other drag related information will be set up and provided by the view once this call returns YES. You need to implement this method, or -collectionView:pasteboardWriterForItemAtIndexPath: (its more modern counterpart), for your collection view to be a drag source. If you want to put file promises on the pasteboard, using the modern NSFilePromiseProvider API added in macOS 10.12, implement -collectionView:pasteboardWriterForItemAtIndexPath: instead of this method, and have it return an NSFilePromiseProvider.
*/
- (BOOL)collectionView:(NSCollectionView *)collectionView writeItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths toPasteboard:(NSPasteboard *)pasteboard API_DEPRECATED("Use -collectionView:pasteboardWriterForItemAtIndexPath: instead", macos(10.11, 10.15));
/* Old Form (Single Section Only) */
- (BOOL)collectionView:(NSCollectionView *)collectionView writeItemsAtIndexes:(NSIndexSet *)indexes toPasteboard:(NSPasteboard *)pasteboard API_DEPRECATED("Use -collectionView:pasteboardWriterForItemAtIndexPath: instead", macos(10.6, 10.15));
/* This is a legacy method for file promise dragging, that's invoked when the delegate has placed NSFilesPromisePboardType data on the dragging pasteboard (typically in -collectionView:writeItemsAtIndexPaths:toPasteboard:). When using file promises and targeting macOS 10.12 and later, you should instead implement -collectionView:pasteboardWriterForItemAtIndexPath: to return a fully configured NSFilePromiseProvider, whose delegate provides the file name resolution functionality that was previously delegated to this method.
NSCollectionView implements -namesOfPromisedFilesDroppedAtDestination: to return the results of this delegate method. This method should return an array of filenames (not full paths) for the created files. `dropURL` specifies the drop location. You do not need to implement this method for your collection view to be a drag source.
*/
- (NSArray<NSString *> *)collectionView:(NSCollectionView *)collectionView namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropURL forDraggedItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_DEPRECATED("Use NSFilePromiseReceiver objects instead", macos(10.11,10.13));
/* Old Form (Single Section Only) */
- (NSArray<NSString *> *)collectionView:(NSCollectionView *)collectionView namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropURL forDraggedItemsAtIndexes:(NSIndexSet *)indexes API_DEPRECATED("Use NSFilePromiseReceiver objects instead", macos(10.6,10.13));
/* Allows the delegate to construct a custom dragging image for the items being dragged. 'indexPaths' contains the (section,item) identification of the items being dragged. 'event' is a reference to the mouse down event that began the drag. 'dragImageOffset' is an in/out parameter. This method will be called with dragImageOffset set to NSZeroPoint, but it can be modified to re-position the returned image. A dragImageOffset of NSZeroPoint will cause the image to be centered under the mouse. You can safely call -[NSCollectionView draggingImageForItemsAtIndexPaths:withEvent:offset:] from within this method. You do not need to implement this method for your collection view to be a drag source.
*/
- (NSImage *)collectionView:(NSCollectionView *)collectionView draggingImageForItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset API_AVAILABLE(macos(10.11));
/* Old Form (Single Section Only) */
- (NSImage *)collectionView:(NSCollectionView *)collectionView draggingImageForItemsAtIndexes:(NSIndexSet *)indexes withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset API_AVAILABLE(macos(10.6));
/* This method is used by the collection view to determine a valid drop target. Based on the mouse position, the collection view will suggest a proposed (section,item) index path and drop operation. These values are in/out parameters and can be changed by the delegate to retarget the drop operation. The collection view will propose NSCollectionViewDropOn when the dragging location is closer to the middle of the item than either of its edges. Otherwise, it will propose NSCollectionViewDropBefore. You may override this default behavior by changing proposedDropOperation or proposedDropIndexPath. This method must return a value that indicates which dragging operation the data source will perform. It must return something other than NSDragOperationNone to accept the drop.
Note: to receive drag messages, you must first send -registerForDraggedTypes: to the collection view with the drag types you want to support (typically this is done in -awakeFromNib). You must implement this method for your collection view to be a drag destination.
Multi-image drag and drop: You can set draggingFormation, animatesToDestination, numberOfValidItemsForDrop within this method.
*/
- (NSDragOperation)collectionView:(NSCollectionView *)collectionView validateDrop:(id <NSDraggingInfo>)draggingInfo proposedIndexPath:(NSIndexPath * _Nonnull * _Nonnull)proposedDropIndexPath dropOperation:(NSCollectionViewDropOperation *)proposedDropOperation API_AVAILABLE(macos(10.11));
/* Old Form (Single Section Only) */
- (NSDragOperation)collectionView:(NSCollectionView *)collectionView validateDrop:(id <NSDraggingInfo>)draggingInfo proposedIndex:(NSInteger *)proposedDropIndex dropOperation:(NSCollectionViewDropOperation *)proposedDropOperation API_AVAILABLE(macos(10.6));
/* This method is called when the mouse is released over a collection view that previously decided to allow a drop via the above validateDrop method. At this time, the delegate should incorporate the data from the dragging pasteboard and update the collection view's contents. You must implement this method for your collection view to be a drag destination.
Multi-image drag and drop: If draggingInfo.animatesToDestination is set to YES, you should enumerate and update the dragging items with the proper image components and frames so that they dragged images animate to the proper locations.
*/
- (BOOL)collectionView:(NSCollectionView *)collectionView acceptDrop:(id <NSDraggingInfo>)draggingInfo indexPath:(NSIndexPath *)indexPath dropOperation:(NSCollectionViewDropOperation)dropOperation API_AVAILABLE(macos(10.11));
/* Old Form (Single Section Only) */
- (BOOL)collectionView:(NSCollectionView *)collectionView acceptDrop:(id <NSDraggingInfo>)draggingInfo index:(NSInteger)index dropOperation:(NSCollectionViewDropOperation)dropOperation API_AVAILABLE(macos(10.6));
/* Multi-image drag and drop */
/* Dragging Source Support - Required for multi-image drag and drop. Return a custom object that implements NSPasteboardWriting (or simply use NSPasteboardItem), or nil to prevent dragging for the item. For each valid item returned, NSCollectionView will create an NSDraggingItem with the draggingFrame equal to the frame of the item view at the given index path and components from -[NSCollectionViewItem draggingItem]. If this method is implemented, then -collectionView:writeItemsAtIndexPaths:toPasteboard: and -collectionView:draggingImageForItemsAtIndexPaths:withEvent:offset: will not be called.
*/
- (nullable id <NSPasteboardWriting>)collectionView:(NSCollectionView *)collectionView pasteboardWriterForItemAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
/* Old Form (Single Section Only) */
- (nullable id <NSPasteboardWriting>)collectionView:(NSCollectionView *)collectionView pasteboardWriterForItemAtIndex:(NSUInteger)index;
/* Dragging Source Support - Optional. Implement this method to know when the dragging session is about to begin and to potentially modify the dragging session.
*/
- (void)collectionView:(NSCollectionView *)collectionView draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint forItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
/* Old Form (Single Section Only) */
- (void)collectionView:(NSCollectionView *)collectionView draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint forItemsAtIndexes:(NSIndexSet *)indexes;
/* Dragging Source Support - Optional. Implement this method to know when the dragging session has ended. This delegate method can be used to know when the dragging source operation ended at a specific location, such as the trash (by checking for an operation of NSDragOperationDelete).
*/
- (void)collectionView:(NSCollectionView *)collectionView draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint dragOperation:(NSDragOperation)operation;
/* Dragging Destination Support - Required for multi-image drag and drop. Implement this method to update dragging items as they are dragged over the view. Typically this will involve calling [draggingInfo enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:] and setting the draggingItem's imageComponentsProvider to a proper image based on the NSDraggingItem's -item value.
*/
- (void)collectionView:(NSCollectionView *)collectionView updateDraggingItemsForDrag:(id <NSDraggingInfo>)draggingInfo;
#pragma mark *** Selection and Highlighting ***
/* Sent during interactive selection or dragging, to inform the delegate that the CollectionView would like to change the "highlightState" property of the items at the specified "indexPaths" to the specified "highlightState". In addition to optionally reacting to the proposed change, you can approve it (by returning "indexPaths" as-is), or selectively refuse some or all of the proposed highlightState changes (by returning a modified autoreleased mutableCopy of indexPaths, or an empty indexPaths instance). Refusing a proposed highlightState change for an item will suppress the associated action for that item (selection change or eligibility to be a drop target).
*/
- (NSSet<NSIndexPath *> *)collectionView:(NSCollectionView *)collectionView shouldChangeItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths toHighlightState:(NSCollectionViewItemHighlightState)highlightState API_AVAILABLE(macos(10.11));
/* Sent during interactive selection or dragging, to inform the delegate that the CollectionView has changed the "highlightState" property of the items at the specified "indexPaths" to the specified "highlightState". */
- (void)collectionView:(NSCollectionView *)collectionView didChangeItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths toHighlightState:(NSCollectionViewItemHighlightState)highlightState API_AVAILABLE(macos(10.11));
/* Sent during interactive selection, to inform the delegate that the CollectionView would like to select the items at the specified "indexPaths". In addition to optionally reacting to the proposed change, you can approve it (by returning "indexPaths" as-is), or selectively refuse some or all of the proposed selection changes (by returning a modified autoreleased mutableCopy of indexPaths, or an empty indexPaths instance).
*/
- (NSSet<NSIndexPath *> *)collectionView:(NSCollectionView *)collectionView shouldSelectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
/* Sent during interactive selection, to inform the delegate that the CollectionView would like to de-select the items at the specified "indexPaths". In addition to optionally reacting to the proposed change, you can approve it (by returning "indexPaths" as-is), or selectively refuse some or all of the proposed selection changes (by returning a modified autoreleased mutableCopy of indexPaths, or an empty indexPaths instance). */
- (NSSet<NSIndexPath *> *)collectionView:(NSCollectionView *)collectionView shouldDeselectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
/* Sent at the end of interactive selection, to inform the delegate that the CollectionView has selected the items at the specified "indexPaths".
*/
- (void)collectionView:(NSCollectionView *)collectionView didSelectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
/* Sent at the end of interactive selection, to inform the delegate that the CollectionView has de-selected the items at the specified "indexPaths".
*/
- (void)collectionView:(NSCollectionView *)collectionView didDeselectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
#pragma mark *** Display Notification ***
/* Sent to notify the delegate that the CollectionView is about to add an NSCollectionViewItem. The indexPath identifies the object that the item represents.
*/
- (void)collectionView:(NSCollectionView *)collectionView willDisplayItem:(NSCollectionViewItem *)item forRepresentedObjectAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
/* Sent to notify the delegate that the CollectionView is about to add a supplementary view (e.g. a section header or footer view). Each NSCollectionViewLayout class defines its own possible values and associated meanings for "elementKind". (For example, NSCollectionViewFlowLayout declares NSCollectionElementKindSectionHeader and NSCollectionElementKindSectionFooter.)
*/
- (void)collectionView:(NSCollectionView *)collectionView willDisplaySupplementaryView:(NSView *)view forElementKind:(NSCollectionViewSupplementaryElementKind)elementKind atIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
/* Sent to notify the delegate that the CollectionView is no longer displaying the given NSCollectionViewItem instance. This happens when the model changes, or when an item is scrolled out of view. You should perform any actions necessary to help decommission the item (such as releasing expensive resources). The CollectionView may retain the item instance and later reuse it to represent the same or a different model object.
*/
- (void)collectionView:(NSCollectionView *)collectionView didEndDisplayingItem:(NSCollectionViewItem *)item forRepresentedObjectAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
/* Sent to notify the delegate that the CollectionView is no longer displaying the given supplementary view. This happens when the model changes, or when a supplementary view is scrolled out of view. You should perform any actions necessary to help decommission the view (such as releasing expensive resources). The CollectionView may retain the view and later reuse it. */
- (void)collectionView:(NSCollectionView *)collectionView didEndDisplayingSupplementaryView:(NSView *)view forElementOfKind:(NSCollectionViewSupplementaryElementKind)elementKind atIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
#pragma mark *** Layout Transition Support ***
/* Sent when the CollectionView switches to a different layout, to allow the delegate to provide a custom transition if desired.
*/
- (NSCollectionViewTransitionLayout *)collectionView:(NSCollectionView *)collectionView transitionLayoutForOldLayout:(NSCollectionViewLayout *)fromLayout newLayout:(NSCollectionViewLayout *)toLayout API_AVAILABLE(macos(10.11));
@end
#if !TARGET_OS_IPHONE
@interface NSIndexPath (NSCollectionViewAdditions)
+ (NSIndexPath *)indexPathForItem:(NSInteger)item inSection:(NSInteger)section API_AVAILABLE(macos(10.11));
@property (readonly) NSInteger item API_AVAILABLE(macos(10.11));
@property (readonly) NSInteger section API_AVAILABLE(macos(10.11));
@end
#endif // !TARGET_OS_IPHONE
@interface NSSet (NSCollectionViewAdditions)
/* Creates and returns a set that contains a single given NSIndexPath.
*/
+ (instancetype)setWithCollectionViewIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(macos(10.11));
/* Creates and returns a set containing a uniqued collection of the NSIndexPaths contained in a given array.
*/
+ (instancetype)setWithCollectionViewIndexPaths:(NSArray<NSIndexPath *> *)indexPaths API_AVAILABLE(macos(10.11));
/* Executes the given block for each NSIndexPath in the set. The index paths are enumerated in the order defined by NSIndexPath's -compare: method. For CollectionView item index paths, this means all index paths in section 0, in ascending order, followed by all index paths in section 1, and so on. You may pass the NSEnumerationReverse option to enumerate in the reverse order. Set *stop = YES if desired, to halt the enumeration early. Note that the given indexPath is not guaranteed to survive return from the block invocation, so if you wish to pass it outside the block, you must make a -copy (and later -release or -autorelease, if not using ARC).
*/
- (void)enumerateIndexPathsWithOptions:(NSEnumerationOptions)opts usingBlock:(void (NS_NOESCAPE ^)(NSIndexPath *indexPath, BOOL *stop))block API_AVAILABLE(macos(10.11));
@end
@interface NSCollectionView (NSDeprecated)
/* Invoked by a dataSource-less NSCollectionView when it needs a new item to represent the given model "object" (which is presumed to be a member of the CollectionView's "content" array). Instantiates and returns a non-autoreleased item whose "representedObject" has been set to point to the given "object". NSCollectionView's implementation of this method makes a copy of the CollectionView's itemPrototype (raising an exception if itemPrototype is nil). You can override this method to customize the returned item or its view subtree however you wish, calling up to super first to obtain it. Or, you can replace super's implementation entirely, to instantiate whatever kind of item you wish, potentially based on the type or properties of the given model "object". The item returned from this factory method should NOT be autoreleased.
It is considered a programming error to send this message to an NSCollectionView that has a dataSource; an exception will be raised. Use -makeItemWithIdentifier:forIndexPath: instead, from the dataSource's -collectionView:itemForRepresentedObjectAtIndexPath: method.
*/
- (NSCollectionViewItem *)newItemForRepresentedObject:(id)object API_DEPRECATED("Use -[NSCollectionViewDataSource collectionView:itemForRepresentedObjectAtIndexPath:] instead", macos(10.5,10.14));
/* A prototype NSCollectionViewItem that a dataSource-less NSCollectionView should clone to produce new items. When not using a dataSource, you must either specify an itemPrototype, or override -newItemForRepresentedObject:, for the CollectionView to be able to create and display items.
It is considered a programming error to send this message to an NSCollectionView that has a dataSource; an exception will be raised.
*/
@property (nullable, strong) NSCollectionViewItem *itemPrototype API_DEPRECATED("Use -registerNib:forItemWithIdentifier: or -registerClass:forItemWithIdentifier: instead.", macos(10.5,10.14));
/* The following properties pertain only to NSCollectionViewGridLayout. When you set collectionViewLayout to point to an instance of this class (or a subclass), these NSCollectionView properties take on the corresponding property values of the NSCollectionViewGridLayout. When collectionViewLayout points to any other kind of layout object, these properties remember the values they are given, but they don't affect item layout or display. When targeting OS X 10.11 and later, it's recommended that you reference the corresponding NSCollectionViewGridLayout properties instead.
*/
@property NSUInteger maxNumberOfRows API_DEPRECATED("Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its maximumNumberOfRows instead", macos(10.5,10.14)); // default: 0, which means no limit
@property NSUInteger maxNumberOfColumns API_DEPRECATED("Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its maximumNumberOfColumns instead", macos(10.5,10.14)); // default: 0, which means no limit
@property NSSize minItemSize API_DEPRECATED("Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its minimumItemSize instead", macos(10.5,10.14)); // default: (0; 0)
@property NSSize maxItemSize API_DEPRECATED("Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its maximumItemSize instead", macos(10.5,10.14)); // default: (0; 0), which means no limit
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTextSelection.h | #if (defined(USE_APPKIT_PUBLIC_HEADERS) && USE_APPKIT_PUBLIC_HEADERS) || !__has_include(<UIFoundation/NSTextSelection.h>)
#include <TargetConditionals.h>
#if !TARGET_OS_IPHONE
//
// NSTextSelection.h
// Text Kit
//
// Copyright (c) 2018-2021, Apple Inc. All rights reserved.
//
#import <Foundation/NSAttributedString.h>
#import <CoreGraphics/CGGeometry.h>
@class NSTextRange;
@protocol NSTextLocation;
NS_ASSUME_NONNULL_BEGIN
// NSTextSelection represents a single logical selection context corresponding to an insertion point.
#pragma mark NSTextSelection
typedef NS_ENUM(NSInteger, NSTextSelectionGranularity) {
NSTextSelectionGranularityCharacter,
NSTextSelectionGranularityWord,
NSTextSelectionGranularityParagraph,
NSTextSelectionGranularityLine,
NSTextSelectionGranularitySentence
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
typedef NS_ENUM(NSInteger, NSTextSelectionAffinity) {
NSTextSelectionAffinityUpstream = 0,
NSTextSelectionAffinityDownstream = 1
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@interface NSTextSelection : NSObject <NSSecureCoding>
#pragma mark Initialization
// textRanges should be ordered and not overlapping. Otherwise, textRanges would get normalized by reordered and merging overlapping ranges.
- (instancetype)initWithRanges:(NSArray<NSTextRange *> *)textRanges affinity:(NSTextSelectionAffinity)affinity granularity:(NSTextSelectionGranularity)granularity NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithRange:(NSTextRange *)range affinity:(NSTextSelectionAffinity)affinity granularity:(NSTextSelectionGranularity)granularity;
- (instancetype)initWithLocation:(id <NSTextLocation>)location affinity:(NSTextSelectionAffinity)affinity;
- (instancetype)init NS_UNAVAILABLE;
#pragma mark Basic properties
// Represents an array of disjoint logical ranges in the selection. The array must be logically ordered. When editing, all ranges in a text selection constitute a single insertion point.
@property (copy, readonly) NSArray<NSTextRange *> *textRanges;
// The granularity of the selection. NSTextSelectionGranularityByCharacter by default. Extending operations should modify the selection by the granularity.
@property (readonly) NSTextSelectionGranularity granularity;
// Either upstream or downstream selection. NSTextSelectionAffinityDownstream by default. For a 0-length selection, it describes the visual location of the text cursor between the head of line containing the selection location (downstream) or tail of the previous line (upstream). For a selection with contents, it describes the logical direction of non-anchored edge of the selection.
@property (readonly) NSTextSelectionAffinity affinity;
// Transient text selection during drag handling
@property (readonly, getter=isTransient) BOOL transient;
#pragma mark Navigation properties
// Represents the anchor position offset from the beginning of a line fragment in the visual order for the initial tap or mouse down. That is from the left for a horizontal line fragment and from the top for a vertical. Navigating between lines uses this point when the current line fragment associated with the selection is shorter than the next line visited. 0.0 by default.
@property CGFloat anchorPositionOffset;
#pragma mark Visual selection
// Indicates whether the selection should be interpreted as logical or visual.
@property (getter=isLogical) BOOL logical;
// Specifies the secondary character location when user taps/clicks at a directional boundary. Setting non-nil location has a side effect of making -logical=NO.
@property (strong, nullable) id <NSTextLocation> secondarySelectionLocation;
#pragma mark Typing attributes
// The template attributes used for characters replacing the contents of this selection.
@property (copy) NSDictionary<NSAttributedStringKey, id> *typingAttributes;
#pragma mark Selection manipulation
// Returns a copy of this selection, replacing this instance's textRanges property with textRanges but keeping all other attributes the same.
- (NSTextSelection *)textSelectionWithTextRanges:(NSArray<NSTextRange *> *)textRanges;
@end
NS_ASSUME_NONNULL_END
#endif // !TARGET_OS_IPHONE
#else
#import <UIFoundation/NSTextSelection.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/NSView.h | /*
NSView.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSRange.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSAnimation.h>
#import <AppKit/NSAppearance.h>
#import <AppKit/NSDragging.h>
#import <AppKit/NSGraphics.h>
#import <AppKit/NSPasteboard.h>
#import <AppKit/NSResponder.h>
#import <AppKit/NSTouch.h>
#import <AppKit/NSUserInterfaceItemIdentification.h>
#import <AppKit/NSUserInterfaceLayout.h>
@protocol NSDraggingSource;
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSBitmapImageRep, NSCursor, NSDraggingSession, NSGestureRecognizer, NSGraphicsContext, NSImage, NSScrollView, NSTextInputContext, NSWindow, NSAttributedString;
@class CIFilter, CALayer, NSScreen, NSShadow, NSTrackingArea, NSLayoutGuide;
// Bitset options for the autoresizingMask
typedef NS_OPTIONS(NSUInteger, NSAutoresizingMaskOptions) {
NSViewNotSizable = 0,
NSViewMinXMargin = 1,
NSViewWidthSizable = 2,
NSViewMaxXMargin = 4,
NSViewMinYMargin = 8,
NSViewHeightSizable = 16,
NSViewMaxYMargin = 32
};
typedef NS_ENUM(NSUInteger, NSBorderType) {
NSNoBorder = 0,
NSLineBorder = 1,
NSBezelBorder = 2,
NSGrooveBorder = 3
};
typedef NS_ENUM(NSInteger, NSViewLayerContentsRedrawPolicy) {
// Leave the layer's contents alone. Never mark the layer as needing display, or draw the view's contents to the layer
NSViewLayerContentsRedrawNever = 0,
// Map view -setNeedsDisplay...: activity to the layer, and redraw affected layer parts by invoking the view's -drawRect:, but don't mark the view or layer as needing display when the view's size changes.
NSViewLayerContentsRedrawOnSetNeedsDisplay = 1,
// Resize the layer and redraw the view to the layer when the view's size changes. If the resize is animated, AppKit will drive the resize animation itself and will do this resize+redraw at each step of the animation. Affected parts of the layer will also be redrawn when the view is marked as needing display. (This mode is a superset of NSViewLayerContentsRedrawOnSetNeedsDisplay.)
NSViewLayerContentsRedrawDuringViewResize = 2,
// Resize the layer and redraw the view to the layer when the view's size changes. This will be done just once at the beginning of a resize animation, not at each frame of the animation. Affected parts of the layer will also be redrawn when the view is marked as needing display. (This mode is a superset of NSViewLayerContentsRedrawOnSetNeedsDisplay.)
NSViewLayerContentsRedrawBeforeViewResize = 3,
// When a view is resized, the layer contents will be redrawn once and the contents will crossfade from the old value to the new value. Use this in conjunction with the layerContentsPlacement to get a nice crossfade animation for complex layer-backed views that can't correctly update on each step of the animation
NSViewLayerContentsRedrawCrossfade API_AVAILABLE(macos(10.9)) = 4
} API_AVAILABLE(macos(10.6));
typedef NS_ENUM(NSInteger, NSViewLayerContentsPlacement) {
NSViewLayerContentsPlacementScaleAxesIndependently = 0,
NSViewLayerContentsPlacementScaleProportionallyToFit = 1,
NSViewLayerContentsPlacementScaleProportionallyToFill = 2,
NSViewLayerContentsPlacementCenter = 3,
NSViewLayerContentsPlacementTop = 4,
NSViewLayerContentsPlacementTopRight = 5,
NSViewLayerContentsPlacementRight = 6,
NSViewLayerContentsPlacementBottomRight = 7,
NSViewLayerContentsPlacementBottom = 8,
NSViewLayerContentsPlacementBottomLeft = 9,
NSViewLayerContentsPlacementLeft = 10,
NSViewLayerContentsPlacementTopLeft = 11
} API_AVAILABLE(macos(10.6));
typedef NSInteger NSTrackingRectTag;
typedef NSInteger NSToolTipTag;
@interface NSView : NSResponder <NSAnimatablePropertyContainer, NSUserInterfaceItemIdentification, NSDraggingDestination, NSAppearanceCustomization, NSAccessibilityElement, NSAccessibility>
- (instancetype)initWithFrame:(NSRect)frameRect NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
@property (nullable, readonly, assign) NSWindow *window;
@property (nullable, readonly, assign) NSView *superview;
@property (copy) NSArray<__kindof NSView *> *subviews;
- (BOOL)isDescendantOf:(NSView *)view;
- (nullable NSView *)ancestorSharedWithView:(NSView *)view;
@property (nullable, readonly, assign) NSView *opaqueAncestor;
@property (getter=isHidden) BOOL hidden;
@property (getter=isHiddenOrHasHiddenAncestor, readonly) BOOL hiddenOrHasHiddenAncestor;
- (void)getRectsBeingDrawn:(const NSRect * _Nullable * _Nullable)rects count:(nullable NSInteger *)count;
- (BOOL)needsToDrawRect:(NSRect)rect;
@property (readonly) BOOL wantsDefaultClipping;
- (void)viewDidHide API_AVAILABLE(macos(10.5));
- (void)viewDidUnhide API_AVAILABLE(macos(10.5));
- (void)addSubview:(NSView *)view;
- (void)addSubview:(NSView *)view positioned:(NSWindowOrderingMode)place relativeTo:(nullable NSView *)otherView;
- (void)sortSubviewsUsingFunction:(NSComparisonResult (NS_NOESCAPE *)(__kindof NSView *, __kindof NSView *, void * _Nullable))compare context:(nullable void *)context;
/* NOTE: In general, it is good practice to call 'super' for the viewWill* and viewDid* methods. Some AppKit subclasses, such as NSTableView, depend on this behavior, and calling super is required for things to work properly.
*/
- (void)viewWillMoveToWindow:(nullable NSWindow *)newWindow;
- (void)viewDidMoveToWindow;
- (void)viewWillMoveToSuperview:(nullable NSView *)newSuperview;
- (void)viewDidMoveToSuperview;
- (void)didAddSubview:(NSView *)subview;
- (void)willRemoveSubview:(NSView *)subview;
- (void)removeFromSuperview;
- (void)replaceSubview:(NSView *)oldView with:(NSView *)newView;
- (void)removeFromSuperviewWithoutNeedingDisplay;
- (void)viewDidChangeBackingProperties API_AVAILABLE(macos(10.7)); // available in 10.7.4
@property BOOL postsFrameChangedNotifications;
- (void)resizeSubviewsWithOldSize:(NSSize)oldSize;
- (void)resizeWithOldSuperviewSize:(NSSize)oldSize;
@property BOOL autoresizesSubviews;
@property NSAutoresizingMaskOptions autoresizingMask;
- (void)setFrameOrigin:(NSPoint)newOrigin;
- (void)setFrameSize:(NSSize)newSize;
@property NSRect frame;
@property CGFloat frameRotation;
@property CGFloat frameCenterRotation API_AVAILABLE(macos(10.5));
- (void)setBoundsOrigin:(NSPoint)newOrigin;
- (void)setBoundsSize:(NSSize)newSize;
@property CGFloat boundsRotation;
- (void)translateOriginToPoint:(NSPoint)translation;
- (void)scaleUnitSquareToSize:(NSSize)newUnitSize;
- (void)rotateByAngle:(CGFloat)angle;
@property NSRect bounds;
@property (getter=isFlipped, readonly) BOOL flipped;
@property (getter=isRotatedFromBase, readonly) BOOL rotatedFromBase;
@property (getter=isRotatedOrScaledFromBase, readonly) BOOL rotatedOrScaledFromBase;
/* A hint as to whether or not this view draws its contents completely opaque or not. Opaque content drawing can allow some optimizations to happen. The default value is NO.
*/
@property (getter=isOpaque, readonly) BOOL opaque;
- (NSPoint)convertPoint:(NSPoint)point fromView:(nullable NSView *)view;
- (NSPoint)convertPoint:(NSPoint)point toView:(nullable NSView *)view;
- (NSSize)convertSize:(NSSize)size fromView:(nullable NSView *)view;
- (NSSize)convertSize:(NSSize)size toView:(nullable NSView *)view;
- (NSRect)convertRect:(NSRect)rect fromView:(nullable NSView *)view;
- (NSRect)convertRect:(NSRect)rect toView:(nullable NSView *)view;
/* Uses NSIntegralRectWithOptions() to produce a backing store pixel aligned rectangle from the given input rectangle in local view coordinates.
*/
- (NSRect)backingAlignedRect:(NSRect)rect options:(NSAlignmentOptions)options API_AVAILABLE(macos(10.7));
- (NSRect)centerScanRect:(NSRect)rect;
/* New methods for converting to and from backing store pixels */
- (NSPoint)convertPointToBacking:(NSPoint)point API_AVAILABLE(macos(10.7));
- (NSPoint)convertPointFromBacking:(NSPoint)point API_AVAILABLE(macos(10.7));
- (NSSize)convertSizeToBacking:(NSSize)size API_AVAILABLE(macos(10.7));
- (NSSize)convertSizeFromBacking:(NSSize)size API_AVAILABLE(macos(10.7));
- (NSRect)convertRectToBacking:(NSRect)rect API_AVAILABLE(macos(10.7));
- (NSRect)convertRectFromBacking:(NSRect)rect API_AVAILABLE(macos(10.7));
/* Use these methods to transform geometry between a view's interior (bounds) coordinate space and its layer's interior coordinate space. The layer's space is virtual, and doesn't take into account the layer's contentsScale setting. For conversion between view space and layer pixels, use -convert(Point/Size/Rect)(To/From)Backing: instead.
*/
- (NSPoint)convertPointToLayer:(NSPoint)point API_AVAILABLE(macos(10.7));
- (NSPoint)convertPointFromLayer:(NSPoint)point API_AVAILABLE(macos(10.7));
- (NSSize)convertSizeToLayer:(NSSize)size API_AVAILABLE(macos(10.7));
- (NSSize)convertSizeFromLayer:(NSSize)size API_AVAILABLE(macos(10.7));
- (NSRect)convertRectToLayer:(NSRect)rect API_AVAILABLE(macos(10.7));
- (NSRect)convertRectFromLayer:(NSRect)rect API_AVAILABLE(macos(10.7));
/* Reports whether AppKit may invoke the view's -drawRect: method on a background thread, where it would otherwise be invoked on the main thread. Defaults to NO.
*/
@property BOOL canDrawConcurrently API_AVAILABLE(macos(10.6));
/* Sets whether AppKit may invoke the view's -drawRect: method on a background thread, where it would otherwise be invoked on the main thread. Defaults to NO for most kinds of views. May be set to YES to enable threaded drawing for a particular view instance. The view's window must also have its "allowsConcurrentViewDrawing" property set to YES (the default) for threading of view drawing to actually take place. */
@property (readonly) BOOL canDraw API_DEPRECATED("If a view needs display, -drawRect: or -updateLayer will be called automatically when the view is able to draw. To check whether a view is in a window, call -window. To check whether a view is hidden, call -isHiddenOrHasHiddenAncestor.", macos(10.0,10.14));
- (void)setNeedsDisplayInRect:(NSRect)invalidRect;
@property BOOL needsDisplay;
- (void)lockFocus API_DEPRECATED("To draw, subclass NSView and implement -drawRect:; AppKit's automatic deferred display mechanism will call -drawRect: as necessary to display the view.", macos(10.0,10.14));
- (void)unlockFocus API_DEPRECATED("To draw, subclass NSView and implement -drawRect:; AppKit's automatic deferred display mechanism will call -drawRect: as necessary to display the view.", macos(10.0,10.14));
- (BOOL)lockFocusIfCanDraw API_DEPRECATED("To draw, subclass NSView and implement -drawRect:; AppKit's automatic deferred display mechanism will call -drawRect: as necessary to display the view.", macos(10.0,10.14));
- (BOOL)lockFocusIfCanDrawInContext:(NSGraphicsContext *)context API_DEPRECATED("Use -[NSView displayRectIgnoringOpacity:inContext:] to draw a view subtree into a graphics context.", macos(10.4,10.13));
@property (class, readonly, nullable, strong) NSView *focusView;
@property (readonly) NSRect visibleRect;
- (void)display;
- (void)displayIfNeeded;
- (void)displayIfNeededIgnoringOpacity;
- (void)displayRect:(NSRect)rect;
- (void)displayIfNeededInRect:(NSRect)rect;
- (void)displayRectIgnoringOpacity:(NSRect)rect;
- (void)displayIfNeededInRectIgnoringOpacity:(NSRect)rect;
- (void)drawRect:(NSRect)dirtyRect;
- (void)displayRectIgnoringOpacity:(NSRect)rect inContext:(NSGraphicsContext *)context;
- (nullable NSBitmapImageRep *)bitmapImageRepForCachingDisplayInRect:(NSRect)rect;
- (void)cacheDisplayInRect:(NSRect)rect toBitmapImageRep:(NSBitmapImageRep *)bitmapImageRep;
- (void)viewWillDraw API_AVAILABLE(macos(10.5));
- (void)scrollPoint:(NSPoint)point;
- (BOOL)scrollRectToVisible:(NSRect)rect;
- (BOOL)autoscroll:(NSEvent *)event;
- (NSRect)adjustScroll:(NSRect)newVisible;
- (void)scrollRect:(NSRect)rect by:(NSSize)delta API_DEPRECATED("Use NSScrollView to achieve scrolling views.", macos(10.0,10.14));
- (void)translateRectsNeedingDisplayInRect:(NSRect)clipRect by:(NSSize)delta API_AVAILABLE(macos(10.5));
- (nullable NSView *)hitTest:(NSPoint)point;
- (BOOL)mouse:(NSPoint)point inRect:(NSRect)rect;
- (nullable __kindof NSView *)viewWithTag:(NSInteger)tag;
@property (readonly) NSInteger tag;
- (BOOL)performKeyEquivalent:(NSEvent *)event;
- (BOOL)acceptsFirstMouse:(nullable NSEvent *)event;
- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)event;
@property (readonly) BOOL needsPanelToBecomeKey;
@property (readonly) BOOL mouseDownCanMoveWindow;
/* Deprecated in favor of allowedTouchTypes. Return YES if allowedTouchTypes includes NSTouchTypeMaskIndirect */
@property BOOL acceptsTouchEvents API_DEPRECATED("Use allowedTouchTypes instead", macos(10.6,10.12.2));
/* In some cases, the user may rest a thumb or other touch on the device. By default, these touches are not delivered and are not included in the event's set of touches. Touches may transition in and out of resting at any time. Unless the view wants restingTouches, began / ended events are simlulated as touches transition from resting to active and vice versa.
*/
@property BOOL wantsRestingTouches API_AVAILABLE(macos(10.6));
- (void)addCursorRect:(NSRect)rect cursor:(NSCursor *)object;
- (void)removeCursorRect:(NSRect)rect cursor:(NSCursor *)object;
- (void)discardCursorRects;
- (void)resetCursorRects;
- (NSTrackingRectTag)addTrackingRect:(NSRect)rect owner:(id)owner userData:(nullable void *)data assumeInside:(BOOL)flag;
- (void)removeTrackingRect:(NSTrackingRectTag)tag;
- (CALayer *)makeBackingLayer API_AVAILABLE(macos(10.6));
/* Get and set how the layer should redraw when resizing and redisplaying. Prior to 10.8, the default value was always set to NSViewLayerContentsRedrawDuringViewResize when an AppKit managed layer was created. In 10.8 and higher, the value is initialized to the appropriate thing for each individual AppKit view. Generally, the default value is NSViewLayerContentsRedrawOnSetNeedsDisplay if the view responds YES to -wantsUpdateLayer. Otherwise, the value is usually NSViewLayerContentsRedrawDuringViewResize, indicating that the view needs to redraw on each step of an animation via a setFrame: change. On 10.8, the value is not encoded by the view.
*/
@property NSViewLayerContentsRedrawPolicy layerContentsRedrawPolicy API_AVAILABLE(macos(10.6));
@property NSViewLayerContentsPlacement layerContentsPlacement API_AVAILABLE(macos(10.6));
/* Indicates if this view should be a "Layer Backed View". When layer backed, all subviews will subsequently also have a layer set on them (however, wantsLayer will only be YES on views that have had it explicitly set). Contents for a layer are specified in one of two ways: if -wantsUpdateLayer returns YES, then one can directly update the layer's contents (or other properties) in -updateLayer. If -wantsUpdateLayer returns NO, then the layer's contents is filled with whatever is drawn by -drawRect:
*/
@property BOOL wantsLayer API_AVAILABLE(macos(10.5));
/* Get and set the CALayer for this view. The layer is not encoded by the view.
*/
@property (nullable, strong) CALayer *layer API_AVAILABLE(macos(10.5));
/* Layer Backed Views: Return YES if this view supports directly setting the layer properties (such as the contents and backgroundColor) as opposed to filling in the contents with a drawRect: implementation. Most AppKit controls return YES if there is no subclassing involved that would alter the drawing appearance. It will return NO for views that do have subclassing that AppKit does not know about (such as, overriding drawRect:, or other drawing methods).
*/
@property (readonly) BOOL wantsUpdateLayer API_AVAILABLE(macos(10.8));
/* Layer Backed Views: If the view responds YES to wantsUpdateLayer, then updateLayer will be called as opposed to drawRect:. This method should be used for better performance; it is faster to directly set the layer.contents with a shared image and inform it how to stretch with the layer.contentsCenter property instead of drawing into a context with drawRect:. In general, one should also set the layerContentsRedrawPolicy to an appropriate value in the init method (frequently NSViewLayerContentsRedrawOnSetNeedsDisplay is desired). To signal a refresh of the layer contents, one will then call [view setNeedsDisplay:YES], and -updateLayer will be lazily called when the layer needs its contents. One should not alter geometry or add/remove subviews (or layers) during this method. To add subviews (or layers) use -layout. -layout will still be called even if autolayout is not enabled, and wantsUpdateLayer returns YES.
*/
- (void)updateLayer API_AVAILABLE(macos(10.8));
/* When canDrawSubviewsIntoLayer is set to YES, and the view is layer-backed (either explicitly with -wantsLayer=YES, or by having a parent view that is layer-backed), the layer will draw all subviews into this view's layer, and each subview will not get an individual layer (the exception to this is a subview which has wantsLayer explicitly set to YES). This is useful for layer-backing a complex set of views that can not be refactored to take advantage of proper resizing and -wantsUpdateLayer==YES. If canDrawSubviewsIntoLayer is YES, the value returned from wantsUpdateLayer will be ignored, and the layer will always have drawRect: invoked to get the layer's contents. The default value is NO. NOTE: These methods should NOT be overridden, and the setter should always be used.
*/
@property BOOL canDrawSubviewsIntoLayer API_AVAILABLE(macos(10.9));
- (void)layoutSubtreeIfNeeded API_AVAILABLE(macos(10.7));
- (void)layout API_AVAILABLE(macos(10.7));
@property BOOL needsLayout API_AVAILABLE(macos(10.7));
@property CGFloat alphaValue API_AVAILABLE(macos(10.5));
/* If you have set a custom layer on your view, and it (or one of its sublayers) uses CIFilters, you should set this. You do not need to set this if you are using the backgroundFilters, compositingFilter, or contentFilters properties below. See the release notes for more information.
*/
@property BOOL layerUsesCoreImageFilters API_AVAILABLE(macos(10.9));
@property (copy) NSArray<__kindof CIFilter *> *backgroundFilters API_AVAILABLE(macos(10.5));
@property (nullable, strong) CIFilter *compositingFilter API_AVAILABLE(macos(10.5));
@property (copy) NSArray<__kindof CIFilter *> *contentFilters API_AVAILABLE(macos(10.5));
@property (nullable, copy) NSShadow *shadow API_AVAILABLE(macos(10.5));
/* The following methods are meant to be invoked, and probably don't need to be overridden
*/
- (void)addTrackingArea:(NSTrackingArea *)trackingArea API_AVAILABLE(macos(10.5));
- (void)removeTrackingArea:(NSTrackingArea *)trackingArea API_AVAILABLE(macos(10.5));
@property (readonly, copy) NSArray<NSTrackingArea *> *trackingAreas API_AVAILABLE(macos(10.5));
/* updateTrackingAreas should be overridden to remove out of date tracking areas and add recomputed tracking areas, and should call super.
*/
- (void)updateTrackingAreas API_AVAILABLE(macos(10.5));
@property BOOL postsBoundsChangedNotifications;
@property (nullable, readonly, strong) NSScrollView *enclosingScrollView;
- (nullable NSMenu *)menuForEvent:(NSEvent *)event;
@property (class, readonly, nullable, strong) NSMenu *defaultMenu;
/*!
* A contextual menu is being opened from the receiving view.
* The view should update any visual state in response — such as making a selection.
* \param menu The contextual menu that is being opened on the view
* \param event The event that caused the menu to open.
*/
- (void)willOpenMenu:(NSMenu *)menu withEvent:(NSEvent *)event API_AVAILABLE(macos(10.11));
/*!
* A contextual menu shown from the receiving view has been closed. This is only called if the menu had been opened and the view previously received \c -willOpenMenu:withEvent:.
* The view should update any visual state in response — such as removing a temporary selection.
* \param menu The contextual menu that was open on the view
* \param event The event that caused the menu to close. This may be nil if there is no specific event that triggered the closing.
*/
- (void)didCloseMenu:(NSMenu *)menu withEvent:(nullable NSEvent *)event API_AVAILABLE(macos(10.11));
@property (nullable, copy) NSString *toolTip;
- (NSToolTipTag)addToolTipRect:(NSRect)rect owner:(id)owner userData:(nullable void *)data;
- (void)removeToolTip:(NSToolTipTag)tag;
- (void)removeAllToolTips;
/* Live resize support */
/* A view receives viewWillStartLiveResize before the frame is first changed for a live resize. It is important to call [super viewWillStartLiveResize] to allow AppKit to do any internal work it needs. */
- (void)viewWillStartLiveResize;
/* A view receives viewWillEndLiveResize after the frame is last changed for a live resize. It is important to call [super viewDidEndLiveResize].
*/
- (void)viewDidEndLiveResize;
/* inLiveResize can be called at any time to determine if the window is performing a live resize or not. Drawing optimizations can be done when the view is being live-resized.
*/
@property (readonly) BOOL inLiveResize;
/* A view that returns YES for -preservesContentDuringLiveResize is responsible for invalidating its own dirty rects during live resize
*/
@property (readonly) BOOL preservesContentDuringLiveResize;
/* -rectPreservedDuringLiveResize indicates the rect the view previously occupied, in the current coordinate system of the view
*/
@property (readonly) NSRect rectPreservedDuringLiveResize;
/* On return from -getRectsExposedDuringLiveResize, exposedRects indicates the parts of the view that are newly exposed (at most 4 rects). *count indicates how many rects are in the exposedRects list */
- (void)getRectsExposedDuringLiveResize:(NSRect[_Nonnull 4])exposedRects count:(NSInteger *)count;
/* Text Input */
/* Returns NSTextInputContext object for the receiver. Returns nil if the receiver doesn't conform to NSTextInputClient protocol.
*/
@property (nullable, readonly, strong) NSTextInputContext *inputContext API_AVAILABLE(macos(10.6));
/* Return the complete rect of the most appropriate content grouping at the specified location. For example, if your content is divided into three columns, return the entire rect of the column that contains the location. NSScrollView will attempt to magnify such that the width fits inside the scroll view while remaining within the minMagnification, maxMagnification range.
If your content layout is sub-divided further than one level deep (for example, two boxes that each contain multiple text boxes), then use the visibleRect parameter to determine when to provide the rect of a sub-grouping. Always return a rect for the appropriate grouping. If there is no deeper content grouping, return the rect for the deepest grouping. NSScrollView will determine when to pan, magnify in, and magnify out.
Return NSZeroRect for the default behavior.
*/
- (NSRect)rectForSmartMagnificationAtPoint:(NSPoint)location inRect:(NSRect)visibleRect API_AVAILABLE(macos(10.8));
/* Get and set the user interface layout direction. By default, a basic NSView may not respect the User Interface Layout Direction that is uniquely set on it, and it is up to the developer and supporting subclasses to correctly implement a Right To Left layout implementation. The default value is set to [NSApp userInterfaceLayoutDirection].
*/
@property NSUserInterfaceLayoutDirection userInterfaceLayoutDirection API_AVAILABLE(macos(10.8));
/* The View Based NSTableView allows views to be reused. Sometimes it is necessary to prepare a view with some initial state before it is to be reused. This method can be overridden to allow a view to be prepared back to the default state. Override this method to do the preparation. By default, NSView will do some setup, such as setting the view to not be hidden and have a 1.0 alpha. It is important to call super to get this work done. This method was made public in 10.9, but exists back to 10.7.
*/
- (void)prepareForReuse API_AVAILABLE(macos(10.7));
/* A subclass of any NSScrollView, NSClipView or the NSScrollView's documentView can override this method to verify that its customizations are compatible with 10.9's responsive scrolling behavior. By default, AppKit assumes that a ScrollView is responsive scrolling compatible if it and its clipview and document view do not override certain methods such as -scrollWheel: (See documentation for the expanded list). However, these views may still opt into responsive scrolling if they work with the new scrolling behavior by overriding and returning YES for this method. Likewise, the same set of views may return NO to explicitly opt out of responsive scrolling.
*/
@property (class, readonly, getter=isCompatibleWithResponsiveScrolling) BOOL compatibleWithResponsiveScrolling API_AVAILABLE(macos(10.9));
/* Called by NSView with a 'rect' for a recommended area that should be fully rendered for overdraw. Override this method and bring in additional subviews and pre-cached content for the 'rect' in order to perform responsive scrolling. Calling super may be required for some subclasses (such as NSTableView and NSOutlineView), so in general, super should always be called. To suppress overdraw for a particular view (such as NSTableView), override this method and call [super prepareContentInRect:[self visibleRect]].
*/
- (void)prepareContentInRect:(NSRect)rect API_AVAILABLE(macos(10.9));
/* The preparedContentRect is the area of the NSView that has full content coverage. In general, this should be called with the area that is filled in fully with views. Set this with a value equal to the visibleRect to have overdraw start from the visibleRect and automatically grow larger on idle, as is needed for optimal system performance. The result of preparedContentRect may include the visibleRect, and may not include it if the previously prepared area has been scrolled away.
*/
@property NSRect preparedContentRect API_AVAILABLE(macos(10.9));
/* allowsVibrancy is queried when a vibrant appearance is used on a view hierarchy. When allowsVibrancy returns YES, the view will have an appropriate measure taken to ensure it is vibrant on top of its given material.
Specific subclasses, such as NSControl, will answer this question based on the artwork they draw for a given appearance.
*/
@property (readonly) BOOL allowsVibrancy API_AVAILABLE(macos(10.10));
/// Override point for reacting to the effective appearance of the receiver changing. At this point `effectiveAppearance` property reflects the new appearance.
- (void)viewDidChangeEffectiveAppearance API_AVAILABLE(macos(10.14));
@end
@protocol NSViewLayerContentScaleDelegate <NSObject>
@optional
/* This method can be implemented as an optional CALayer delegate method, for handling resolution changes. When a window changes its backing resolution, AppKit attempts to automatically update the contentsScale and contents of all CALayers in the window to match the new resolution. View backing layers are updated automatically. Any layer whose "contents" property is set to an NSImage will also be updated automatically. (Based on the NSImage's available representations, AppKit will select an appropriate bitmapped representation, or rasterize a resolution-independent representation at the appropriate scale factor.) For all other layers, AppKit will check whether the layer has a delegate that implements this method. If so, AppKit will send this message to the layer's delegate to ask whether it should automatically update the contentsScale for that layer to match the backingScaleFactor of the window. If you return YES for a given layer, AppKit will set the layer's contentsScale as proposed, and you must ensure that the layer's contents and other properties are configured appropriately for that new contentsScale. (If you expressed the layer's "contents" as a CGImage, you may need to provide a different CGImage that's appropriate for the new contentsScale.) Note that this method is only invoked when a window's backingScaleFactor changes. You are responsible for setting the initial contentsScale of your layers.
*/
- (BOOL)layer:(CALayer *)layer shouldInheritContentsScale:(CGFloat)newScale fromWindow:(NSWindow *)window API_AVAILABLE(macos(10.7)); // added in 10.7.3
@end
#if __swift__ < 40200
@interface NSObject (NSLayerDelegateContentsScaleUpdating)
- (BOOL)layer:(CALayer *)layer shouldInheritContentsScale:(CGFloat)newScale fromWindow:(NSWindow *)window API_DEPRECATED("This is now a method of the NSViewLayerContentScaleDelegate protocol.", macos(10.7, 11.0)); // added in 10.7.3
@end
#endif
@protocol NSViewToolTipOwner <NSObject>
- (NSString *)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag point:(NSPoint)point userData:(nullable void *)data;
@end
#if __swift__ < 40200
@interface NSObject(NSToolTipOwner)
- (NSString *)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag point:(NSPoint)point userData:(nullable void *)data API_DEPRECATED("This is now a method of the NSViewToolTipOwner protocol.", macos(10.0, 11.0));
@end
#endif
@interface NSView(NSKeyboardUI)
@property (nullable, assign) NSView *nextKeyView;
@property (nullable, readonly, assign) NSView *previousKeyView;
@property (nullable, readonly, assign) NSView *nextValidKeyView;
@property (nullable, readonly, assign) NSView *previousValidKeyView;
@property (readonly) BOOL canBecomeKeyView;
- (void)setKeyboardFocusRingNeedsDisplayInRect:(NSRect)rect;
@property NSFocusRingType focusRingType;
@property (class, readonly) NSFocusRingType defaultFocusRingType;
- (void)drawFocusRingMask API_AVAILABLE(macos(10.7));
@property (readonly) NSRect focusRingMaskBounds API_AVAILABLE(macos(10.7));
- (void)noteFocusRingMaskChanged API_AVAILABLE(macos(10.7));
@end
@interface NSView(NSPrinting)
/* EPS/PDF generation */
- (void)writeEPSInsideRect:(NSRect)rect toPasteboard:(NSPasteboard *)pasteboard;
- (NSData *)dataWithEPSInsideRect:(NSRect)rect;
- (void)writePDFInsideRect:(NSRect)rect toPasteboard:(NSPasteboard *)pasteboard;
- (NSData *)dataWithPDFInsideRect:(NSRect)rect;
- (void)print:(nullable id)sender;
/* Pagination */
- (BOOL)knowsPageRange:(NSRangePointer)range;
@property (readonly) CGFloat heightAdjustLimit;
@property (readonly) CGFloat widthAdjustLimit;
- (void)adjustPageWidthNew:(CGFloat *)newRight left:(CGFloat)oldLeft right:(CGFloat)oldRight limit:(CGFloat)rightLimit;
- (void)adjustPageHeightNew:(CGFloat *)newBottom top:(CGFloat)oldTop bottom:(CGFloat)oldBottom limit:(CGFloat)bottomLimit;
- (NSRect)rectForPage:(NSInteger)page;
- (NSPoint)locationOfPrintRect:(NSRect)rect;
- (void)drawPageBorderWithSize:(NSSize)borderSize;
@property (readonly, copy) NSAttributedString *pageHeader;
@property (readonly, copy) NSAttributedString *pageFooter;
/*** This method is obsolete. It will never be invoked from within AppKit, and NSView's implementation of it does nothing. ***/
- (void)drawSheetBorderWithSize:(NSSize)borderSize API_DEPRECATED("This is never invoked and the NSView implementation does nothing", macos(10.0,10.14));
/* Printing */
/* Returns print job title. Default implementation first tries its window's NSDocument (displayName), then window's title */
@property (readonly, copy) NSString *printJobTitle;
- (void)beginDocument;
- (void)endDocument;
- (void)beginPageInRect:(NSRect)rect atPlacement:(NSPoint)location;
- (void)endPage;
@end
@interface NSView(NSDrag)
/* Starts a dragging session with a group of NSDraggingItems. The frame property of each NSDraggingItem must be in the view's coordinate system. The images may animate (flock) from thier initial layout into a system defined formation. Flocking or may not be done immediately. (see NSDraggingSession's flockOnBeginDrag. The visible area of the view is used as the clip rect.
*/
- (NSDraggingSession *)beginDraggingSessionWithItems:(NSArray<NSDraggingItem *> *)items event:(NSEvent *)event source:(id<NSDraggingSource>)source API_AVAILABLE(macos(10.7));
@property (readonly, copy) NSArray<NSPasteboardType> *registeredDraggedTypes;
- (void)registerForDraggedTypes:(NSArray<NSPasteboardType> *)newTypes;
- (void)unregisterDraggedTypes;
@end
/* Constants for options when entering and exiting full screen mode */
typedef NSString * NSViewFullScreenModeOptionKey NS_TYPED_ENUM;
APPKIT_EXTERN NSViewFullScreenModeOptionKey const NSFullScreenModeAllScreens API_AVAILABLE(macos(10.5)); // NSNumber numberWithBool:YES/NO
APPKIT_EXTERN NSViewFullScreenModeOptionKey const NSFullScreenModeSetting API_AVAILABLE(macos(10.5)); // NSDictionary (obtained from CGSDisplay based functions)
APPKIT_EXTERN NSViewFullScreenModeOptionKey const NSFullScreenModeWindowLevel API_AVAILABLE(macos(10.5)); // NSNumber numberWithInt:windowLevel
APPKIT_EXTERN NSViewFullScreenModeOptionKey const NSFullScreenModeApplicationPresentationOptions API_AVAILABLE(macos(10.5)); // NSNumber numberWithUnsignedInteger:(NSApplicationPresentationOptions flags)
@interface NSView (NSFullScreenMode)
- (BOOL)enterFullScreenMode:(NSScreen *)screen withOptions:(nullable NSDictionary<NSViewFullScreenModeOptionKey, id> *)options API_AVAILABLE(macos(10.5));
- (void)exitFullScreenModeWithOptions:(nullable NSDictionary<NSViewFullScreenModeOptionKey, id> *)options API_AVAILABLE(macos(10.5));
@property (getter=isInFullScreenMode, readonly) BOOL inFullScreenMode API_AVAILABLE(macos(10.5));
@end
/* NSDefinitionPresentationTypeKey is an optional key in 'options' that specifies the presentation type of the definition display. The possible values are NSDefinitionPresentationTypeOverlay that produces a small overlay window at the string location, or NSDefinitionPresentationTypeDictionaryApplication that invokes 'Dictionary' application to display the definition. Without this option, the definition will be shown in either of those presentation forms depending on the 'Contextual Menu:' setting in Dictionary application preferences.
*/
typedef NSString * NSDefinitionOptionKey NS_TYPED_ENUM;
APPKIT_EXTERN NSDefinitionOptionKey const NSDefinitionPresentationTypeKey API_AVAILABLE(macos(10.6));
typedef NSString * NSDefinitionPresentationType NS_TYPED_ENUM;
APPKIT_EXTERN NSDefinitionPresentationType const NSDefinitionPresentationTypeOverlay API_AVAILABLE(macos(10.6));
APPKIT_EXTERN NSDefinitionPresentationType const NSDefinitionPresentationTypeDictionaryApplication API_AVAILABLE(macos(10.6));
@interface NSView(NSDefinition)
/* Shows a window that displays the definition (or other subject depending on available dictionaries) of the specified attributed string. This method can be used for implementing the same functionality as NSTextView's 'Look Up in Dictionary' contextual menu on a custom view.
textBaselineOrigin specifies the baseline origin of attrString in the receiver view coordinate system. If a small overlay window is selected as default presentation (see NSDefinitionPresentationTypeKey option for details), the overlay text would be rendered starting from the location. Otherwise, 'Dictionary' application will be invoked to show the definition of the specified string.
This method is equivalent to using showDefinitionForAttributedString:range:options:baselineOriginProvider: and passing attrString with the whole range, nil options, and an originProvider which returns textBaselineOrigin.
*/
- (void)showDefinitionForAttributedString:(nullable NSAttributedString *)attrString atPoint:(NSPoint)textBaselineOrigin API_AVAILABLE(macos(10.6));
/* Takes a whole attributed string with the target range (normally, this is the selected range), and shows a window displaying the definition of the specified range. The caller can pass a zero-length range and the appropriate range will be auto-detected around the range's offset. That's the recommended approach when there is no selection.
This method also an 'options' dictionary containing options described below as key-value pairs (can be nil).
Except when NSDefinitionPresentationTypeKey with NSDefinitionPresentationTypeDictionaryApplication is specified in options, the caller must supply an originProvider Block which returns the baseline origin of the first character at proposed adjustedRange in the receiver view coordinate system.
If the receiver is an NSTextView, both attrString and originProvider may be nil, in which case the text view will automatically supply values suitable for displaying definitions for the specified range within its text content. This method does not cause scrolling, so clients should perform any necessary scrolling before calling this method.
*/
- (void)showDefinitionForAttributedString:(nullable NSAttributedString *)attrString range:(NSRange)targetRange options:(nullable NSDictionary<NSDefinitionOptionKey, id> *)options baselineOriginProvider:(NSPoint (^ _Nullable)(NSRange adjustedRange))originProvider API_AVAILABLE(macos(10.6));
@end
@interface NSView(NSFindIndicator)
/* When this method returns YES, the receiver or one of its ancestors is being drawn for a find indicator, meaning the receiver should draw so its contents will be easily readable.
*/
@property (getter=isDrawingFindIndicator, readonly) BOOL drawingFindIndicator API_AVAILABLE(macos(10.7));
@end
@interface NSView (NSGestureRecognizer)
@property (copy) NSArray<__kindof NSGestureRecognizer *> *gestureRecognizers API_AVAILABLE(macos(10.10));
- (void)addGestureRecognizer:(NSGestureRecognizer *)gestureRecognizer API_AVAILABLE(macos(10.10));
- (void)removeGestureRecognizer:(NSGestureRecognizer *)gestureRecognizer API_AVAILABLE(macos(10.10));
@end
@interface NSView (NSTouchBar)
/* Defaults to NSTouchTypeDirect if linked on or after 10_12, 0 otherwise */
@property NSTouchTypeMask allowedTouchTypes API_AVAILABLE(macos(10.12.2));
@end
@interface NSView (NSSafeAreas)
/* Indicates the potentially-obscured distance from each edge of the view (e.g, not behind the window title bar, etc., if present). */
@property (readonly) NSEdgeInsets safeAreaInsets API_AVAILABLE(macos(11.0));
/* Configurable insets added to insets inherited from the superview (if any), and contributing to self.safeAreaInsets. */
@property NSEdgeInsets additionalSafeAreaInsets API_AVAILABLE(macos(11.0));
/* This layout guide reflects the safe area for this view (i.e., the frame minus safeAreaInsets), and provides a convenient way to arrange content relative to the safe area using auto layout. */
@property(readonly, strong) NSLayoutGuide *safeAreaLayoutGuide API_AVAILABLE(macos(11.0));
/* The safe area for this view expressed as a rectangle in the view's coordinate space. */
@property (readonly) NSRect safeAreaRect API_AVAILABLE(macos(11.0));
/* This layout guide provides the recommended amount of padding for content inside a view. */
@property (readonly, strong) NSLayoutGuide *layoutMarginsGuide API_AVAILABLE(macos(11.0));
@end
@interface NSView(NSDeprecated)
- (void)dragImage:(NSImage *)image at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag API_DEPRECATED("Use -beginDraggingSessionWithItems:event:source: instead", macos(10.0,10.7));
- (BOOL)dragFile:(NSString *)filename fromRect:(NSRect)rect slideBack:(BOOL)flag event:(NSEvent *)event API_DEPRECATED("Use -beginDraggingSessionWithItems:event:source: instead", macos(10.0,10.13));
- (BOOL)dragPromisedFilesOfTypes:(NSArray<NSString *> *)typeArray fromRect:(NSRect)rect source:(id)sourceObject slideBack:(BOOL)flag event:(NSEvent *)event API_DEPRECATED("Use -beginDraggingSessionWithItems:event:source: with an NSFilePromiseProvider instead", macos(10.0,10.13));
- (NSPoint)convertPointToBase:(NSPoint)point API_DEPRECATED("", macos(10.5,10.7));
- (NSPoint)convertPointFromBase:(NSPoint)point API_DEPRECATED("", macos(10.5,10.7));
- (NSSize)convertSizeToBase:(NSSize)size API_DEPRECATED("", macos(10.5,10.7));
- (NSSize)convertSizeFromBase:(NSSize)size API_DEPRECATED("", macos(10.5,10.7));
- (NSRect)convertRectToBase:(NSRect)rect API_DEPRECATED("", macos(10.5,10.7));
- (NSRect)convertRectFromBase:(NSRect)rect API_DEPRECATED("", macos(10.5,10.7));
- (BOOL)performMnemonic:(NSString *)string API_DEPRECATED("This has always returned NO and had no effect on macOS", macos(10.0,10.8));
/* shouldDrawColor is no longer used by AppKit.
*/
- (BOOL)shouldDrawColor API_DEPRECATED("This method no longer does anything", macos(10.0,10.10));
/* The gState class of methods are deprecated and in many cases did not do anything, or not what one would expect.
*/
- (NSInteger)gState API_DEPRECATED("", macos(10.0,10.10));
- (void)allocateGState API_DEPRECATED("", macos(10.0,10.10));
- (oneway void)releaseGState API_DEPRECATED("", macos(10.0,10.10));
- (void)setUpGState API_DEPRECATED("", macos(10.0,10.10));
- (void)renewGState API_DEPRECATED("", macos(10.0,10.10));
@end
/* Notifications */
/* Sent when the frame changes for a view. This is only sent if postsFrameChangedNotifications is set to YES.
*/
APPKIT_EXTERN NSNotificationName NSViewFrameDidChangeNotification;
APPKIT_EXTERN NSNotificationName NSViewFocusDidChangeNotification API_DEPRECATED("", macos(10.0,10.4));
/* This notification is sent whenever the views bounds change and the frame does not. That is, it is sent whenever the view's bounds are translated, scaled or rotated, but NOT when the bounds change as a result of, for example, setFrameSize:.
*/
APPKIT_EXTERN NSNotificationName NSViewBoundsDidChangeNotification;
/* This notification is sent whenever an NSView that has an attached NSOpenGLContext changes size or changes screens (thus potentially changing graphics hardware drivers).
*/
APPKIT_EXTERN NSNotificationName NSViewGlobalFrameDidChangeNotification API_DEPRECATED("Use NSOpenGLView instead.", macos(10.0,10.14));
/* This notification is sent whenever tracking areas should be recalculated for the view. It is sent after the view receives -updateTrackingAreas.
*/
APPKIT_EXTERN NSNotificationName NSViewDidUpdateTrackingAreasNotification API_AVAILABLE(macos(10.5));
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/NSDocumentScripting.h | /*
NSDocumentScripting.h
AppKit Framework
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSDocument.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSCloseCommand;
@class NSScriptCommand;
@class NSScriptObjectSpecifier;
@class NSString;
@interface NSDocument (NSScripting)
@property (copy) NSString *lastComponentOfFileName;
- (nullable id)handleSaveScriptCommand:(NSScriptCommand *)command;
- (nullable id)handleCloseScriptCommand:(NSCloseCommand *)command;
- (nullable id)handlePrintScriptCommand:(NSScriptCommand *)command;
@property (readonly, strong) NSScriptObjectSpecifier *objectSpecifier;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSLayoutManager.h | #if !__has_include(<UIFoundation/NSLayoutManager.h>)
/*
NSLayoutManager.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <AppKit/NSTextStorage.h>
#import <AppKit/NSFont.h>
#import <AppKit/NSGlyphGenerator.h>
@class NSTextContainer;
@class NSColor;
@class NSTypesetter;
@class NSTextView;
@class NSGraphicsContext;
@class NSAffineTransform;
@class NSBox;
@class NSRulerView;
@class NSRulerMarker;
@protocol NSLayoutManagerDelegate;
NS_ASSUME_NONNULL_BEGIN
#if !TARGET_OS_IPHONE
typedef NS_ENUM(NSInteger, NSTextLayoutOrientation) {
NSTextLayoutOrientationHorizontal = 0, // Lines rendered horizontally, grow top to bottom
NSTextLayoutOrientationVertical = 1, // Lines rendered vertically, grow right to left
} API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0));
typedef NS_OPTIONS(NSInteger, NSGlyphProperty) {
NSGlyphPropertyNull = (1 << 0), // null glyph ignored for layout and display
NSGlyphPropertyControlCharacter = (1 << 1), // control character such as tab, attachment, etc that has special behavior associated with
NSGlyphPropertyElastic = (1 << 2), // glyphs with elastic glyph width behavior such as white spaces
NSGlyphPropertyNonBaseCharacter = (1 << 3) // glyphs with combining properties. typically characters in Unicode Mn class.
} API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
typedef NS_OPTIONS(NSInteger, NSControlCharacterAction) {
NSControlCharacterActionZeroAdvancement = (1 << 0), // glyphs with this action are filtered out from layout (notShownAttribute == YES)
NSControlCharacterActionWhitespace = (1 << 1), // the width for glyphs with this action are determined by -layoutManager:boundingBoxForControlGlyphAtIndex:forTextContainer:proposedLineFragment:glyphPosition:characterIndex: if the method is implemented; otherwise, same as NSControlCharacterZeroAdvancementAction
NSControlCharacterActionHorizontalTab = (1 << 2), // Treated as tab character
NSControlCharacterActionLineBreak = (1 << 3), // Causes line break
NSControlCharacterActionParagraphBreak = (1 << 4), // Causes paragraph break; firstLineIndent will be used for the following glyph
NSControlCharacterActionContainerBreak = (1 << 5) // Causes container break
} API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
@protocol NSTextLayoutOrientationProvider
// A property describing the receiver's layout orientation. This property defines the default value for the range of string laid out in the receiver in absence of explicit NSVerticalGlyphFormAttributeName attribute. For example, when NSTextLayoutOrientationVertical, the default value for NSVerticalGlyphFormAttributeName is 1. When rendering into the receiver, the Text System assumes the coordinate system is appropriately rotated.
@property (readonly) NSTextLayoutOrientation layoutOrientation API_AVAILABLE(macos(10.7), ios(7.0), tvos(9.0));
@end
typedef NS_ENUM(NSInteger, NSTypesetterBehavior) {
NSTypesetterLatestBehavior = -1,
NSTypesetterOriginalBehavior = 0, // Mac OS X versions 10.0 and 10.1 (uses NSSimpleHorizontalTypesetter)
NSTypesetterBehavior_10_2_WithCompatibility = 1, // 10.2 with backward compatibility layout (uses new ATS-based typesetter)
NSTypesetterBehavior_10_2 = 2,
NSTypesetterBehavior_10_3 = 3,
NSTypesetterBehavior_10_4 = 4
};
API_AVAILABLE(macos(10.7), ios(7.0), tvos(9.0)) @interface NSLayoutManager : NSObject <NSSecureCoding>
/**************************** Initialization ****************************/
// Designated Initializer. Sets up this instance. The NSLayoutManager starts off without an NSTextStorage.
- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
/*************************** Text storage ***************************/
// Accessor for the NSTextStorage object owning the receiver.
// Avoid assigning a text storage directly through this property. Adding a layout manager to a text storage through -[NSTextStorage addLayoutManager:] will use the property for assigning the new text storage.
@property (nullable, assign) NSTextStorage *textStorage;
// This method should be used instead of the primitive -setTextStorage: if you need to replace a NSLayoutManager's NSTextStorage with a new one, leaving all related objects intact. This method deals with all the work of making sure the NSLayoutManager doesn't get deallocated and transferring all the NSLayoutManagers on the old NSTextStorage to the new one.
- (void)replaceTextStorage:(NSTextStorage *)newTextStorage;
/**************************** Text containers ****************************/
// NSTextContainer objects owner by the receiver.
@property (readonly) NSArray<NSTextContainer *> *textContainers;
// Add a container to the end of the array. Must invalidate layout of all glyphs after the previous last container (i.e., glyphs that were not previously laid out because they would not fit anywhere).
- (void)addTextContainer:(NSTextContainer *)container;
// Insert a container into the array before the container at index. Must invalidate layout of all glyphs in the containers from the one previously at index to the last container.
- (void)insertTextContainer:(NSTextContainer *)container atIndex:(NSUInteger)index;
// Removes the container at index from the array. Must invalidate layout of all glyphs in the container being removed and any containers which come after it.
- (void)removeTextContainerAtIndex:(NSUInteger)index;
// Called by NSTextContainer whenever it changes size or shape. Invalidates layout of all glyphs in container and all subsequent containers.
- (void)textContainerChangedGeometry:(NSTextContainer *)container;
// Called by NSTextContainer whenever its textView changes. Used to keep notifications in sync.
- (void)textContainerChangedTextView:(NSTextContainer *)container;
/**************************** Delegate ****************************/
@property (nullable, weak) id <NSLayoutManagerDelegate> delegate;
/*********************** Global layout manager options ***********************/
// If YES, then whitespace and other "invisible" characters will be shown with special glyphs or other drawing. The default is NO.
@property BOOL showsInvisibleCharacters;
// If YES, then control characters will be rendered visibly (usually like "^M"). The default is NO.
@property BOOL showsControlCharacters;
// When YES, NSLayoutManager will attempt to hyphenate when wrapping lines. May be overridden on a per-paragraph basis by the NSParagraphStyle's hyphenationFactor. The receiver makes the best effort to decide the exact logic including the hyphenation factor based on the context. The default value is NO. Can be overridden by the preference key @"NSUsesDefaultHyphenation".
@property BOOL usesDefaultHyphenation API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0));
// By default, a layout manager will use leading as specified by the font. However, this is not appropriate for most UI text, for which a fixed leading is usually specified by UI layout guidelines. These methods allow the use of the font's leading to be turned off.
@property BOOL usesFontLeading;
// If YES, then the layout manager may perform glyph generation and layout for a given portion of the text, without having glyphs or layout for preceding portions. The default is NO. Turning this setting on will significantly alter which portions of the text will have glyph generation or layout performed when a given generation-causing method is invoked. It also gives significant performance benefits, especially for large documents.
@property BOOL allowsNonContiguousLayout API_AVAILABLE(macos(10.5), ios(7.0), tvos(9.0));
// Even if non-contiguous layout is allowed, it may not always be used, and there may not always be layout holes. This method returns YES if there might currently be non-contiguous portions of the text laid out.
@property (readonly) BOOL hasNonContiguousLayout API_AVAILABLE(macos(10.5), ios(7.0), tvos(9.0));
// When YES, enables internal security analysis for malicious inputs and activates defensive behaviors. By enabling this functionality, it's possible certain text such as a very long paragraph might result in unexpected layout. NO by default.
@property BOOL limitsLayoutForSuspiciousContents API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0));
// These methods allow you to set/query whether the NSLayoutManager will lay out text in the background, i.e. on the main thread when it is idle. The default is YES, but this should be set to NO whenever the layout manager is being accessed from other threads.
@property BOOL backgroundLayoutEnabled;
// Specifies the default behavior desired if an attachment image is too large to fit in a text container. Note that attachment cells control their own size and drawing, so this setting can only be advisory for them, but kit-supplied attachment cells will respect it. The default is NSImageScaleNone, meaning that images will clip rather than scaling.
@property NSImageScaling defaultAttachmentScaling;
/*********************** Typesetter ***********************/
// By default an NSLayoutManager uses the shared default typesetter. Setting the typesetter invalidates all glyphs in the NSLayoutManager. It can't just invalidate layout because the typesetter may have contributed to the actual glyphs as well (e.g. hyphenation).
@property (strong) __kindof NSTypesetter *typesetter;
// Specifies the typesetter behavior (compatibility setting) value for the layout manager. The default is determined by the version of AppKit against which the application is linked.
@property NSTypesetterBehavior typesetterBehavior;
/************************** Invalidation **************************/
// This removes all glyphs for the old character range, adjusts the character indices of all the subsequent glyphs by the change in length, and invalidates the new character range. If actualCharRange is non-NULL it will be set to the actual range invalidated after any necessary expansion.
- (void)invalidateGlyphsForCharacterRange:(NSRange)charRange changeInLength:(NSInteger)delta actualCharacterRange:(nullable NSRangePointer)actualCharRange;
// This method invalidates the layout information for the given range of characters. If actualCharRange is non-NULL it will be set to the actual range invalidated after any necessary expansion.
- (void)invalidateLayoutForCharacterRange:(NSRange)charRange actualCharacterRange:(nullable NSRangePointer)actualCharRange API_AVAILABLE(macos(10.5), ios(7.0), tvos(9.0));
// These methods invalidate display for the glyph or character range given. For the character range variant, unlaid parts of the range are remembered and will be redisplayed at some point later when the layout is available. For the glyph range variant any part of the range that does not yet have glyphs generated is ignored. Neither method actually causes layout.
- (void)invalidateDisplayForCharacterRange:(NSRange)charRange;
- (void)invalidateDisplayForGlyphRange:(NSRange)glyphRange;
// Sent from processEditing in NSTextStorage. The newCharRange is the range in the final string which was explicitly edited. The invalidatedRange includes portions that changed as a result of attribute fixing. invalidatedRange is either equal to newCharRange or larger. Layout managers should not change the contents of the text storage during the execution of this message.
- (void)processEditingForTextStorage:(NSTextStorage *)textStorage edited:(NSTextStorageEditActions)editMask range:(NSRange)newCharRange changeInLength:(NSInteger)delta invalidatedRange:(NSRange)invalidatedCharRange API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
/************************ Causing glyph generation and layout ************************/
// These methods allow clients to specify exactly the portions of the document for which they wish to have glyphs or layout. This is particularly important if non-contiguous layout is enabled. The layout manager still reserves the right to perform glyph generation or layout for larger ranges. If non-contiguous layout is not enabled, then the range in question will always effectively be extended to start at the beginning of the text.
- (void)ensureGlyphsForCharacterRange:(NSRange)charRange;
- (void)ensureGlyphsForGlyphRange:(NSRange)glyphRange;
- (void)ensureLayoutForCharacterRange:(NSRange)charRange;
- (void)ensureLayoutForGlyphRange:(NSRange)glyphRange;
- (void)ensureLayoutForTextContainer:(NSTextContainer *)container;
- (void)ensureLayoutForBoundingRect:(NSRect)bounds inTextContainer:(NSTextContainer *)container;
/************************ Set glyphs and glyph properties ************************/
// Sets the initial glyphs and properties for a character range. This method is invoked mainly from the glyph generation process. Only place apps are allowed to directly call this method is from -layoutManager:shouldGenerateGlyphs:properties:characterIndexes:forGlyphRange:. Each array has glyphRange.length items. charIndexes must be contiguous (no skipped indexes). It allows multiple items to have a same character index (a character index generating multiple glyph IDs). Due to the font substitution, aFont passed into this method might not match the font in the attributes dictionary. Calling this method for a range with the layout information invalidates the layout and display.
- (void)setGlyphs:(const CGGlyph *)glyphs properties:(const NSGlyphProperty *)props characterIndexes:(const NSUInteger *)charIndexes font:(NSFont *)aFont forGlyphRange:(NSRange)glyphRange API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
/************************ Get glyphs and glyph properties ************************/
// Returns the total number of glyphs. If non-contiguous layout is not enabled, this will force generation of glyphs for all characters.
@property (readonly) NSUInteger numberOfGlyphs;
// If non-contiguous layout is not enabled, these will cause generation of all glyphs up to and including glyphIndex. The first CGGlyphAtIndex variant returns kCGFontIndexInvalid if the requested index is out of the range (0, numberOfGlyphs), and optionally returns a flag indicating whether the requested index is in range. The second CGGlyphAtIndex variant raises a NSRangeError if the requested index is out of range.
- (CGGlyph)CGGlyphAtIndex:(NSUInteger)glyphIndex isValidIndex:(nullable BOOL *)isValidIndex API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
- (CGGlyph)CGGlyphAtIndex:(NSUInteger)glyphIndex API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
- (BOOL)isValidGlyphIndex:(NSUInteger)glyphIndex API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0));
// If non-contiguous layout is not enabled, this will cause generation of all glyphs up to and including glyphIndex. It will return the glyph property associated with the glyph at the specified index.
- (NSGlyphProperty)propertyForGlyphAtIndex:(NSUInteger)glyphIndex API_AVAILABLE(macos(10.5), ios(7.0), tvos(9.0));
// If non-contiguous layout is not enabled, this will cause generation of all glyphs up to and including glyphIndex. It will return the character index for the first character associated with the glyph at the specified index.
- (NSUInteger)characterIndexForGlyphAtIndex:(NSUInteger)glyphIndex;
// If non-contiguous layout is not enabled, this will cause generation of all glyphs up to and including those associated with the specified character. It will return the glyph index for the first glyph associated with the character at the specified index.
- (NSUInteger)glyphIndexForCharacterAtIndex:(NSUInteger)charIndex;
// Fills a passed-in buffer with a sequence of CGGlyphs. They will also optionally fill other passed-in buffers with the glyph properties, character indexes, and bidi levels corresponding to these glyphs. Each pointer passed in should either be NULL, or else point to sufficient memory to hold glyphRange.length elements. These methods return the number of glyphs filled in.
- (NSUInteger)getGlyphsInRange:(NSRange)glyphRange glyphs:(nullable CGGlyph *)glyphBuffer properties:(nullable NSGlyphProperty *)props characterIndexes:(nullable NSUInteger *)charIndexBuffer bidiLevels:(nullable unsigned char *)bidiLevelBuffer API_AVAILABLE(macos(10.5), ios(7.0), tvos(9.0));
/************************ Set layout information ************************/
// Associates the given container with the given range of glyphs. This method should be called by the typesetter first, before setting line fragment rect or any of the layout bits, for each range of glyphs it lays out. This method will reset several key layout attributes (like not shown and draws outside line fragment) to their default values. In the course of layout, all glyphs should end up being included in a range passed to this method. The range passed in is not expected to be the entire range of glyphs for that text container; usually, in fact, it will be the range for a given line fragment being laid out in that container.
- (void)setTextContainer:(NSTextContainer *)container forGlyphRange:(NSRange)glyphRange;
// Associates the given line fragment bounds with the given range of glyphs. The typesetter should call this method second, after setting the line fragment rect and before setting the location or any of the layout bits. In the course of layout, all glyphs should end up being included in a range passed to this method, but only glyphs which start a new line fragment should be at the start of such ranges. Line fragment rects and line fragment used rects are always in container coordinates.
- (void)setLineFragmentRect:(NSRect)fragmentRect forGlyphRange:(NSRange)glyphRange usedRect:(NSRect)usedRect;
// Sets the bounds and container for the extra line fragment. The extra line fragment is used when the text backing ends with a hard line break or when the text backing is totally empty, to define the extra line which needs to be displayed at the end of the text. Line fragment rects and line fragment used rects are always in container coordinates. This method should be invoked only when there is a non-empty extra line fragment.
- (void)setExtraLineFragmentRect:(NSRect)fragmentRect usedRect:(NSRect)usedRect textContainer:(NSTextContainer *)container;
// Sets the location for the first glyph of the given range. Setting the location for a glyph range implies that its first glyph is not nominally spaced with respect to the previous glyph. In the course of layout, all glyphs should end up being included in a range passed to this method, but only glyphs which start a new nominal range should be at the start of such ranges. The first glyph in a line fragment should always start a new nominal range. Glyph locations are given relative to their line fragment rect's origin.
- (void)setLocation:(NSPoint)location forStartOfGlyphRange:(NSRange)glyphRange;
// Some glyphs are not shown. The typesetter decides which ones and sets this attribute in the layout manager to ensure that those glyphs will not be displayed.
- (void)setNotShownAttribute:(BOOL)flag forGlyphAtIndex:(NSUInteger)glyphIndex;
// Used to indicate that a particular glyph for some reason will draw outside of its line fragment rect. This can commonly happen if a fixed line height is used (consider a 12 point line height and a 24 point glyph). This information is important for determining whether additional lines need to be redrawn as a result of changes to any given line fragment.
- (void)setDrawsOutsideLineFragment:(BOOL)flag forGlyphAtIndex:(NSUInteger)glyphIndex;
// For a glyph corresponding to an attachment, this method should be called to set the size the attachment cell will occupy.
- (void)setAttachmentSize:(NSSize)attachmentSize forGlyphRange:(NSRange)glyphRange;
/************************ Get layout information ************************/
// Returns (by reference for the "get" method) the character index or glyph index or both of the first unlaid character/glyph in the layout manager at this time.
- (void)getFirstUnlaidCharacterIndex:(nullable NSUInteger *)charIndex glyphIndex:(nullable NSUInteger *)glyphIndex;
- (NSUInteger)firstUnlaidCharacterIndex;
- (NSUInteger)firstUnlaidGlyphIndex;
// Returns the container in which the given glyph is laid and (optionally) by reference the whole range of glyphs that are in that container. This will cause glyph generation and layout for the line fragment containing the specified glyph, or if non-contiguous layout is not enabled, up to and including that line fragment; if non-contiguous layout is not enabled and effectiveGlyphRange is non-NULL, this will additionally cause glyph generation and layout for the entire text container containing the specified glyph.
- (nullable NSTextContainer *)textContainerForGlyphAtIndex:(NSUInteger)glyphIndex effectiveRange:(nullable NSRangePointer)effectiveGlyphRange;
- (nullable NSTextContainer *)textContainerForGlyphAtIndex:(NSUInteger)glyphIndex effectiveRange:(nullable NSRangePointer)effectiveGlyphRange withoutAdditionalLayout:(BOOL)flag API_AVAILABLE(macos(10.0), ios(9.0), tvos(9.0));
// Returns the container's currently used area. This determines the size that the view would need to be in order to display all the glyphs that are currently laid into the container. This causes neither glyph generation nor layout. Used rects are always in container coordinates.
- (NSRect)usedRectForTextContainer:(NSTextContainer *)container;
// Returns the rect for the line fragment in which the given glyph is laid and (optionally) by reference the whole range of glyphs that are in that fragment. This will cause glyph generation and layout for the line fragment containing the specified glyph, or if non-contiguous layout is not enabled, up to and including that line fragment. Line fragment rects are always in container coordinates.
- (NSRect)lineFragmentRectForGlyphAtIndex:(NSUInteger)glyphIndex effectiveRange:(nullable NSRangePointer)effectiveGlyphRange;
- (NSRect)lineFragmentRectForGlyphAtIndex:(NSUInteger)glyphIndex effectiveRange:(nullable NSRangePointer)effectiveGlyphRange withoutAdditionalLayout:(BOOL)flag API_AVAILABLE(macos(10.0), ios(9.0), tvos(9.0));
// Returns the usage rect for the line fragment in which the given glyph is laid and (optionally) by reference the whole range of glyphs that are in that fragment. This will cause glyph generation and layout for the line fragment containing the specified glyph, or if non-contiguous layout is not enabled, up to and including that line fragment. Line fragment used rects are always in container coordinates.
- (NSRect)lineFragmentUsedRectForGlyphAtIndex:(NSUInteger)glyphIndex effectiveRange:(nullable NSRangePointer)effectiveGlyphRange;
- (NSRect)lineFragmentUsedRectForGlyphAtIndex:(NSUInteger)glyphIndex effectiveRange:(nullable NSRangePointer)effectiveGlyphRange withoutAdditionalLayout:(BOOL)flag API_AVAILABLE(macos(10.0), ios(9.0), tvos(9.0));
// Return info about the extra line fragment. The extra line fragment is used for displaying the line at the end of document when the last character in the document causes a line or paragraph break. Since the extra line is not associated with any glyph inside the layout manager, the information is handed separately from other line fragment rects. Typically the extra line fragment is placed in the last document content text container along with other normal line fragment rects. Line fragment rects and line fragment used rects are always in container coordinates.
@property (readonly) NSRect extraLineFragmentRect;
@property (readonly) NSRect extraLineFragmentUsedRect;
@property (nullable, readonly) NSTextContainer *extraLineFragmentTextContainer;
// Returns the location for the given glyph within its line fragment. If this glyph does not have an explicit location set for it (i.e., it is part of (but not first in) a sequence of nominally spaced characters), the location is calculated by glyph advancements from the location of the most recent preceding glyph with a location set. Glyph locations are relative to their line fragment rect's origin. This will cause glyph generation and layout for the line fragment containing the specified glyph, or if non-contiguous layout is not enabled, up to and including that line fragment.
- (NSPoint)locationForGlyphAtIndex:(NSUInteger)glyphIndex;
// Some glyphs are not shown. This method returns whether the given glyph has been designated as not shown. This will cause glyph generation and layout for the line fragment containing the specified glyph, or if non-contiguous layout is not enabled, up to and including that line fragment.
- (BOOL)notShownAttributeForGlyphAtIndex:(NSUInteger)glyphIndex;
// Returns whether the glyph will draw outside of its line fragment rect. This will cause glyph generation and layout for the line fragment containing the specified glyph, or if non-contiguous layout is not enabled, up to and including that line fragment.
- (BOOL)drawsOutsideLineFragmentForGlyphAtIndex:(NSUInteger)glyphIndex;
// For a glyph corresponding to an attachment, this method returns the size the attachment cell will occupy. Returns {-1,-1} if no attachment size has been set for the specified glyph.
- (NSSize)attachmentSizeForGlyphAtIndex:(NSUInteger)glyphIndex;
// Returns a range of truncated glyph range for a line fragment containing the specified index. When there is no truncation for the line fragment, it returns {NSNotFound, 0}.
- (NSRange)truncatedGlyphRangeInLineFragmentForGlyphAtIndex:(NSUInteger)glyphIndex API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
/************************ More sophisticated queries ************************/
// Returns the range of glyphs that are generated from the characters in the given charRange. If actualCharRange is not NULL, it will return by reference the actual range of characters that fully define the glyph range returned. This range may be identical to or slightly larger than the requested character range. For example, if the text storage contains the characters "o" and (umlaut) and the glyph store contains the single precomposed glyph (o-umlaut), and if the character range given encloses only the first or second character, then actualCharRange will be set to enclose both characters. If the length of charRange is zero, the resulting glyph range will be a zero-length range just after the glyph(s) corresponding to the preceding character, and actualCharRange will also be zero-length. If non-contiguous layout is not enabled, this will force the generation of glyphs for all characters up to and including the end of the specified range.
- (NSRange)glyphRangeForCharacterRange:(NSRange)charRange actualCharacterRange:(nullable NSRangePointer)actualCharRange;
// Returns the range of characters that generated the glyphs in the given glyphRange. If actualGlyphRange is not NULL, it will return by reference the full range of glyphs generated by the character range returned. This range may be identical or slightly larger than the requested glyph range. For example, if the text storage contains the character (o-umlaut) and the glyph store contains the two atomic glyphs "o" and (umlaut), and if the glyph range given encloses only the first or second glyph, then actualGlyphRange will be set to enclose both glyphs. If the length of glyphRange is zero, the resulting character range will be a zero-length range just after the character(s) corresponding to the preceding glyph, and actualGlyphRange will also be zero-length. If non-contiguous layout is not enabled, this will force the generation of glyphs for all characters up to and including the end of the returned range.
- (NSRange)characterRangeForGlyphRange:(NSRange)glyphRange actualGlyphRange:(nullable NSRangePointer)actualGlyphRange;
// Returns the range of characters which have been laid into the given container. This is a less efficient method than the similar -textContainerForGlyphAtIndex:effectiveRange:.
- (NSRange)glyphRangeForTextContainer:(NSTextContainer *)container;
// Returns the range including the first glyph from glyphIndex on back that has a location set and up to, but not including the next glyph that has a location set.
- (NSRange)rangeOfNominallySpacedGlyphsContainingIndex:(NSUInteger)glyphIndex;
// Returns the smallest bounding rect which completely encloses the glyphs in the given glyphRange that are in the given container. The range is intersected with the container's range before computing the bounding rect. This method can be used to translate glyph ranges into display rectangles for invalidation. Bounding rects are always in container coordinates.
- (NSRect)boundingRectForGlyphRange:(NSRange)glyphRange inTextContainer:(NSTextContainer *)container;
// Returns a contiguous glyph range containing all glyphs that would need to be displayed in order to draw all glyphs that fall (even partially) within the bounding rect given. This range might include glyphs which do not fall into the rect at all. At most this will return the glyph range for the whole container. The WithoutAdditionalLayout variant will not generate glyphs or perform layout in attempting to answer, and thus may not be entirely correct. Bounding rects are always in container coordinates.
- (NSRange)glyphRangeForBoundingRect:(NSRect)bounds inTextContainer:(NSTextContainer *)container;
- (NSRange)glyphRangeForBoundingRectWithoutAdditionalLayout:(NSRect)bounds inTextContainer:(NSTextContainer *)container;
// Returns the index of the glyph falling under the given point, expressed in the given container's coordinate system. If no glyph is under the point, the nearest glyph is returned, where nearest is defined according to the requirements of selection by touch or mouse. Clients who wish to determine whether the the point actually lies within the bounds of the glyph returned should follow this with a call to boundingRectForGlyphRange:inTextContainer: and test whether the point falls in the rect returned by that method. If partialFraction is non-NULL, it will return by reference the fraction of the distance between the location of the glyph returned and the location of the next glyph.
- (NSUInteger)glyphIndexForPoint:(NSPoint)point inTextContainer:(NSTextContainer *)container fractionOfDistanceThroughGlyph:(nullable CGFloat *)partialFraction;
- (NSUInteger)glyphIndexForPoint:(NSPoint)point inTextContainer:(NSTextContainer *)container;
- (CGFloat)fractionOfDistanceThroughGlyphForPoint:(NSPoint)point inTextContainer:(NSTextContainer *)container;
// Returns the index of the character falling under the given point, expressed in the given container's coordinate system. If no character is under the point, the nearest character is returned, where nearest is defined according to the requirements of selection by touch or mouse. This is not simply equivalent to taking the result of the corresponding glyph index method and converting it to a character index, because in some cases a single glyph represents more than one selectable character, for example an fi ligature glyph. In that case, there will be an insertion point within the glyph, and this method will return one character or the other, depending on whether the specified point lies to the left or the right of that insertion point. In general, this method will return only character indexes for which there is an insertion point (see next method). The partial fraction is a fraction of the distance from the insertion point logically before the given character to the next one, which may be either to the right or to the left depending on directionality.
- (NSUInteger)characterIndexForPoint:(NSPoint)point inTextContainer:(NSTextContainer *)container fractionOfDistanceBetweenInsertionPoints:(nullable CGFloat *)partialFraction;
// Allows clients to obtain all insertion points for a line fragment in one call. The caller specifies the line fragment by supplying one character index within it, and can choose whether to obtain primary or alternate insertion points, and whether they should be in logical or in display order. The return value is the number of insertion points returned. Each pointer passed in should either be NULL, or else point to sufficient memory to hold as many elements as there are insertion points in the line fragment (which cannot be more than the number of characters + 1). The positions buffer passed in will be filled in with the positions of the insertion points, in the order specified, and the charIndexes buffer passed in will be filled in with the corresponding character indexes. Positions indicate a transverse offset relative to the line fragment rect's origin. Internal caching is used to ensure that repeated calls to this method for the same line fragment (possibly with differing values for other arguments) will not be significantly more expensive than a single call.
- (NSUInteger)getLineFragmentInsertionPointsForCharacterAtIndex:(NSUInteger)charIndex alternatePositions:(BOOL)aFlag inDisplayOrder:(BOOL)dFlag positions:(nullable CGFloat *)positions characterIndexes:(nullable NSUInteger *)charIndexes;
// Enumerates line fragments intersecting with glyphRange.
- (void)enumerateLineFragmentsForGlyphRange:(NSRange)glyphRange usingBlock:(void (^)(NSRect rect, NSRect usedRect, NSTextContainer *textContainer, NSRange glyphRange, BOOL *stop))block API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
// Enumerates enclosing rects for glyphRange in textContainer. If a selected range is given in the second argument, the rectangles returned will be correct for drawing the selection. Selection rectangles are generally more complicated than enclosing rectangles and supplying a selected range is the clue these methods use to determine whether to go to the trouble of doing this special work. If the caller is interested in this more from an enclosing point of view rather than a selection point of view, pass {NSNotFound, 0} as the selected range. This method will do the minimum amount of work required to answer the question.
- (void)enumerateEnclosingRectsForGlyphRange:(NSRange)glyphRange withinSelectedGlyphRange:(NSRange)selectedRange inTextContainer:(NSTextContainer *)textContainer usingBlock:(void (^)(NSRect rect, BOOL *stop))block API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
/************************ Drawing support ************************/
// These methods are primitives for drawing. You can override these to perform additional drawing, or to replace text drawing entirely, but not to change layout. You can call them if you want, but focus must already be locked on the destination view or image. -drawBackgroundForGlyphRange:atPoint: draws the background color and selection and marked range aspects of the text display, along with block decoration such as table backgrounds and borders. -drawGlyphsForGlyphRange:atPoint: draws the actual glyphs, including attachments, as well as any underlines or strikethroughs. In either case all of the specified glyphs must lie in a single container.
- (void)drawBackgroundForGlyphRange:(NSRange)glyphsToShow atPoint:(NSPoint)origin;
- (void)drawGlyphsForGlyphRange:(NSRange)glyphsToShow atPoint:(NSPoint)origin;
// This is the glyph rendering primitive method. Renders glyphs at positions into the CGContext. The positions are in the user space coordinate system. CGContext that is passed in is already configured according to the text attributes arguments: font, textMatrix, and attributes. The font argument represents the font applied to the graphics state. The value can be different from the NSFontAttributeName value in the attributes argument because of various font substitutions that the system automatically executes. The textMatrix is the affine transform mapping the text space coordinate system to the user space coordinate system. The tx and ty components of textMatrix are ignored since Quartz overrides them with the glyph positions.
- (void)showCGGlyphs:(const CGGlyph *)glyphs positions:(const CGPoint *)positions count:(NSInteger)glyphCount font:(NSFont *)font textMatrix:(CGAffineTransform)textMatrix attributes:(NSDictionary<NSAttributedStringKey, id> *)attributes inContext:(CGContextRef)CGContext API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0));
// This is the primitive used by -drawBackgroundForGlyphRange:atPoint: for actually filling rects with a particular background color, whether due to a background color attribute, a selected or marked range highlight, a block decoration, or any other rect fill needed by that method. As with -showCGGlyphs:..., the character range and color are merely for informational purposes; the color will already be set in the graphics state. If for any reason you modify it, you must restore it before returning from this method. You should never call this method, but you might override it. The default implementation will simply fill the specified rect array.
- (void)fillBackgroundRectArray:(const NSRect *)rectArray count:(NSUInteger)rectCount forCharacterRange:(NSRange)charRange color:(NSColor *)color API_AVAILABLE(macos(10.6));
// The first of these methods actually draws an appropriate underline for the glyph range given. The second method potentially breaks the range it is given up into subranges and calls drawUnderline... for ranges that should actually have the underline drawn. As examples of why there are two methods, consider two situations. First, in all cases you don't want to underline the leading and trailing whitespace on a line. The -underlineGlyphRange... method is passed glyph ranges that have underlining turned on, but it will then look for this leading and trailing white space and only pass the ranges that should actually be underlined to -drawUnderline... Second, if the underlineType: indicates that only words, (i.e., no whitespace), should be underlined, then -underlineGlyphRange... will carve the range it is passed up into words and only pass word ranges to -drawUnderline.
- (void)drawUnderlineForGlyphRange:(NSRange)glyphRange underlineType:(NSUnderlineStyle)underlineVal baselineOffset:(CGFloat)baselineOffset lineFragmentRect:(NSRect)lineRect lineFragmentGlyphRange:(NSRange)lineGlyphRange containerOrigin:(NSPoint)containerOrigin;
- (void)underlineGlyphRange:(NSRange)glyphRange underlineType:(NSUnderlineStyle)underlineVal lineFragmentRect:(NSRect)lineRect lineFragmentGlyphRange:(NSRange)lineGlyphRange containerOrigin:(NSPoint)containerOrigin;
// These two methods parallel the two corresponding underline methods, but draw strikethroughs instead of underlines.
- (void)drawStrikethroughForGlyphRange:(NSRange)glyphRange strikethroughType:(NSUnderlineStyle)strikethroughVal baselineOffset:(CGFloat)baselineOffset lineFragmentRect:(NSRect)lineRect lineFragmentGlyphRange:(NSRange)lineGlyphRange containerOrigin:(NSPoint)containerOrigin;
- (void)strikethroughGlyphRange:(NSRange)glyphRange strikethroughType:(NSUnderlineStyle)strikethroughVal lineFragmentRect:(NSRect)lineRect lineFragmentGlyphRange:(NSRange)lineGlyphRange containerOrigin:(NSPoint)containerOrigin;
// This is the primitive for actually drawing an attachment cell. The attachment should be drawn within the given rect. The character index is provided for those cells that alter their appearance based on their location.
- (void)showAttachmentCell:(NSCell *)cell inRect:(NSRect)rect characterIndex:(NSUInteger)attachmentIndex;
/************************** Block information **************************/
// Used to set and get information about layout of text blocks. These methods cause glyph generation but not layout. The latter two will return NSZeroRect if no rect has been set for the specified block and range since the last invalidation. Block layout rects and bounds rects are always in container coordinates.
- (void)setLayoutRect:(NSRect)rect forTextBlock:(NSTextBlock *)block glyphRange:(NSRange)glyphRange;
- (void)setBoundsRect:(NSRect)rect forTextBlock:(NSTextBlock *)block glyphRange:(NSRange)glyphRange;
- (NSRect)layoutRectForTextBlock:(NSTextBlock *)block glyphRange:(NSRange)glyphRange;
- (NSRect)boundsRectForTextBlock:(NSTextBlock *)block glyphRange:(NSRange)glyphRange;
// Similar to the above, but they can be passed any index in the range and will return the range by reference if effectiveGlyphRange is not NULL.
- (NSRect)layoutRectForTextBlock:(NSTextBlock *)block atIndex:(NSUInteger)glyphIndex effectiveRange:(nullable NSRangePointer)effectiveGlyphRange;
- (NSRect)boundsRectForTextBlock:(NSTextBlock *)block atIndex:(NSUInteger)glyphIndex effectiveRange:(nullable NSRangePointer)effectiveGlyphRange;
/************************ Temporary attribute support ************************/
// Temporary attributes provide a way to override attributes for drawing on a per-layout manager basis, without affecting the underlying stored text. Clients may set any attributes they wish, but the only attributes that the layout manager will recognize for drawing are those that do not affect layout (color, underline, etc.).
- (NSDictionary<NSAttributedStringKey, id> *)temporaryAttributesAtCharacterIndex:(NSUInteger)charIndex effectiveRange:(nullable NSRangePointer)effectiveCharRange;
- (void)setTemporaryAttributes:(NSDictionary<NSAttributedStringKey, id> *)attrs forCharacterRange:(NSRange)charRange;
- (void)addTemporaryAttributes:(NSDictionary<NSAttributedStringKey, id> *)attrs forCharacterRange:(NSRange)charRange;
- (void)removeTemporaryAttribute:(NSAttributedStringKey)attrName forCharacterRange:(NSRange)charRange;
- (nullable id)temporaryAttribute:(NSAttributedStringKey)attrName atCharacterIndex:(NSUInteger)location effectiveRange:(nullable NSRangePointer)range API_AVAILABLE(macos(10.5));
- (nullable id)temporaryAttribute:(NSAttributedStringKey)attrName atCharacterIndex:(NSUInteger)location longestEffectiveRange:(nullable NSRangePointer)range inRange:(NSRange)rangeLimit API_AVAILABLE(macos(10.5));
- (NSDictionary<NSAttributedStringKey, id> *)temporaryAttributesAtCharacterIndex:(NSUInteger)location longestEffectiveRange:(nullable NSRangePointer)range inRange:(NSRange)rangeLimit API_AVAILABLE(macos(10.5));
- (void)addTemporaryAttribute:(NSAttributedStringKey)attrName value:(id)value forCharacterRange:(NSRange)charRange API_AVAILABLE(macos(10.5));
/******************************* Font metrics ******************************/
// Returns the default line height specified by the layout manager's typesetter behavior for the given font.
- (CGFloat)defaultLineHeightForFont:(NSFont *)theFont;
// Returns the default baseline offset specified by the layout manager's typesetter behavior for the given font.
- (CGFloat)defaultBaselineOffsetForFont:(NSFont *)theFont;
@end
@interface NSLayoutManager (NSTextViewSupport)
/***************************** Ruler support *****************************/
// These return, respectively, an array of text ruler objects for the current selection, and the accessory view that the text system uses for its ruler. If you have turned off automatic ruler updating through the use of setUsesRulers: so that you can do more complex things, but you still want to display the appropriate text ruler objects and/or accessory view, you can use these methods.
- (NSArray<NSRulerMarker *> *)rulerMarkersForTextView:(NSTextView *)view paragraphStyle:(NSParagraphStyle *)style ruler:(NSRulerView *)ruler;
- (nullable __kindof NSView *)rulerAccessoryViewForTextView:(NSTextView *)view paragraphStyle:(NSParagraphStyle *)style ruler:(NSRulerView *)ruler enabled:(BOOL)isEnabled;
/************************ First responder support ************************/
// Returns YES if the firstResponder of the given window is one of the NSTextViews attached to this NSLayoutManager.
- (BOOL)layoutManagerOwnsFirstResponderInWindow:(NSWindow *)window;
@property (nullable, readonly, assign) NSTextView *firstTextView;
// This method is special in that it won't cause layout if the beginning of the selected range is not yet laid out. Other than that this method could be done through other API.
@property (nullable, readonly, assign) NSTextView *textViewForBeginningOfSelection;
@end
@protocol NSLayoutManagerDelegate <NSObject>
@optional
/************************ Glyph generation ************************/
// This is sent whenever layoutManager is about to store the initial glyph information via -setGlyphs:properties:characterIndexes:forGlyphRange:. This method allows customizing the initial glyph generation process. It can invoke -setGlyphs:properties:characterIndexes:forGlyphRange: with modified glyph information. The return value specifies the actual glyph range stored in this method. By returning 0, it can indicate layoutManager to do the default processing. Note that querying glyph information surrounding glyphRange could lead to recursion since the data might not be available, yet.
- (NSUInteger)layoutManager:(NSLayoutManager *)layoutManager shouldGenerateGlyphs:(const CGGlyph *)glyphs properties:(const NSGlyphProperty *)props characterIndexes:(const NSUInteger *)charIndexes font:(NSFont *)aFont forGlyphRange:(NSRange)glyphRange API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
/************************ Line layout ************************/
// These methods are invoked while each line is laid out. They allow NSLayoutManager delegate to customize the shape of line.
// Returns the spacing after the line ending with glyphIndex.
- (CGFloat)layoutManager:(NSLayoutManager *)layoutManager lineSpacingAfterGlyphAtIndex:(NSUInteger)glyphIndex withProposedLineFragmentRect:(NSRect)rect API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
// Returns the paragraph spacing before the line starting with glyphIndex.
- (CGFloat)layoutManager:(NSLayoutManager *)layoutManager paragraphSpacingBeforeGlyphAtIndex:(NSUInteger)glyphIndex withProposedLineFragmentRect:(NSRect)rect API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
// Returns the paragraph spacing after the line ending with glyphIndex.
- (CGFloat)layoutManager:(NSLayoutManager *)layoutManager paragraphSpacingAfterGlyphAtIndex:(NSUInteger)glyphIndex withProposedLineFragmentRect:(NSRect)rect API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
// Returns the control character action for the control character at charIndex.
- (NSControlCharacterAction)layoutManager:(NSLayoutManager *)layoutManager shouldUseAction:(NSControlCharacterAction)action forControlCharacterAtIndex:(NSUInteger)charIndex API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
// Invoked while determining the soft line break point. When NO, NSLayoutManager tries to find the next line break opportunity before charIndex
- (BOOL)layoutManager:(NSLayoutManager *)layoutManager shouldBreakLineByWordBeforeCharacterAtIndex:(NSUInteger)charIndex API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
// Invoked while determining the hyphenation point. When NO, NSLayoutManager tries to find the next hyphenation opportunity before charIndex
- (BOOL)layoutManager:(NSLayoutManager *)layoutManager shouldBreakLineByHyphenatingBeforeCharacterAtIndex:(NSUInteger)charIndex API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
// Invoked for resolving the glyph metrics for NSControlCharacterWhitespaceAction control character.
- (NSRect)layoutManager:(NSLayoutManager *)layoutManager boundingBoxForControlGlyphAtIndex:(NSUInteger)glyphIndex forTextContainer:(NSTextContainer *)textContainer proposedLineFragment:(NSRect)proposedRect glyphPosition:(NSPoint)glyphPosition characterIndex:(NSUInteger)charIndex API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
// Allows NSLayoutManagerDelegate to customize the line fragment geometry before committing to the layout cache. The implementation of this method should make sure that the modified fragments are still valid inside the text container coordinate. When it returns YES, the layout manager uses the modified rects. Otherwise, it ignores the rects returned from this method.
- (BOOL)layoutManager:(NSLayoutManager *)layoutManager shouldSetLineFragmentRect:(inout NSRect *)lineFragmentRect lineFragmentUsedRect:(inout NSRect *)lineFragmentUsedRect baselineOffset:(inout CGFloat *)baselineOffset inTextContainer:(NSTextContainer *)textContainer forGlyphRange:(NSRange)glyphRange API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0));
/************************ Layout processing ************************/
// This is sent whenever layout or glyphs become invalidated in a layout manager which previously had all layout complete.
- (void)layoutManagerDidInvalidateLayout:(NSLayoutManager *)sender API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0));
// This is sent whenever a container has been filled. This method can be useful for paginating. The textContainer might be nil if we have completed all layout and not all of it fit into the existing containers. The atEnd flag indicates whether all layout is complete.
- (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(nullable NSTextContainer *)textContainer atEnd:(BOOL)layoutFinishedFlag API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0));
// This is sent right before layoutManager invalidates the layout due to textContainer changing geometry. The receiver of this method can react to the geometry change and perform adjustments such as recreating the exclusion path.
- (void)layoutManager:(NSLayoutManager *)layoutManager textContainer:(NSTextContainer *)textContainer didChangeGeometryFromSize:(NSSize)oldSize API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0));
// This is sent when the layout manager is drawing and needs to decide whether to use temporary attributes or not. The delegate returns a dictionary of temporary attributes to be used, or nil to suppress the use of temporary attributes altogether. The effectiveCharRange argument is both an in and out by-reference effective range for those attributes. The default behavior if this method is not implemented is to use temporary attributes only when drawing to the screen, so an implementation to match that behavior would return attrs if toScreen is YES and nil otherwise, without changing effectiveCharRange.
- (nullable NSDictionary<NSAttributedStringKey, id> *)layoutManager:(NSLayoutManager *)layoutManager shouldUseTemporaryAttributes:(NSDictionary<NSAttributedStringKey, id> *)attrs forDrawingToScreen:(BOOL)toScreen atCharacterIndex:(NSUInteger)charIndex effectiveRange:(nullable NSRangePointer)effectiveCharRange API_AVAILABLE(macos(10.5));
@end
/************************ Deprecated ************************/
enum {
NSGlyphAttributeSoft API_DEPRECATED("", macos(10.0,10.11)) = 0,
NSGlyphAttributeElastic API_DEPRECATED("", macos(10.0,10.11)) = 1,
NSGlyphAttributeBidiLevel API_DEPRECATED("", macos(10.0,10.11)) = 2,
NSGlyphAttributeInscribe API_DEPRECATED("", macos(10.0,10.11)) = 5
} API_DEPRECATED("Use NSGlyphProperty instead", macos(10.0,10.11));
typedef NS_ENUM(NSUInteger, NSGlyphInscription) {
NSGlyphInscribeBase API_DEPRECATED("", macos(10.0,10.11)) = 0,
NSGlyphInscribeBelow API_DEPRECATED("", macos(10.0,10.11)) = 1,
NSGlyphInscribeAbove API_DEPRECATED("", macos(10.0,10.11)) = 2,
NSGlyphInscribeOverstrike API_DEPRECATED("", macos(10.0,10.11)) = 3,
NSGlyphInscribeOverBelow API_DEPRECATED("", macos(10.0,10.11)) = 4
} API_DEPRECATED("Use NSGlyphProperty instead", macos(10.0,10.11));
@interface NSLayoutManager (NSLayoutManagerDeprecated)
// These two methods are soft deprecated starting with OS X 10.11. It will be officially deprecated in a future release
- (NSGlyph)glyphAtIndex:(NSUInteger)glyphIndex isValidIndex:(nullable BOOL *)isValidIndex; // Use -CGGlyphAtIndex:isValidIndex: instead
- (NSGlyph)glyphAtIndex:(NSUInteger)glyphIndex; // Use -CGGlyphAtIndex: instead
// These two methods are soft deprecated starting with OS X 10.11. It will be officially deprecated in a future release. Use -enumerateEnclosingRectsForGlyphRange:withinSelectedGlyphRange:inTextContainer:usingBlock: instead
- (nullable NSRectArray)rectArrayForCharacterRange:(NSRange)charRange withinSelectedCharacterRange:(NSRange)selCharRange inTextContainer:(NSTextContainer *)container rectCount:(NSUInteger *)rectCount NS_RETURNS_INNER_POINTER;
- (nullable NSRectArray)rectArrayForGlyphRange:(NSRange)glyphRange withinSelectedGlyphRange:(NSRange)selGlyphRange inTextContainer:(NSTextContainer *)container rectCount:(NSUInteger *)rectCount NS_RETURNS_INNER_POINTER;
@property BOOL usesScreenFonts API_DEPRECATED("", macos(10.0,10.11));
- (NSFont *)substituteFontForFont:(NSFont *)originalFont API_DEPRECATED("", macos(10.0,10.11));
- (void)insertGlyphs:(const NSGlyph *)glyphs length:(NSUInteger)length forStartingGlyphAtIndex:(NSUInteger)glyphIndex characterIndex:(NSUInteger)charIndex API_DEPRECATED("Use -setGlyphs:properties:characterIndexes:font:forGlyphRange instead", macos(10.0,10.11));
- (void)insertGlyph:(NSGlyph)glyph atGlyphIndex:(NSUInteger)glyphIndex characterIndex:(NSUInteger)charIndex API_DEPRECATED("Use -setGlyphs:properties:characterIndexes:font:forGlyphRange instead", macos(10.0,10.11));
- (void)replaceGlyphAtIndex:(NSUInteger)glyphIndex withGlyph:(NSGlyph)newGlyph API_DEPRECATED("Use -setGlyphs:properties:characterIndexes:font:forGlyphRange instead", macos(10.0,10.11));
- (void)deleteGlyphsInRange:(NSRange)glyphRange API_DEPRECATED("Use -setGlyphs:properties:characterIndexes:font:forGlyphRange instead", macos(10.0,10.11));
- (void)setCharacterIndex:(NSUInteger)charIndex forGlyphAtIndex:(NSUInteger)glyphIndex API_DEPRECATED("Use -setGlyphs:properties:characterIndexes:font:forGlyphRange instead", macos(10.0,10.11));
- (void)setIntAttribute:(NSInteger)attributeTag value:(NSInteger)val forGlyphAtIndex:(NSUInteger)glyphIndex API_DEPRECATED("Use -setGlyphs:properties:characterIndexes:font:forGlyphRange instead", macos(10.0,10.11));
- (void)invalidateGlyphsOnLayoutInvalidationForGlyphRange:(NSRange)glyphRange API_DEPRECATED("Use -setGlyphs:properties:characterIndexes:font:forGlyphRange instead", macos(10.5,10.11));
- (NSInteger)intAttribute:(NSInteger)attributeTag forGlyphAtIndex:(NSUInteger)glyphIndex API_DEPRECATED("Use -getGlyphsInRange:glyphs:properties:characterIndexes:bidiLevels: instead", macos(10.0,10.11));
- (NSUInteger)getGlyphsInRange:(NSRange)glyphRange glyphs:(nullable NSGlyph *)glyphBuffer characterIndexes:(nullable NSUInteger *)charIndexBuffer glyphInscriptions:(nullable NSGlyphInscription *)inscribeBuffer elasticBits:(nullable BOOL *)elasticBuffer API_DEPRECATED("Use -getGlyphsInRange:glyphs:properties:characterIndexes:bidiLevels: instead", macos(10.0,10.11));
- (NSUInteger)getGlyphsInRange:(NSRange)glyphRange glyphs:(nullable NSGlyph *)glyphBuffer characterIndexes:(nullable NSUInteger *)charIndexBuffer glyphInscriptions:(nullable NSGlyphInscription *)inscribeBuffer elasticBits:(nullable BOOL *)elasticBuffer bidiLevels:(nullable unsigned char *)bidiLevelBuffer API_DEPRECATED("Use -getGlyphsInRange:glyphs:properties:characterIndexes:bidiLevels: instead", macos(10.0,10.11));
- (NSUInteger)getGlyphs:(nullable NSGlyph *)glyphArray range:(NSRange)glyphRange API_DEPRECATED("Use -getGlyphsInRange:glyphs:properties:characterIndexes:bidiLevels: instead", macos(10.0,10.11));
- (void)invalidateLayoutForCharacterRange:(NSRange)charRange isSoft:(BOOL)flag actualCharacterRange:(nullable NSRangePointer)actualCharRange API_DEPRECATED("Use -invalidateLayoutForCharacterRange:actualCharacterRange: instead", macos(10.0,10.11));
- (void)textStorage:(NSTextStorage *)str edited:(NSTextStorageEditedOptions)editedMask range:(NSRange)newCharRange changeInLength:(NSInteger)delta invalidatedRange:(NSRange)invalidatedCharRange API_DEPRECATED("Use -processEditingForTextStorage:edited:range:changeInLength:invalidatedRange: instead", macos(10.0,10.11));
- (void)setLocations:(NSPointArray)locations startingGlyphIndexes:(NSUInteger *)glyphIndexes count:(NSUInteger)count forGlyphRange:(NSRange)glyphRange API_DEPRECATED("Use -setLocation:forStartOfGlyphRange: instead", macos(10.5,10.11));
- (void)showPackedGlyphs:(char *)glyphs length:(NSUInteger)glyphLen glyphRange:(NSRange)glyphRange atPoint:(NSPoint)point font:(NSFont *)font color:(NSColor *)color printingAdjustment:(NSSize)printingAdjustment API_DEPRECATED("Use -showCGGlyphs:positions:count:font:matrix:attributes:inContext: instead", macos(10.0,10.7));
- (void)showCGGlyphs:(const CGGlyph *)glyphs positions:(const NSPoint *)positions count:(NSUInteger)glyphCount font:(NSFont *)font matrix:(NSAffineTransform *)textMatrix attributes:(NSDictionary<NSAttributedStringKey, id> *)attributes inContext:(NSGraphicsContext *)graphicsContext API_DEPRECATED_WITH_REPLACEMENT("showCGGlyphs:positions:count:font:textMatrix:attributes:inContext:", macos(10.7,10.15), ios(7.0,13.0), tvos(9.0,13.0)) API_UNAVAILABLE(macCatalyst);
@property float hyphenationFactor API_DEPRECATED("Please use usesDefaultHyphenation or -[NSParagraphStyle hyphenationFactor] instead.", macos(10.0,10.15), ios(7.0,13.0), tvos(9.0,13.0)) API_UNAVAILABLE(macCatalyst);
@end
// NSGlyph-based API is now deprecated. Use -layoutManager:shouldGenerateGlyphs:properties:characterIndexes:forGlyphRange: instead
@interface NSLayoutManager (NSGlyphGeneration) <NSGlyphStorage>
@property (strong) NSGlyphGenerator *glyphGenerator;
@end
#endif // !TARGET_OS_IPHONE
NS_ASSUME_NONNULL_END
#else
#import <UIFoundation/NSLayoutManager.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/NSPrintPanel.h | /*
NSPrintPanel.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/AppKitDefines.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSSet.h>
#import <AppKit/NSHelpManager.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSPrintInfo, NSSet, NSView, NSViewController, NSWindow, NSWindowController;
typedef NS_OPTIONS(NSUInteger, NSPrintPanelOptions) {
/* Whether the print panel has separate controls (not in any accessory view) that allow the user to change the number of copies to print, which pages to print, paper size, orientation, and scaling, respectively.
*/
NSPrintPanelShowsCopies = 1 << 0,
NSPrintPanelShowsPageRange = 1 << 1,
NSPrintPanelShowsPaperSize = 1 << 2,
NSPrintPanelShowsOrientation = 1 << 3,
NSPrintPanelShowsScaling = 1 << 4,
/* Whether the print panel has an additional "Selection" option for the paper range.
*/
NSPrintPanelShowsPrintSelection API_AVAILABLE(macos(10.6)) = 1 << 5,
/* Whether the print panel has a page setup accessory view with controls that allow the user to change paper size, orientation, and scaling. Any control that appear in the main part of the panel because one of the previous options is used does not also appear in the page setup accessory view.
*/
NSPrintPanelShowsPageSetupAccessory = 1 << 8,
/* Whether the print panel has a built-in preview. Setting this option in a print panel that's not being presented by an NSPrintOperation is not useful. Two things you need to be aware of when this option is set:
1) the NSPrintInfo passed into -beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo: or -runModalWithPrintInfo: will be retained instead of copied. This is so that the NSPrintOperation that is presenting the panel can respond to -printInfo messages by returning the NSPrintInfo that the user is actually looking at and manipulating, which is the most useful thing for it to return. The result is that the passed-in NSPrintInfo can be mutated even when the user cancels the print panel, but that's OK; the factory methods that you use to create NSPrintOperations do the copying that's appropriate in that case.
2) The presenting NSPrintOperation will send the printing view more messages that it would otherwise, so that it can do pagination right away, draw the preview on screen, etc.
*/
NSPrintPanelShowsPreview = 1 << 17
} API_AVAILABLE(macos(10.5));
/* Valid values for passing into -[NSPrintPanel setJobStyleHint:].
*/
typedef NSString * NSPrintPanelJobStyleHint NS_TYPED_ENUM;
APPKIT_EXTERN NSPrintPanelJobStyleHint const NSPrintPhotoJobStyleHint;
APPKIT_EXTERN NSPrintPanelJobStyleHint const NSPrintAllPresetsJobStyleHint API_AVAILABLE(macos(10.6));
APPKIT_EXTERN NSPrintPanelJobStyleHint const NSPrintNoPresetsJobStyleHint API_AVAILABLE(macos(10.6));
/* The keys of the entries that must be in the dictionaries returned by NSPrintPanelAccessorizing's -localizedSummaryItems method.
*/
typedef NSString * NSPrintPanelAccessorySummaryKey NS_TYPED_ENUM;
APPKIT_EXTERN NSPrintPanelAccessorySummaryKey const NSPrintPanelAccessorySummaryItemNameKey API_AVAILABLE(macos(10.5));
APPKIT_EXTERN NSPrintPanelAccessorySummaryKey const NSPrintPanelAccessorySummaryItemDescriptionKey API_AVAILABLE(macos(10.5));
@protocol NSPrintPanelAccessorizing
/* Return the text that summarizes the settings that the user has chosen using this print panel accessory view and that should appear in the summary pane of the print panel. It must be an array of dictionaries (not nil), each of which has an NSPrintPanelAccessorySummaryItemNameKey entry and an NSPrintPanelAccessorySummaryItemDescriptionKey entry whose values are strings. A print panel accessory view must be KVO-compliant for "localizedSummaryItems" because NSPrintPanel observes it to keep what it displays in its Summary view up to date. (In Mac OS 10.5 there is no way for the user to see your accessory view and the Summary view at the same time, but that might not always be true in the future.)
*/
- (NSArray<NSDictionary<NSPrintPanelAccessorySummaryKey, NSString *> *> *)localizedSummaryItems;
@optional
/* Return the key paths for properties whose values affect what is drawn in the print panel's built-in preview. NSPrintPanel observes these key paths and redraws the preview when the values for any of them change. For example, if you write an accessory view that lets the user change document margins in the print panel you might provide an implementation of this method that returns a set that includes strings like @"representedObject.leftMargin", @"representedObject.rightMargin", etc. (because the representedObject would be an NSPrintInfo, which is KVO-compliant for "leftMargin," "rightMargin," etc.). This protocol method is optional because it's not necessary if you're not using NSPrintPanel's built-in preview, but if you use preview you almost certainly have to implement this method properly too.
*/
- (NSSet<NSString *> *)keyPathsForValuesAffectingPreview;
@end
NS_SWIFT_UI_ACTOR
@interface NSPrintPanel : NSObject
/* Create a new NSPrintPanel.
*/
+ (NSPrintPanel *)printPanel;
/* Controllers for the accessory views that will be presented in the print panel by the methods below. When the print panel is presented to the user each controller is automatically sent a -setRepresentedObject: message with this object's NSPrintInfo. Because NSViewControllers are KVC and KVO compliant for "representedObject," you can use one as the file's owner of an accessory view's nib and bind controls to the file's owner using key paths that start with "representedObject." to take advantage of NSPrintInfo's KVC and KVO compliance. Each controller is also automatically sent a -title message. If that returns nil the application's short name is used in the popup menu that lets the user choose an accessory view.
*/
- (void)addAccessoryController:(NSViewController<NSPrintPanelAccessorizing> *)accessoryController API_AVAILABLE(macos(10.5));
- (void)removeAccessoryController:(NSViewController<NSPrintPanelAccessorizing> *)accessoryController API_AVAILABLE(macos(10.5));
@property (readonly, copy) NSArray<__kindof NSViewController *> *accessoryControllers API_AVAILABLE(macos(10.5));
/* The options described above. In Mac OS 10.5 an -options message sent to a freshly-created NSPrintPanel will return (NSPrintPanelShowsCopies | NSPrintPanelShowsPageRange) unless it was created by an NSPrintOperation, in which case it will also return NSPrintPanelShowsPreview. (See the release notes for backward binary compatibility information though.) To allow your application to take advantage of controls that may be added by default in future versions of Mac OS X, get the options from the print panel you've just created, turn on and off the flags you care about, and then set the options.
*/
@property NSPrintPanelOptions options API_AVAILABLE(macos(10.5));
/* The title of the default button in the print panel. You can override the standard button title, "Print," when you're using an NSPrintPanel in such a way that printing isn't actually going to happen when the user presses that button.
*/
- (void)setDefaultButtonTitle:(nullable NSString *)defaultButtonTitle API_AVAILABLE(macos(10.5));
- (nullable NSString *)defaultButtonTitle API_AVAILABLE(macos(10.5));
/* The HTML help anchor for the print panel. You can override the standard anchor of the print panel's help button.
*/
@property (nullable, copy) NSHelpAnchorName helpAnchor API_AVAILABLE(macos(10.5));
// Set or get a string that provides a hint about the type of print job in which this print panel is being used. This controls the set of items that appear in the Presets menu. The string must be one of the job style hint strings declared above, or nil to show general presets.
@property (nullable, copy) NSPrintPanelJobStyleHint jobStyleHint;
/* Present a print panel to the user, document-modally. When the user has dismissed it, send the message selected by didEndSelector to the delegate, with the contextInfo as the last argument. The method selected by didEndSelector must have the same signature as:
- (void)printPanelDidEnd:(NSPrintPanel *)printPanel returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
*/
- (void)beginSheetWithPrintInfo:(NSPrintInfo *)printInfo modalForWindow:(NSWindow *)docWindow delegate:(nullable id)delegate didEndSelector:(nullable SEL)didEndSelector contextInfo:(nullable void *)contextInfo;
/* Present a print panel to the user, application-modally, and return either NSOKButton or NSCancelButton. The default implementation of -runModal just invokes [self runModalWithPrintInfo:[[NSPrintOperation currentOperation] printInfo]].
*/
- (NSInteger)runModalWithPrintInfo:(NSPrintInfo *)printInfo API_AVAILABLE(macos(10.5));
- (NSInteger)runModal;
/* A simple accessor. Your -beginSheetWithPrintInfo:... delegate can use this so it doesn't have to keep a pointer to the NSPrintInfo elsewhere while waiting for the user to dismiss the print panel.
*/
@property (readonly, strong) NSPrintInfo *printInfo API_AVAILABLE(macos(10.5));
@end
@interface NSPrintPanel(NSDeprecated)
- (void)setAccessoryView:(nullable NSView *)accessoryView API_DEPRECATED("Use -addAccessoryController instead", macos(10.0,10.5));
- (nullable NSView *)accessoryView API_DEPRECATED("Use -accessoryControllers instead. For compatibility this returns the view of the first accessory controller, or nil", macos(10.0,10.5));
- (void)updateFromPrintInfo API_DEPRECATED("", macos(10.0,10.5));
- (void)finalWritePrintInfo API_DEPRECATED("", macos(10.0,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/NSOpenGL.h | /*
NSOpenGL.h
Application Kit
Copyright (c) 2000-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/AppKitDefines.h>
#import <Foundation/Foundation.h>
#import <OpenGL/CGLTypes.h>
#import <OpenGL/gltypes.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
#ifndef GL_SILENCE_DEPRECATION
#define NS_OPENGL_DEPRECATED(minVers, maxVers) API_DEPRECATED("OpenGL API deprecated; please use Metal and MetalKit. (Define GL_SILENCE_DEPRECATION to silence these warnings.)", macos(minVers,maxVers))
#define NS_OPENGL_ENUM_DEPRECATED(minVers, maxVers) API_DEPRECATED("OpenGL API deprecated; please use Metal and MetalKit. (Define GL_SILENCE_DEPRECATION to silence these warnings.)", macos(minVers,maxVers))
#define NS_OPENGL_CLASS_DEPRECATED(message, minVers, maxVers) API_DEPRECATED(message, macos(minVers,maxVers))
#else
#define NS_OPENGL_DEPRECATED(minVers, maxVers) API_AVAILABLE(macos(minVers))
#define NS_OPENGL_ENUM_DEPRECATED(minVers, maxVers) API_AVAILABLE(macos(minVers))
#define NS_OPENGL_CLASS_DEPRECATED(message, minVers, maxVers) API_AVAILABLE(macos(minVers))
#endif
@class NSData, NSView, NSScreen;
/* Option names for NSOpenGLSetOption() and NSOpenGLGetOption() */
typedef NS_ENUM(uint32_t, NSOpenGLGlobalOption) {
NSOpenGLGOFormatCacheSize NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 501, /* Set the size of the pixel format cache */
NSOpenGLGOClearFormatCache NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 502, /* Reset the pixel format cache if true */
NSOpenGLGORetainRenderers NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 503, /* Whether to retain loaded renderers in memory */
NSOpenGLGOUseBuildCache NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 506, /* Enable the function compilation block cache. Off by default. Must be enabled at startup. */
NSOpenGLGOResetLibrary API_DEPRECATED("", macos(10.0,10.4)) = 504
} NS_OPENGL_DEPRECATED(10.0, 10.14);
/*
** Library global options.
*/
APPKIT_EXTERN void NSOpenGLSetOption(NSOpenGLGlobalOption pname, GLint param) NS_OPENGL_DEPRECATED(10.0, 10.14);
APPKIT_EXTERN void NSOpenGLGetOption(NSOpenGLGlobalOption pname, GLint * param) NS_OPENGL_DEPRECATED(10.0, 10.14);
/*
** Library version.
*/
APPKIT_EXTERN void NSOpenGLGetVersion(GLint * _Nullable major, GLint * _Nullable minor) NS_OPENGL_DEPRECATED(10.0, 10.14);
/*********************
** NSOpenGLPixelFormat
*********************/
/*
** Attribute names for [NSOpenGLPixelFormat initWithAttributes]
** and [NSOpenGLPixelFormat getValues:forAttribute:forVirtualScreen].
*/
enum {
NSOpenGLPFAAllRenderers NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 1, /* choose from all available renderers */
NSOpenGLPFATripleBuffer NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 3, /* choose a triple buffered pixel format */
NSOpenGLPFADoubleBuffer NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 5, /* choose a double buffered pixel format */
NSOpenGLPFAAuxBuffers NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 7, /* number of aux buffers */
NSOpenGLPFAColorSize NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 8, /* number of color buffer bits */
NSOpenGLPFAAlphaSize NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 11, /* number of alpha component bits */
NSOpenGLPFADepthSize NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 12, /* number of depth buffer bits */
NSOpenGLPFAStencilSize NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 13, /* number of stencil buffer bits */
NSOpenGLPFAAccumSize NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 14, /* number of accum buffer bits */
NSOpenGLPFAMinimumPolicy NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 51, /* never choose smaller buffers than requested */
NSOpenGLPFAMaximumPolicy NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 52, /* choose largest buffers of type requested */
NSOpenGLPFASampleBuffers NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 55, /* number of multi sample buffers */
NSOpenGLPFASamples NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 56, /* number of samples per multi sample buffer */
NSOpenGLPFAAuxDepthStencil NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 57, /* each aux buffer has its own depth stencil */
NSOpenGLPFAColorFloat NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 58, /* color buffers store floating point pixels */
NSOpenGLPFAMultisample NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 59, /* choose multisampling */
NSOpenGLPFASupersample NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 60, /* choose supersampling */
NSOpenGLPFASampleAlpha NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 61, /* request alpha filtering */
NSOpenGLPFARendererID NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 70, /* request renderer by ID */
NSOpenGLPFANoRecovery NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 72, /* disable all failure recovery systems */
NSOpenGLPFAAccelerated NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 73, /* choose a hardware accelerated renderer */
NSOpenGLPFAClosestPolicy NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 74, /* choose the closest color buffer to request */
NSOpenGLPFABackingStore NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 76, /* back buffer contents are valid after swap */
NSOpenGLPFAScreenMask NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 84, /* bit mask of supported physical screens */
NSOpenGLPFAAllowOfflineRenderers NS_OPENGL_ENUM_DEPRECATED(10.5, 10.14) = 96, /* allow use of offline renderers */
NSOpenGLPFAAcceleratedCompute NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 97, /* choose a hardware accelerated compute device */
NSOpenGLPFAOpenGLProfile NS_OPENGL_ENUM_DEPRECATED(10.7, 10.14) = 99, /* specify an OpenGL Profile to use */
NSOpenGLPFAVirtualScreenCount NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 128, /* number of virtual screens in this format */
NSOpenGLPFAStereo API_DEPRECATED("", macos(10.0,10.12)) = 6,
NSOpenGLPFAOffScreen API_DEPRECATED("", macos(10.0,10.7)) = 53,
NSOpenGLPFAFullScreen API_DEPRECATED("", macos(10.0,10.6)) = 54,
NSOpenGLPFASingleRenderer API_DEPRECATED("", macos(10.0,10.9)) = 71,
NSOpenGLPFARobust API_DEPRECATED("", macos(10.0,10.5)) = 75,
NSOpenGLPFAMPSafe API_DEPRECATED("", macos(10.0,10.5)) = 78,
NSOpenGLPFAWindow API_DEPRECATED("", macos(10.0,10.9)) = 80,
NSOpenGLPFAMultiScreen API_DEPRECATED("", macos(10.0,10.5)) = 81,
NSOpenGLPFACompliant API_DEPRECATED("", macos(10.0,10.9)) = 83,
NSOpenGLPFAPixelBuffer API_DEPRECATED("", macos(10.3,10.7)) = 90,
NSOpenGLPFARemotePixelBuffer API_DEPRECATED("", macos(10.3,10.7)) = 91,
};
typedef uint32_t NSOpenGLPixelFormatAttribute NS_OPENGL_DEPRECATED(10.0, 10.14);
/* NSOpenGLPFAOpenGLProfile values */
enum {
NSOpenGLProfileVersionLegacy NS_OPENGL_ENUM_DEPRECATED(10.7, 10.14) = 0x1000, /* choose a Legacy/Pre-OpenGL 3.0 Implementation */
NSOpenGLProfileVersion3_2Core NS_OPENGL_ENUM_DEPRECATED(10.7, 10.14) = 0x3200, /* choose an OpenGL 3.2 Core Implementation */
NSOpenGLProfileVersion4_1Core NS_OPENGL_ENUM_DEPRECATED(10.10, 10.14) = 0x4100 /* choose an OpenGL 4.1 Core Implementation */
};
/*
** NSOpenGLPixelFormat interface.
*/
NS_OPENGL_CLASS_DEPRECATED("Please use Metal or MetalKit.", 10.0, 10.14)
@interface NSOpenGLPixelFormat : NSObject <NSCoding>
- (nullable NSOpenGLPixelFormat *)initWithCGLPixelFormatObj:(CGLPixelFormatObj)format API_AVAILABLE(macos(10.6)) NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithAttributes:(const NSOpenGLPixelFormatAttribute *)attribs;
- (nullable id)initWithData:(null_unspecified NSData*)attribs API_DEPRECATED("Use -initWithAttributes: instead", macos(10.0,10.6));
- (null_unspecified NSData*)attributes API_DEPRECATED("", macos(10.0,10.6));
- (void)setAttributes:(null_unspecified NSData*)attribs API_DEPRECATED("", macos(10.0,10.6));
- (void)getValues:(GLint *)vals forAttribute:(NSOpenGLPixelFormatAttribute)attrib forVirtualScreen:(GLint)screen;
@property (readonly) GLint numberOfVirtualScreens;
@property (nullable, readonly) CGLPixelFormatObj CGLPixelFormatObj NS_RETURNS_INNER_POINTER;
@end
/*********************
** NSOpenGLPixelBuffer
*********************/
/* NOTE: PBuffers should be considered deprecated as of 10.7. Use GL_EXT_framebuffer_object instead.
*/
API_DEPRECATED("Use GL_EXT_framebuffer_object instead", macos(10.2,10.7))
@interface NSOpenGLPixelBuffer : NSObject
/*
** size width and height must be powers of two for 1D or 2D or CUBE_MAP targets
** size width and height must also be equal for CUBE_MAP target
** target should be one of GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP or GL_TEXTURE_RECTANGLE_EXT
** internalFormat should be GL_RGB, GL_RGBA or GL_DEPTH_COMPONENT
** maxLevel specifies the desired maximum mipmap level, starting with 0. Must be 0 for
** TEXTURE_RECTANGLE targets.
*/
- (nullable instancetype)initWithTextureTarget:(GLenum)target textureInternalFormat:(GLenum)format textureMaxMipMapLevel:(GLint)maxLevel pixelsWide:(GLsizei)pixelsWide pixelsHigh:(GLsizei)pixelsHigh API_DEPRECATED("", macos(10.2,10.7)); /* Use IOSurface instead of NSOpenGLPixelBuffer on Mac OS 10.7 and newer. */
- (nullable NSOpenGLPixelBuffer *)initWithCGLPBufferObj:(CGLPBufferObj)pbuffer API_DEPRECATED("", macos(10.6,10.7)); /* Use IOSurface instead of NSOpenGLPixelBuffer on Mac OS 10.7 and newer. */
@property (nullable, readonly) CGLPBufferObj CGLPBufferObj NS_RETURNS_INNER_POINTER API_AVAILABLE(macos(10.6)) API_DEPRECATED("", macos(10.6,10.7)); /* Use IOSurface instead of NSOpenGLPixelBuffer on Mac OS 10.7 and newer. */
@property (readonly) GLsizei pixelsWide API_DEPRECATED("", macos(10.2,10.7)); /* Use IOSurface instead of NSOpenGLPixelBuffer on Mac OS 10.7 and newer. */
@property (readonly) GLsizei pixelsHigh API_DEPRECATED("", macos(10.2,10.7)); /* Use IOSurface instead of NSOpenGLPixelBuffer on Mac OS 10.7 and newer. */
@property (readonly) GLenum textureTarget API_DEPRECATED("", macos(10.2,10.7)); /* Use IOSurface instead of NSOpenGLPixelBuffer on Mac OS 10.7 and newer. */
@property (readonly) GLenum textureInternalFormat API_DEPRECATED("", macos(10.2,10.7)); /* Use IOSurface instead of NSOpenGLPixelBuffer on Mac OS 10.7 and newer. */
@property (readonly) GLint textureMaxMipMapLevel API_DEPRECATED("", macos(10.2,10.7)); /* Use IOSurface instead of NSOpenGLPixelBuffer on Mac OS 10.7 and newer. */
@end
/*****************
** NSOpenGLContext
*****************/
/* Parameter names for NSOpenGLContext -setValues:forParameter: and -getValues:forParameter: */
typedef NS_ENUM(NSInteger, NSOpenGLContextParameter) {
NSOpenGLContextParameterSwapInterval NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 222, /* 1 param. 0 -> Don't sync, 1 -> Sync to vertical retrace */
NSOpenGLContextParameterSurfaceOrder NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 235, /* 1 param. 1 -> Above Window (default), -1 -> Below Window */
NSOpenGLContextParameterSurfaceOpacity NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 236, /* 1 param. 1-> Surface is opaque (default), 0 -> non-opaque */
NSOpenGLContextParameterSurfaceBackingSize NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 304, /* 2 params. Width/height of surface backing size */
NSOpenGLContextParameterReclaimResources NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 308, /* 0 params. */
NSOpenGLContextParameterCurrentRendererID NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 309, /* 1 param. Retrieves the current renderer ID */
NSOpenGLContextParameterGPUVertexProcessing NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 310, /* 1 param. Currently processing vertices with GPU (get) */
NSOpenGLContextParameterGPUFragmentProcessing NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 311, /* 1 param. Currently processing fragments with GPU (get) */
NSOpenGLContextParameterHasDrawable NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 314, /* 1 param. Boolean returned if drawable is attached */
NSOpenGLContextParameterMPSwapsInFlight NS_OPENGL_ENUM_DEPRECATED(10.0, 10.14) = 315, /* 1 param. Max number of swaps queued by the MP GL engine */
NSOpenGLContextParameterSwapRectangle API_DEPRECATED("", macos(10.0,10.14)) = 200, /* 4 params. Set or get the swap rectangle {x, y, w, h} */
NSOpenGLContextParameterSwapRectangleEnable API_DEPRECATED("", macos(10.0,10.14)) = 201, /* Enable or disable the swap rectangle */
NSOpenGLContextParameterRasterizationEnable API_DEPRECATED("", macos(10.0,10.14)) = 221, /* Enable or disable all rasterization */
NSOpenGLContextParameterStateValidation API_DEPRECATED("", macos(10.0,10.14)) = 301, /* Validate state for multi-screen functionality */
NSOpenGLContextParameterSurfaceSurfaceVolatile API_DEPRECATED("", macos(10.0,10.14)) = 306, /* 1 param. Surface volatile state */
} NS_OPENGL_DEPRECATED(10.0, 10.14);
NS_OPENGL_CLASS_DEPRECATED("Please use Metal or MetalKit.", 10.0, 10.14)
@interface NSOpenGLContext : NSObject <NSLocking>
/* Context creation */
- (nullable instancetype)initWithFormat:(NSOpenGLPixelFormat *)format shareContext:(nullable NSOpenGLContext *)share;
- (nullable NSOpenGLContext *)initWithCGLContextObj:(CGLContextObj)context API_AVAILABLE(macos(10.6));
@property (readonly, strong) NSOpenGLPixelFormat *pixelFormat API_AVAILABLE(macos(10.10));
/* Drawable management */
@property (nullable, weak) NSView *view NS_SWIFT_UI_ACTOR API_DEPRECATED("", macos(10.0,10.14));
- (void)setView:(nullable NSView *)view NS_SWIFT_UI_ACTOR API_DEPRECATED("Use NSOpenGLView to provide OpenGL content in a Cocoa app.", macos(10.0,10.14));
- (void)setFullScreen API_DEPRECATED("Use a fullscreen NSOpenGLView instead", macos(10.0,10.7));
/* Deprecated in 10.7. The -setOffScreen:width:height:rowbytes: API forces use of the software rasterizer, which is much slower than GPU rendering. It is generally much better nowadays to use a normal pixel format with either an off-screen window or an FBO (GL_EXT_framebuffer_object), and then call glReadPixels() to read the rendered result back to CPU memory (if that's where it is needed).
*/
- (void)setOffScreen:(void *)baseaddr width:(GLsizei)width height:(GLsizei)height rowbytes:(GLint)rowbytes API_DEPRECATED("", macos(10.0,10.7));
- (void)clearDrawable;
- (void)update NS_SWIFT_UI_ACTOR;
/* Flush draw buffer */
- (void)flushBuffer;
/* Current context control */
- (void)makeCurrentContext;
+ (void)clearCurrentContext;
@property (class, readonly, nullable, strong) NSOpenGLContext *currentContext;
/* Copy attributes from another context */
- (void)copyAttributesFromContext:(NSOpenGLContext *)context withMask:(GLbitfield)mask API_DEPRECATED("", macos(10.0,10.8));
/* Context Parameter handling */
- (void)setValues:(const GLint *)vals forParameter:(NSOpenGLContextParameter)param;
- (void)getValues:(GLint *)vals forParameter:(NSOpenGLContextParameter)param;
/* virtual screens */
@property GLint currentVirtualScreen;
/* creating textures */
- (void)createTexture:(GLenum)target fromView:(NSView *)view internalFormat:(GLenum)format API_DEPRECATED("", macos(10.2,10.8));
@property (nullable, readonly) CGLContextObj CGLContextObj NS_RETURNS_INNER_POINTER;
@end
@interface NSOpenGLContext (NSOpenGLPixelBuffer)
/*
** NOTE: PBuffers have been Deprecated as of 10.7. Use GL_EXT_framebuffer_object instead.
**
** Attach context to an NSOpenGLPixelBuffer instance.
** For GL_CUBE_MAP target pixel buffers, face should be one of GL_TEXTURE_CUBE_MAP_POSITIVE_X,
** GL_TEXTURE_CUBE_MAP_POSITIVE_Y, etc. Otherwise it should be 0.
** Level specifies the desired mipmap level you want to render to. It must less than or equal to the maxLevel
** parameter of the pixel buffer.
** If applicable, the virtual screen should be set to the same value as the current virtual screen you are using
** to render on-screen with.
*/
- (void)setPixelBuffer:(NSOpenGLPixelBuffer *)pixelBuffer cubeMapFace:(GLenum)face mipMapLevel:(GLint)level currentVirtualScreen:(GLint)screen API_DEPRECATED("", macos(10.3,10.7)); /* Use IOSurface instead of NSOpenGLPixelBuffer on Mac OS 10.7 and newer. */
- (nullable NSOpenGLPixelBuffer *)pixelBuffer API_DEPRECATED("", macos(10.3,10.7)); /* Use IOSurface instead of NSOpenGLPixelBuffer on Mac OS 10.7 and newer. */
- (GLenum)pixelBufferCubeMapFace API_DEPRECATED("", macos(10.3,10.7)); /* Use IOSurface instead of NSOpenGLPixelBuffer on Mac OS 10.7 and newer. */
- (GLint)pixelBufferMipMapLevel API_DEPRECATED("", macos(10.3,10.7)); /* Use IOSurface instead of NSOpenGLPixelBuffer on Mac OS 10.7 and newer. */
/*
** NOTE: PBuffers have been Deprecated as of 10.7. Use GL_EXT_framebuffer_object instead.
**
** This call is a mirror of CGLTexImagePBuffer. This essentially "binds" the given pixel buffer's image data
** to the currently bound texture object. Source specifies which of the PBuffer's color buffers should be used,
** and should be one of GL_FRONT, GL_BACK, GL_AUX0, etc.
*/
- (void)setTextureImageToPixelBuffer:(NSOpenGLPixelBuffer *)pixelBuffer colorBuffer:(GLenum)source API_DEPRECATED("", macos(10.3,10.7)); /* Use IOSurface instead of NSOpenGLPixelBuffer on Mac OS 10.7 and newer. */
@end
static const NSOpenGLContextParameter NSOpenGLCPSwapInterval API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterSwapInterval", macos(10.5,10.14)) = NSOpenGLContextParameterSwapInterval;
static const NSOpenGLContextParameter NSOpenGLCPSurfaceOrder API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterSurfaceOrder", macos(10.0,10.14)) = NSOpenGLContextParameterSurfaceOrder;
static const NSOpenGLContextParameter NSOpenGLCPSurfaceOpacity API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterSurfaceOpacity", macos(10.0,10.14)) = NSOpenGLContextParameterSurfaceOpacity;
static const NSOpenGLContextParameter NSOpenGLCPSurfaceBackingSize API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterSurfaceBackingSize", macos(10.0,10.14)) = NSOpenGLContextParameterSurfaceBackingSize;
static const NSOpenGLContextParameter NSOpenGLCPReclaimResources API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterReclaimResources", macos(10.0,10.14)) = NSOpenGLContextParameterReclaimResources;
static const NSOpenGLContextParameter NSOpenGLCPCurrentRendererID API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterCurrentRendererID", macos(10.0,10.14)) = NSOpenGLContextParameterCurrentRendererID;
static const NSOpenGLContextParameter NSOpenGLCPGPUVertexProcessing API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterGPUVertexProcessing", macos(10.0,10.14)) = NSOpenGLContextParameterGPUVertexProcessing;
static const NSOpenGLContextParameter NSOpenGLCPGPUFragmentProcessing API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterGPUFragmentProcessing", macos(10.0,10.14)) = NSOpenGLContextParameterGPUFragmentProcessing;
static const NSOpenGLContextParameter NSOpenGLCPHasDrawable API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterHasDrawable", macos(10.0,10.14)) = NSOpenGLContextParameterHasDrawable;
static const NSOpenGLContextParameter NSOpenGLCPMPSwapsInFlight API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterMPSwapsInFlight", macos(10.0,10.14)) = NSOpenGLContextParameterMPSwapsInFlight;
static const NSOpenGLContextParameter NSOpenGLCPSwapRectangle API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterSwapRectangle", macos(10.0,10.14)) = NSOpenGLContextParameterSwapRectangle;
static const NSOpenGLContextParameter NSOpenGLCPSwapRectangleEnable API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterSwapRectangleEnable", macos(10.0,10.14)) = NSOpenGLContextParameterSwapRectangleEnable;
static const NSOpenGLContextParameter NSOpenGLCPRasterizationEnable API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterRasterizationEnable", macos(10.0,10.14)) = NSOpenGLContextParameterRasterizationEnable;
static const NSOpenGLContextParameter NSOpenGLCPStateValidation API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterStateValidation", macos(10.0,10.14)) = NSOpenGLContextParameterStateValidation;
static const NSOpenGLContextParameter NSOpenGLCPSurfaceSurfaceVolatile API_DEPRECATED_WITH_REPLACEMENT("NSOpenGLContextParameterSurfaceSurfaceVolatile", macos(10.0,10.14)) = NSOpenGLContextParameterSurfaceSurfaceVolatile;
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/NSDiffableDataSource.h | /*
NSDiffableDataSource.h
Application Kit
Copyright (c) 2019-2021, Apple Inc.
All rights reserved.
*/
#import <TargetConditionals.h>
#if !TARGET_OS_IPHONE
#import <AppKit/NSCollectionView.h>
NS_ASSUME_NONNULL_BEGIN
/* An NSDiffableDataSourceSnapshot represents the complete state of a UI element (e.g. NSCollectionView)
Snapshots can be created in two ways:
1. From a connected data source: e.g. `[diffableDataSource snapshot]`
This will contain the current state of the UI element.
2. Constructing a new instance: e.g. `[[NSDiffableDataSourceSnapshot<Int,UUID> alloc] init]`
This will construct an empty snapshot with no section or item identifiers.
Notes:
1. All identifiers must be unique. Section and Item identifiers do not overlap and may contain values that exist in the other (i.e. it is OK
to have a section identifier == 1 and an item identifier == 1)
2. If you pass duplicate values in an item or section array (e.g. `-appendItemsWithIdentifiers:`), the system will throw an exception.
*/
API_AVAILABLE(macos(10.15),ios(13.0),tvos(13.0),watchos(6.0))
@interface NSDiffableDataSourceSnapshot<SectionIdentifierType,ItemIdentifierType> : NSObject<NSCopying>
// structure
@property(nonatomic,readonly) NSInteger numberOfItems;
@property(nonatomic,readonly) NSInteger numberOfSections;
@property(nonatomic,readonly) NSArray<SectionIdentifierType> *sectionIdentifiers;
@property(nonatomic,readonly) NSArray<ItemIdentifierType> *itemIdentifiers;
- (NSInteger)numberOfItemsInSection:(SectionIdentifierType)sectionIdentifier;
- (NSArray<ItemIdentifierType> *)itemIdentifiersInSectionWithIdentifier:(SectionIdentifierType)sectionIdentifier;
- (nullable SectionIdentifierType)sectionIdentifierForSectionContainingItemIdentifier:(ItemIdentifierType)itemIdentifier;
- (NSInteger)indexOfItemIdentifier:(ItemIdentifierType)itemIdentifier; // If item identifier is not present returns NSNotFound
- (NSInteger)indexOfSectionIdentifier:(SectionIdentifierType)sectionIdentifier; // If section identifier is not present returns NSNotFound
// items operations
- (void)appendItemsWithIdentifiers:(NSArray<ItemIdentifierType> *)identifiers; // convenience: appends into last section
- (void)appendItemsWithIdentifiers:(NSArray<ItemIdentifierType> *)identifiers intoSectionWithIdentifier:(SectionIdentifierType)sectionIdentifier;
- (void)insertItemsWithIdentifiers:(NSArray<ItemIdentifierType> *)identifiers beforeItemWithIdentifier:(ItemIdentifierType)itemIdentifier;
- (void)insertItemsWithIdentifiers:(NSArray<ItemIdentifierType> *)identifiers afterItemWithIdentifier:(ItemIdentifierType)itemIdentifier;
- (void)deleteItemsWithIdentifiers:(NSArray<ItemIdentifierType> *)identifiers;
- (void)deleteAllItems;
- (void)moveItemWithIdentifier:(ItemIdentifierType)fromIdentifier beforeItemWithIdentifier:(ItemIdentifierType)toIdentifier;
- (void)moveItemWithIdentifier:(ItemIdentifierType)fromIdentifier afterItemWithIdentifier:(ItemIdentifierType)toIdentifier;
- (void)reloadItemsWithIdentifiers:(NSArray<ItemIdentifierType>*)identifiers;
// section operations
- (void)appendSectionsWithIdentifiers:(NSArray*)sectionIdentifiers;
- (void)insertSectionsWithIdentifiers:(NSArray<SectionIdentifierType> *)sectionIdentifiers beforeSectionWithIdentifier:(SectionIdentifierType)toSectionIdentifier;
- (void)insertSectionsWithIdentifiers:(NSArray<SectionIdentifierType> *)sectionIdentifiers afterSectionWithIdentifier:(SectionIdentifierType)toSectionIdentifier;
- (void)deleteSectionsWithIdentifiers:(NSArray<SectionIdentifierType> *)sectionIdentifiers;
- (void)moveSectionWithIdentifier:(SectionIdentifierType)fromSectionIdentifier beforeSectionWithIdentifier:(SectionIdentifierType)toSectionIdentifier;
- (void)moveSectionWithIdentifier:(SectionIdentifierType)fromSectionIdentifier afterSectionWithIdentifier:(SectionIdentifierType)toSectionIdentifier;
- (void)reloadSectionsWithIdentifiers:(NSArray<SectionIdentifierType>*)sectionIdentifiers;
@end
/* NSCollectionViewDiffableDataSource offers an identifier-based interface for providing an NSCollectionView's content. It automatically performs the inserts, deletes, and moves necessary to transition an NSCollectionView from one model-state snapshot to another.
*/
API_AVAILABLE(macos(10.15))
@interface NSCollectionViewDiffableDataSource<SectionIdentifierType,ItemIdentifierType> : NSObject<NSCollectionViewDataSource>
typedef NSCollectionViewItem * _Nullable (^NSCollectionViewDiffableDataSourceItemProvider)(NSCollectionView * _Nonnull, NSIndexPath * _Nonnull, ItemIdentifierType _Nonnull);
typedef NSView * _Nullable (^NSCollectionViewDiffableDataSourceSupplementaryViewProvider)(NSCollectionView* _Nonnull, NSString * _Nonnull, NSIndexPath * _Nonnull);
/* Creates a new NSCollectionViewDiffableDataSource that automatically wires itself up as the given `collectionView`'s `dataSource`. The data source is initially empty. To put items into the `collectionView`, you must create an NSDiffableDataSourceSnapshot, add the desired section and item identifiers to the snapshot, and apply the snapshot to the diffable data source. The required `itemProvider` closure serves the same purpose as NSCollectionViewDataSource `-collectionView:itemForRepresentedObjectAtIndexPath:` method: Its job is to ask the `collectionView` to make an item of the desired type, configure its content and appearance to represent the model object specified by the given identifier and NSIndexPath, and return the configured item.
*/
- (instancetype)initWithCollectionView:(NSCollectionView*)collectionView itemProvider:(NSCollectionViewDiffableDataSourceItemProvider)itemProvider;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
// Create a mutable "snapshot" of the data source state.
// This can be mutated via transactional updates which, when completed, can be "applied" back to a connected data source
- (NSDiffableDataSourceSnapshot<SectionIdentifierType,ItemIdentifierType>*)snapshot;
// Apply a snapshot to the connected data source.
// To perform an animated diff of the changes: animatingDifferences == YES
// For non-animated update (i.e. reloadData) without the diff overhead: animatingDifferences == NO
- (void)applySnapshot:(NSDiffableDataSourceSnapshot<SectionIdentifierType,ItemIdentifierType> *)snapshot animatingDifferences:(BOOL)animatingDifferences;
// IndexPath <-> item identifier conversion
- (nullable ItemIdentifierType)itemIdentifierForIndexPath:(NSIndexPath *)indexPath;
- (nullable NSIndexPath *)indexPathForItemIdentifier:(ItemIdentifierType)identifier;
@property(copy,nullable) NSCollectionViewDiffableDataSourceSupplementaryViewProvider supplementaryViewProvider;
@end
NS_ASSUME_NONNULL_END
#endif
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTextCheckingController.h | /*
NSTextCheckingController.h
Application Kit
Copyright (c) 2018-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSRange.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSValue.h>
#import <Foundation/NSString.h>
#import <Foundation/NSAttributedString.h>
#import <Foundation/NSTextCheckingResult.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSSpellChecker.h>
#import <AppKit/NSTextCheckingClient.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
API_AVAILABLE(macos(10.15))
@interface NSTextCheckingController : NSObject
- (instancetype)initWithClient:(id <NSTextCheckingClient>)client NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE; // Use the designated initializer initWithClient:
// The client, typically an NSView, retains its controller instance; the controller doesn't retain its client.
@property (readonly) id <NSTextCheckingClient> client;
// Disconnects the controller from its client and renders the controller incapable of further action.
- (void)invalidate;
// To be called after text is changed.
- (void)didChangeTextInRange:(NSRange)range;
// To be called when user input has inserted text.
- (void)insertedTextInRange:(NSRange)range;
// To be called when the selection changes.
- (void)didChangeSelectedRange;
// To be called when the client wants the controller to ensure that a particular range of text should be scheduled to undergo any needed automatic checking.
- (void)considerTextCheckingForRange:(NSRange)range;
// Manually causes checking to be started immediately for a specified range.
- (void)checkTextInRange:(NSRange)range types:(NSTextCheckingTypes)checkingTypes options:(NSDictionary<NSTextCheckingOptionKey, id> *)options;
// Methods to be used to implement various menu actions.
- (void)checkTextInSelection:(nullable id)sender;
- (void)checkTextInDocument:(nullable id)sender;
- (void)orderFrontSubstitutionsPanel:(nullable id)sender;
- (void)checkSpelling:(nullable id)sender;
- (void)showGuessPanel:(nullable id)sender;
- (void)changeSpelling:(nullable id)sender;
- (void)ignoreSpelling:(nullable id)sender;
// To be called if Touch Bar candidates need to be updated for some reason other than change in text or selection.
- (void)updateCandidates;
// Gives a list of the annotation keys that the controller uses.
- (NSArray<NSAttributedStringKey> *)validAnnotations;
// Gives contextual menu items related to text checking that are specific to the given index in the text. The client should add these before any standard contextual menu items. If the click was not on the selection, this method may also provide a new effective range for the contextual menu to operate on.
- (nullable NSMenu *)menuAtIndex:(NSUInteger)location clickedOnSelection:(BOOL)clickedOnSelection effectiveRange:(NSRangePointer)effectiveRange;
// The controller will automatically generate a spellchecker document tag for the client. With this property the client can obtain the tag to use as needed, or set its own choice of tag.
@property NSInteger spellCheckerDocumentTag;
@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/NSSliderCell.h | /*
NSSliderCell.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSActionCell.h>
#import <AppKit/AppKitDefines.h>
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
typedef NS_ENUM(NSUInteger, NSTickMarkPosition) {
NSTickMarkPositionBelow = 0,
NSTickMarkPositionAbove = 1,
NSTickMarkPositionLeading = NSTickMarkPositionAbove,
NSTickMarkPositionTrailing = NSTickMarkPositionBelow
};
typedef NS_ENUM(NSUInteger, NSSliderType) {
NSSliderTypeLinear = 0,
NSSliderTypeCircular = 1,
};
@interface NSSliderCell : NSActionCell
@property (class, readonly) BOOL prefersTrackingUntilMouseUp;
@property double minValue;
@property double maxValue;
@property double altIncrementValue;
@property NSSliderType sliderType;
@property (readwrite, getter=isVertical) BOOL vertical API_AVAILABLE(macos(10.11));
@property (readonly) NSRect trackRect;
@property (readonly) CGFloat knobThickness;
- (NSRect)knobRectFlipped:(BOOL)flipped;
- (NSRect)barRectFlipped:(BOOL)flipped API_AVAILABLE(macos(10.9));
- (void)drawKnob:(NSRect)knobRect;
- (void)drawKnob;
- (void)drawBarInside:(NSRect)rect flipped:(BOOL)flipped;
@end
@interface NSSliderCell (NSSliderCellVerticalGetter)
@property (readonly, getter=isVertical) BOOL vertical API_AVAILABLE(macos(10.0));
@end
@interface NSSliderCell(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;
- (void)drawTickMarks API_AVAILABLE(macos(10.9));
@end
@interface NSSliderCell (NSDeprecated)
- (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
static const NSTickMarkPosition NSTickMarkBelow API_DEPRECATED_WITH_REPLACEMENT("NSTickMarkPositionBelow", macos(10.0,10.12)) = NSTickMarkPositionBelow;
static const NSTickMarkPosition NSTickMarkAbove API_DEPRECATED_WITH_REPLACEMENT("NSTickMarkPositionAbove", macos(10.0,10.12)) = NSTickMarkPositionAbove;
static const NSTickMarkPosition NSTickMarkLeft API_DEPRECATED_WITH_REPLACEMENT("NSTickMarkPositionLeading", macos(10.0,10.12)) = NSTickMarkPositionLeading;
static const NSTickMarkPosition NSTickMarkRight API_DEPRECATED_WITH_REPLACEMENT("NSTickMarkPositionTrailing", macos(10.0,10.12)) = NSTickMarkPositionTrailing;
static const NSSliderType NSLinearSlider API_DEPRECATED_WITH_REPLACEMENT("NSSliderTypeLinear", macos(10.0,10.12)) = NSSliderTypeLinear;
static const NSSliderType NSCircularSlider API_DEPRECATED_WITH_REPLACEMENT("NSSliderTypeCircular", macos(10.0,10.12)) = NSSliderTypeCircular;
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/NSLayoutConstraint.h | /*
NSLayoutConstraint.h
Application Kit
Copyright (c) 2009-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSWindow.h>
#import <AppKit/NSControl.h>
#import <AppKit/NSView.h>
#import <AppKit/NSAnimation.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <AppKit/NSLayoutAnchor.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
#if !TARGET_OS_IPHONE
/* Where AppKit's use of priority levels interacts with the user's use, we must define the priority levels involved. Note that most of the time there is no interaction. The use of priority levels is likely to be local to one sub-area of the window that is under the control of one author.
*/
typedef float NSLayoutPriority NS_TYPED_EXTENSIBLE_ENUM API_AVAILABLE(macos(10.7));
static const NSLayoutPriority NSLayoutPriorityRequired API_AVAILABLE(macos(10.7)) = 1000; // a required constraint. Do not exceed this.
static const NSLayoutPriority NSLayoutPriorityDefaultHigh API_AVAILABLE(macos(10.7)) = 750; // this is the priority level with which a button resists compressing its content. Note that it is higher than NSLayoutPriorityWindowSizeStayPut. Thus dragging to resize a window will not make buttons clip. Rather the window frame is constrained.
static const NSLayoutPriority NSLayoutPriorityDragThatCanResizeWindow API_AVAILABLE(macos(10.7)) = 510; // This is the appropriate priority level for a drag that may end up resizing the window. This needn't be a drag whose explicit purpose is to resize the window. The user might be dragging around window contents, and it might be desirable that the window get bigger to accommodate.
static const NSLayoutPriority NSLayoutPriorityWindowSizeStayPut API_AVAILABLE(macos(10.7)) = 500; // This is the priority level at which the window prefers to stay the same size. It's generally not appropriate to make a constraint at exactly this priority. You want to be higher or lower.
static const NSLayoutPriority NSLayoutPriorityDragThatCannotResizeWindow API_AVAILABLE(macos(10.7)) = 490; // This is the priority level at which a split view divider, say, is dragged. It won't resize the window.
static const NSLayoutPriority NSLayoutPriorityDefaultLow API_AVAILABLE(macos(10.7)) = 250; // this is the priority level at which a button hugs its contents horizontally.
static const NSLayoutPriority NSLayoutPriorityFittingSizeCompression API_AVAILABLE(macos(10.7)) = 50; // When you issue -[NSView fittingSize], the smallest size that is large enough for the view's contents is computed. This is the priority level with which the view wants to be as small as possible in that computation. It's quite low. It is generally not appropriate to make a constraint at exactly this priority. You want to be higher or lower.
typedef NS_ENUM(NSInteger, NSLayoutConstraintOrientation) {
NSLayoutConstraintOrientationHorizontal = 0,
NSLayoutConstraintOrientationVertical = 1
};
#if __cplusplus
#define NSLAYOUTCONSTRAINT_EXTERN extern "C" __attribute((visibility("default")))
#else
#define NSLAYOUTCONSTRAINT_EXTERN extern __attribute((visibility("default")))
#endif
typedef NS_ENUM(NSInteger, NSLayoutRelation) {
NSLayoutRelationLessThanOrEqual = -1,
NSLayoutRelationEqual = 0,
NSLayoutRelationGreaterThanOrEqual = 1,
};
typedef NS_ENUM(NSInteger, NSLayoutAttribute) {
NSLayoutAttributeLeft = 1,
NSLayoutAttributeRight,
NSLayoutAttributeTop,
NSLayoutAttributeBottom,
NSLayoutAttributeLeading,
NSLayoutAttributeTrailing,
NSLayoutAttributeWidth,
NSLayoutAttributeHeight,
NSLayoutAttributeCenterX,
NSLayoutAttributeCenterY,
NSLayoutAttributeLastBaseline,
#if TARGET_OS_IPHONE
NSLayoutAttributeBaseline NS_SWIFT_UNAVAILABLE("Use 'lastBaseline' instead") = NSLayoutAttributeLastBaseline,
#else
NSLayoutAttributeBaseline = NSLayoutAttributeLastBaseline,
#endif
NSLayoutAttributeFirstBaseline API_AVAILABLE(macos(10.11), ios(8.0)),
#if TARGET_OS_IPHONE
NSLayoutAttributeLeftMargin API_AVAILABLE(ios(8.0)),
NSLayoutAttributeRightMargin API_AVAILABLE(ios(8.0)),
NSLayoutAttributeTopMargin API_AVAILABLE(ios(8.0)),
NSLayoutAttributeBottomMargin API_AVAILABLE(ios(8.0)),
NSLayoutAttributeLeadingMargin API_AVAILABLE(ios(8.0)),
NSLayoutAttributeTrailingMargin API_AVAILABLE(ios(8.0)),
NSLayoutAttributeCenterXWithinMargins API_AVAILABLE(ios(8.0)),
NSLayoutAttributeCenterYWithinMargins API_AVAILABLE(ios(8.0)),
#endif
NSLayoutAttributeNotAnAttribute = 0
};
typedef NS_OPTIONS(NSUInteger, NSLayoutFormatOptions) {
NSLayoutFormatAlignAllLeft = (1 << NSLayoutAttributeLeft),
NSLayoutFormatAlignAllRight = (1 << NSLayoutAttributeRight),
NSLayoutFormatAlignAllTop = (1 << NSLayoutAttributeTop),
NSLayoutFormatAlignAllBottom = (1 << NSLayoutAttributeBottom),
NSLayoutFormatAlignAllLeading = (1 << NSLayoutAttributeLeading),
NSLayoutFormatAlignAllTrailing = (1 << NSLayoutAttributeTrailing),
NSLayoutFormatAlignAllCenterX = (1 << NSLayoutAttributeCenterX),
NSLayoutFormatAlignAllCenterY = (1 << NSLayoutAttributeCenterY),
NSLayoutFormatAlignAllLastBaseline = (1 << NSLayoutAttributeLastBaseline),
NSLayoutFormatAlignAllFirstBaseline API_AVAILABLE(macos(10.11), ios(8.0)) = (1 << NSLayoutAttributeFirstBaseline),
#if TARGET_OS_IPHONE
NSLayoutFormatAlignAllBaseline NS_SWIFT_UNAVAILABLE("Use 'alignAllLastBaseline' instead") = NSLayoutFormatAlignAllLastBaseline,
#else
NSLayoutFormatAlignAllBaseline = NSLayoutFormatAlignAllLastBaseline,
#endif
NSLayoutFormatAlignmentMask = 0xFFFF,
/* choose only one of these three
*/
NSLayoutFormatDirectionLeadingToTrailing = 0 << 16, // default
NSLayoutFormatDirectionLeftToRight = 1 << 16,
NSLayoutFormatDirectionRightToLeft = 2 << 16,
NSLayoutFormatDirectionMask = 0x3 << 16,
#if TARGET_OS_IPHONE
/* choose only one spacing format
*/
NSLayoutFormatSpacingEdgeToEdge API_AVAILABLE(ios(11.0),tvos(11.0)) = 0 << 19, // default
/* Valid only for vertical layouts. Between views with text content the value
will be used to determine the distance from the last baseline of the view above
to the first baseline of the view below. For views without text content the top
or bottom edge will be used in lieu of the baseline position.
The default spacing "]-[" will be determined from the line heights of the fonts
involved in views with text content, when present.
*/
NSLayoutFormatSpacingBaselineToBaseline API_AVAILABLE(ios(11.0),tvos(11.0)) = 1 << 19,
NSLayoutFormatSpacingMask API_AVAILABLE(ios(11.0),tvos(11.0)) = 0x1 << 19,
#endif
};
NSLAYOUTCONSTRAINT_EXTERN API_AVAILABLE(macos(10.7), ios(6.0), tvos(9.0))
@interface NSLayoutConstraint : NSObject
/* Create an array of constraints using an ASCII-art-like visual format string. The values of the `metrics` dictionary should be NSNumber (or some other type that responds to -doubleValue and returns a double).
*/
+ (NSArray<NSLayoutConstraint *> *)constraintsWithVisualFormat:(NSString *)format options:(NSLayoutFormatOptions)opts metrics:(nullable NSDictionary<NSString *, id> *)metrics views:(NSDictionary<NSString *, id> *)views API_AVAILABLE(macos(10.7), ios(6.0), tvos(9.0));
/* This macro is a helper for making view dictionaries for +constraintsWithVisualFormat:options:metrics:views:.
NSDictionaryOfVariableBindings(v1, v2, v3) is equivalent to [NSDictionary dictionaryWithObjectsAndKeys:v1, @"v1", v2, @"v2", v3, @"v3", nil];
*/
#define NSDictionaryOfVariableBindings(...) _NSDictionaryOfVariableBindings(@"" # __VA_ARGS__, __VA_ARGS__, nil)
NSLAYOUTCONSTRAINT_EXTERN NSDictionary<NSString *, id> *_NSDictionaryOfVariableBindings(NSString *commaSeparatedKeysString, __nullable id firstValue, ...) API_AVAILABLE(macos(10.7), ios(6.0)); // not for direct use
/* Create constraints explicitly. Constraints are of the form "view1.attr1 = view2.attr2 * multiplier + constant"
If your equation does not have a second view and attribute, use nil and NSLayoutAttributeNotAnAttribute.
Use of this method is not recommended. Constraints should be created using anchor objects on views and layout guides.
*/
+ (instancetype)constraintWithItem:(id)view1 attribute:(NSLayoutAttribute)attr1 relatedBy:(NSLayoutRelation)relation toItem:(nullable id)view2 attribute:(NSLayoutAttribute)attr2 multiplier:(CGFloat)multiplier constant:(CGFloat)c API_AVAILABLE(macos(10.7), ios(6.0), tvos(9.0));
/* If a constraint's priority level is less than required, then it is optional. Higher priority constraints are met before lower priority constraints.
Constraint satisfaction is not all or nothing. If a constraint 'a == b' is optional, that means we will attempt to minimize 'abs(a-b)'.
This property may only be modified as part of initial set up or when optional. After a constraint has been added to a view, an exception will be thrown if the priority is changed from/to NSLayoutPriorityRequired.
*/
#if TARGET_OS_IPHONE
@property UILayoutPriority priority;
#else
@property NSLayoutPriority priority;
#endif
/* When a view is archived, it archives some but not all constraints in its -constraints array. The value of shouldBeArchived informs the view if a particular constraint should be archived by the view.
If a constraint is created at runtime in response to the state of the object, it isn't appropriate to archive the constraint - rather you archive the state that gives rise to the constraint. Since the majority of constraints that should be archived are created in Interface Builder (which is smart enough to set this prop to YES), the default value for this property is NO.
*/
@property BOOL shouldBeArchived;
/* accessors
firstItem.firstAttribute {==,<=,>=} secondItem.secondAttribute * multiplier + constant
Access to these properties is not recommended. Use the `firstAnchor` and `secondAnchor` properties instead.
*/
@property (nullable, readonly, assign) id firstItem;
@property (nullable, readonly, assign) id secondItem;
@property (readonly) NSLayoutAttribute firstAttribute;
@property (readonly) NSLayoutAttribute secondAttribute;
/* accessors
firstAnchor{==,<=,>=} secondAnchor * multiplier + constant
*/
@property (readonly, copy) NSLayoutAnchor *firstAnchor API_AVAILABLE(macos(10.12), ios(10.0));
@property (readonly, copy, nullable) NSLayoutAnchor *secondAnchor API_AVAILABLE(macos(10.12), ios(10.0));
@property (readonly) NSLayoutRelation relation;
@property (readonly) CGFloat multiplier;
/* Unlike the other properties, the constant may be modified after constraint creation. Setting the constant on an existing constraint performs much better than removing the constraint and adding a new one that's just like the old but for having a new constant.
*/
@property CGFloat constant;
/* The receiver may be activated or deactivated by manipulating this property. Only active constraints affect the calculated layout. Attempting to activate a constraint whose items have no common ancestor will cause an exception to be thrown. Defaults to NO for newly created constraints. */
@property (getter=isActive) BOOL active API_AVAILABLE(macos(10.10), ios(8.0));
/* Convenience method that activates each constraint in the contained array, in the same manner as setting active=YES. This is often more efficient than activating each constraint individually. */
+ (void)activateConstraints:(NSArray<NSLayoutConstraint *> *)constraints API_AVAILABLE(macos(10.10), ios(8.0));
/* Convenience method that deactivates each constraint in the contained array, in the same manner as setting active=NO. This is often more efficient than deactivating each constraint individually. */
+ (void)deactivateConstraints:(NSArray<NSLayoutConstraint *> *)constraints API_AVAILABLE(macos(10.10), ios(8.0));
@end
@interface NSLayoutConstraint (NSIdentifier)
/* For ease in debugging, name a constraint by setting its identifier, which will be printed in the constraint's description.
Identifiers starting with NS or UI are reserved by the system.
*/
@property (nullable, copy) NSString *identifier API_AVAILABLE(macos(10.7), ios(7.0));
@end
@interface NSLayoutConstraint () <NSAnimatablePropertyContainer>
@end
#pragma mark Installing Constraints
/* A constraint is typically installed on the closest common ancestor of the views involved in the constraint.
It is required that a constraint be installed on _a_ common ancestor of every view involved. The numbers in a constraint are interpreted in the coordinate system of the view it is installed on. A view is considered to be an ancestor of itself (as with other NSView API).
*/
@interface NSView (NSConstraintBasedLayoutInstallingConstraints)
/*
These properties aid concise creation of simple constraints. Views can be constrained using simple code like the following:
[view.topAnchor constraintEqualToAnchor:otherView.bottomAnchor constant:10].active=YES;
See NSLayoutAnchor.h for more details.
*/
@property (readonly, strong) NSLayoutXAxisAnchor *leadingAnchor API_AVAILABLE(macos(10.11));
@property (readonly, strong) NSLayoutXAxisAnchor *trailingAnchor API_AVAILABLE(macos(10.11));
@property (readonly, strong) NSLayoutXAxisAnchor *leftAnchor API_AVAILABLE(macos(10.11));
@property (readonly, strong) NSLayoutXAxisAnchor *rightAnchor API_AVAILABLE(macos(10.11));
@property (readonly, strong) NSLayoutYAxisAnchor *topAnchor API_AVAILABLE(macos(10.11));
@property (readonly, strong) NSLayoutYAxisAnchor *bottomAnchor API_AVAILABLE(macos(10.11));
@property (readonly, strong) NSLayoutDimension *widthAnchor API_AVAILABLE(macos(10.11));
@property (readonly, strong) NSLayoutDimension *heightAnchor API_AVAILABLE(macos(10.11));
@property (readonly, strong) NSLayoutXAxisAnchor *centerXAnchor API_AVAILABLE(macos(10.11));
@property (readonly, strong) NSLayoutYAxisAnchor *centerYAnchor API_AVAILABLE(macos(10.11));
@property (readonly, strong) NSLayoutYAxisAnchor *firstBaselineAnchor API_AVAILABLE(macos(10.11));
@property (readonly, strong) NSLayoutYAxisAnchor *lastBaselineAnchor API_AVAILABLE(macos(10.11));
@property (readonly, copy) NSArray<NSLayoutConstraint *> *constraints API_AVAILABLE(macos(10.7)); // This property is deprecated and should be avoided. Instead, create IB outlets or otherwise maintain references to constraints you need to reference directly.
- (void)addConstraint:(NSLayoutConstraint *)constraint API_AVAILABLE(macos(10.7)); // This method is deprecated and should be avoided. Instead, set NSLayoutConstraint's active property to YES.
- (void)addConstraints:(NSArray<NSLayoutConstraint *> *)constraints API_AVAILABLE(macos(10.7)); // This method is deprecated and should be avoided. Instead use +[NSLayoutConstraint activateConstraints:].
- (void)removeConstraint:(NSLayoutConstraint *)constraint API_AVAILABLE(macos(10.7)); // This method is deprecated and should be avoided. Instead set NSLayoutConstraint's active property to NO.
- (void)removeConstraints:(NSArray<NSLayoutConstraint *> *)constraints API_AVAILABLE(macos(10.7)); // This method is deprecated and should be avoided. Instead use +[NSLayoutConstraint deactivateConstraints:].
@end
#endif // !TARGET_OS_IPHONE
#pragma mark Core Layout Methods
/* To render a window, the following passes will occur, if necessary.
update constraints
layout
display
Please see the conceptual documentation for a discussion of these methods.
*/
@interface NSWindow (NSConstraintBasedLayoutCoreMethods)
- (void)updateConstraintsIfNeeded API_AVAILABLE(macos(10.7));
- (void)layoutIfNeeded API_AVAILABLE(macos(10.7));
@end
@interface NSView (NSConstraintBasedLayoutCoreMethods)
- (void)updateConstraintsForSubtreeIfNeeded API_AVAILABLE(macos(10.7));
- (void)updateConstraints API_AVAILABLE(macos(10.7)) NS_REQUIRES_SUPER;
@property BOOL needsUpdateConstraints API_AVAILABLE(macos(10.7));
@end
#pragma mark Compatibility and Adoption
@interface NSView (NSConstraintBasedCompatibility)
/* by default, the autoresizing mask on a view gives rise to constraints that fully determine the view's position. To do anything interesting with constraints, you need to turn that off. IB will turn it off.
*/
@property BOOL translatesAutoresizingMaskIntoConstraints API_AVAILABLE(macos(10.7));
/* constraint based layout engages lazily when someone tries to use it. If you do all of your constraint set up in -updateConstraints, you might never even receive updateConstraints if no one makes a constraint. To fix this chicken and egg problem, override this method to return YES if your view needs the window to use constraint based layout.
*/
@property (class, readonly) BOOL requiresConstraintBasedLayout API_AVAILABLE(macos(10.7));
@end
#pragma mark Separation of Concerns
@interface NSView (NSConstraintBasedLayoutLayering)
/* Constraints do not actually relate the frames of the views, rather they relate the "alignment rects" of views. This is the same as the frame unless overridden by a subclass of NSView. Alignment rects are the same as the "layout rects" shown in Interface Builder 3. Typically the alignment rect of a view is what the end user would think of as the bounding rect around a control, omitting ornamentation like shadows and engraving lines. The edges of the alignment rect are what is interesting to align, not the shadows and such.
*/
/* These two methods should be inverses of each other. AppKit will call both as part of layout computation.
They may be overridden to provide arbitrary transforms between frame and alignment rect, though the two methods must be inverses of each other.
However, the default implementation uses -alignmentRectInsets, so just override that if it's applicable. It's easier to get right. If you do override these be sure to account for the top of your frame being either minY or maxY depending on the superview's flippedness.
A view that displayed an image with some ornament would typically override these, because the ornamental part of an image would scale up with the size of the frame.
Set the NSUserDefault NSShowAlignmentRects to YES to see alignment rects drawn.
*/
- (NSRect)alignmentRectForFrame:(NSRect)frame API_AVAILABLE(macos(10.7));
- (NSRect)frameForAlignmentRect:(NSRect)alignmentRect API_AVAILABLE(macos(10.7));
/* override this if the alignment rect is obtained from the frame by insetting each edge by a fixed amount. This is only called by alignmentRectForFrame: and frameForAlignmentRect:.
*/
@property (readonly) NSEdgeInsets alignmentRectInsets API_AVAILABLE(macos(10.7));
/* override this to provide the distance between NSLayoutAttributeTop and NSLayoutAttributeFirstBaseline. NSView's implementation returns zero.
*/
@property (readonly) CGFloat firstBaselineOffsetFromTop API_AVAILABLE(macos(10.11));
/* override this to provide the distance between NSLayoutAttributeBottom and NSLayoutAttributeLastBaseline (or NSLayoutAttributeBaseline). NSView's implementation returns zero.
*/
@property (readonly) CGFloat lastBaselineOffsetFromBottom API_AVAILABLE(macos(10.11));
@property (readonly) CGFloat baselineOffsetFromBottom API_AVAILABLE(macos(10.7)); // Deprecated. Override lastBaselineOffsetFromBottom instead.
/* Override this method to tell the layout system that there is something it doesn't natively understand in this view, and this is how large it intrinsically is. A typical example would be a single line text field. The layout system does not understand text - it must just be told that there's something in the view, and that that something will take a certain amount of space if not clipped.
In response, AppKit will set up constraints that specify (1) that the opaque content should not be compressed or clipped, (2) that the view prefers to hug tightly to its content.
A user of a view may need to specify the priority of these constraints. For example, by default, a push button
-strongly wants to hug its content in the vertical direction (buttons really ought to be their natural height)
-weakly hugs its content horizontally (extra side padding between the title and the edge of the bezel is acceptable)
-strongly resists compressing or clipping content in both directions.
However, in the case of the scope bar in Finder, the buttons only weakly resist compressing content in the horizontal direction. You can make the window small enough that buttons start truncating their contents. Thus, Finder wants to lower the priority with which these buttons resist compressing content.
The default 'strong' and 'weak' priorities referred to above are NSLayoutPriorityDefaultHigh and NSLayoutPriorityDefaultLow.
Note that not all views have an intrinsicContentSize. A horizontal slider has an intrinsic height, but no intrinsic width - the slider artwork has no intrinsic best width. A horizontal NSSlider returns (NSViewNoIntrinsicMetric, <slider height>) for intrinsicContentSize. An NSBox returns (NSViewNoIntrinsicMetric, NSViewNoIntrinsicMetric). The _intrinsic_ content size is concerned only with data that is in the view itself, not in other views.
*/
APPKIT_EXTERN const CGFloat NSViewNoInstrinsicMetric API_DEPRECATED_WITH_REPLACEMENT("NSViewNoIntrinsicMetric", macos(10.7,10.14));
APPKIT_EXTERN const CGFloat NSViewNoIntrinsicMetric API_AVAILABLE(macos(10.11)); // -1
@property (readonly) NSSize intrinsicContentSize API_AVAILABLE(macos(10.7));
- (void)invalidateIntrinsicContentSize API_AVAILABLE(macos(10.7)); // call this when something changes that affects the intrinsicContentSize. Otherwise AppKit won't notice that it changed.
#if !TARGET_OS_IPHONE
- (NSLayoutPriority)contentHuggingPriorityForOrientation:(NSLayoutConstraintOrientation)orientation API_AVAILABLE(macos(10.7));
- (void)setContentHuggingPriority:(NSLayoutPriority)priority forOrientation:(NSLayoutConstraintOrientation)orientation API_AVAILABLE(macos(10.7));
- (NSLayoutPriority)contentCompressionResistancePriorityForOrientation:(NSLayoutConstraintOrientation)orientation API_AVAILABLE(macos(10.7));
- (void)setContentCompressionResistancePriority:(NSLayoutPriority)priority forOrientation:(NSLayoutConstraintOrientation)orientation API_AVAILABLE(macos(10.7));
#endif // !TARGET_OS_IPHONE
// A boolean value that controls whether the receiver's horizontal content size constraint is active. As an optimization, if the constraint is inactive, Auto Layout may avoid measuring the view's intrinsic content size. Defaults to YES.
@property (getter=isHorizontalContentSizeConstraintActive) BOOL horizontalContentSizeConstraintActive API_AVAILABLE(macos(10.15));
// A boolean value that controls whether the receiver's vertical content size constraint is active. As an optimization, if the constraint is inactive, Auto Layout may avoid measuring the view's intrinsic content size. Defaults to YES.
@property (getter=isVerticalContentSizeConstraintActive) BOOL verticalContentSizeConstraintActive API_AVAILABLE(macos(10.15));
@end
@interface NSControl (NSConstraintBasedLayoutLayering)
/* should be called by a cell on its -controlView
*/
- (void)invalidateIntrinsicContentSizeForCell:(NSCell *)cell API_AVAILABLE(macos(10.7));
@end
#pragma mark Window anchoring
@interface NSWindow (NSConstraintBasedLayoutAnchoring)
#if !TARGET_OS_IPHONE
/* If changes in the interior content (and thus, constraints) of a window force the window to get smaller or larger, what part of the window stays motionless? By default, the top left corner of the window is anchored in place.
*/
- (NSLayoutAttribute)anchorAttributeForOrientation:(NSLayoutConstraintOrientation)orientation;
- (void)setAnchorAttribute:(NSLayoutAttribute)attr forOrientation:(NSLayoutConstraintOrientation)orientation;
#endif // !TARGET_OS_IPHONE
@end
#pragma mark Size To Fit
@interface NSView (NSConstraintBasedLayoutFittingSize)
/* like sizeToFit, but for arbitrary views, and returns the size rather than changing the view's frame. This considers everything in the receiver's subtree.
*/
@property (readonly) NSSize fittingSize API_AVAILABLE(macos(10.7));
@end
#pragma mark Debugging
/* Everything in this section should be used in debugging only, never in shipping code. These methods may not exist in the future - no promises.
set default NSShowAlignmentRects to YES to see alignment rects drawn. Useful in conjunction with NSShowAllViews, which shows frames.
the existing -[NSView _subtreeDescription] is also very useful
*/
@interface NSView (NSConstraintBasedLayoutDebugging)
#if !TARGET_OS_IPHONE
/* This returns a list of all the constraints that are affecting the current location of the receiver. The constraints do not necessarily involve the receiver, they may affect the frame indirectly.
Pass NSLayoutConstraintOrientationHorizontal for the constraints affecting NSMinX([self frame]) and NSWidth([self frame]), or NSLayoutConstraintOrientationVertical for the constraints affecting NSMinY([self frame]) and NSHeight([self frame]).
*/
- (NSArray<NSLayoutConstraint *> *)constraintsAffectingLayoutForOrientation:(NSLayoutConstraintOrientation)orientation API_AVAILABLE(macos(10.7));
#endif // !TARGET_OS_IPHONE
/* If there aren't enough constraints in the system to uniquely determine layout, we say the layout is ambiguous. For example, if the only constraint in the system was x = y + 100, then there are lots of different possible values for x and y. This situation is not automatically detected by AppKit, due to performance considerations and details of the algorithm used for layout.
The symptom of ambiguity is that views sometimes jump from place to place, or possibly are just in the wrong place.
-hasAmbiguousLayout runs a check for whether there is any other frame the receiver could have that could also satisfy the constraints.
-exerciseAmbiguousLayout does more. It randomly changes the frames of views in your window to another of their valid possible layouts. Making the UI jump back and forth can be helpful for figuring out where you're missing a constraint.
*/
@property (readonly) BOOL hasAmbiguousLayout API_AVAILABLE(macos(10.7));
- (void)exerciseAmbiguityInLayout API_AVAILABLE(macos(10.7));
@end
@interface NSWindow (NSConstraintBasedLayoutDebugging)
#if !TARGET_OS_IPHONE
/* This draws a visual representation of the given constraints in the receiver window. It's a nice way to understand exactly what a collection of constraints specifies.
*/
- (void)visualizeConstraints:(nullable NSArray<NSLayoutConstraint *> *)constraints API_AVAILABLE(macos(10.7));
#endif // !TARGET_OS_IPHONE
@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/NSTextAttachmentCell.h | /*
NSTextAttachmentCell.h
Copyright (c) 2021-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSCell.h>
@class NSTextAttachment;
@class NSLayoutManager;
@class NSTextContainer;
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
// These are the only methods required of cells in text attachments... The default NSCell class implements most of these; the NSTextAttachmentCell class is a subclass which implements all and provides some additional functionality.
API_UNAVAILABLE(macCatalyst)
@protocol NSTextAttachmentCell <NSObject>
- (void)drawWithFrame:(NSRect)cellFrame inView:(nullable NSView *)controlView;
- (BOOL)wantsToTrackMouse;
- (void)highlight:(BOOL)flag withFrame:(NSRect)cellFrame inView:(nullable NSView *)controlView;
- (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(nullable NSView *)controlView untilMouseUp:(BOOL)flag;
- (NSSize)cellSize;
- (NSPoint)cellBaselineOffset;
@property (nullable, assign) NSTextAttachment *attachment;
// Sophisticated cells should implement these in addition to the simpler methods, above. The class NSTextAttachmentCell implements them to simply call the simpler methods; more complex conformers should implement the simpler methods to call these.
- (void)drawWithFrame:(NSRect)cellFrame inView:(nullable NSView *)controlView characterIndex:(NSUInteger)charIndex;
- (void)drawWithFrame:(NSRect)cellFrame inView:(nullable NSView *)controlView characterIndex:(NSUInteger)charIndex layoutManager:(NSLayoutManager *)layoutManager;
- (BOOL)wantsToTrackMouseForEvent:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(nullable NSView *)controlView atCharacterIndex:(NSUInteger)charIndex;
- (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(nullable NSView *)controlView atCharacterIndex:(NSUInteger)charIndex untilMouseUp:(BOOL)flag;
- (NSRect)cellFrameForTextContainer:(NSTextContainer *)textContainer proposedLineFragment:(NSRect)lineFrag glyphPosition:(NSPoint)position characterIndex:(NSUInteger)charIndex;
@end
// Simple class to provide basic attachment cell functionality. By default this class causes NSTextView to send out delegate messages when the attachment is clicked on or dragged.
@interface NSTextAttachmentCell : NSCell <NSTextAttachmentCell>
@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/NSCollectionViewGridLayout.h | /*
NSCollectionViewGridLayout.h
Application Kit
Copyright (c) 2015-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSCollectionViewLayout.h>
#import <AppKit/AppKitDefines.h>
@class NSColor;
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
/* NSCollectionView's default "Grid" layout, which matches NSCollectionView's layout behavior on OS X 10.5 through 10.10. When you create a new NSCollectionView, its collectionViewLayout property defaults to an instance of NSCollectionViewGridLayout.
*/
API_AVAILABLE(macos(10.11))
@interface NSCollectionViewGridLayout : NSCollectionViewLayout
#pragma mark *** Margins and Inter-Item Spacing ***
/* The amount of empty space to leave between the edges of the CollectionView's frame and the items within it. Items will be laid out in the rectangle that remains after margins have been subtracted. Defaults to NSEdgeInsetsZero.
*/
@property NSEdgeInsets margins;
/* For a vertically scrolling grid, this value represents the minimum spacing between items in the same row. For a horizontally scrolling grid, this value represents the minimum spacing between items in the same column. This spacing is used to compute how many items can fit in a single line, but after the number of items is determined, the actual spacing may possibly be adjusted upward. Defaults to 0 for a Grid layout.
*/
@property CGFloat minimumInteritemSpacing;
/* For a vertically scrolling grid, this value represents the minimum spacing between successive rows. For a horizontally scrolling grid, this value represents the minimum spacing between successive columns. This spacing is not applied to the space between the header and the first line or between the last line and the footer. Defaults to 0 for a Grid layout.
*/
@property CGFloat minimumLineSpacing;
#pragma mark *** Grid Parameters ***
/* The largest number of item rows to attempt to fit in the CollectionView's visible area (if enclosed in a ScrollView). Defaults to 0, which is interpreted to mean there should be no limit other than minimumItemSize.height.
*/
@property NSUInteger maximumNumberOfRows;
/* The largest number of item columns to attempt to fit in the CollectionView's visible area (if enclosed in a ScrollView). Defaults to 0, which is interpreted to mean there should be no limit other than minimumItemSize.width.
*/
@property NSUInteger maximumNumberOfColumns;
#pragma mark *** Item Size Limits ***
/* The smallest allowed dimensions for an item's root view. Defaults to NSZeroSize, which makes the layout attempt to infer minimum dimensions from the provided itemPrototype's view's frame size.
*/
@property NSSize minimumItemSize;
/* The largest allowed dimensions for an item's root view. Defaults to NSZeroSize, which makes the layout attempt to infer maximum dimensions from the provided itemPrototype's view's frame size.
*/
@property NSSize maximumItemSize;
#pragma mark *** Background Appearance ***
/* The colors with which to fill the background. Defaults to nil. Setting this to nil causes a default background color to be used. Setting it to an empty array causes the CollectionView to draw no background fill. Setting it to a single-NSColor array causes the entire CollectionView to be drawn with the given background fill color. For CollectionViews using the old, pre-10.11 API: Setting it to an array of (N >= 2) colors causes the CollectionView to use them in sequence, applying color (index % N) behind the item at "index”. For new, 10.11-and-later NSCollectionViews, colors after the first are ignored.
*/
@property (null_resettable, copy) NSArray<NSColor *> *backgroundColors;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSVisualEffectView.h | /*
NSVisualEffectView.h
Application Kit
Copyright (c) 2014-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSView.h>
#import <AppKit/NSWindow.h>
#import <AppKit/NSImage.h>
#import <AppKit/NSCell.h>
#import <AppKit/AppKitDefines.h>
#import <Foundation/NSObjCRuntime.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
/// The main material that this view displays. Materials are dynamic, and their exact look depends on the view's effectiveAppearance, blendingMode, state, emphasized, and possibly other factors.
typedef NS_ENUM(NSInteger, NSVisualEffectMaterial) {
/// The material used by window titlebars.
NSVisualEffectMaterialTitlebar = 3,
/// The material used in some table views, menus, etc., to indicate selection.
NSVisualEffectMaterialSelection = 4,
/// The material used by menus.
NSVisualEffectMaterialMenu API_AVAILABLE(macos(10.11)) = 5,
/// The material used in the background of NSPopover windows.
NSVisualEffectMaterialPopover API_AVAILABLE(macos(10.11)) = 6,
/// The material used in the background of window sidebars.
NSVisualEffectMaterialSidebar API_AVAILABLE(macos(10.11)) = 7,
/// The material used in various in-line header or footer views (e.g., by NSTableView).
NSVisualEffectMaterialHeaderView API_AVAILABLE(macos(10.14)) = 10,
/// The material used as the background of sheet windows.
NSVisualEffectMaterialSheet API_AVAILABLE(macos(10.14)) = 11,
/// The material used by opaque window backgrounds.
NSVisualEffectMaterialWindowBackground API_AVAILABLE(macos(10.14)) = 12,
/// The material used as the background of heads-up display (HUD) windows.
NSVisualEffectMaterialHUDWindow API_AVAILABLE(macos(10.14)) = 13,
/// The material used as the background of full-screen modal UI.
NSVisualEffectMaterialFullScreenUI API_AVAILABLE(macos(10.14)) = 15,
/// The material used as the background of tool tips.
NSVisualEffectMaterialToolTip API_AVAILABLE(macos(10.14)) = 17,
/// The material used as the opaque background of content (e.g., by NSScrollView, NSTableView, NSCollectionView, etc.).
NSVisualEffectMaterialContentBackground API_AVAILABLE(macos(10.14)) = 18,
/// The material used under window backgrounds.
NSVisualEffectMaterialUnderWindowBackground API_AVAILABLE(macos(10.14)) = 21,
/// The material used as the background behind document pages.
NSVisualEffectMaterialUnderPageBackground API_AVAILABLE(macos(10.14)) = 22,
/// A default material appropriate for the view's effectiveAppearance. You should instead choose an appropriate semantic material.
NSVisualEffectMaterialAppearanceBased API_DEPRECATED("Use a specific semantic material instead.", macos(10.10, 10.14)) = 0,
// Materials with specific looks. You should instead choose an appropriate semantic material.
NSVisualEffectMaterialLight API_DEPRECATED("Use a semantic material instead. To force the appearance of a view hierarchy, set the `appearance` property to an appropriate NSAppearance value.", macos(10.10, 10.14)) = 1,
NSVisualEffectMaterialDark API_DEPRECATED("Use a semantic material instead. To force the appearance of a view hierarchy, set the `appearance` property to an appropriate NSAppearance value.", macos(10.10, 10.14)) = 2,
NSVisualEffectMaterialMediumLight API_DEPRECATED("Use a semantic material instead. To force the appearance of a view hierarchy, set the `appearance` property to an appropriate NSAppearance value.", macos(10.11, 10.14)) = 8,
NSVisualEffectMaterialUltraDark API_DEPRECATED("Use a semantic material instead. To force the appearance of a view hierarchy, set the `appearance` property to an appropriate NSAppearance value.", macos(10.11, 10.14)) = 9,
} API_AVAILABLE(macos(10.10));
typedef NS_ENUM(NSInteger, NSVisualEffectBlendingMode) {
/// Blend with the area behind the window (such as the Desktop or other windows).
NSVisualEffectBlendingModeBehindWindow,
/// Blend with the area behind the view in the window.
NSVisualEffectBlendingModeWithinWindow,
} API_AVAILABLE(macos(10.10));
typedef NS_ENUM(NSInteger, NSVisualEffectState) {
/// Use the active look only when the containing window is active.
NSVisualEffectStateFollowsWindowActiveState,
/// Use the active look always.
NSVisualEffectStateActive,
/// Use the inactive look always.
NSVisualEffectStateInactive,
} API_AVAILABLE(macos(10.10));
API_AVAILABLE(macos(10.10))
@interface NSVisualEffectView : NSView
/// A value indicating which material is shown by the NSVisualEffectView. See the comments on NSVisualEffectMaterial. Defaults to NSVisualEffectMaterialAppearanceBased. You should instead specify an appropriate semantic material value. See the comments on NSVisualEffectMaterial.
@property NSVisualEffectMaterial material;
/// An NSBackgroundStyle value that most closely matches the look of the material shown by the NSVisualEffectView.
@property (readonly) NSBackgroundStyle interiorBackgroundStyle;
/// A value controlling how the NSVisualEffectView generates its material. See the comments on NSVisualEffectBlendingMode. Not all materials support both blending modes, so NSVisualEffectView may fall back to a more appropriate blending mode as needed. Defaults to NSVisualEffectBlendingModeBehindWindow.
@property NSVisualEffectBlendingMode blendingMode;
/// A value controlling when the NSVisualEffectView takes on the active look. See the comments on NSVisualEffectState. Defaults to NSVisualEffectStateFollowsWindowActiveState.
@property NSVisualEffectState state;
/// An image whose alpha channel is used to mask the material generated by the NSVisualEffectView. (It does not also mask subviews.) Defaults to nil. It is best to set this to the smallest mask image possible and properly set the image's capInsets property to stretch it. Setting the maskImage on an NSVisualEffectView that is the contentView of a window will correctly influence the window's shadow.
@property (nullable, retain) NSImage *maskImage;
/// When YES, the material takes on the emphasized look. Defaults to NO. Some, but not all, materials change their look when emphasized. This is used to indicate that an associated view has firstResponder status.
@property (getter=isEmphasized) BOOL emphasized API_AVAILABLE(macos(10.12));
// Some things this class overrides. It is required to call super if you subclass NSVisualEffectView and override these.
- (void)viewDidMoveToWindow NS_REQUIRES_SUPER;
- (void)viewWillMoveToWindow:(nullable NSWindow *)newWindow 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/NSAppearance.h | /*
NSAppearance.h
Application Kit
Copyright (c) 2011-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/AppKitDefines.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSString, NSBundle;
typedef NSString * NSAppearanceName NS_TYPED_EXTENSIBLE_ENUM;
API_AVAILABLE(macos(10.9))
@interface NSAppearance : NSObject <NSSecureCoding>
@property (readonly, copy) NSAppearanceName name API_AVAILABLE(macos(10.9));
// Sets the current thread's appearance, which is used for drawing, resolving colors/images, and laying out views.
// Automatically set by NSView before that view's drawRect:, updateLayer, and layout methods are invoked.
// At other times its return value is unreliable (depending on if the previous caller restored it to a previous value after setting it).
// This is not the correct way to determine the 'system' appearance. Use a view's, window's, or the app's effectiveAppearance.
@property (class, null_resettable, strong) NSAppearance *currentAppearance API_DEPRECATED("Use -performAsCurrentDrawingAppearance: to temporarily set the drawing appearance, or +currentDrawingAppearance to access the currently drawing appearance.", macos(10.9, 12.0));
// The appearance which has been made active for drawing (usually by locking focus on a view)
// and is used for color and asset resolution.
@property (class, readonly, strong) NSAppearance *currentDrawingAppearance API_AVAILABLE(macos(11.0));
// Make the receiver the active drawing appearance and perform the block.
// Saves and restores the previous current appearance.
- (void)performAsCurrentDrawingAppearance:(void (NS_NOESCAPE ^)(void))block API_AVAILABLE(macos(11.0));
/* Finds and returns an NSAppearance based on the name.
For standard appearances such as NSAppearanceNameAqua, a built-in appearance is returned.
For other names, the main bundle is searched.
*/
+ (nullable NSAppearance *)appearanceNamed:(NSAppearanceName)name;
/* Creates an NSAppearance by searching the specified bundle for a file with the specified name (without path extension).
If bundle is nil, the main bundle is assumed.
*/
- (nullable instancetype)initWithAppearanceNamed:(NSAppearanceName)name bundle:(nullable NSBundle *)bundle NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
/* Query allowsVibrancy to see if the given appearance actually needs vibrant drawing. You may want to draw differently if the current apperance is vibrant.
*/
@property (readonly) BOOL allowsVibrancy API_AVAILABLE(macos(10.10));
/* Given a list of appearance names, returns the one that best matches the receiver
*/
- (nullable NSAppearanceName)bestMatchFromAppearancesWithNames:(NSArray<NSAppearanceName> *)appearances API_AVAILABLE(macos(10.14));
@end
#pragma mark -
#pragma mark Standard Appearances
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameAqua API_AVAILABLE(macos(10.9));
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameDarkAqua API_AVAILABLE(macos(10.14));
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameLightContent API_DEPRECATED("Light content should use the default Aqua apppearance.", macos(10.9,10.10));
/* The following two Vibrant appearances should only be set on an NSVisualEffectView, or one of its container subviews.
*/
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameVibrantDark API_AVAILABLE(macos(10.10));
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameVibrantLight API_AVAILABLE(macos(10.10));
/* The following appearance names are for matching using bestMatchFromAppearancesWithNames:
Passing any of them to appearanceNamed: will return NULL
*/
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameAccessibilityHighContrastAqua API_AVAILABLE(macos(10.14));
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameAccessibilityHighContrastDarkAqua API_AVAILABLE(macos(10.14));
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameAccessibilityHighContrastVibrantLight API_AVAILABLE(macos(10.14));
APPKIT_EXTERN NSAppearanceName const NSAppearanceNameAccessibilityHighContrastVibrantDark API_AVAILABLE(macos(10.14));
#pragma mark -
@protocol NSAppearanceCustomization <NSObject>
@required
@property (nullable, strong) NSAppearance *appearance API_AVAILABLE(macos(10.9));
/* This returns the appearance that would be used when drawing the receiver, taking inherited appearances into account.
*/
@property (readonly, strong) NSAppearance *effectiveAppearance API_AVAILABLE(macos(10.9));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSToolbarItemGroup.h | /*
NSToolbarItemGroup.h
Application Kit
Copyright (c) 2000-2021, Apple Inc.
All rights reserved.
*/
#import <TargetConditionals.h>
#import <AppKit/NSToolbarItem.h>
#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
@class UIImage;
#endif
/* NSToolbarItemGroup is a subclass of NSToolbarItem which can be used to create sets of NSToolbarItems that are always attached to one another and that are added, removed, or reordered as a single unit. Properties that get set on the parent toolbar item, such as label or view, apply to the entire item. Otherwise, the individual properties are displayed adjacent to one another. */
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, NSToolbarItemGroupSelectionMode) {
NSToolbarItemGroupSelectionModeSelectOne = 0, // Only one option in the control can be selected at a time.
NSToolbarItemGroupSelectionModeSelectAny = 1, // One or more options in the control can be selected at a time.
NSToolbarItemGroupSelectionModeMomentary = 2 // An option is only highlighted when the user is engaging within the bounds of that option.
} API_AVAILABLE(macos(10.15), ios(13.0));
typedef NS_ENUM(NSInteger, NSToolbarItemGroupControlRepresentation) {
NSToolbarItemGroupControlRepresentationAutomatic, // The representation will be chosen based on available space
NSToolbarItemGroupControlRepresentationExpanded, // All functions of the control will be visible in a horizontal representation
NSToolbarItemGroupControlRepresentationCollapsed // All functions of the control will be presented through a menu
} API_AVAILABLE(macos(10.15), ios(13.0));
API_AVAILABLE(macos(10.5), ios(13.0))
@interface NSToolbarItemGroup : NSToolbarItem
/*
Convenience constructors for creating segmented control based toolbar items with images or text.
The item returned will have a custom view for representing the control and automatically create subitems for the group.
The labels array, if not nil, will be used to provide individual labels under the item for each segment of the control.
When space in the toolbar is tight, the control may switch to a smaller alternate representation as necessary to remain in the toolbar.
*/
+ (instancetype)groupWithItemIdentifier:(NSToolbarItemIdentifier)itemIdentifier titles:(NSArray<NSString *> *)titles selectionMode:(NSToolbarItemGroupSelectionMode)selectionMode labels:(nullable NSArray<NSString *> *)labels target:(nullable id)target action:(nullable SEL)action API_AVAILABLE(macos(10.15));
#if !TARGET_OS_IPHONE
+ (instancetype)groupWithItemIdentifier:(NSToolbarItemIdentifier)itemIdentifier images:(NSArray<NSImage *> *)images selectionMode:(NSToolbarItemGroupSelectionMode)selectionMode labels:(nullable NSArray<NSString *> *)labels target:(nullable id)target action:(nullable SEL)action API_AVAILABLE(macos(10.15));
#else
+ (instancetype)groupWithItemIdentifier:(NSToolbarItemIdentifier)itemIdentifier images:(NSArray<UIImage *> *)images selectionMode:(NSToolbarItemGroupSelectionMode)selectionMode labels:(nullable NSArray<NSString *> *)labels target:(nullable id)target action:(nullable SEL)action;
#endif
/* Set or get the array of subitems for the toolbar item. By default, a NSToolbarItemGroup has an empty array of subitems. You should call this to set the subitems before returning the item to the toolbar. NSToolbarItemGroups may not contain other NSToolbarItemGroups as subitems.
*/
@property (copy) NSArray<__kindof NSToolbarItem *> *subitems;
/*
The style in which this item will be represented to the user.
Defaults to NSToolbarItemGroupControlRepresentationAutomatic.
*/
@property NSToolbarItemGroupControlRepresentation controlRepresentation API_AVAILABLE(macos(10.15));
/*
Get and set how selection is handled by the control.
*/
@property NSToolbarItemGroupSelectionMode selectionMode API_AVAILABLE(macos(10.15));
/*
The most recently selected item of the group, or -1 if nothing is selected.
*/
@property NSInteger selectedIndex API_AVAILABLE(macos(10.15));
/*
Get and set selection of individual subitems of the group item.
*/
- (void)setSelected:(BOOL)selected atIndex:(NSInteger)index API_AVAILABLE(macos(10.15));
- (BOOL)isSelectedAtIndex:(NSInteger)index API_AVAILABLE(macos(10.15));
@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/NSController.h | /*
NSController.h
Application Kit
Copyright (c) 2002-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSKeyValueBinding.h>
#import <AppKit/AppKitDefines.h>
#import <CoreFoundation/CoreFoundation.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSMutableArray, NSMutableDictionary, NSMutableSet;
@interface NSController : NSObject <NSCoding, NSEditor, NSEditorRegistration>
- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
- (void)objectDidBeginEditing:(id<NSEditor>)editor;
- (void)objectDidEndEditing:(id<NSEditor>)editor;
- (void)discardEditing;
- (BOOL)commitEditing;
- (void)commitEditingWithDelegate:(nullable id)delegate didCommitSelector:(nullable SEL)didCommitSelector contextInfo:(nullable void *)contextInfo;
@property (getter=isEditing, readonly) BOOL editing;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSSharingServicePickerToolbarItem.h | /*
NSSharingServicePickerToolbarItem.h
Application Kit
Copyright (c) 2019-2021, Apple Inc.
All rights reserved.
*/
#import <TargetConditionals.h>
#import <AppKit/NSToolbarItem.h>
#import <AppKit/NSSharingService.h>
#if !TARGET_OS_IPHONE
@protocol NSSharingServicePickerToolbarItemDelegate;
#endif
NS_ASSUME_NONNULL_BEGIN
API_AVAILABLE(macos(10.15), ios(10.13))
@interface NSSharingServicePickerToolbarItem : NSToolbarItem
#if !TARGET_OS_IPHONE
@property (weak) id<NSSharingServicePickerToolbarItemDelegate> delegate;
#endif
@end
#if !TARGET_OS_IPHONE
@protocol NSSharingServicePickerToolbarItemDelegate <NSSharingServicePickerDelegate>
@required
/* Return the items that represent the objects to be shared. They must conform to the <NSPasteboardWriting> protocol or be an NSItemProvider. (e.g. NSString, NSImage, NSURL, etc.). */
- (NSArray *)itemsForSharingServicePickerToolbarItem:(NSSharingServicePickerToolbarItem *)pickerToolbarItem;
@end
#endif
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/NSTouchBarItem.h | /*
NSTouchBarItem.h
Application Kit
Copyright (c) 2015-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/AppKitDefines.h>
#import <Foundation/Foundation.h>
typedef NSString * NSTouchBarItemIdentifier NS_TYPED_EXTENSIBLE_ENUM API_AVAILABLE(ios(13.0));
@class NSTouchBar, NSViewController, NSView, NSImage, NSGestureRecognizer;
@class NSString;
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
typedef float NSTouchBarItemPriority NS_TYPED_EXTENSIBLE_ENUM API_AVAILABLE(macos(10.12.2), ios(13.0));
static const NSTouchBarItemPriority NSTouchBarItemPriorityHigh API_AVAILABLE(macos(10.12.2), ios(13.0)) = 1000;
static const NSTouchBarItemPriority NSTouchBarItemPriorityNormal API_AVAILABLE(macos(10.12.2), ios(13.0)) = 0;
static const NSTouchBarItemPriority NSTouchBarItemPriorityLow API_AVAILABLE(macos(10.12.2), ios(13.0)) = -1000;
API_AVAILABLE(macos(10.12.2), ios(13.0)) NS_SWIFT_UI_ACTOR
@interface NSTouchBarItem : NSObject <NSCoding>
/*
The designated initializer. This instantiates a new NSTouchBarItem with the specified initializer.
*/
- (instancetype)initWithIdentifier:(NSTouchBarItemIdentifier)identifier NS_DESIGNATED_INITIALIZER API_AVAILABLE(ios(13.0));
/*
Items can be archived and unarchived using NSCoder, as noted by conformance to the NSCoding protocol.
*/
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER API_AVAILABLE(ios(13.0));
/*
Items must be instantiated with an identifier. Use -initWithIdentifier instead of -init.
*/
- (instancetype)init NS_UNAVAILABLE;
/*
The identifier of this item. Apart from spaces, item identifiers should be globally unique.
*/
@property (readonly, copy) NSTouchBarItemIdentifier identifier API_AVAILABLE(ios(13.0));
/*
If there are more items in the NSTouchBar than can be displayed, some will be hidden. Items with high visibility priority will be hidden after items with low visibility priority.
*/
@property NSTouchBarItemPriority visibilityPriority API_AVAILABLE(ios(13.0));
/*
Intended for subclassing. By default, this method returns this item's view controller's view.
*/
@property (readonly, nullable) NSView *view;
/*
Intended for subclassing. By default, this method returns nil.
*/
@property (readonly, nullable) NSViewController *viewController;
/*
The user visible string identifying this item during customization. By default this method returns the empty string.
*/
@property (readonly, copy) NSString *customizationLabel API_AVAILABLE(ios(13.0));
/*
When YES, this item is attached to a visible NSTouchBar, and is being displayed. Note that some types of items are never considered visible, for example spaces, other items proxys, and groups.
This property is key value observable.
*/
@property (readonly, getter=isVisible) BOOL visible API_AVAILABLE(ios(13.0));
@end
/*
The identifier of an item appropriate for use as a small space in the NSTouchBar. Generally, you can use this identifier in an NSTouchBar's itemIdentifiers array, and it will instantiate that space for you.
*/
APPKIT_EXTERN NSTouchBarItemIdentifier const NSTouchBarItemIdentifierFixedSpaceSmall API_AVAILABLE(macos(10.12.2), ios(13.0));
/*
The identifier of an item appropriate for use as a large space in the NSTouchBar. Generally, you can use this identifier in an NSTouchBar's itemIdentifiers array, and it will instantiate that space for you.
*/
APPKIT_EXTERN NSTouchBarItemIdentifier const NSTouchBarItemIdentifierFixedSpaceLarge API_AVAILABLE(macos(10.12.2), ios(13.0));
/*
The identifier of an item appropriate for use as a flexible space in the NSTouchBar. Generally, you can use this identifier in an NSTouchBar's itemIdentifiers array, and it will instantiate that space for you.
*/
APPKIT_EXTERN NSTouchBarItemIdentifier const NSTouchBarItemIdentifierFlexibleSpace API_AVAILABLE(macos(10.12.2), ios(13.0));
/*
The identifier of the special "other items proxy." Generally, you can use this identifier in an NSTouchBar's itemIdentifiers array, and a special proxy item will be instantiated for you. When the NSTouchBar containing this item is visible, NSTouchBars provided by items closer to the first responder will be nested inside the space denoted for this item. Space items on either side of this item will be automatically massaged to handle cases where the NSTouchBar containing this identifier is itself the bar closest to the first responder (or closer bars are empty.)
Note that an NSTouchBar lacking this item identifier will be replaced in its entirety by NSTouchBars closer to the first responder.
*/
APPKIT_EXTERN NSTouchBarItemIdentifier const NSTouchBarItemIdentifierOtherItemsProxy API_AVAILABLE(macos(10.12.2), ios(13.0));
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/NSInterfaceStyle.h | /*
NSInterfaceStyle.h
Application Kit
Copyright (c) 1995-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSResponder.h>
#import <AppKit/AppKitDefines.h>
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
enum {
NSNoInterfaceStyle API_DEPRECATED("", macos(10.0,10.8)) = 0, // Default value for a window's interfaceStyle
NSNextStepInterfaceStyle API_DEPRECATED("", macos(10.0,10.8)) = 1,
NSWindows95InterfaceStyle API_DEPRECATED("", macos(10.0,10.8)) = 2,
NSMacintoshInterfaceStyle API_DEPRECATED("", macos(10.0,10.8)) = 3
};
typedef NSUInteger NSInterfaceStyle API_DEPRECATED("", macos(10.0,10.8));
APPKIT_EXTERN NSInterfaceStyle NSInterfaceStyleForKey(NSString *key, NSResponder *responder) API_DEPRECATED("", macos(10.0,10.8));
// Responders can use this function to parameterize their drawing and behavior. If the responder has specific defaults to control various aspects of its interface individually, the keys for those special settings can be passed in, otherwise pass nil to get the global setting. The responder should always be passed, but in situations where a responder is not available, pass nil.
@interface NSResponder (NSInterfaceStyle)
- (NSInterfaceStyle)interfaceStyle API_DEPRECATED("", macos(10.0,10.8));
- (void)setInterfaceStyle:(NSInterfaceStyle)interfaceStyle API_DEPRECATED("", macos(10.0,10.8));
// A responder's style (if set) overrides all other settings. Responders which need to redraw or do any other work when the interface style changes should override this to do it. Always call super.
@end
// Default strings
APPKIT_EXTERN NSString *NSInterfaceStyleDefault API_DEPRECATED("", macos(10.0,10.8));
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/NSSplitViewController.h | /*
NSSplitViewController.h
Application Kit
Copyright (c) 2014-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSViewController.h>
#import <AppKit/NSSplitViewItem.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSSplitView.h>
#import <AppKit/AppKitDefines.h>
#import <Foundation/NSArray.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
/// This constant can be used with any sizing related \c NSSplitViewController properties to get the default system behavior.
APPKIT_EXTERN const CGFloat NSSplitViewControllerAutomaticDimension API_AVAILABLE(macos(10.11));
/*!
* NSSplitViewController is a container view controller that manages side-by-side (horizontal or vertical) children view controllers.
* Views are lazily loaded. For instance, adding a collapsed SplitViewItem will not load the associated ViewController's view until it is uncollapsed.
* The NSSplitViewController is set as the delegate of its managed NSSplitView. Any overrides of NSSplitViewDelegate methods must call super.
* Only the \c -vertical, \c -autosaveName, and divider properties should be manipulated on the managed NSSplitView. Changing other properties (such as delegate, manipulating subviews, holding priorities) will cause an exception to be thrown.
* Autolayout must be used with NSSplitViewController to properly control the layout of the child views and the animations of collapses and reveals. e.g., Constraints can be used to setup whether a window should grow/shrink or stay the same size when showing and hiding a sidebar.
* NSViewController's methods \c -addChildViewController:, \c -insertViewController:atIndex:, and \c -removeChildViewControllerAtIndex: can all be used as convience methods to add children; default SplitViewItems will be appropriately created or destroyed.
*/
API_AVAILABLE(macos(10.10))
@interface NSSplitViewController : NSViewController <NSSplitViewDelegate, NSUserInterfaceValidations>
/// The split view managed by the SplitViewController. This can be used to customize view properties such as the dividerStyle, vertical, and autosaveName. It is not guaranteed to be the same view as the receivers 'view' property. The default created splitView is vertical with a dividerStyle of \c NSSplitViewDividerStyleThin. To provide a custom NSSplitView, set the splitView property anytime before self.viewLoaded is YES.
@property (strong) NSSplitView *splitView;
/// The array of SplitViewItems that correspond to the current child view controllers. After a child view controller is added to the receiving splitViewController, a NSSplitViewItem with the default values will be created for it. Once the child is removed, its corresponding splitViewItem will be removed from the splitViewItems array. Setting this will call through to \c -insertSplitViewItem:atIndex and \c -removeSplitViewItem: for items that are new or need removal.
@property (copy) NSArray<__kindof NSSplitViewItem *> *splitViewItems;
/*!
* Adds a SplitViewItem to the end of the SplitViewController. If the receiver's view is loaded and the SplitViewItem is not collapsed, the SplitViewItem's viewController's view will be loaded and added to the splitView. This calls through to -insertSplitViewItem:atIndex:.
* \param splitViewItem The SplitViewItem to add. It must have a viewController set by the time it is added or an exception will be thrown. An exception will also be thrown if splitViewItem is nil.
*/
- (void)addSplitViewItem:(NSSplitViewItem *)splitViewItem;
/*!
* Adds a SplitViewItem to a given index in the SplitViewController. If the receiver's view is loaded and the SplitViewItem is not collapsed, the SplitViewItem's viewController's view will be loaded and added to the \c splitView. Subclasses must call through \c -insertSplitViewItem:atIndex: to add a SplitViewItem.
* \param splitViewItem The SplitViewItem 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 splitViewItem is nil.
* \param index The index to add the SplitViewItem at. Will throw an exception if \c index < 0 or \c index > \c splitViewItems.count
*/
- (void)insertSplitViewItem:(NSSplitViewItem *)splitViewItem atIndex:(NSInteger)index;
/*!
* Removes a SplitViewItem from the receiver. The layout of the \c splitView will be adjusted for its removal. Subclasses must call through \c -removeSplitViewItem: to remove a SplitViewItem.
* \param splitViewItem The SplitViewItem to remove. An exception will be thrown if \c splitViewItem is not in the SplitViewController or if it is nil.
*/
- (void)removeSplitViewItem:(NSSplitViewItem *)splitViewItem;
/*!
* Returns the corresponding SplitViewItem for a given child ViewController.
* \param viewController The ViewController to look up.
* \return The corresponding SplitViewItem. Returns nil if \c viewController is not a child of the SplitViewController.
*/
- (nullable NSSplitViewItem *)splitViewItemForViewController:(NSViewController *)viewController;
/*!
* The minimum thickness in the primary axis of split view (width for "vertical", height otherwise) before sidebar items will automatically collapse. If reshown in fullscreen, they will overlay over the other split items.
* Auto-collapsed sidebars will automatically uncollapse if the thickness is increased back to or past the minimum thickness.
* Defaults to \c NSSplitViewControllerAutomaticDimension, which will use the effective minimum sizes of the split view item views as described by constraints in the window to determine the minimum size for inline sidebars. Once constraints establishing the minimum size can't be satisfied for all non-collapsed split panes, all sidebars will auto-collapse. When fullscreen, if a sidebar tries to uncollapse in this state, it will overlay.
*/
@property CGFloat minimumThicknessForInlineSidebars API_AVAILABLE(macos(10.11));
/// Validates items with an action of `toggleSidebar:` to reflect the status of the sidebar item contained within the receiver.
- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item API_AVAILABLE(macos(10.11));
/* Overridden methods from NSViewController. These require a call to super if overriden by a subclass */
- (void)viewDidLoad NS_REQUIRES_SUPER;
/* Implemented methods from NSSplitViewDelegate. These require a call to super if overriden by a subclass */
- (BOOL)splitView:(NSSplitView *)splitView canCollapseSubview:(NSView *)subview NS_REQUIRES_SUPER;
- (BOOL)splitView:(NSSplitView *)splitView shouldCollapseSubview:(NSView *)subview forDoubleClickOnDividerAtIndex:(NSInteger)dividerIndex NS_REQUIRES_SUPER API_DEPRECATED("NSSplitView no longer supports collapsing sections via double-click. This delegate method is never called, and NSSplitViewController's implementation always returns NO.", macos(10.5,10.15));
- (BOOL)splitView:(NSSplitView *)splitView shouldHideDividerAtIndex:(NSInteger)dividerIndex NS_REQUIRES_SUPER; // By default, NSSplitViewController hides the first and last dividers if their outer neighbor is collapsed
- (NSRect)splitView:(NSSplitView *)splitView effectiveRect:(NSRect)proposedEffectiveRect forDrawnRect:(NSRect)drawnRect ofDividerAtIndex:(NSInteger)dividerIndex NS_REQUIRES_SUPER;
- (NSRect)splitView:(NSSplitView *)splitView additionalEffectiveRectOfDividerAtIndex:(NSInteger)dividerIndex NS_REQUIRES_SUPER;
@end
@interface NSSplitViewController (NSSplitViewControllerToggleSidebarAction)
/// Animatedly collapses or uncollapses the first sidebar split view item in the receiver. Does nothing if the receiver does not contain any sidebars.
- (IBAction)toggleSidebar:(nullable id)sender 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/NSDraggingSession.h | /*
NSDraggingSession.h
Application Kit
Copyright (c) 2010-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/NSDragging.h>
#import <AppKit/AppKitDefines.h>
@protocol NSDraggingSource, NSPasteboardWriting;
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSPasteboard, NSImage, NSDraggingItem;
API_AVAILABLE(macos(10.7))
@interface NSDraggingSession : NSObject
/* Controls the dragging formation when the drag is over the source. The default value is NSDraggingFormationNone. */
@property NSDraggingFormation draggingFormation;
/* Controls whether the dragging image animates back to its starting point on a cancelled or failed drag. -draggingSession:endedAtPoint:operation: is a good time to change this value depending on the result of the drag operation. The default value is YES.
*/
@property BOOL animatesToStartingPositionsOnCancelOrFail;
/* The index of the draggingItem under the cursor. The default is the NSDraggingItem closest to the location in the event that was passed to -beginDraggingSessionWithItems:event:source:
*/
@property NSInteger draggingLeaderIndex;
/* Returns the pasteboard object that holds the data being dragged. */
@property(readonly) NSPasteboard *draggingPasteboard;
/* Returns a number that uniquely identifies the dragging session. */
@property(readonly) NSInteger draggingSequenceNumber;
/* The current location (cursor) of the drag in screen coordinates. */
@property(readonly) NSPoint draggingLocation;
/* Use the following enumerate methods to modify the properties of each dragging item. For example, change the drag image and size.
Note: All changes made here are only in effect while destination is not overriding them. When the drag exits the destination, all properties return to the last values set here.
*/
/* Enumerate through each dragging item. Any changes made to the properties of the draggingItem are reflected in the drag when the destination is not overriding them. Classes in the provided array must implement the NSPasteboardReading protocol. Cocoa classes that implement this protocol include NSImage, NSString, NSURL, NSColor, NSAttributedString, and NSPasteboardItem. For every item on the pasteboard, each class in the provided array will be queried for the types it can read using -readableTypesForPasteboard:. An instance will be created of the first class found in the provided array whose readable types match a conforming type contained in that pasteboard item. If an Instance is created from the pasteboard item data, it is placed into an NSDraggingItem along with the dragging properties of that item such as the drag image. The NSDraggingItem is then passed as a parameter to the provided block. Additional search options, such as restricting the search to file URLs with particular content types, can be specified with a search options dictionary. See the comments for the Pasteboard Reading Options keys in NSPasteboard.h for a full description. Note: all coordinate properties in the NSDraggingItem are in the coordinate system of view. If view is nil, the screen coordinate space is used.
*/
- (void)enumerateDraggingItemsWithOptions:(NSDraggingItemEnumerationOptions)enumOpts forView:(nullable NSView *)view classes:(NSArray<Class> *)classArray searchOptions:(NSDictionary<NSPasteboardReadingOptionKey, id> *)searchOptions usingBlock:(void (NS_NOESCAPE ^)(NSDraggingItem *draggingItem, NSInteger idx, BOOL *stop))block;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSBrowserCell.h | /*
NSBrowserCell.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSCell.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSImage;
@interface NSBrowserCell : NSCell
- (instancetype)initTextCell:(NSString *)string NS_DESIGNATED_INITIALIZER;
- (instancetype)initImageCell:(nullable NSImage *)image NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
@property (class, readonly, nullable, strong) NSImage *branchImage;
@property (class, readonly, nullable, strong) NSImage *highlightedBranchImage;
- (nullable NSColor *)highlightColorInView:(NSView *)controlView;
@property (getter=isLeaf) BOOL leaf;
@property (getter=isLoaded) BOOL loaded;
- (void)reset;
- (void)set;
@property (nullable, strong) NSImage *image;
@property (nullable, strong) NSImage *alternateImage;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSWindowController.h | /*
NSWindowController.h
Application Kit
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSResponder.h>
#import <AppKit/NSNib.h>
#import <AppKit/NSNibDeclarations.h>
#import <AppKit/NSStoryboardSegue.h>
#import <AppKit/NSWindow.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSArray, NSDocument, NSStoryboard, NSViewController, NSWindow;
@interface NSWindowController : NSResponder <NSSeguePerforming>
/* Designated Initializer. window can be nil. All other -init... methods call this, and then possibly do other setup.
*/
- (instancetype)initWithWindow:(nullable NSWindow *)window NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
/* Instances initialized with the "Name" methods will eventually locate their nib file in the file's owner's class' bundle or in the app's +mainBundle using standard NSBundle API. Use the "Path" method if your nib file is at a fixed location (which is not inside one of those bundles).
*/
- (instancetype)initWithWindowNibName:(NSNibName)windowNibName; // self is the owner
- (instancetype)initWithWindowNibName:(NSNibName)windowNibName owner:(id)owner; // The owner is NOT retained
- (instancetype)initWithWindowNibPath:(NSString *)windowNibPath owner:(id)owner;
// -----------------------------------------------------------------------------
// Basic properties
// -----------------------------------------------------------------------------
/* If -initWithWindowNibPath:owner: was used to initialize the instance, this gives the last path component with its extension stripped off. If -initWithWindowNibName:[owner:] was used this just gives that name.
*/
@property(nullable, copy, readonly) NSNibName windowNibName;
/* The full path of the nib. If -initWithWindowNibPath:owner: was used to initialize the instance, the path is just returned. If -initWithWindowNibName:[owner:] was used this locates the nib in the file's owner's class' bundle or in the app's mainBundle and returns the full path (or nil if it cannot be located). Subclasses can override this to augment the search behavior, but probably ought to call super first.
*/
@property(nullable, copy, readonly) NSString *windowNibPath;
/* The file's owner for this window controller's nib file. Usually this is either the controller itself or the controller's document, but, in general, it is specified by the -init... methods. The owner is weakly referenced.
*/
@property(weak, readonly) id owner;
/* This allows setting and accessing the autosave name for the controller's window. If the controller has a window frame autosave name, it will automatically make sure its window gets it set appropriately whenever it gets its window set.
*/
@property(copy) NSWindowFrameAutosaveName windowFrameAutosaveName;
/* If this is set to YES then new windows will be cascaded based on the original frame of the window.
*/
@property BOOL shouldCascadeWindows;
// -----------------------------------------------------------------------------
// Dealing with the document
// -----------------------------------------------------------------------------
/* Returns the document associated with the window controller (if any).
You should not set the document property. It is invoked automatically from NSDocument's -addWindowController:. You can override it if you need to, but call super's implementation. The document is not retained by the NSWindowController.
*/
@property (nullable, assign) id /* __kindof NSDocument * */ document;
/* NSDocument calls this method for its window controllers whenever the document is made dirty or clean. By default this calls -setDocumentEdited: on the controller's window (if any). A controller calls this on itself when its document gets set or its window gets set.
*/
- (void)setDocumentEdited:(BOOL)dirtyFlag;
/* This indicates whether closing this controller should cause the associated document to close even if the document has other open window controllers. Normally a document will close automatically only when its last window controller closes. See the -close method below for more info.
*/
@property BOOL shouldCloseDocument;
// -----------------------------------------------------------------------------
// Dealing with the window
// -----------------------------------------------------------------------------
/* This method is invoked automatically whenever the controller's document has changed that would affect the window title. (For instance, when the fileName of the document changes, or when the controller gets a new document.) This method uses the -displayName method of NSDocument to find out the display name. It then passes the display name to -windowTitleForDocumentDisplayName: to give it a chance to change it. Finally, if the document has a -fileName and the display name is the same as the -fileName's last component, it actually sets the title from the -fileName instead of the display name. Otherwise it sets the title from the display name. If there is a -fileName, that file is always set as the window's represented file The window title is left alone if the controller has no document. This method can be overridden if you need to do something else.
*/
- (void)synchronizeWindowTitleWithDocumentName;
/* This method can be overridden to modify or replace the display name computed by the document's -displayName. If you return something other than the given display name, it will be used as-is for the window title.
*/
- (NSString *)windowTitleForDocumentDisplayName:(NSString *)displayName;
/* The view controller for the window's contentView. Tracks the window property of the same name.
*/
@property (nullable, strong) NSViewController *contentViewController API_AVAILABLE(macos(10.10));
/* The window getter will load the nib file (if there is one and it has not yet been loaded) and then return the window. If it has to load the window, it will first call -windowWillLoad, then -loadWindow, then -windowDidLoad. To affect nib loading or do something before or after it happens, you should always override those other methods.
The window setter is used internally from -initWithWindow: or when a controller's nib file is loaded (as the "window" outlet gets connected). You can also call it yourself if you want to create the window for a window controller lazily, but you aren't loading it from a nib. This can also be used to set the window to nil for cases where your subclass might not want to keep the window it loaded from a nib, but rather only wants the contents of the window. Setting the window to nil, after the nib has been loaded, does not reset the -isWindowLoaded state. A window controller will only load its nib file once. This method makes sure the window does not release when closed, and it sets the controller's -windowFrameAutosaveName onto the window and updates the window's dirty state to match the controller's document (if any). It also calls -setWindowController: on the window. You can override this if you need to know when the window gets set, but call super.
*/
@property (nullable, strong) NSWindow *window;
/* Returns YES if the receiver has loaded its -windowNibName, has itself been loaded from a nib, OR has no -windowNibName. In other words, if there is no nib to load, this always returns YES.
*/
@property (getter=isWindowLoaded, readonly) BOOL windowLoaded;
/* These are invoked immediately before and after this controller loads its nib, if the the nib loading is triggered by an invocation of -window (which is typical). The default implementations of these methods do nothing. You can override them to add additional processing before and after nib loading. Overriding of -windowDidLoad in particular is useful because it's the first method that's invoked after the connecting of any IB outlets added in a subclass. Your application should not invoke these methods directly.
*/
- (void)windowWillLoad;
- (void)windowDidLoad;
/* This method can be overridden by advanced users. It should not be called directly (doing so will cause the window controller to be improperly set up). Call the -window method to force loading of the nib.
*/
- (void)loadWindow;
/* This will close the window controller. If the controller belongs to a document and it is either the last controller for the document or -shouldCloseDocument is YES, then this will also -close the document.
*/
- (void)close;
/* This will show the controller's window, if any. If the window is a panel and the panel becomes key only if needed, this method just orders it front. Otherwise it makes the window key and orders it front.
*/
- (IBAction)showWindow:(nullable id)sender;
@end
/*!
These methods are used to support using Storyboards with your app.
*/
@interface NSWindowController (NSWindowControllerStoryboardingMethods)
/* The Storyboard the WindowController was loaded from. Returns nil if the WindowController was not loaded from a Storyboard.
*/
@property(nullable, readonly, strong) NSStoryboard *storyboard API_AVAILABLE(macos(10.10));
@end
@interface NSWindowController (NSWindowControllerDismissing)
/* Dismisses the WindowController. Does nothing if the receiver is not currently presented.
*/
- (IBAction)dismissController:(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/NSActionCell.h | /*
NSActionCell.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSCell.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@interface NSActionCell : NSCell
@property (nullable, weak) id target; // Target is weak for zeroing-weak compatible objects in apps linked on 10.10 or later. Otherwise the behavior of this property is 'assign’.
@property (nullable) SEL action;
@property NSInteger tag;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTextLayoutManager.h | #if (defined(USE_APPKIT_PUBLIC_HEADERS) && USE_APPKIT_PUBLIC_HEADERS) || !__has_include(<UIFoundation/NSTextLayoutManager.h>)
#include <TargetConditionals.h>
#if !TARGET_OS_IPHONE
//
// NSTextLayoutManager.h
// Text Kit
//
// Copyright (c) 2017-2021, Apple Inc. All rights reserved.
//
#import <Foundation/NSAttributedString.h>
#import <CoreGraphics/CGGeometry.h>
#import <AppKit/NSTextLayoutFragment.h>
@class NSTextRange;
@class NSTextContentManager;
@class NSTextElement;
@class NSTextContainer;
@class NSTextSelection;
@class NSTextSelectionNavigation;
@class NSTextViewportLayoutController;
@protocol NSTextLocation;
@protocol NSTextLayoutManagerDelegate;
@protocol NSTextSelectionDataSource;
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, NSTextLayoutManagerSegmentType) {
NSTextLayoutManagerSegmentTypeStandard = 0, // The standard segment matching the typographic bounds of range.
NSTextLayoutManagerSegmentTypeSelection = 1, // The segment behavior suitable for the selection rendering. Extends the last segment in a line fragment to the trailing edge if continuing to the next line.
NSTextLayoutManagerSegmentTypeHighlight = 2, // The segment behavior suitable for highlighting.
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
typedef NS_OPTIONS(NSUInteger, NSTextLayoutManagerSegmentOptions) {
NSTextLayoutManagerSegmentOptionsNone = 0,
NSTextLayoutManagerSegmentOptionsRangeNotRequired = (1 << 0), // Does not allocate and pass to the enumerator
NSTextLayoutManagerSegmentOptionsMiddleFragmentsExcluded = (1 << 1), // Only enumerates segments in the first and last line fragments.
NSTextLayoutManagerSegmentOptionsHeadSegmentExtended = (1 << 2), // When specified, the segment is extended to the head edge
NSTextLayoutManagerSegmentOptionsTailSegmentExtended = (1 << 3), // When specified, the segment is extended to the tail edge.
NSTextLayoutManagerSegmentOptionsUpstreamAffinity = (1 << 4), // When specified, the segment is placed based on the upstream affinity for an empty range.
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
// NSTextLayoutManager is the center piece of the TextKit object network maintaining the layout geometry via an array of NSTextContainer and layout results with NSTextLayoutFragment associated with NSTextElement vended from the owner NSTextContentManager.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@interface NSTextLayoutManager : NSObject <NSSecureCoding, NSTextSelectionDataSource>
#pragma mark Initialization
- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
#pragma mark Basic properties
@property (nullable, weak) id <NSTextLayoutManagerDelegate> delegate;
// If YES, uses the leading as specified by the font. However, this is not appropriate for most UI text. YES by default.
@property BOOL usesFontLeading;
// When YES, enables internal security analysis for malicious inputs and activates defensive behaviors. By enabling this functionality, it's possible certain text such as a very long paragraph might result in unexpected layout. NO by default.
@property BOOL limitsLayoutForSuspiciousContents;
// When YES, NSTextLayoutManager will attempt to hyphenate when wrapping lines. May be overridden on a per-paragraph basis by the NSParagraphStyle's usesDefaultHyphenation. The receiver makes the best effort to decide the exact logic including the hyphenation factor based on the context. The default value is NO. Can be overridden by the preference key @"NSUsesDefaultHyphenation".
@property BOOL usesHyphenation;
#pragma mark NSTextContentManager interface
// Pointing to the NSTextContentManager object strongly referencing the text layout manager.
@property (nullable, weak, readonly) NSTextContentManager *textContentManager;
// This method should be used in order to replace an NSTextContentManager with a new one, leaving all related objects intact. This method makes sure the NSTextLayoutManager doesn't get deallocated while migrating to the new manager.
- (void)replaceTextContentManager:(NSTextContentManager *)textContentManager;
#pragma mark NSTextContainer interface
// The text container object providing geometric information for the layout destination. If isSimpleRectangularTextContainer=NO, NSTextLayoutManager always fill from the top instead of allowing non-contiguous layout support.
@property (nullable, strong, readwrite) NSTextContainer *textContainer;
// The usage bounds for textContainer. KVO-compliant. Views can observe this property in order to trigger a resize operation. For example, UIView/NSView should call setNeedsUpdateConstraints() when the usage bounds changes.
@property (readonly) CGRect usageBoundsForTextContainer;
#pragma mark Layout
// Returns NSTextViewportLayoutController associated with textContainer.
@property (readonly, strong) NSTextViewportLayoutController *textViewportLayoutController;
// If non-nil, it performs layout in the specified queue until estimatedUsageBounds=NO.
@property (nullable, strong) NSOperationQueue *layoutQueue;
// Performs the layout for textRange.
- (void)ensureLayoutForRange:(NSTextRange *)range;
// Performs the layout for filling bounds inside the last text container.
- (void)ensureLayoutForBounds:(CGRect)bounds;
// Invalidates layout information for textRange
- (void)invalidateLayoutForRange:(NSTextRange *)range;
// Returns the text layout fragment containing position inside the coordinate system for textContainer.
- (nullable NSTextLayoutFragment *)textLayoutFragmentForPosition:(CGPoint)position;
// Returns the text layout fragment containing the document location, location.
- (nullable NSTextLayoutFragment *)textLayoutFragmentForLocation:(id <NSTextLocation>)location;
// Enumerates the text layout fragments starting at textLocation. If textLocation=nil, it assumes self.textContentManager.documentRange.location; uses self.documentRange.endLocation for reverse enumeration. When enumerating backward, it starts with the fragment preceding the one containing textLocation. If enumerated at least one fragment, 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>)enumerateTextLayoutFragmentsFromLocation:(nullable id <NSTextLocation>)location options:(NSTextLayoutFragmentEnumerationOptions)options usingBlock:(BOOL (NS_NOESCAPE ^)(NSTextLayoutFragment *layoutFragment))block;
#pragma mark Text Selection
// An array of NSTextSelections associated by the text layout manager. Each NSTextSelection represents an insertion point. The selection state is shared among all view ports connected to the text layout manager via text containers.
@property (strong) NSArray<NSTextSelection *> *textSelections;
// Returns an NSTextSelectionNavigation configured to have the text layout manager as NSTextSelectionDataSource
@property (strong) NSTextSelectionNavigation *textSelectionNavigation;
#pragma mark Rendering Attributes
// Rendering attributes overrides the document text attributes stored in NSTextParagraphs supplied by NSTextContentManager. NSTextLayoutFragment associated with a text paragraph applies the overriding attributes before executing layout. Specifying NSNull to an attribute indicates removing it from the document attributes. Rendering attributes are invalidated upon re-layout of the text layout fragment that they belong to.
// Enumerates the rendering attributes from location. It enumerates only ranges with rendering attributes specified. Returning NO from block breaks out of the enumeration.
- (void)enumerateRenderingAttributesFromLocation:(id <NSTextLocation> )location reverse:(BOOL)reverse usingBlock:(BOOL (NS_NOESCAPE ^)(NSTextLayoutManager *textLayoutManager, NSDictionary<NSAttributedStringKey, id> *attributes, NSTextRange *textRange))block;
// Sets the rendering attributes.
- (void)setRenderingAttributes:(NSDictionary<NSAttributedStringKey, id> *)renderingAttributes forTextRange:(NSTextRange *)textRange;
// Sets the rendering attribute. Passing nil value indicates overriding the specified attribute by removing from the final attributes passed to the layout and rendering engine. This is a convenience over -setRenderingAttributes:forTextRange:.
- (void)addRenderingAttribute:(NSAttributedStringKey)renderingAttribute value:(nullable id)value forTextRange:(NSTextRange *)textRange;
// Removes attribute from textRange. This is a convenience over -setRenderingAttributes:forTextRange:.
- (void)removeRenderingAttribute:(NSAttributedStringKey)renderingAttribute forTextRange:(NSTextRange *)textRange;
// Invalidates the rendering attributes in textRange. Enumerating rendering attributes will skip the invalidated range.
- (void)invalidateRenderingAttributesForTextRange:(NSTextRange *)textRange;
// A callback block invoked whenever NSTextLayoutManager needs to validate the rendering attributes for the range. The validator should use -setRenderingAttributes:forTextRange: to fill the rendering attributes appropriate for the range inside textLayoutFragment.
@property (nullable, copy) void (^renderingAttributesValidator)(NSTextLayoutManager *textLayoutManager, NSTextLayoutFragment *textLayoutFragment);
#pragma mark Link Attributes
// The default set of attributes for rendering NSLinkAttributeName. The base NSTextLayoutManager class returns with NSUnderlineStyleSingle for NSUnderlineStyleAttributeName and the platform link color for NSForegroundColorAttributeName. The platform color for macOS is +linkColor. Other platforms uses +blueColor.
@property (class, readonly) NSDictionary<NSAttributedStringKey, id> *linkRenderingAttributes;
// Returns a dictionary of rendering attributes for rendering NSLinkAttributeName. Just as other rendering attributes, specifying NSNull removes the attribute from the final attributes used for rendering. It has priority over the general rendering attributes.
- (NSDictionary<NSAttributedStringKey, id> *)renderingAttributesForLink:(id)link atLocation:(id <NSTextLocation>)location;
#pragma mark Text Segments
// Enumerates text segments of type in textRange. A text segment is both logically and visually contiguous portion of the text content inside a line fragment. It can be defined with a single text range. The segments are enumerated visually from left to right. Returning NO from block breaks out of the enumeration.
- (void)enumerateTextSegmentsInRange:(NSTextRange *)textRange type:(NSTextLayoutManagerSegmentType)type options:(NSTextLayoutManagerSegmentOptions)options usingBlock:(BOOL (NS_NOESCAPE ^)(NSTextRange * _Nullable textSegmentRange, CGRect textSegmentFrame, CGFloat baselinePosition, NSTextContainer *textContainer))block;
#pragma mark Editing
- (void)replaceContentsInRange:(NSTextRange *)range withTextElements:(NSArray<NSTextElement *> *)textElements;
- (void)replaceContentsInRange:(NSTextRange *)range withAttributedString:(NSAttributedString *)attributedString;
@end
#pragma mark NSTextLayoutManagerDelegate
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@protocol NSTextLayoutManagerDelegate <NSObject>
@optional
// NSTextLayoutFragment management
// Returns NSTextLayoutFragment for location in textElement. NSTextLayoutManagerDelegate could provide an NSTextLayoutFragment specialized for an NSTextElement subclass targeted for the rendering surface.
- (NSTextLayoutFragment *)textLayoutManager:(NSTextLayoutManager *)textLayoutManager textLayoutFragmentForLocation:(id <NSTextLocation>)location inTextElement:(NSTextElement *)textElement;
// Layout behavior
// Invoked while determining the soft line break point. When hyphenating=NO, NSTextLayoutManager tries to find the next line break opportunity before location. When hyphenating=YES, it is an auto-hyphenation point.
- (BOOL)textLayoutManager:(NSTextLayoutManager *)textLayoutManager shouldBreakLineBeforeLocation:(id <NSTextLocation>)location hyphenating:(BOOL)hyphenating;
// Rendering attributes
// Returns a dictionary of rendering attributes for rendering NSLinkAttributeName. Just as other rendering attributes, specifying NSNull removes the attribute from the final attributes used for rendering. It has priority over the general rendering attributes.
- (nullable NSDictionary<NSAttributedStringKey, id> *)textLayoutManager:(NSTextLayoutManager *)textLayoutManager renderingAttributesForLink:(id)link atLocation:(id <NSTextLocation>)location defaultAttributes:(NSDictionary<NSAttributedStringKey, id> *)renderingAttributes;
@end
NS_ASSUME_NONNULL_END
#endif // !TARGET_OS_IPHONE
#else
#import <UIFoundation/NSTextLayoutManager.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/NSTableViewRowAction.h | /*
NSTableViewRowAction.h
Application Kit
Copyright (c) 2014-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSColor, NSButton, NSImage;
typedef NS_ENUM(NSInteger, NSTableViewRowActionStyle) {
NSTableViewRowActionStyleRegular,
NSTableViewRowActionStyleDestructive, // Destructive buttons will do a special animation when being deleted
} API_AVAILABLE(macos(10.11));
/* An array of this class should be returned from the NSTableView delegate method tableView:rowActionsForRow:edge:.
*/
API_AVAILABLE(macos(10.11))
@interface NSTableViewRowAction : NSObject <NSCopying>
+ (instancetype)rowActionWithStyle:(NSTableViewRowActionStyle)style title:(NSString *)title handler:(void (^)(NSTableViewRowAction *action, NSInteger row))handler;
@property (readonly) NSTableViewRowActionStyle style;
@property (copy) NSString *title;
@property (null_resettable, copy) NSColor *backgroundColor; // The default background color is dependent on style. Generally this is red for destructive actions, and blue for others.
/* Prefer using an image over text for the row action button
*/
@property (nullable, strong) NSImage *image 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/NSOutlineView.h | /*
NSOutlineView.h
Application Kit
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSTableView.h>
#import <AppKit/AppKitDefines.h>
#import <CoreFoundation/CFDictionary.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSButtonCell;
@class NSTableView;
@class NSTableHeaderView;
@class NSTableColumn;
@class NSTintConfiguration;
@class NSNotification;
@class NSString;
@protocol NSOutlineViewDelegate, NSOutlineViewDataSource;
/* NSOutlineViewDropOnItemIndex may be used as a valid childIndex of a drop target item. In this case, the drop will happen directly on the target item.
*/
enum { NSOutlineViewDropOnItemIndex = -1 };
@interface NSOutlineView : NSTableView <NSAccessibilityOutline>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wincompatible-property-type"
@property (nullable, weak) id <NSOutlineViewDelegate> delegate;
@property (nullable, weak) id <NSOutlineViewDataSource> dataSource;
#pragma clang diagnostic pop
/* The 'outlineTableColumn' is the column that displays data in a hierarchical fashion, indented one identationlevel per level, decorated with indentation marker (disclosure triangle) on rows that are expandable. A nil 'outlineTableColumn' is silently ignored. On 10.5 and higher, this value is saved in encodeWithCoder: and restored in initWithCoder:.
*/
@property (nullable, assign) NSTableColumn *outlineTableColumn;
/* Returns YES if 'item' is expandable and can contain other items. May call out to the delegate/datasource, if required.
*/
- (BOOL)isExpandable:(nullable id)item;
/* Returns the number of children for a given parent item. This is mostly useful for static outline views where the data was encoded at design time; however, it will work for both static and non-static outline views. This may call out to the datasource, if required.
*/
- (NSInteger)numberOfChildrenOfItem:(nullable id)item API_AVAILABLE(macos(10.10));
/* Returns the child item for a given parent item. This is mostly useful for static outline views where the data was encoded at design time, however, it will work for both static and non-static outline views. This may call out to the datasource, if required.
*/
- (nullable id)child:(NSInteger)index ofItem:(nullable id)item API_AVAILABLE(macos(10.10));
/* Expands 'item', if not already expanded, and all children if 'expandChildren' is YES. On 10.5 and higher, passing 'nil' for 'item' will expand each item under the root.
*/
- (void)expandItem:(nullable id)item expandChildren:(BOOL)expandChildren;
/* Calls expandItem:expandChildren with 'expandChildren == NO'
*/
- (void)expandItem:(nullable id)item;
/* Collapses 'item' and all children if 'collapseChildren' is YES. On 10.5 and higher, passing 'nil' for 'item' will collapse each item under the root.
*/
- (void)collapseItem:(nullable id)item collapseChildren:(BOOL)collapseChildren;
/* Calls collapseItem:collapseChildren with 'collapseChildren == NO'
*/
- (void)collapseItem:(nullable id)item;
/* Reloads 'item' and all children if 'reloadChildren' is YES. On 10.5 and higher, passing 'nil' for 'item' will reload everything under the root item.
*/
- (void)reloadItem:(nullable id)item reloadChildren:(BOOL)reloadChildren;
/* Calls reloadItem:reloadChildren with 'reloadChildren == NO'
*/
- (void)reloadItem:(nullable id)item;
/* Returns the parent for 'item', or nil, if the parent is the root.
*/
- (nullable id)parentForItem:(nullable id)item;
/* Returns the child index of 'item' within its parent. The performance of this method is O(1) at best and O(n) at worst.
*/
- (NSInteger)childIndexForItem:(id)item API_AVAILABLE(macos(10.11));
/* Item/Row translation
*/
- (nullable id)itemAtRow:(NSInteger)row;
- (NSInteger)rowForItem:(nullable id)item;
/* Indentation
*/
- (NSInteger)levelForItem:(nullable id)item;
- (NSInteger)levelForRow:(NSInteger)row;
- (BOOL)isItemExpanded:(nullable id)item;
/* Controls the amount of indentation per level. Negative values are ignored, and only integral values are accepted. The default value is 16.0. An indentationPerLevel of 0 can be used to eliminate all indentation and make an NSOutlineView appear more like an NSTableView.
*/
@property CGFloat indentationPerLevel;
/* The indentation marker is the visual indicator that shows an item is expandable (i.e. disclosure triangle). The default value is YES.
*/
@property BOOL indentationMarkerFollowsCell;
/* If autoresizesOutlineColumn is YES, then the outlineTableColumn will automatically resize when there is a new expanded child at a particular depth level. The default value is YES.
*/
@property BOOL autoresizesOutlineColumn;
/* Returns the frame of the outline cell for a particular row, considering the current indentation and indentationMarkerFollowsCell value. If 'row' is not an expandable row, it will return NSZeroRect. This method can be overridden by subclassers to return a custom frame for the outline button cell. If an empty rect is returned, no outline cell will be drawn for that row.
*/
- (NSRect)frameOfOutlineCellAtRow:(NSInteger)row API_AVAILABLE(macos(10.5));
/* Drag and Drop
*/
/* To be used from validateDrop: in order to "re-target" the proposed drop. To specify a drop on an item I, one would specify item=I, and index=NSOutlineViewDropOnItemIndex. To specify a drop between child 2 and 3 of an item I, on would specify item=I, and index=3 (children are zero-base indexed). To specify a drop on an un-expandable item I, one would specify item=I, and index=NSOutlineViewDropOnItemIndex.
*/
- (void)setDropItem:(nullable id)item dropChildIndex:(NSInteger)index;
/* This method returns YES to indicate that auto expanded items should return to their original collapsed state. Override this method to provide custom behavior. 'deposited' tells wether or not the drop terminated due to a successful drop (as indicated by the return value from acceptDrop:). Note that exiting the view will be treated the same as a failed drop.
*/
- (BOOL)shouldCollapseAutoExpandedItemsForDeposited:(BOOL)deposited;
/* Persistence. The value for autosaveExpandedItems is saved out in the nib file on Mac OS 10.5 or higher. The default value is NO. Calling setAutosaveExpandedItems:YES requires you to implement outlineView:itemForPersistentObject: and outlineView:persistentObjectForItem:.
*/
@property BOOL autosaveExpandedItems;
#pragma mark -
#pragma mark ***** Animated Insert / Remove / Move Support *****
/* This method parallels TableView's -insertRowIndexes:withAnimation:, and is used in a way similar to NSMutableArray's -insertObjects:atIndexes: This method inserts a new item at 'indexes' in 'parent'. 'parent' can be nil to insert items into the root of the OutlineView. The operation will not do anything if 'parent' is not expanded. The actual item values are determined by the dataSource methods -outlineView:child:ofItem: (note that this will only be called after an -endUpdates happens to ensure dataSource integrity). Calling this method multiple times within the same beginUpdates/endUpdates block is allowed; new insertions will move previously inserted new items, just like modifying an array. Inserting an index beyond what is available will throw an exception. The "Cell Based TableView" must first call -beginUpdates before calling this method. This method can also be used when "usesStaticContents=YES".
*/
- (void)insertItemsAtIndexes:(NSIndexSet *)indexes inParent:(nullable id)parent withAnimation:(NSTableViewAnimationOptions)animationOptions API_AVAILABLE(macos(10.7));
/* This method parallels TableView's -removeRowsAtIndexes:withAnimation:, and is used similar to NSMutableArray's -removeObjectsAtIndexes:. The items at the given indexes will be removed from the parent. The operation will not do anything if 'parent' is not expanded. If one of the children items is expanded, then all of its children rows will also be removed. Calling this method multiple times within the same beginUpdates/endUpdates block is allowed; changes work just like modifying an array. Deleting an index beyond what is available will throw an exception. The "Cell Based TableView" must first call -beginUpdates before calling this method. This method can also be used when "usesStaticContents=YES".
*/
- (void)removeItemsAtIndexes:(NSIndexSet *)indexes inParent:(nullable id)parent withAnimation:(NSTableViewAnimationOptions)animationOptions API_AVAILABLE(macos(10.7));
/* This method parallels TableView's -moveRowAtIndex:toIndex:. The item located at 'fromIndex' is moved from the existing 'oldParent' to the given index in 'newParent'. 'newParent' can be the same as 'oldParent' to reorder an item within the same parent. This method can be called multiple times within the same beginUpdates/endUpdates block. Moving from an invalid index, or to an invalid index will throw an exception. The "Cell Based TableView" must first call -beginUpdates before calling this method. This method can also be used when "usesStaticContents=YES".
*/
- (void)moveItemAtIndex:(NSInteger)fromIndex inParent:(nullable id)oldParent toIndex:(NSInteger)toIndex inParent:(nullable id)newParent API_AVAILABLE(macos(10.7));
/* Modifications to an OutlineView should be done with the insertItems:/deleteItems:/moveItem: methods, and not the NSTableView primitives. Internally, these methods are used in the implementation, and while they are unavailable for callers they can be overridden by subclasses.
*/
- (void)insertRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)animationOptions UNAVAILABLE_ATTRIBUTE;
- (void)removeRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)animationOptions UNAVAILABLE_ATTRIBUTE;
- (void)moveRowAtIndex:(NSInteger)oldIndex toIndex:(NSInteger)newIndex UNAVAILABLE_ATTRIBUTE;
#pragma mark -
/* Get and set the user interface layout direction. When set to NSUserInterfaceLayoutDirectionRightToLeft, the Outline View will show the disclosure triangle to the right of the cell instead of the left. This method is available for NSOutlineView on 10.7 and higher.
*/
@property NSUserInterfaceLayoutDirection userInterfaceLayoutDirection API_AVAILABLE(macos(10.7));
/* When YES, the NSOutlineView will retain and release the objects returned to it from the dataSource (outlineView:child:ofItem:). When NO, it only treats the objects as opaque items and assume the client has a retain on them. The default value is YES for applications linked on 10.12 and later, and NO for previous applications. This value is not encoded in the nib, and must be explicitly set to NO in code if one requires the legacy behavior and is linking on 10.12 and later. In general, this is required if the items themselves create a retain cycle.
*/
@property BOOL stronglyReferencesItems API_AVAILABLE(macos(10.12));
@end
#pragma mark -
/* Data Source Note: Specifying nil as the item will refer to the "root" item(s).
*/
@protocol NSOutlineViewDataSource <NSObject>
@optional
#pragma mark -
#pragma mark ***** Required Methods (unless bindings is used) *****
/* NOTE: it is not acceptable to call reloadData or reloadItem from the implementation of any of the following four methods, and doing so can cause corruption in NSOutlineViews internal structures.
*/
- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(nullable id)item;
- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(nullable id)item;
- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item;
/* NOTE: this method is optional for the View Based OutlineView.
*/
- (nullable id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(nullable NSTableColumn *)tableColumn byItem:(nullable id)item;
#pragma mark -
#pragma mark ***** Optional Methods *****
/* View Based OutlineView: This method is not applicable.
*/
- (void)outlineView:(NSOutlineView *)outlineView setObjectValue:(nullable id)object forTableColumn:(nullable NSTableColumn *)tableColumn byItem:(nullable id)item;
/* NOTE: Returning nil indicates the item no longer exists, and won't be re-expanded.
*/
- (nullable id)outlineView:(NSOutlineView *)outlineView itemForPersistentObject:(id)object;
/* NOTE: Returning nil indicates that the item's state will not be persisted.
*/
- (nullable id)outlineView:(NSOutlineView *)outlineView persistentObjectForItem:(nullable id)item;
/* Optional - Sorting Support
This is the indication that sorting needs to be done. Typically the data source will sort its data, reload, and adjust selections.
*/
- (void)outlineView:(NSOutlineView *)outlineView sortDescriptorsDidChange:(NSArray<NSSortDescriptor *> *)oldDescriptors;
/* Optional - Drag and Drop support
*/
/* Dragging Source Support - Required for multi-image dragging. Implement this method to allow the table to be an NSDraggingSource that supports multiple item dragging. Return a custom object that implements NSPasteboardWriting (or simply use NSPasteboardItem). Return nil to prevent a particular item from being dragged. If this method is implemented, then outlineView:writeItems:toPasteboard: will not be called.
*/
- (nullable id <NSPasteboardWriting>)outlineView:(NSOutlineView *)outlineView pasteboardWriterForItem:(id)item API_AVAILABLE(macos(10.7));
/* Dragging Source Support - Optional. Implement this method know when the dragging session is about to begin and to potentially modify the dragging session. 'draggedItems' is an array of items that we dragged, excluding items that were not dragged due to outlineView:pasteboardWriterForItem: returning nil. This array will directly match the pasteboard writer array used to begin the dragging session with [NSView beginDraggingSessionWithItems:event:source]. Hence, the order is deterministic, and can be used in -outlineView:acceptDrop:item:childIndex: when enumerating the NSDraggingInfo's pasteboard classes.
*/
- (void)outlineView:(NSOutlineView *)outlineView draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint forItems:(NSArray *)draggedItems API_AVAILABLE(macos(10.7));
/* Dragging Source Support - Optional. Implement this method know when the dragging session has ended. This delegate method can be used to know when the dragging source operation ended at a specific location, such as the trash (by checking for an operation of NSDragOperationDelete).
*/
- (void)outlineView:(NSOutlineView *)outlineView draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation API_AVAILABLE(macos(10.7));
/* Dragging Source Support - Optional for single-image dragging. This method is called after it has been determined that a drag should begin, but before the drag has been started. To refuse the drag, return NO. To start a drag, return YES and place the drag data onto the pasteboard (data, owner, etc...). The drag image and other drag related information will be set up and provided by the outline view once this call returns with YES. The items array is the list of items that will be participating in the drag.
*/
- (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pasteboard API_DEPRECATED("Use -outlineView:pasteboardWriterForItem: instead", macos(10.0, 10.15));
/* Dragging Destination Support - Required for multi-image dragging. Implement this method to allow the table to update dragging items as they are dragged over the view. Typically this will involve calling [draggingInfo enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:] and setting the draggingItem's imageComponentsProvider to a proper image based on the content. For View Based TableViews, one can use NSTableCellView's -draggingImageComponents and -draggingImageFrame.
*/
- (void)outlineView:(NSOutlineView *)outlineView updateDraggingItemsForDrag:(id <NSDraggingInfo>)draggingInfo API_AVAILABLE(macos(10.7));
/* Dragging Destination Support - This method is used by NSOutlineView to determine a valid drop target. Based on the mouse position, the outline view will suggest a proposed child 'index' for the drop to happen as a child of 'item'. This method must return a value that indicates which NSDragOperation the data source will perform. The data source may "re-target" a drop, if desired, by calling setDropItem:dropChildIndex: and returning something other than NSDragOperationNone. One may choose to re-target for various reasons (eg. for better visual feedback when inserting into a sorted position). On Leopard linked applications, this method is called only when the drag position changes or the dragOperation changes (ie: a modifier key is pressed). Prior to Leopard, it would be called constantly in a timer, regardless of attribute changes.
*/
- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id <NSDraggingInfo>)info proposedItem:(nullable id)item proposedChildIndex:(NSInteger)index;
/* Dragging Destination Support - This method is called when the mouse is released over an outline view that previously decided to allow a drop via the validateDrop method. The data source should incorporate the data from the dragging pasteboard at this time. 'index' is the location to insert the data as a child of 'item', and are the values previously set in the validateDrop: method.
*/
- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id <NSDraggingInfo>)info item:(nullable id)item childIndex:(NSInteger)index;
/* Dragging Destination Support - NSOutlineView data source objects can support file promised drags via by adding NSFilesPromisePboardType to the pasteboard in outlineView:writeItems:toPasteboard:. NSOutlineView implements -namesOfPromisedFilesDroppedAtDestination: to return the results of this data source method. This method should returns an array of filenames for the created files (filenames only, not full paths). The URL represents the drop location. For more information on file promise dragging, see documentation on the NSDraggingSource protocol and -namesOfPromisedFilesDroppedAtDestination:.
*/
- (NSArray<NSString *> *)outlineView:(NSOutlineView *)outlineView namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination forDraggedItems:(NSArray *)items API_DEPRECATED("Use NSFilePromiseReceiver objects instead", macos(10.0,10.13));
@end
#pragma mark -
@protocol NSOutlineViewDelegate <NSControlTextEditingDelegate>
@optional
#pragma mark -
#pragma mark ***** View Based TableView/OutlineView Support *****
/* View Based OutlineView: See the delegate method -tableView:viewForTableColumn:row: in NSTableView.
*/
- (nullable NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(nullable NSTableColumn *)tableColumn item:(id)item API_AVAILABLE(macos(10.7));
/* View Based OutlineView: See the delegate method -tableView:rowViewForRow: in NSTableView.
*/
- (nullable NSTableRowView *)outlineView:(NSOutlineView *)outlineView rowViewForItem:(id)item API_AVAILABLE(macos(10.7));
/* View Based OutlineView: This delegate method can be used to know when a new 'rowView' has been added to the table. At this point, you can choose to add in extra views, or modify any properties on 'rowView'.
*/
- (void)outlineView:(NSOutlineView *)outlineView didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row API_AVAILABLE(macos(10.7));
/* View Based OutlineView: This delegate method can be used to know when 'rowView' has been removed from the table. The removed 'rowView' may be reused by the table so any additionally inserted views should be removed at this point. A 'row' parameter is included. 'row' will be '-1' for rows that are being deleted from the table and no longer have a valid row, otherwise it will be the valid row that is being removed due to it being moved off screen.
*/
- (void)outlineView:(NSOutlineView *)outlineView didRemoveRowView:(NSTableRowView *)rowView forRow:(NSInteger)row API_AVAILABLE(macos(10.7));
#pragma mark -
#pragma mark ***** Regular Delegate Methods *****
/* NSOutlineView replacements for NSTableView delegate methods.
*/
- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(nullable NSTableColumn *)tableColumn item:(id)item;
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(nullable NSTableColumn *)tableColumn item:(id)item;
- (BOOL)selectionShouldChangeInOutlineView:(NSOutlineView *)outlineView;
/* Optional - Return YES if 'item' should be selected and 'NO' if it should not. For better performance, and greater control, it is recommended that you use outlineView:selectionIndexesForProposedSelection:.
*/
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item;
/* Optional - Return a set of new indexes to select when the user changes the selection with the keyboard or mouse. If implemented, this method will be called instead of outlineView:shouldSelectItem:. This method may be called multiple times with one new index added to the existing selection to find out if a particular index can be selected when the user is extending the selection with the keyboard or mouse. Note that 'proposedSelectionIndexes' will contain the entire newly suggested selection, and you can return the existing selection to avoid changing the selection.
*/
- (NSIndexSet *)outlineView:(NSOutlineView *)outlineView selectionIndexesForProposedSelection:(NSIndexSet *)proposedSelectionIndexes API_AVAILABLE(macos(10.5));
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectTableColumn:(nullable NSTableColumn *)tableColumn;
- (void)outlineView:(NSOutlineView *)outlineView mouseDownInHeaderOfTableColumn:(NSTableColumn *)tableColumn;
- (void)outlineView:(NSOutlineView *)outlineView didClickTableColumn:(NSTableColumn *)tableColumn;
- (void)outlineView:(NSOutlineView *)outlineView didDragTableColumn:(NSTableColumn *)tableColumn;
/* Optional - Tool Tip support
When the user pauses over a cell, the value returned from this method will be displayed in a tooltip. 'point' represents the current mouse location in view coordinates. If you don't want a tooltip at that location, return an empty string. On entry, 'rect' represents the proposed active area of the tooltip. By default, rect is computed as [cell drawingRectForBounds:cellFrame]. To control the default active area, you can modify the 'rect' parameter.
*/
- (NSString *)outlineView:(NSOutlineView *)outlineView toolTipForCell:(NSCell *)cell rect:(NSRectPointer)rect tableColumn:(nullable NSTableColumn *)tableColumn item:(id)item mouseLocation:(NSPoint)mouseLocation;
/* Optional - Variable Row Heights
Implement this method to support a table with varying row heights. The height returned by this method should not include intercell spacing. Returning a height of -1 will default to the rowHeight of the tableView for normal rows, and the system defined height for group rows. Performance Considerations: For large tables in particular, you should make sure that this method is efficient. NSTableView may cache the values this method returns, but this should NOT be depended on, as all values may not be cached. To signal a row height change, call -noteHeightOfRowsWithIndexesChanged:. For a given row, the same row height should always be returned until -noteHeightOfRowsWithIndexesChanged: is called, otherwise unpredicable results will happen. NSTableView automatically invalidates its entire row height cache in -reloadData, and -noteNumberOfRowsChanged.
*/
- (CGFloat)outlineView:(NSOutlineView *)outlineView heightOfRowByItem:(id)item;
/* View Based OutlineView: Optional - Item tinting customization
Implement this method to customize an item's tinting behavior. This is typically used for sidebars which may want custom colors. Return a non-nil `NSTintConfiguration` to specify a particular tinting behavior for the item's row, or return nil to inherit the tinting behavior from the item's parent. Items at the root of the outline inherit the default tint configuration.
*/
- (nullable NSTintConfiguration *)outlineView:(NSOutlineView *)outlineView tintConfigurationForItem:(id)item API_AVAILABLE(macos(11.0));
/* Optional - Type select support
Implement this method if you want to control the string that is used for type selection. You may want to change what is searched for based on what is displayed, or simply return nil for that row and/or column to not be searched. By default, all cells with text in them are searched. The default value when this delegate method is not implemented is [[outlineView preparedCellForColumn:tableColumn row:[outlineView rowForItem:item]] stringValue], and this value can be returned from the delegate method if desired.
*/
- (nullable NSString *)outlineView:(NSOutlineView *)outlineView typeSelectStringForTableColumn:(nullable NSTableColumn *)tableColumn item:(id)item API_AVAILABLE(macos(10.5));
/* Optional - Type select support
Implement this method if you want to control how type selection works. Return the first item that matches the searchString from within the range of startItem to endItem. It is possible for endItem to be less than startItem if the search will wrap. Return nil when there is no match. Include startItem as a possible match, but do not include endItem. It is not necessary to implement this method in order to support type select.
*/
- (nullable id)outlineView:(NSOutlineView *)outlineView nextTypeSelectMatchFromItem:(id)startItem toItem:(id)endItem forString:(NSString *)searchString API_AVAILABLE(macos(10.5));
/* Optional - Type select support
Implement this method if you would like to prevent a type select from happening based on the current event and current search string. Generally, this will be called from keyDown: and the event will be a key event. The search string will be nil if no type select has began.
*/
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldTypeSelectForEvent:(NSEvent *)event withCurrentSearchString:(nullable NSString *)searchString API_AVAILABLE(macos(10.5));
/* Optional - Expansion ToolTip support
Implement this method and return NO to prevent an expansion tooltip from appearing for a particular cell at 'item' in 'tableColumn'. See NSCell.h for more information on expansion tool tips.
*/
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldShowCellExpansionForTableColumn:(nullable NSTableColumn *)tableColumn item:(id)item API_AVAILABLE(macos(10.5));
/* Optional - Custom tracking support
It is possible to control the ability to track a cell or not. Normally, only selectable or selected cells can be tracked. If you implement this method, cells which are not selectable or selected can be tracked, and vice-versa. For instance, this allows you to have an NSButtonCell in a table which does not change the selection, but can still be clicked on and tracked.
*/
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldTrackCell:(NSCell *)cell forTableColumn:(nullable NSTableColumn *)tableColumn item:(id)item API_AVAILABLE(macos(10.5));
/* Optional - Different cells for each row
A different data cell can be returned for any particular tableColumn and item, or a cell that will be used for the entire row (a full width cell). The returned cell should properly implement copyWithZone:, since the cell may be copied by NSTableView. If the tableColumn is non-nil, you should return a cell, and generally you will want to default to returning the result from [tableColumn dataCellForRow:row].
When each row (identified by the item) is being drawn, this method will first be called with a nil tableColumn. At this time, you can return a cell that will be used to draw the entire row, acting like a group. If you do return a cell for the 'nil' tableColumn, be prepared to have the other corresponding datasource and delegate methods to be called with a 'nil' tableColumn value. If don't return a cell, the method will be called once for each tableColumn in the tableView, as usual.
*/
- (nullable NSCell *)outlineView:(NSOutlineView *)outlineView dataCellForTableColumn:(nullable NSTableColumn *)tableColumn item:(id)item API_AVAILABLE(macos(10.5));
/* Optional - Group rows.
Implement this method and return YES to indicate a particular row should have the "group row" style drawn for that row. If the cell in that row is an NSTextFieldCell and contains only a stringValue, the "group row" style attributes will automatically be applied for that cell.
*/
- (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item API_AVAILABLE(macos(10.5));
/* Optional - Controlling expanding/collapsing of items.
Called when the outlineView is about to expand 'item'. Implementations of this method should be fast. This method may be called multiple times if a given 'item' has children that are also being expanded. If NO is returned, 'item' will not be expanded, nor will its children (even if -[outlineView expandItem:item expandChildren:YES] is called).
*/
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldExpandItem:(id)item;
/* Optional - Controlling expanding/collapsing of items.
Called when the outlineView is about to collapse 'item'. Implementations of this method should be fast. If NO is returned, 'item' will not be collapsed, nor will its children (even if -[outlineView collapseItem:item collapseChildren:YES] is called).
*/
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldCollapseItem:(id)item;
/* Optional - OutlineCell (disclosure triangle button cell)
Implement this method to customize the "outline cell" used for the disclosure triangle button. customization of the "outline cell" used for the disclosure triangle button.
*/
- (void)outlineView:(NSOutlineView *)outlineView willDisplayOutlineCell:(id)cell forTableColumn:(nullable NSTableColumn *)tableColumn item:(id)item;
/* Optional - Autosizing table columns
Implement this method if you want to control how wide a column is made when the user double clicks on the resize divider. By default, NSTableView iterates every row in the table, accesses a cell via preparedCellAtRow:column:, and requests the "cellSize" to find the appropriate largest width to use. For large row counts, a monte carlo simulation is done instead of interating every row. For accurate performance, it is recommended that this method is implemented when using large tables.
*/
- (CGFloat)outlineView:(NSOutlineView *)outlineView sizeToFitWidthOfColumn:(NSInteger)column API_AVAILABLE(macos(10.6));
/* Optional - Control of column reordering.
Specifies if the column can be reordered to a new location, or not. 'columnIndex' is the column that is being dragged. The actual NSTableColumn instance can be retrieved from the [tableView tableColumns] array. 'newColumnIndex' is the new proposed target location for 'columnIndex'. When a column is initially dragged by the user, the delegate is first called with a 'newColumnIndex' of -1. Returning NO will disallow that column from being reordered at all. Returning YES allows it to be reordered, and the delegate will be called again when the column reaches a new location. If this method is not implemented, all columns are considered reorderable.
*/
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldReorderColumn:(NSInteger)columnIndex toColumn:(NSInteger)newColumnIndex API_AVAILABLE(macos(10.6));
/* Optional - Hiding the outline cell (disclosure triangle)
Allows the delegate to decide if the outline cell (disclosure triangle) for 'item' should be displayed or not. This method will only be called for expandable rows. If 'NO' is returned, -[outlineView frameOfOutlineCellAtRow:] will return NSZeroRect, causing the outline cell to be hidden. In addition, if 'NO' is returned, the row will not be collapsable by keyboard shortcuts.
*/
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldShowOutlineCellForItem:(id)item API_AVAILABLE(macos(10.6));
/* Notifications - see comments below for more information about the @"NSObject" parameter in the userInfo dictionary.
*/
- (void)outlineViewSelectionDidChange:(NSNotification *)notification;
- (void)outlineViewColumnDidMove:(NSNotification *)notification;
- (void)outlineViewColumnDidResize:(NSNotification *)notification;
- (void)outlineViewSelectionIsChanging:(NSNotification *)notification;
- (void)outlineViewItemWillExpand:(NSNotification *)notification;
- (void)outlineViewItemDidExpand:(NSNotification *)notification;
- (void)outlineViewItemWillCollapse:(NSNotification *)notification;
- (void)outlineViewItemDidCollapse:(NSNotification *)notification;
@end
/* The following NSOutlineView*Keys are used by the View Based NSOutlineView to create the "disclosure button" used to collapse and expand items. The NSOutlineView creates these buttons by calling [self makeViewWithIdentifier:owner:] passing in the key as the identifier and the delegate as the owner. Custom NSButtons (or subclasses thereof) can be provided for NSOutlineView to use in the following two ways:
1. makeViewWithIdentifier:owner: can be overridden, and if the identifier is (for instance) NSOutlineViewDisclosureButtonKey, a custom NSButton can be configured and returned. Be sure to set the button.identifier to be NSOutlineViewDisclosureButtonKey.
2. At design time, a button can be added to the outlineview which has this identifier, and it will be unarchived and used as needed.
When a custom button is used, it is important to properly set up the target/action to do something (probably expand or collapse the rowForView: that the sender is located in). Or, one can call super to get the default button, and copy its target/action to get the normal default behavior.
NOTE: These keys are backwards compatible to 10.7, however, the symbol is not exported prior to 10.9 and the regular string value must be used (i.e.: @"NSOutlineViewDisclosureButtonKey").
*/
APPKIT_EXTERN NSUserInterfaceItemIdentifier const NSOutlineViewDisclosureButtonKey API_AVAILABLE(macos(10.9)); // The normal triangle disclosure button
APPKIT_EXTERN NSUserInterfaceItemIdentifier const NSOutlineViewShowHideButtonKey API_AVAILABLE(macos(10.9)); // The show/hide button used in "Source Lists"
/* Notifications
*/
APPKIT_EXTERN NSNotificationName NSOutlineViewSelectionDidChangeNotification;
APPKIT_EXTERN NSNotificationName NSOutlineViewColumnDidMoveNotification; // @"NSOldColumn", @"NSNewColumn"
APPKIT_EXTERN NSNotificationName NSOutlineViewColumnDidResizeNotification; // @"NSTableColumn", @"NSOldWidth"
APPKIT_EXTERN NSNotificationName NSOutlineViewSelectionIsChangingNotification;
/* Note for the following NSOutlineViewItem*Notifications:
The 'userInfo' dictionary in the notification will have an @"NSObject" key where the value is the changed (id)item.
*/
APPKIT_EXTERN NSNotificationName NSOutlineViewItemWillExpandNotification;
APPKIT_EXTERN NSNotificationName NSOutlineViewItemDidExpandNotification;
APPKIT_EXTERN NSNotificationName NSOutlineViewItemWillCollapseNotification;
APPKIT_EXTERN NSNotificationName NSOutlineViewItemDidCollapseNotification;
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/NSMenuView.h | /*
NSMenuView.h
Application Kit
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#warning NSMenuView 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/NSAlert.h | /*
NSAlert.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSApplication.h>
#import <AppKit/NSHelpManager.h>
#import <AppKit/NSGraphics.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSTextField, NSPanel, NSWindow, NSImage, NSButton, NSError;
@protocol NSAlertDelegate;
/* The default alert style is NSAlertStyleWarning. NSAlertStyleCritical should be reserved for critical alerts and will cause the icon to be badged with a caution icon.
*/
typedef NS_ENUM(NSUInteger, NSAlertStyle) {
NSAlertStyleWarning = 0,
NSAlertStyleInformational = 1,
NSAlertStyleCritical = 2
};
/* These are additional NSModalResponse values used by NSAlert's -runModal and -beginSheetModalForWindow:completionHandler:.
By default, NSAlert return values are position dependent, with this mapping:
first (rightmost) button = NSAlertFirstButtonReturn
second button = NSAlertSecondButtonReturn
third button = NSAlertThirdButtonReturn
buttonPosition 3+x = NSAlertThirdButtonReturn + x
Note that these return values do not apply to an NSAlert created via +alertWithMessageText:defaultButton:alternateButton:otherButton:informativeTextWithFormat:, which instead uses the same return values as NSRunAlertPanel. See NSAlertDefaultReturn, etc. in NSPanel.h
*/
static const NSModalResponse NSAlertFirstButtonReturn = 1000;
static const NSModalResponse NSAlertSecondButtonReturn = 1001;
static const NSModalResponse NSAlertThirdButtonReturn = 1002;
NS_SWIFT_UI_ACTOR
@interface NSAlert : NSObject
/* Given an NSError, create an NSAlert that can be used to present the error to the user. The error's localized description, recovery suggestion, and recovery options will be used to set the alert's message text, informative text, and button titles, respectively.
*/
+ (NSAlert *)alertWithError:(NSError *)error;
@property (copy) NSString *messageText;
@property (copy) NSString *informativeText;
/* customize the icon. By default uses the image named NSApplicationIcon.
*/
@property (null_resettable, strong) NSImage *icon;
/* customize the buttons in the alert panel. Buttons are added from right to left (for left to right languages).
*/
- (NSButton *)addButtonWithTitle:(NSString *)title;
/* get the buttons, where the rightmost button is at index 0.
*/
@property (readonly, copy) NSArray<NSButton *> *buttons;
/* In order to customize a return value for a button:
setTag:(NSInteger)tag; setting a tag on a button will cause that tag to be the button's return value
Note that we reserve the use of the tag for this purpose. We also reserve the use of the target and the action.
By default, the first button has a key equivalent of return which implies a pulsing default button, the button named "Cancel", if any, has a key equivalent of escape, and the button named "Don't Save", if any, has a key equivalent of cmd-d. The following methods can be used to customize key equivalents:
setKeyEquivalent:(NSString *)charCode:
setKeyEquivalentModifierMask:(NSUInt)mask;
*/
/* -setShowsHelp:YES adds a help button to the alert panel. When the help button is pressed, the delegate is first consulted. If the delegate does not implement alertShowHelp: or returns NO, then -[NSHelpManager openHelpAnchor:inBook:] is called with a nil book and the anchor specified by -setHelpAnchor:, if any. An exception will be raised if the delegate returns NO and there is no help anchor set.
*/
@property BOOL showsHelp;
@property (nullable, copy) NSHelpAnchorName helpAnchor;
@property NSAlertStyle alertStyle;
/* The delegate of the receiver, currently only allows for custom help behavior of the alert.
For apps linked against 10.12, this property has zeroing weak memory semantics. When linked against an older SDK this back to having `retain` semantics, matching legacy behavior.
*/
@property (nullable, weak) id<NSAlertDelegate> delegate;
/* -setShowsSuppressionButton: indicates whether or not the alert should contain a suppression checkbox. The default is NO. This checkbox is typically used to give the user an option to not show this alert again. If shown, the suppression button will have a default localized title similar to @"Do not show this message again" (single-button alert) or @"Don't ask again" (multi-button alert). You can customize this title using [[alert suppressionButton] setTitle:]. When the alert is dismissed, you can get the state of the suppression button, using [[alert suppressionButton] state] and store the result in user defaults, for example. This setting can then be checked before showing the alert again. By default, the suppression button is positioned below the informative text, and above the accessory view (if any) and the alert buttons, and left-aligned with the informative text. However do not count on the placement of this button, since it might be moved if the alert panel user interface is changed in the future. If you need a checkbox for purposes other than suppression text, it is recommended you create your own using an accessory view.
*/
@property BOOL showsSuppressionButton API_AVAILABLE(macos(10.5));
/* -suppressionButton returns a suppression button which may be customized, including the title and the initial state. You can also use this method to get the state of the button after the alert is dismissed, which may be stored in user defaults and checked before showing the alert again. In order to show the suppression button in the alert panel, you must call -setShowsSuppressionButton:YES.
*/
@property (nullable, readonly, strong) NSButton *suppressionButton API_AVAILABLE(macos(10.5));
/* -setAccessoryView: sets the accessory view displayed in the alert panel. By default, the accessory view is positioned below the informative text and the suppression button (if any) and above the alert buttons, left-aligned with the informative text. If you want to customize the location of the accessory view, you must first call -layout. See the discussion of -layout for more information.
*/
@property (nullable, strong) NSView *accessoryView API_AVAILABLE(macos(10.5));
/* -layout can be used to indicate that the alert panel should do immediate layout, overriding the default behavior of laying out lazily just before showing panel. You should only call this method if you want to do your own custom layout after it returns. You should call this method only after you have finished with NSAlert customization, including setting message and informative text, and adding buttons and an accessory view if needed. You can make layout changes after this method returns, in particular to adjust the frame of an accessory view. Note that the standard layout of the alert may change in the future, so layout customization should be done with caution.
*/
- (void)layout API_AVAILABLE(macos(10.5));
/* Run the alert as an application-modal panel and return the result.
*/
- (NSModalResponse)runModal;
/* Begins a sheet on the doc window using NSWindow's sheet API.
If the alert has an alertStyle of NSAlertStyleCritical, it will be shown as a "critical" sheet; it will otherwise be presented as a normal sheet.
*/
- (void)beginSheetModalForWindow:(NSWindow *)sheetWindow completionHandler:(void (^ _Nullable)(NSModalResponse returnCode))handler API_AVAILABLE(macos(10.9));
/* return the application-modal panel or the document-modal sheet corresponding to this alert.
*/
@property (readonly, strong) NSWindow *window;
@end
@protocol NSAlertDelegate <NSObject>
@optional
/* the delegate should implement this if custom help behavior is required.
*/
- (BOOL)alertShowHelp:(NSAlert *)alert;
@end
@interface NSAlert (NSAlertDeprecated)
/* This was intended for use by apps migrating from the C-based API. This uses alternate return codes that were compatible with this C-based API, but not with modern alerts, see NSAlertDefaultReturn, etc. in NSPanel.h
Alerts should be created with the -init method and setting properties.
*/
+ (NSAlert *)alertWithMessageText:(nullable NSString *)message defaultButton:(nullable NSString *)defaultButton alternateButton:(nullable NSString *)alternateButton otherButton:(nullable NSString *)otherButton informativeTextWithFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(5,6) API_DEPRECATED("Use -init instead", macos(10.3,10.10));
- (void)beginSheetModalForWindow:(NSWindow *)window modalDelegate:(nullable id)delegate didEndSelector:(nullable SEL)didEndSelector contextInfo:(nullable void *)contextInfo API_DEPRECATED("Use -beginSheetModalForWindow:completionHandler: instead", macos(10.3,10.10));
@end
static const NSAlertStyle NSWarningAlertStyle API_DEPRECATED_WITH_REPLACEMENT("NSAlertStyleWarning", macos(10.3,10.12)) = NSAlertStyleWarning;
static const NSAlertStyle NSInformationalAlertStyle API_DEPRECATED_WITH_REPLACEMENT("NSAlertStyleInformational", macos(10.3,10.12)) = NSAlertStyleInformational;
static const NSAlertStyle NSCriticalAlertStyle API_DEPRECATED_WITH_REPLACEMENT("NSAlertStyleCritical", macos(10.3,10.12)) = NSAlertStyleCritical;
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSPageController.h | /*
NSPageController.h
Application Kit
Copyright (c) 2011-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <AppKit/NSAnimation.h>
#import <AppKit/NSViewController.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSMutableDictionary, NSView;
@protocol NSPageControllerDelegate;
typedef NSString * NSPageControllerObjectIdentifier NS_SWIFT_BRIDGED_TYPEDEF;
typedef NS_ENUM(NSInteger, NSPageControllerTransitionStyle) {
NSPageControllerTransitionStyleStackHistory, // Pages are stacked on top of each other. Pages animate out to the right to reveal the previous page. Next pages animate in from the right. (See Safari as an example)
NSPageControllerTransitionStyleStackBook, // Pages are stacked on top of each other. Pages animate out to the left to reveal the next page. Previous pages animate in from the left. (See Preview as an example)
NSPageControllerTransitionStyleHorizontalStrip // Each page is laid out next to each other in one long horizontal strip
} API_AVAILABLE(macos(10.8));
API_AVAILABLE(macos(10.8))
@interface NSPageController : NSViewController <NSAnimatablePropertyContainer, NSCoding>
@property (nullable, weak) IBOutlet id<NSPageControllerDelegate> delegate;
/* The viewController associated with the selected arrangedObject. May be nil if delegate is not supplying viewControllers.
*/
@property (nullable, readonly, strong) NSViewController *selectedViewController;
/* The animation style used when transitioning from one page to another. The default value is NSPageControllerTransitionStyleStackHistory */
@property NSPageControllerTransitionStyle transitionStyle;
/* Array of all displayed objects (after sorting and potentially filtering by you). The delegate will be asked for snapshots as they are needed. Alternatively, you may never directly set this array and use the -navigateForwardToRepresentedObject API to create a history as the user navigates. This property is KVO compliant.
*/
@property (copy) NSArray *arrangedObjects;
/* The index into the arrangedObjects that is being displayed. This property is KVO compliant. To animate a transition to a new index, use NSPageController's animator object. */
@property NSInteger selectedIndex;
/* Clears the arrangedObjects array after the selected index, adds the argument to the arrangedObjects array, and sets the selectedIndex to the argument.
*/
- (void)navigateForwardToObject:(id)object;
/* Hide the transition view used for animation and show the selectedViewController.view. Generally, this is called during pageControllerDidEndLiveTransition: in the delegate when the new contents of view is ready to be displayed.
*/
- (void)completeTransition;
/* Supported IBActions - all IB actions are animated and delegate LiveTransition methods are called. */
- (IBAction)navigateBack:(nullable id)sender;
- (IBAction)navigateForward:(nullable id)sender;
- (IBAction)takeSelectedIndexFrom:(nullable id)sender; // sender must respond to -integerValue;
@end
@protocol NSPageControllerDelegate <NSObject>
@required
@optional
/* HISTORY MODE - If you want NSPageController to completely manage the arrangedObjects and snapshots then do not implement the following 2 methods.
CUSTOM MODE - If you manually set the arrangedObjects, then NSPageController does not have any chance to take snapshots of all the objects. In this case, or if you just need more control, you are required to implement the following 2 methods so that navigation can properly occur.
*/
/* Return the identifier of the view controller that owns a view to display the object. If NSPageController does not have an unused viewController for this identifier, then you will be asked to create one via pageController:viewControllerForIdentifier.
*/
- (NSPageControllerObjectIdentifier)pageController:(NSPageController *)pageController identifierForObject:(id)object;
/* NSPageController will cache as many viewControllers and views as necessary to maintain performance. This method is called whenever another instance is required. Note: The viewController may become the selectedViewController after a transition if necessary.
*/
- (NSViewController *)pageController:(NSPageController *)pageController viewControllerForIdentifier:(NSPageControllerObjectIdentifier)identifier;
/* NOTE: The following 2 methods are only useful if you also implement the above two methods.
*/
/* You only need to implement this if the view frame can differ between arrangedObjects. This method must return immediately. Avoid file, network or any potentially blocking or lengthy work to provide an answer. This method is called with a nil object to get the default frame size. If this method is not implemented, all arrangedObjects are assumed to have the same frame as the current selectedViewController.view or the bounds of view when selectedViewController is nil.
*/
- (NSRect)pageController:(NSPageController *)pageController frameForObject:(nullable id)object;
/* Prepare the viewController and view for drawing. Setup data sources and perform layout. Note: a nil object is passed for the purposes of caching a rendering of a default viewController. Note: this method is called on the main thread and should return immediately. The view will be asked to draw on a background thread and must support background drawing. If this method is not implemented, then viewController's representedObject is set to the representedObject.
*/
- (void)pageController:(NSPageController *)pageController prepareViewController:(NSViewController *)viewController withObject:(nullable id)object;
/* Note: You may find these useful regardless of which way you use NSPageController (History vs Custom).
*/
/* This message is sent when any page transition is completed. */
- (void)pageController:(NSPageController *)pageController didTransitionToObject:(id)object;
/* This message is sent when the user begins a transition wither via swipe gesture of one of the navigation IBAction methods. */
- (void)pageControllerWillStartLiveTransition:(NSPageController *)pageController;
/* This message is sent when a transition animation completes either via swipe gesture or one of the navigation IBAction methods. Your content view is still hidden and you must call -completeTransition; on pageController when your content is ready to show. If completed successfully, a pageController:didTransitionToRepresentedObject: will already have been sent.
*/
- (void)pageControllerDidEndLiveTransition:(NSPageController *)pageController;
@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/NSTabView.h | /*
NSTabView.h
Application Kit
Copyright (c) 2000-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSView.h>
#import <AppKit/NSCell.h>
#import <AppKit/NSLayoutConstraint.h>
#import <AppKit/NSApplication.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSFont, NSTabViewItem;
@protocol NSTabViewDelegate;
static const NSAppKitVersion NSAppKitVersionNumberWithDirectionalTabs = 631.0;
// Use tabPosition and tabViewBorderType instead
typedef NS_ENUM(NSUInteger, NSTabViewType) {
NSTopTabsBezelBorder = 0, // the default
NSLeftTabsBezelBorder = 1,
NSBottomTabsBezelBorder = 2,
NSRightTabsBezelBorder = 3,
NSNoTabsBezelBorder = 4,
NSNoTabsLineBorder = 5,
NSNoTabsNoBorder = 6
};
typedef NS_ENUM(NSUInteger, NSTabPosition) {
NSTabPositionNone = 0,
NSTabPositionTop = 1,
NSTabPositionLeft = 2,
NSTabPositionBottom = 3,
NSTabPositionRight = 4
} API_AVAILABLE(macos(10.12));
typedef NS_ENUM(NSUInteger, NSTabViewBorderType) {
NSTabViewBorderTypeNone = 0,
NSTabViewBorderTypeLine = 1,
NSTabViewBorderTypeBezel = 2
} API_AVAILABLE(macos(10.12));
@interface NSTabView : NSView
/* Select */
- (void)selectTabViewItem:(nullable NSTabViewItem *)tabViewItem;
- (void)selectTabViewItemAtIndex:(NSInteger)index; // May raise an NSRangeException
- (void)selectTabViewItemWithIdentifier:(id)identifier; // May raise an NSRangeException if identifier not found
- (void)takeSelectedTabViewItemFromSender:(nullable id)sender; // May raise an NSRangeException
/* Navigation */
- (void)selectFirstTabViewItem:(nullable id)sender;
- (void)selectLastTabViewItem:(nullable id)sender;
- (void)selectNextTabViewItem:(nullable id)sender;
- (void)selectPreviousTabViewItem:(nullable id)sender;
/* Getters */
@property (nullable, readonly, strong) NSTabViewItem *selectedTabViewItem; // return nil if none are selected
@property (strong) NSFont *font; // returns font used for all tab labels.
@property NSTabViewType tabViewType; // Use tabPosition and tabViewBorderType instead. Setting this will also set the tabPosition and tabViewBorderType. Setting tabPosition or tabViewBorderType will affect tabViewType
@property NSTabPosition tabPosition API_AVAILABLE(macos(10.12));
@property NSTabViewBorderType tabViewBorderType API_AVAILABLE(macos(10.12)); // This will only be respected if NSTabPosition is NSTabPositionNone.
@property (copy) NSArray<__kindof NSTabViewItem *> *tabViewItems;
@property BOOL allowsTruncatedLabels;
@property (readonly) NSSize minimumSize; // returns the minimum size of the tab view
@property BOOL drawsBackground; // only relevant for borderless tab view type
@property NSControlSize controlSize;
/* Add/Remove tabs */
- (void)addTabViewItem:(NSTabViewItem *)tabViewItem; // Add tab at the end.
- (void)insertTabViewItem:(NSTabViewItem *)tabViewItem atIndex:(NSInteger)index;// May raise an NSRangeException
- (void)removeTabViewItem:(NSTabViewItem *)tabViewItem; // tabViewItem must be an existing tabViewItem
/* Delegate */
@property (nullable, weak) id<NSTabViewDelegate> delegate;
/* Hit testing */
- (nullable NSTabViewItem *)tabViewItemAtPoint:(NSPoint)point; // point in local coordinates. returns nil if none.
/* Geometry */
@property (readonly) NSRect contentRect; // Return the rect available for a "page".
/* Query */
@property (readonly) NSInteger numberOfTabViewItems;
- (NSInteger)indexOfTabViewItem:(NSTabViewItem *)tabViewItem; // NSNotFound if not found
- (NSTabViewItem *)tabViewItemAtIndex:(NSInteger)index; // May raise an NSRangeException
- (NSInteger)indexOfTabViewItemWithIdentifier:(id)identifier; // NSNotFound if not found
@property NSControlTint controlTint API_DEPRECATED("The controlTint property is not respected on 10.14 and later.", macos(10.0, 10.14));
@end
//================================================================================
// NSTabViewDelegate protocol
//================================================================================
@protocol NSTabViewDelegate <NSObject>
@optional
- (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(nullable NSTabViewItem *)tabViewItem;
- (void)tabView:(NSTabView *)tabView willSelectTabViewItem:(nullable NSTabViewItem *)tabViewItem;
- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(nullable NSTabViewItem *)tabViewItem;
- (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)tabView;
@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/NSTextViewportLayoutController.h | #if (defined(USE_APPKIT_PUBLIC_HEADERS) && USE_APPKIT_PUBLIC_HEADERS) || !__has_include(<UIFoundation/NSTextViewportLayoutController.h>)
#include <TargetConditionals.h>
#if !TARGET_OS_IPHONE
//
// NSTextViewportLayoutController.h
// Text Kit
//
// Copyright (c) 2017-2021, Apple Inc. All rights reserved.
//
#import <Foundation/NSObject.h>
#import <CoreGraphics/CGGeometry.h>
@class NSTextRange;
@class NSTextLayoutManager;
@class NSTextLayoutFragment;
@class NSTextViewportLayoutController;
@protocol NSTextLocation;
NS_ASSUME_NONNULL_BEGIN
// A viewport is a rectangular area within a flipped coordinate system expanding along the y-axis. With text contents, lines advance along the expanding direction typically. It defines the active area where text layout fragments laid out. The area corresponds to the user visible area with additional over-scroll region in most cases. NSTextViewportLayoutController manages the layout process inside the viewport interacting with its delegate.
#pragma mark NSTextViewportLayoutControllerDelegate
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@protocol NSTextViewportLayoutControllerDelegate <NSObject>
#pragma mark Properties
// The current viewport, typically the view visible bounds with overdraw.
- (CGRect)viewportBoundsForTextViewportLayoutController:(NSTextViewportLayoutController *)textViewportLayoutController;
#pragma mark Viewport layout
// Called when textViewportLayoutController lays out a given textLayoutFragment.
// The delegate should arrange to present the text layout fragment in the UI, e.g. a sublayer/subview.
// Layout information such as viewportBounds on textViewportLayoutController is not up-to-date at the point of this call.
- (void)textViewportLayoutController:(NSTextViewportLayoutController *)textViewportLayoutController configureRenderingSurfaceForTextLayoutFragment:(NSTextLayoutFragment *)textLayoutFragment;
@optional
#pragma mark Layout Process Observation
// Called when textViewportLayoutController is about to layout.
// Layout information on textViewportLayoutController is up-to-date at the point of this call.
- (void)textViewportLayoutControllerWillLayout:(NSTextViewportLayoutController *)textViewportLayoutController;
// Called when textViewportLayoutController is about to layout.
// Layout information on textViewportLayoutController is up-to-date at the point of this call.
- (void)textViewportLayoutControllerDidLayout:(NSTextViewportLayoutController *)textViewportLayoutController;
@end
#pragma mark NSTextViewportLayoutController
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@interface NSTextViewportLayoutController : NSObject
#pragma mark Initialization
- (instancetype)initWithTextLayoutManager:(NSTextLayoutManager *)textLayoutManager NS_DESIGNATED_INITIALIZER;
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
#pragma mark Properties
// The viewport layout delegate.
@property (nullable, weak) id <NSTextViewportLayoutControllerDelegate> delegate;
// The provider of viewport text layout fragments.
@property (weak, readonly) NSTextLayoutManager *textLayoutManager;
#pragma mark Viewport layout state
// The viewport of the current layout.
// Not KVO-compliant.
@property (readonly) CGRect viewportBounds;
// The text range of the current viewport layout.
// Not KVO-compliant.
@property (nullable, readonly) NSTextRange *viewportRange;
#pragma mark Viewport layout
// Performs layout in the viewport.
- (void)layoutViewport;
// Relocates the viewport to start with the specified *location*.
// This is used to programmatically scroll to the specified *location*.
// Returns the suggested viewport anchor point.
- (CGFloat)relocateViewportToTextLocation:(id <NSTextLocation>)textLocation;
// Adjusts the viewport rect by the specified offset if needed.
// This is used to artificially move the viewport without affecting viewport content, can be both positive/negative offset.
- (void)adjustViewportByVerticalOffset:(CGFloat)verticalOffset;
@end
NS_ASSUME_NONNULL_END
#endif // !TARGET_OS_IPHONE
#else
#import <UIFoundation/NSTextViewportLayoutController.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/NSTextInputContext.h | /*
NSTextInputContext.h
Application Kit
Copyright (c) 2008-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSTextInputClient.h>
#import <Foundation/NSNotification.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSEvent;
typedef NSString * NSTextInputSourceIdentifier NS_SWIFT_BRIDGED_TYPEDEF;
API_AVAILABLE(macos(10.6))
@interface NSTextInputContext : NSObject
/* The current activated text input context object. The Cocoa Text Input system communicates primarily with the client of the activated input context via the NSTextInputClient protocol.
*/
@property (class, readonly, nullable, strong) NSTextInputContext *currentInputContext;
/* The designated initializer.
*/
- (instancetype)initWithClient:(id <NSTextInputClient>)client NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE; // Use the designated initializer initWithClient:
/**** Properties *****/
/* Returns the owner of this input context. The owner, typically an NSView, retains its NSTextInputContext instance. NSTextInputContext doesn't retain its client.
*/
@property(readonly) id <NSTextInputClient> client;
/* Indicates whether the client handles NSGlyphInfoAttributeName or not. The default value is determined by examining the return value sending -validAttributesForMarkedText to client at initialization.
*/
@property BOOL acceptsGlyphInfo;
/* Specifies the set of keyboard input source locales allowed when this input context is active. NSAllRomanInputSourcesLocaleIdentifier can be specified as a valid locale.
*/
@property(nullable, copy) NSArray<NSString *> *allowedInputSourceLocales;
/**** Activation *****/
/* Invoked when the receiver gets activated/deactivated.
*/
- (void)activate;
- (void)deactivate;
/**** Input source interface ****/
/* Tells the Cocoa Text Input system to handle mouse/key events. Returns YES if the system consumed the event.
*/
- (BOOL)handleEvent:(NSEvent *)event;
/* Notifies the system to discard the current conversion session. The client should clear its marked range when sending this message.
*/
- (void)discardMarkedText;
/* Notifies the text input system that information related to character positions, including the document's visual coordinates, text selection, and document contents, has been modified. Text engines implementing the NSTextInputClient protocol should send this message whenever any of these changes occur, and -[NSTextInputContext handleEvent:] will not otherwise be called. -handleEvent: serves as an implicit notification that any of these changes could have occurred.
*/
- (void)invalidateCharacterCoordinates;
/**** Text Input sources handling ****/
/* Text Input source handling API identifies text input sources with text input source identifier strings (i.e. "com.apple.inputmethod.Kotoeri.Japanese") supplied by the underlying TextInputSources framework. The ID corresponds to the kTISPropertyInputSourceID attribute.
*/
/* The array of keyboard text input source identifier strings available to the receiver.
*/
@property(nullable, readonly) NSArray<NSTextInputSourceIdentifier> *keyboardInputSources;
/* The identifier string for the selected keyboard text input source.
*/
@property(nullable, copy) NSTextInputSourceIdentifier selectedKeyboardInputSource;
/**** Text Input source attributes ****/
/* Returns the display name for inputSourceIdentifier.
*/
+ (nullable NSString *)localizedNameForInputSource:(NSTextInputSourceIdentifier)inputSourceIdentifier;
@end
/**** Notifications ****/
/* Notified whenever the selected text input source changes.
*/
APPKIT_EXTERN NSNotificationName NSTextInputContextKeyboardSelectionDidChangeNotification API_AVAILABLE(macos(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/NSTextSelectionNavigation.h | #if (defined(USE_APPKIT_PUBLIC_HEADERS) && USE_APPKIT_PUBLIC_HEADERS) || !__has_include(<UIFoundation/NSTextSelectionNavigation.h>)
#include <TargetConditionals.h>
#if !TARGET_OS_IPHONE
//
// NSTextSelectionNavigation.h
// Text Kit
//
// Copyright (c) 2019-2021, Apple Inc. All rights reserved.
//
#import <Foundation/NSObject.h>
#import <CoreGraphics/CGGeometry.h>
#import <AppKit/NSTextSelection.h>
NS_ASSUME_NONNULL_BEGIN
@class NSTextSelection;
@class NSTextRange;
@class NSTextLineFragment;
@protocol NSTextLocation;
@protocol NSTextSelectionDataSource;
// NSTextSelectionNavigation is an interface exposing methods for obtaining results from actions performed on text selections. It returns the essential information necessary for editing, selecting, and navigating operations.
typedef NS_ENUM(NSInteger, NSTextSelectionNavigationDirection) {
// Logical directions
// Works with just character information
NSTextSelectionNavigationDirectionForward,
NSTextSelectionNavigationDirectionBackward,
// Visual directions
// Requires layout information if the direction is along the line (i.e. right and left for a horizontal line). Otherwise, it gets resolved to the corresponding logical direction except for NSTextSelectionNavigationDestinationCharacter
NSTextSelectionNavigationDirectionRight,
NSTextSelectionNavigationDirectionLeft,
NSTextSelectionNavigationDirectionUp,
NSTextSelectionNavigationDirectionDown
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
typedef NS_ENUM(NSInteger, NSTextSelectionNavigationDestination) {
NSTextSelectionNavigationDestinationCharacter, // Moving to the next extended grapheme cluster boundary. Could result in a location inside a cluster depending on operations. When the movement direction is not along the line (i.e. up and down for a horizontal line), it moves to the adjacent line using the anchor point instead of resolving to the logical direction
NSTextSelectionNavigationDestinationWord, // Moving to the next word boundary. Ignores punctuations, whitespaces, and format characters preceding the next word
NSTextSelectionNavigationDestinationLine, // Moving to the next line boundary. The boundary can be logical based on the line separator characters as well as visual with soft line wrapping
NSTextSelectionNavigationDestinationSentence, // Moving to the next sentence boundary. Ignores punctuations, whitespaces, and format characters preceding the next sentence
NSTextSelectionNavigationDestinationParagraph, // Moving to the next paragraph boundary. Ignores the end of line elastic characters and paragraph separators
NSTextSelectionNavigationDestinationContainer, // Moving to the next container/page boundary. Ignores the end of line elastic characters and container/page separators
NSTextSelectionNavigationDestinationDocument, // Moving to the document boundary
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
typedef NS_OPTIONS(NSUInteger, NSTextSelectionNavigationModifier) {
NSTextSelectionNavigationModifierExtend = (1 << 0), // Extends the selection by not moving the initial location while drag selection
NSTextSelectionNavigationModifierVisual = (1 << 1), // Extends the selection visually inside the rectangular area defined by the anchor and dragged positions
NSTextSelectionNavigationModifierMultiple = (1 << 2), // Extends the selection visually inside the rectangular area defined by the anchor and dragged positions and produces an NSTextSelection per line
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
typedef NS_ENUM(NSInteger, NSTextSelectionNavigationWritingDirection) {
NSTextSelectionNavigationWritingDirectionLeftToRight = 0, // Left to right writing direction
NSTextSelectionNavigationWritingDirectionRightToLeft = 1 // Right to left writing direction
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
typedef NS_ENUM(NSInteger, NSTextSelectionNavigationLayoutOrientation) {
NSTextSelectionNavigationLayoutOrientationHorizontal = 0, // Lines rendered horizontally, grow top to bottom
NSTextSelectionNavigationLayoutOrientationVertical = 1, // Lines rendered vertically, grow right to left
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@interface NSTextSelectionNavigation : NSObject
#pragma mark Initialization
- (instancetype)initWithDataSource:(id <NSTextSelectionDataSource>)dataSource NS_DESIGNATED_INITIALIZER;
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
#pragma mark Properties
// The data source object providing the layout and document content information.
@property (readonly, weak) id <NSTextSelectionDataSource> textSelectionDataSource;
// If YES, the object could produce selections with multiple disjoint ranges.
@property BOOL allowsNonContiguousRanges;
// If YES, rotates the coordinate system for arguments passed to the navigation methods such as -textSelectionsInteractingAtPoint:inContainerAtLocation:anchors:modifiers:selecting:bounds: based on the text container layout orientation. NO by default.
@property BOOL rotatesCoordinateSystemForLayoutOrientation;
#pragma mark Layout Information Cache
// Flushes cached layout information. Should be called whenever the document contents get changed.
- (void)flushLayoutCache;
#pragma mark Selection & Cursor Navigation
// Returns a text selection moved from textSelection by the navigating operation presented by direction, destination, and extending. Returns nil when the requested operation does not produce any logically valid result. If 'confined' is YES, confine any movement to the text element that the selection already lies within.
- (nullable NSTextSelection *)destinationSelectionForTextSelection:(NSTextSelection *)textSelection direction:(NSTextSelectionNavigationDirection)direction destination:(NSTextSelectionNavigationDestination)destination extending:(BOOL)extending confined:(BOOL)confined;
// Returns an array of text selections produced with tap/mouse down at point. anchors defines the last text selection state if selecting=YES or NSTextSelectionNavigationModifierExtend. selecting=YES indicates it's in a text selection dragging session. bounds defines the view area in the container coordinate system that can interact with events. It is typically the view's visible area.
- (NSArray<NSTextSelection *> *)textSelectionsInteractingAtPoint:(CGPoint)point inContainerAtLocation:(id <NSTextLocation>)containerLocation anchors:(NSArray <NSTextSelection *> *)anchors modifiers:(NSTextSelectionNavigationModifier)modifiers selecting:(BOOL)selecting bounds:(CGRect)bounds;
// Returns a text selection expanded to the nearest boundaries for selectionGranularity enclosing textSelection.textRanges. The returned selection will have granularity=selectionGranularity.
- (NSTextSelection *)textSelectionForSelectionGranularity:(NSTextSelectionGranularity)selectionGranularity enclosingTextSelection:(NSTextSelection *)textSelection;
// Returns a text selection expanded to the nearest boundaries for selectionGranularity that contains point in the coordinate system of the text container at containerLocation. The returned selection will have granularity=selectionGranularity.
- (nullable NSTextSelection *)textSelectionForSelectionGranularity:(NSTextSelectionGranularity)selectionGranularity enclosingPoint:(CGPoint)point inContainerAtLocation:(id <NSTextLocation>)location;
#pragma mark Editing
// Returns the resolved location for inserting the next input if textSelection is isLogical=NO && secondarySelectionLocation!=nil. If not, returns nil.
- (nullable id <NSTextLocation>)resolvedInsertionLocationForTextSelection:(NSTextSelection *)textSelection writingDirection:(NSTextSelectionNavigationWritingDirection)writingDirection;
// Returns the ranges that should be deleted based on textSelection and movement arguments. The selection after deletion should contain a 0-length range starting at the location of the first range returned. destination is ignored when textSelection has a non-empty selection. allowsDecomposition only applies to NSTextSelectionNavigationDirectionBackward and NSTextSelectionNavigationDestinationCharacter with 0-length selection.
- (NSArray<NSTextRange *> *)deletionRangesForTextSelection:(NSTextSelection *)textSelection direction:(NSTextSelectionNavigationDirection)direction destination:(NSTextSelectionNavigationDestination)destination allowsDecomposition:(BOOL)allowsDecomposition;
@end
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@protocol NSTextSelectionDataSource <NSObject>
@required
// Declares the starting and ending locations for the document.
@property (strong, readonly) NSTextRange *documentRange;
// Enumerating the textual segment boundaries starting at location. The segmentation logic should be based on the natural language semantics and rules such as Unicode Text Segmentation UAX 29. It is allowed to have custom text segmentation behavior for specialized document contents (i.e. text editors with structured document contents such as a programming language). NSStringEnumerationByLines should be aware of the visual line boundaries based on soft line wrapping.
- (void)enumerateSubstringsFromLocation:(id <NSTextLocation>)location options:(NSStringEnumerationOptions)options usingBlock:(void (NS_NOESCAPE ^)(NSString * _Nullable substring, NSTextRange *substringRange, NSTextRange * _Nullable enclosingRange, BOOL *stop))block;
// Returns a text range corresponding to selectionGranularity enclosing location. Returns nil when documentRange.isEmpty=YES.
- (nullable NSTextRange *)textRangeForSelectionGranularity:(NSTextSelectionGranularity)selectionGranularity enclosingLocation:(id <NSTextLocation>)location;
// 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;
// Returns the base writing direction at location. It is recommended to return the resolved base direction either NSTextSelectionNavigationWritingDirectionLeftToRight or NSTextSelectionNavigationWritingDirectionRightToLeft.
- (NSTextSelectionNavigationWritingDirection)baseWritingDirectionAtLocation:(id <NSTextLocation>)location;
// Layout
// Enumerates all the caret offset from left to right in visual order. caretOffset should be in the coordinate system for the text container. When leadingEdge=YES, it indicates caretOffset is at the edge logically preceding the character. For LTR characters, it is on the left, and on the right for RTL characters.
- (void)enumerateCaretOffsetsInLineFragmentAtLocation:(id<NSTextLocation>)location usingBlock:(void (NS_NOESCAPE ^)(CGFloat caretOffset, id <NSTextLocation> location, BOOL leadingEdge, BOOL * stop))block;
// Returns the range of the line fragment containing point inside the coordinate system containing location.
- (nullable NSTextRange *)lineFragmentRangeForPoint:(CGPoint)point inContainerAtLocation:(id <NSTextLocation>)location;
@optional
// This optional method should be implemented enumerating the text container/page boundary when the text selection data provider supports such a layout functionality.
- (void)enumerateContainerBoundariesFromLocation:(id <NSTextLocation>)location reverse:(BOOL)reverse usingBlock:(void (NS_NOESCAPE ^)(id <NSTextLocation> boundaryLocation, BOOL *stop))block;
// Returns the text layout orientation at location. If not implemented, NSTextSelectionNavigation assumes it is NSTextSelectionNavigationLayoutOrientationHorizontal.
- (NSTextSelectionNavigationLayoutOrientation)textLayoutOrientationAtLocation:(id <NSTextLocation>)location;
@end
NS_ASSUME_NONNULL_END
#endif // !TARGET_OS_IPHONE
#else
#import <UIFoundation/NSTextSelectionNavigation.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/NSControl.h | /*
NSControl.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSView.h>
#import <AppKit/NSText.h>
#import <AppKit/NSCell.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSCell, NSFont, NSTextView, NSNotification, NSAttributedString, NSFormatter;
@interface NSControl : NSView
- (instancetype)initWithFrame:(NSRect)frameRect NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
@property (nullable, weak) id target; // Target is weak for zeroing-weak compatible objects in apps linked on 10.10 or later. Otherwise the behavior of this property is 'assign’.
@property (nullable) SEL action;
@property NSInteger tag;
@property BOOL ignoresMultiClick;
@property (getter=isContinuous) BOOL continuous;
@property (getter=isEnabled) BOOL enabled;
@property BOOL refusesFirstResponder;
@property (getter=isHighlighted) BOOL highlighted API_AVAILABLE(macos(10.10));
@property NSControlSize controlSize API_AVAILABLE(macos(10.10));
@property (nullable, strong) __kindof NSFormatter *formatter;
@property (nullable, copy) id /* id<NSCopying> */ objectValue;
@property (copy) NSString *stringValue;
@property (copy) NSAttributedString *attributedStringValue;
@property int intValue;
@property NSInteger integerValue;
@property float floatValue;
@property double doubleValue;
- (NSSize)sizeThatFits:(NSSize)size API_AVAILABLE(macos(10.10));
- (void)sizeToFit;
- (NSInteger)sendActionOn:(NSEventMask)mask;
- (BOOL)sendAction:(nullable SEL)action to:(nullable id)target;
- (void)takeIntValueFrom:(nullable id)sender;
- (void)takeFloatValueFrom:(nullable id)sender;
- (void)takeDoubleValueFrom:(nullable id)sender;
- (void)takeStringValueFrom:(nullable id)sender;
- (void)takeObjectValueFrom:(nullable id)sender;
- (void)takeIntegerValueFrom:(nullable id)sender API_AVAILABLE(macos(10.5));
- (void)mouseDown:(NSEvent *)event;
- (void)performClick:(nullable id)sender;
/* The following methods apply only to controls with apparent textual content of some sort (buttons with labels, textfields, etc.).
*/
@property (nullable, copy) NSFont *font;
@property BOOL usesSingleLineMode API_AVAILABLE(macos(10.10));
#if !TARGET_OS_IPHONE
@property NSLineBreakMode lineBreakMode API_AVAILABLE(macos(10.10));
@property NSTextAlignment alignment;
@property NSWritingDirection baseWritingDirection;
#endif
/* Gets and sets the ability for expansion tool tips to be shown or not. Expansion tooltips are automatically shown when the cell can not show the full content. This is controlled by the NSCell API expansionFrameWithFrame:inView: and is drawn by drawWithExpansionFrame:inView:. The default value is NO.
This value is encoded along with the control. In general, it is recommended to turn this on for NSTextFields in a View Based NSTableView.
*/
@property BOOL allowsExpansionToolTips API_AVAILABLE(macos(10.8));
/* Allows the control to return an expansion tool tip frame if contentFrame is too small for the entire contents in the view. When the mouse is hovered over the text in certain controls, the full contents will be shown in a special floating tool tip view. If the frame is not too small, return an empty rect, and no expansion tool tip view will be shown. By default, NSControl returns NSZeroRect, while some subclasses (such as NSTextField) will return the proper frame when required.
*/
- (NSRect)expansionFrameWithFrame:(NSRect)contentFrame API_AVAILABLE(macos(10.10));
/* Allows the control to perform custom expansion tool tip drawing. Note that the view may be different from the original view that the text appeared in.
*/
- (void)drawWithExpansionFrame:(NSRect)contentFrame inView:(NSView *)view API_AVAILABLE(macos(10.10));
@end
/* The following category applies only to controls with editable text, like NSTextField.
*/
@interface NSControl(NSControlEditableTextMethods)
- (nullable NSText *)currentEditor;
- (BOOL)abortEditing;
- (void)validateEditing;
- (void)editWithFrame:(NSRect)rect editor:(NSText *)textObj delegate:(nullable id)delegate event:(NSEvent *)event API_AVAILABLE(macos(10.10));
- (void)selectWithFrame:(NSRect)rect editor:(NSText *)textObj delegate:(nullable id)delegate start:(NSInteger)selStart length:(NSInteger)selLength API_AVAILABLE(macos(10.10));
- (void)endEditing:(NSText *)textObj API_AVAILABLE(macos(10.10));
@end
@protocol NSControlTextEditingDelegate <NSObject>
@optional
- (void)controlTextDidBeginEditing:(NSNotification *)obj;
- (void)controlTextDidEndEditing:(NSNotification *)obj;
- (void)controlTextDidChange:(NSNotification *)obj;
// These delegate and notification methods are sent from NSControl subclasses that allow text editing such as NSTextField and NSMatrix. The classes that need to send these have delegates. NSControl does not.
- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor;
- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
- (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(nullable NSString *)error;
- (void)control:(NSControl *)control didFailToValidatePartialString:(NSString *)string errorDescription:(nullable NSString *)error;
- (BOOL)control:(NSControl *)control isValidObject:(nullable id)obj;
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector;
- (NSArray<NSString *> *)control:(NSControl *)control textView:(NSTextView *)textView completions:(NSArray<NSString *> *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger *)index;
@end
// userInfo keys:
APPKIT_EXTERN NSNotificationName NSControlTextDidBeginEditingNotification; // @"NSFieldEditor"
APPKIT_EXTERN NSNotificationName NSControlTextDidEndEditingNotification; // @"NSFieldEditor"
APPKIT_EXTERN NSNotificationName NSControlTextDidChangeNotification; // @"NSFieldEditor"
@interface NSControl (NSDeprecated)
// Use formatters instead. See -[NSControl formatter] and -[NSControl setFormatter:].
- (void)setFloatingPointFormat:(BOOL)autoRange left:(NSUInteger)leftDigits right:(NSUInteger)rightDigits API_DEPRECATED("", macos(10.0,10.0));
@property (class, nullable) Class cellClass;
@property (nullable, strong) __kindof NSCell *cell;
- (nullable __kindof NSCell *)selectedCell;
- (NSInteger)selectedTag;
- (void)setNeedsDisplay API_DEPRECATED("Set the needsDisplay property to YES instead", macos(10.0,10.14));
- (void)calcSize API_DEPRECATED("Override -layout instead. This method should never be called", macos(10.0,10.14));
- (void)updateCell:(NSCell *)cell;
- (void)updateCellInside:(NSCell *)cell;
- (void)drawCellInside:(NSCell *)cell;
- (void)drawCell:(NSCell *)cell;
- (void)selectCell:(NSCell *)cell;
@end
#if __swift__ < 40200
@interface NSObject(NSControlSubclassNotifications)
- (void)controlTextDidBeginEditing:(NSNotification *)obj API_DEPRECATED("This is now an optional method of the NSControlTextEditingDelegate protocol.", macos(10.0, 11.0));
- (void)controlTextDidEndEditing:(NSNotification *)obj API_DEPRECATED("This is now an optional method of the NSControlTextEditingDelegate protocol.", macos(10.0, 11.0));
- (void)controlTextDidChange:(NSNotification *)obj API_DEPRECATED("This is now an optional method of the NSControlTextEditingDelegate protocol.", macos(10.0, 11.0));
@end
#endif
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSOpenPanel.h | /*
NSOpenPanel.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSSavePanel.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSString;
@class NSWindow;
@interface NSOpenPanel : NSSavePanel
/* Creates a new instance of the NSOpenPanel. This class is not a singleton.
*/
+ (NSOpenPanel *)openPanel;
@property (readonly, copy) NSArray<NSURL *> *URLs;
@property BOOL resolvesAliases;
@property BOOL canChooseDirectories;
@property BOOL allowsMultipleSelection;
@property BOOL canChooseFiles;
/* Controls how the receiver responds to ubiquitous documents with conflicting versions. If YES, then when the user attempts to open one or more documents with conflicts, the receiver will first display conflict resolution UI, requiring the user to resolve those conflicts before the documents can be opened. If NO, then the receiver does nothing in response to conflicts, allowing your application to handle them. The default value is YES, except for applications linked against the 10.9 SDK or earlier that have adopted iCloud by specifying a ubiquitous container identifier entitlement.
To provide the ideal user experience, you should set this property to NO and do conflict detection and resolution (using NSURLUbiquitousItemHasUnresolvedConflictsKey and NSFileVersion) in the context of your application, instead of relying on the open panel to do it.
*/
@property BOOL canResolveUbiquitousConflicts API_AVAILABLE(macos(10.10));
/* Controls how the receiver responds to ubiquitous documents that aren't yet fully downloaded locally. If YES, then the receiver will disallow opening non-local ubiquitous files. Also, if the user attempts to select a non-local file, the receiver will trigger or reprioritize downloading for that file so that it can be opened as soon as possible. If NO, then the receiver will allow the user to select and open non-local files, giving your application responsibility for downloading and reporting progress. The default value is YES, except for applications linked against the 10.9 SDK or earlier that have adopted iCloud by specifying a ubiquitous container identifier entitlement.
To provide the ideal user experience, you should set this property to NO and download the file's contents (with NSFileCoordinator) and show downloading progress (with NSProgress or NSMetadataQuery) in the context of your application, instead of relying on the open panel to do it.
*/
@property BOOL canDownloadUbiquitousContents API_AVAILABLE(macos(10.10));
/* Gets and sets the disclosure state of an accessory view in an NSOpenPanel. If hiding / disclosing an accessory view is not applicable this property will behave like a read only property. */
@property (getter=isAccessoryViewDisclosed) BOOL accessoryViewDisclosed API_AVAILABLE(macos(10.11));
@end
@interface NSOpenPanel (NSDeprecated)
/* Use URLs instead.
*/
- (NSArray *)filenames API_DEPRECATED("", macos(10.0,10.6));
/* Use -beginSheetModalForWindow:completionHandler: instead.
Set the -directoryURL property instead of passing in a 'path'.
Set the -allowedFileTypes property instead of passing in the 'fileTypes'.
*/
- (void)beginSheetForDirectory:(nullable NSString *)path file:(nullable NSString *)name types:(nullable NSArray *)fileTypes modalForWindow:(nullable NSWindow *)docWindow modalDelegate:(nullable id)delegate didEndSelector:(nullable SEL)didEndSelector contextInfo:(nullable void *)contextInfo API_DEPRECATED("", macos(10.0,10.6));
/* Use -beginWithCompletionHandler: instead.
Set the -directoryURL property instead of passing in a 'path'.
Set the -allowedFileTypes property instead of passing in the 'fileTypes'.
*/
- (void)beginForDirectory:(nullable NSString *)path file:(nullable NSString *)name types:(nullable NSArray *)fileTypes modelessDelegate:(nullable id)delegate didEndSelector:(nullable SEL)didEndSelector contextInfo:(nullable void *)contextInfo API_DEPRECATED("", macos(10.0,10.6));
/* Use -runModal instead.
Set the -directoryURL property instead of passing in a 'path'.
Set the -allowedFileTypes property instead of passing in the 'fileTypes'.
*/
- (NSInteger)runModalForDirectory:(nullable NSString *)path file:(nullable NSString *)name types:(nullable NSArray *)fileTypes API_DEPRECATED("", macos(10.0,10.6));
/* Use -runModal instead.
Set the -allowedFileTypes property instead of passing in the 'fileTypes'.
*/
- (NSInteger)runModalForTypes:(nullable NSArray *)fileTypes 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/NSPageLayout.h | /*
NSPageLayout.h
Application Kit
Copyright (c) 1994-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 NSPrintInfo, NSView, NSViewController, NSWindow, NSWindowController;
NS_SWIFT_UI_ACTOR
@interface NSPageLayout : NSObject
/* Create a new NSPageLayout.
*/
+ (NSPageLayout *)pageLayout;
/* Controllers for the accessory views that will be presented in the page setup panel by the methods below. When the page setup panel is presented to the user each controller is automatically sent a -setRepresentedObject: message with this object's NSPrintInfo. Because NSViewControllers are KVC and KVO compliant for "representedObject," you can use one as the file's owner of an accessory view's nib and bind controls to the file's owner using key paths that start with "representedObject." to take advantage of NSPrintInfo's KVC and KVO compliance. Each controller is also automatically sent a -title message. If that returns nil the application's short name is used in the popup menu that lets the user choose an accessory view.
*/
- (void)addAccessoryController:(NSViewController *)accessoryController API_AVAILABLE(macos(10.5));
- (void)removeAccessoryController:(NSViewController *)accessoryController API_AVAILABLE(macos(10.5));
@property (readonly, copy) NSArray<__kindof NSViewController *> *accessoryControllers API_AVAILABLE(macos(10.5));
/* Present a page setup panel to the user, document-modally. When the user has dismissed it, send the message selected by didEndSelector to the delegate, with the contextInfo as the last argument. The method selected by didEndSelector must have the same signature as:
- (void)pageLayoutDidEnd:(NSPageLayout *)pageLayout returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
*/
- (void)beginSheetWithPrintInfo:(NSPrintInfo *)printInfo modalForWindow:(NSWindow *)docWindow delegate:(nullable id)delegate didEndSelector:(nullable SEL)didEndSelector contextInfo:(nullable void *)contextInfo;
/* Present a page setup panel to the user, application-modally, and return either NSOKButton or NSCancelButton. The default implementation of -runModal just invokes [self runModalWithPrintInfo:[NSPrintInfo sharedPrintInfo]].
*/
- (NSInteger)runModalWithPrintInfo:(NSPrintInfo *)printInfo;
- (NSInteger)runModal;
/* A simple accessor. Your -beginSheetWithPrintInfo:... delegate can use this so it doesn't have to keep a pointer to the NSPrintInfo elsewhere while waiting for the user to dismiss the print panel.
*/
@property (nullable, readonly, strong) NSPrintInfo *printInfo;
@end
@interface NSPageLayout(NSDeprecated)
/* -setAccessoryView: replaces all of the accessory controllers that have been added so far by -addAccessoryController:. -accessoryView merely returns the view of the first accessory controller, or nil.
*/
- (void)setAccessoryView:(null_unspecified NSView *)accessoryView API_DEPRECATED("", macos(10.0,10.5));
- (null_unspecified NSView *)accessoryView API_DEPRECATED("", macos(10.0,10.5));
- (void)readPrintInfo API_DEPRECATED("", macos(10.0,10.5));
- (void)writePrintInfo API_DEPRECATED("", macos(10.0,10.5));
@end
@interface NSApplication(NSPageLayoutPanel)
/* An action method that merely invokes [[NSPageLayout pageLayout] runModal].
*/
- (void)runPageLayout:(nullable id)sender;
@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/NSTextRange.h | #if (defined(USE_APPKIT_PUBLIC_HEADERS) && USE_APPKIT_PUBLIC_HEADERS) || !__has_include(<UIFoundation/NSTextRange.h>)
#include <TargetConditionals.h>
#if !TARGET_OS_IPHONE
//
// NSTextRange.h
// Text Kit
//
// Copyright (c) 2018-2021, Apple Inc. All rights reserved.
//
#import <Foundation/NSObject.h>
NS_ASSUME_NONNULL_BEGIN
#pragma mark NSTextLocation
// NSTextLocation represents an abstract location inside document contents. A concrete class conforming to the protocol should be associated with a particular document backing store type. The interpretation of a location in enumeration operations is depending on the logical direction. When enumerating forward, it should start with the item containing the location. The enumeration should start with an item preceding the location for reverse operations.
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos) NS_PROTOCOL_REQUIRES_EXPLICIT_IMPLEMENTATION
@protocol NSTextLocation <NSObject>
// Compares and returns the logical ordering to location
- (NSComparisonResult)compare:(id <NSTextLocation>)location API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
@end
#pragma mark NSTextRange
// NSTextRange represents a contiguous range between two locations inside document contents. It consists of the starting location and terminating location. They are the two basic properties, location and endLocation, respectively. The terminating location, endLocation, is directly following the last location in the range. So, a location is contained in a range if (range.location <= location) && (location < range.endLocation).
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@interface NSTextRange : NSObject
#pragma mark Initialization
// Returns an empty range when endLocation=nil
- (nullable instancetype)initWithLocation:(id <NSTextLocation>)location endLocation:(nullable id <NSTextLocation>)endLocation NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithLocation:(id <NSTextLocation>)location;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
#pragma mark Basic properties
// An empty range when location == endLocation
@property (readonly, getter=isEmpty) BOOL empty;
// Represented with the inclusive location and the exclusive endLocation
@property (strong, readonly) id <NSTextLocation> location;
@property (strong, readonly) id <NSTextLocation> endLocation;
- (BOOL)isEqualToTextRange:(NSTextRange *)textRange;
#pragma mark Basic operations
- (BOOL)containsLocation:(id <NSTextLocation>)location;
- (BOOL)containsRange:(NSTextRange *)textRange;
- (BOOL)intersectsWithTextRange:(NSTextRange *)textRange;
#pragma mark Basic mutations
// Returns the intersection with textRange. Returns nil when not intersecting.
- (nullable instancetype)textRangeByIntersectingWithTextRange:(NSTextRange *)textRange;
- (instancetype)textRangeByFormingUnionWithTextRange:(NSTextRange *)textRange;
@end
NS_ASSUME_NONNULL_END
#endif // !TARGET_OS_IPHONE
#else
#import <UIFoundation/NSTextRange.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/NSTextLayoutFragment.h | #if (defined(USE_APPKIT_PUBLIC_HEADERS) && USE_APPKIT_PUBLIC_HEADERS) || !__has_include(<UIFoundation/NSTextLayoutFragment.h>)
#include <TargetConditionals.h>
#if !TARGET_OS_IPHONE
//
// NSTextLayoutFragment.h
// Text Kit
//
// Copyright (c) 2017-2021, Apple Inc. All rights reserved.
//
#import <Foundation/NSArray.h>
#import <CoreGraphics/CoreGraphics.h>
@class NSTextLayoutManager;
@class NSTextElement;
@class NSTextRange;
@class NSTextParagraph;
@class NSTextLineFragment;
@class NSOperationQueue;
@class NSTextAttachmentViewProvider;
@protocol NSTextLocation;
NS_ASSUME_NONNULL_BEGIN
// NSTextLayoutFragment represents the layout fragment typically corresponding to a rendering surface such as CALayer or UIView/NSView subclasses.
typedef NS_OPTIONS(NSUInteger, NSTextLayoutFragmentEnumerationOptions) {
NSTextLayoutFragmentEnumerationOptionsNone = 0,
NSTextLayoutFragmentEnumerationOptionsReverse = (1 << 0),
NSTextLayoutFragmentEnumerationOptionsEstimatesSize = (1 << 1), // When enumerating, the layout fragments will be asked to estimate their size.
NSTextLayoutFragmentEnumerationOptionsEnsuresLayout = (1 << 2), // When enumerating, the layout fragments will be asked to layout.
NSTextLayoutFragmentEnumerationOptionsEnsuresExtraLineFragment = (1 << 3), // It synthesizes the extra line fragment when necessary.
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
typedef NS_ENUM(NSUInteger, NSTextLayoutFragmentState) {
NSTextLayoutFragmentStateNone = 0, // No layout information
NSTextLayoutFragmentStateEstimatedUsageBounds = 1, // When associated with NSTextLayoutManager, filled with an estimated rect if no layout
NSTextLayoutFragmentStateCalculatedUsageBounds = 2, // layout fragment measurements available without textLineFragments
NSTextLayoutFragmentStateLayoutAvailable = 3 // textLineFragments and layout fragment measurements available
} API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@interface NSTextLayoutFragment : NSObject <NSSecureCoding>
#pragma mark Initialization
- (instancetype)initWithTextElement:(NSTextElement *)textElement range:(nullable NSTextRange *)rangeInElement NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
#pragma mark Properties
@property (nullable, weak, readonly) NSTextLayoutManager *textLayoutManager;
#pragma mark Contents
// The parent text element
@property (weak, readonly) NSTextElement *textElement;
// range inside textElement relative to the document origin
@property (strong, readonly) NSTextRange *rangeInElement;
#pragma mark Layout
// An array of NSTextLineFragments. Valid when NSTextLayoutFragmentStateLayoutAvailable. KVO-compliant
@property (copy, readonly) NSArray<NSTextLineFragment *> *textLineFragments;
// When non-nil, the layout operation is dispatched to the queue asynchronously.
@property (nullable, strong) NSOperationQueue *layoutQueue;
// The layout information state. KVO-compliant
@property (readonly) NSTextLayoutFragmentState state;
// Invalidates any layout information associated with the receiver
- (void)invalidateLayout;
#pragma mark Layout information
// The rect for tiling the layout fragment inside the target layout coordinate system typically in an NSTextContainer.
@property (readonly) CGRect layoutFragmentFrame;
// The bounds defining the area required for rendering the contents. The coordinate system is vertically flipped from the layoutFragmentFrame origin ({0,0} is at the upper left corner). The size should be larger than layoutFragmentFrame.size. The origin could be in the negative coordinate since the rendering could be stretched out of layoutFragmentFrame. Only valid when state > NSTextLayoutFragmentStateEstimatedUsageBounds.
@property (readonly) CGRect renderingSurfaceBounds;
#pragma mark Custom spacing
// The amount of margin space reserved during paragraph layout between the leading edge of the text layout fragment (according to the primary writing direction of the paragraph) and the start of the lines in the paragraph.
@property (readonly) CGFloat leadingPadding;
// The amount of margin space reserved during paragraph layout between the end of the lines in the paragraph and the trailing edge of the text layout fragment (according to the primary writing direction of the paragraph).
@property (readonly) CGFloat trailingPadding;
// The amount of space reserved during paragraph layout between the top of the text layout fragment and the top of the first line in the paragraph.
@property (readonly) CGFloat topMargin;
// The amount of space reserved during paragraph layout between the bottom of the last line in the paragraph and the bottom of the text layout fragment.
@property (readonly) CGFloat bottomMargin;
#pragma mark Rendering
// Renders the visual representation of this element in the specified graphics context.
- (void)drawAtPoint:(CGPoint)point inContext:(CGContextRef)context;
#pragma mark Text attachments
// Returns NSTextAttachmentViewProvider associated with the receiver. The property contents are only valid with NSTextLayoutFragmentStateLayoutAvailable.
@property (copy, readonly) NSArray<NSTextAttachmentViewProvider *> *textAttachmentViewProviders;
// Returns the frame in the text layout fragment coordinate system for the attachment at location. It returns CGRectZero if location is not with any attachment or the state is not NSTextLayoutFragmentStateLayoutAvailable.
- (CGRect)frameForTextAttachmentAtLocation:(id <NSTextLocation>)location;
@end
NS_ASSUME_NONNULL_END
#endif // !TARGET_OS_IPHONE
#else
#import <UIFoundation/NSTextLayoutFragment.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/NSAccessibilityCustomRotor.h | /*
NSAccessibilityCustomRotor.h
Application Kit
Copyright (c) 2016-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <AppKit/NSAccessibilityProtocols.h>
#import <AppKit/AppKitDefines.h>
/*!
* @discussion NSAccessibilityCustomRotor:
*
* Assistive technologies, such as VoiceOver, provide interfaces to quickly
* search applications for content of a given type. For example, in a web
* browser, a list of navigational links or buttons can quickly be explored
* using VoiceOver's content menus.
*
* The classes defined here provide a way for applications to vend their own
* content menus. For example, Pages can create a "Headings" custom rotor
* that allows assistive technologies to search the Pages document for all
* headings.
*/
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSAccessibilityCustomRotor;
@class NSAccessibilityCustomRotorItemResult;
@class NSAccessibilityCustomRotorSearchParameters;
@protocol NSAccessibilityCustomRotorItemSearchDelegate;
@protocol NSAccessibilityCustomRotorItemLoadDelegate;
/*!
* @brief Direction to search for an NSAccessibilityCustomRotorItemResult.
*/
typedef NS_ENUM(NSInteger, NSAccessibilityCustomRotorSearchDirection) {
NSAccessibilityCustomRotorSearchDirectionPrevious,
NSAccessibilityCustomRotorSearchDirectionNext,
} API_AVAILABLE(macos(10.13));
/*!
* @brief Use NSAccessibilityCustomRotorType when providing results for the
* following types. This allows assistive technologies to assign keyboard
* commands and gestures for these common search types.
*/
typedef NS_ENUM(NSInteger, NSAccessibilityCustomRotorType) {
// Default if using a custom labeled rotor
NSAccessibilityCustomRotorTypeCustom = 0,
// This type is used for searching the current
// element for any type of item.
NSAccessibilityCustomRotorTypeAny = 1,
// Common types of rotors
NSAccessibilityCustomRotorTypeAnnotation,
NSAccessibilityCustomRotorTypeBoldText,
NSAccessibilityCustomRotorTypeHeading,
NSAccessibilityCustomRotorTypeHeadingLevel1,
NSAccessibilityCustomRotorTypeHeadingLevel2,
NSAccessibilityCustomRotorTypeHeadingLevel3,
NSAccessibilityCustomRotorTypeHeadingLevel4,
NSAccessibilityCustomRotorTypeHeadingLevel5,
NSAccessibilityCustomRotorTypeHeadingLevel6,
NSAccessibilityCustomRotorTypeImage,
NSAccessibilityCustomRotorTypeItalicText,
NSAccessibilityCustomRotorTypeLandmark,
NSAccessibilityCustomRotorTypeLink,
NSAccessibilityCustomRotorTypeList,
NSAccessibilityCustomRotorTypeMisspelledWord,
NSAccessibilityCustomRotorTypeTable,
NSAccessibilityCustomRotorTypeTextField,
NSAccessibilityCustomRotorTypeUnderlinedText,
NSAccessibilityCustomRotorTypeVisitedLink,
NSAccessibilityCustomRotorTypeAudiograph,
} API_AVAILABLE(macos(10.13));
/*!
* @brief NSAccessibilityCustomRotors allow assistive technologies, like
* VoiceOver, to search applications for content related to the given label.
*/
API_AVAILABLE(macos(10.13)) @interface NSAccessibilityCustomRotor : NSObject
/*!
* @brief Convenience initializer that uses
* NSAccessibilityCustomRotorTypeCustom as the default rotor type. Use this
* initializer for custom rotors that are not one of the common types.
*/
- (instancetype)initWithLabel:(NSString *)label
itemSearchDelegate:(id<NSAccessibilityCustomRotorItemSearchDelegate>)itemSearchDelegate;
/*!
* @brief Convenience initializer for custom rotors that use a common type
* such as links, headings, etc. A default label will be provided.
*/
- (instancetype)initWithRotorType:(NSAccessibilityCustomRotorType)rotorType
itemSearchDelegate:(id<NSAccessibilityCustomRotorItemSearchDelegate>)itemSearchDelegate;
/*!
* @brief The rotor type to provide results for.
* @remark The default type is NSAccessibilityCustomRotorTypeCustom, unless
* the rotor type was specified in the initializer.
*/
@property NSAccessibilityCustomRotorType type;
/*!
* @brief The localized label assistive technologies will use to describe
* the custom rotor.
* @remark The label is only used when the rotor type is
* NSAccessibilityCustomRotorTypeCustom since a default is provided
* for all other types.
*/
@property (copy) NSString *label;
/*!
* @brief The itemSearchDelegate will be asked to find the next item result
* after performing a search with the given search parameters.
*/
@property (weak) id<NSAccessibilityCustomRotorItemSearchDelegate> itemSearchDelegate;
/*!
* @brief Provide an item load delegate if the rotor vends item results that
* do not have a backing UI element yet. The loader will be asked to load an
* element via the accessibilityElementWithToken protocol method when the
* item result is selected by an assistive client. Applications can use the
* item result's token to determine which item to return.
*/
@property (nullable, weak) id<NSAccessibilityElementLoading> itemLoadingDelegate;
@end
/*!
* @brief NSAccessibilityCustomRotorSearchParameters is a container for
* search parameters. It should be examined to determine the next matching
* NSAccessibilityCustomRotorItemResult.
*/
API_AVAILABLE(macos(10.13)) @interface NSAccessibilityCustomRotorSearchParameters : NSObject
/*!
* @brief The currentItem determines where the search will start from. If
* it is nil, the search should begin from, and include, the first or last
* item, depending on which search direction is used (e.g. search direction
* next will return the first item and previous will return the last item).
*/
@property (nullable, strong) NSAccessibilityCustomRotorItemResult *currentItem;
/*!
* @brief Either NSAccessibilityCustomRotorSearchDirectionPrevious or
* NSAccessibilityCustomRotorSearchDirectionNext.
*/
@property NSAccessibilityCustomRotorSearchDirection searchDirection;
/*!
* @brief A string of text to filter the results against. This is used to get
* type-ahead results. For example, given a list of primary colors and filter
* text "Re", color item "Red" would be returned as a result.
*/
@property (copy) NSString *filterString;
@end
/*!
* @brief NSAccessibilityCustomRotorItemResults are the objects returned
* to assistive technologies that match a search parameter criteria.
*/
API_AVAILABLE(macos(10.13)) @interface NSAccessibilityCustomRotorItemResult : NSObject
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
/*!
* @brief Creates an item result with a given target element. Assistive
* technologies may try to set accessibility focus on the element.
*/
- (instancetype)initWithTargetElement:(id<NSAccessibilityElement>)targetElement NS_DESIGNATED_INITIALIZER;
/*!
* @brief Creates an item result with a given item load token and custom label.
* Use this initializer if the application has not yet loaded the element
* backing the item result.
*/
- (instancetype)initWithItemLoadingToken:(NSAccessibilityLoadingToken)itemLoadingToken
customLabel:(NSString *)customLabel NS_DESIGNATED_INITIALIZER;
/*!
* @brief A target element references an element that will be messaged for
* other accessibility properties. If it is not nil, assistive technologies
* may try to set accessibility focus on it.
*/
@property (nullable, weak, readonly) id<NSAccessibilityElement> targetElement;
/*!
* @brief Provide an item load token if the application has not yet
* loaded the element backing the item result. Application can use the token
* to determine which item to return.
*/
@property (nullable, strong, readonly) NSAccessibilityLoadingToken itemLoadingToken;
/*!
* @brief For text-based elements such as an NSTextView, this is an NSRange
* that specifies the area of interest. If the target range has NSNotFound
* for the location, the search should begin from the first or last character
* of the text element, depending on the search direction.
*/
@property NSRange targetRange;
/*!
* @brief A localized label that can be used instead of the default item
* label to describe the item result.
* @remark Required if using the loader-based initializer. Optional otherwise.
*/
@property (nullable, copy) NSString *customLabel;
@end
API_AVAILABLE(macos(10.13)) @protocol NSAccessibilityCustomRotorItemSearchDelegate <NSObject>
@required
/*!
* @brief Returns the found NSAccessibilityCustomRotorItemResult after
* performing a search with the given search parameters.
*/
- (nullable NSAccessibilityCustomRotorItemResult *)rotor:(NSAccessibilityCustomRotor *)rotor
resultForSearchParameters:(NSAccessibilityCustomRotorSearchParameters *)searchParameters;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSImageView.h | /*
NSImageView.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSControl.h>
#import <AppKit/NSImageCell.h>
#import <AppKit/NSMenu.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSImageSymbolConfiguration;
@interface NSImageView : NSControl <NSAccessibilityImage, NSMenuItemValidation>
/*!
Creates a non-editable image view containing the provided image. The image is scaled proportionally down to fit the view, and is centered within the view.
@param image The image to display within the view.
@return An initialized image view.
*/
+ (instancetype)imageViewWithImage:(NSImage *)image API_AVAILABLE(macos(10.12));
@property (nullable, strong) NSImage *image;
@property (getter=isEditable) BOOL editable;
@property NSImageAlignment imageAlignment;
@property NSImageScaling imageScaling;
@property NSImageFrameStyle imageFrameStyle;
/*!
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 image view uses a default size, weight, and scale provided by the system. The default value is `nil`.
*/
@property (nullable, copy) NSImageSymbolConfiguration *symbolConfiguration API_AVAILABLE(macos(11));
/*!
A tint color to be used when rendering template image content. This color may be combined with other effects to produce a theme-appropriate rendition of the template image. A nil value indicates the standard set of effects without color modification. The default value is nil.
*/
@property (nullable, copy) NSColor *contentTintColor API_AVAILABLE(macos(10.14));
@property BOOL animates;
@property BOOL allowsCutCopyPaste;
@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/NSFilePromiseProvider.h | /*
NSFilePromiseProvider.h
Application Kit
Copyright (c) 2015-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSPasteboard.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@protocol NSFilePromiseProviderDelegate;
@class NSOperationQueue;
API_AVAILABLE(macos(10.12))
@interface NSFilePromiseProvider : NSObject <NSPasteboardWriting>
/* The UTI of the promised file type. An exception is thrown if the fileType does not conform to kUTTypeData or kUTTypeDirectory */
@property(copy) NSString *fileType;
/* Your object that is ultimately responsible for determining the final file name and writing the promised data to the destination. */
@property(weak, nullable) id <NSFilePromiseProviderDelegate> delegate;
/* When a simple string identifier is not enough. Store a pointer to an object that contains the source of the promised file data. */
@property(strong, nullable) id userInfo;
/* See fileType above for restrictions on the type of files to pass in */
- (instancetype)initWithFileType:(NSString *)fileType delegate:(id <NSFilePromiseProviderDelegate>)delegate;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end
@protocol NSFilePromiseProviderDelegate <NSObject>
@required
/* Return the base filename (not a full path) for this promise item. Do not start writing the file yet. */
- (NSString *)filePromiseProvider:(NSFilePromiseProvider*)filePromiseProvider fileNameForType:(NSString *)fileType;
/* Write the contents of this promise item to the provided URL and call completionHandler when done. NSFilePromiseReceiver automatically wraps this message with NSFileCoordinator when the promise destination is an NSFilePromiseReceiver. Always use the supplied URL. Note: This request shall occur on the NSOperationQueue supplied by -promiseOperationQueue.
*/
- (void)filePromiseProvider:(NSFilePromiseProvider*)filePromiseProvider writePromiseToURL:(NSURL *)url completionHandler:(void (^)(NSError * _Nullable errorOrNil))completionHandler;
@optional
/* The operation queue that the write request will be issued from. If this method is not implemented, the mainOperationQueue is used. */
- (NSOperationQueue *)operationQueueForFilePromiseProvider:(NSFilePromiseProvider*)filePromiseProvider;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSAccessibilityElement.h | /*
NSAccessibilityElement.h
Application Kit
Copyright (c) 2013-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <AppKit/NSAccessibilityConstants.h>
#import <AppKit/NSAccessibilityProtocols.h>
#import <AppKit/AppKitDefines.h>
/* An NSAccessibilityElement is used to convey information regarding onscreen UI through the accessibility API for UI that may not already have a single backing object. For example, if a single NSView subclass draws 4 buttons, it would vend 4 NSAccessibilityElements as accessibilityChildren. Note that as long as the UI is around, the vendor of NSAccessibilityElements must maintain ownership of the NSAccessibilityElements. */
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
API_AVAILABLE(macos(10.10))
@interface NSAccessibilityElement : NSObject <NSAccessibility>
+ (id)accessibilityElementWithRole:(NSAccessibilityRole)role frame:(NSRect)frame label:(nullable NSString *)label parent:(nullable id)parent;
- (void)accessibilityAddChildElement:(NSAccessibilityElement *)childElement;
// Accessibility frame in the cordinate system of the accessibility parent
@property NSRect accessibilityFrameInParentSpace;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSRotationGestureRecognizer.h | /*
NSRotationGestureRecognizer.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 NSRotationGestureRecognizer : NSGestureRecognizer
@property CGFloat rotation; // in radians
@property CGFloat rotationInDegrees;
@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/NSUserInterfaceItemSearching.h | /*
NSUserInterfaceItemSearching.h
Application Kit
Copyright (c) 2008-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSString.h>
#import <AppKit/NSApplication.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@protocol NSUserInterfaceItemSearching <NSObject>
@required
/* Search for items matching the provided search string and return them by calling the matched items block, passing an array of items to append to the help menu. The framework does not care what these items are. They are just used to identify particular search results to other methods in this protocol. Do not assume that this will be called from the main UI thread. When searchForItemsWithSearchString gets called again, the client should cancel any previous searches in progress for better performance. If not Spotlight for Help will ignore the older results. resultLimit is the maximum number of results that Spotlight for Help will process. Any results returned beyond this limit will be ignored, but for performance reasons it is better to not exceed it.
The handleMatchedItems block can be invoked from any thread desired. If it is called more than once the additional results will be appended after previous items until the maximum is reached.
*/
- (void)searchForItemsWithSearchString:(NSString *)searchString resultLimit:(NSInteger)resultLimit matchedItemHandler:(void (^)(NSArray *items))handleMatchedItems;
/* return an array of strings (localized for display in the menu) that will be combined with separators to form the menu item title
*/
- (NSArray<NSString *> *)localizedTitlesForItem:(id)item;
@optional
/* Called when the user selects a search result in Help menu. For example, the default implementation brings up Help Viewer for a Help item.
*/
- (void)performActionForItem:(id)item;
/* If this method is implemented, a "Show All Help Topics" item will appear in the menu and this method is called when the user selects it. The application should show all its results for this search, which does not include results for Menu Items. The string for "Show All Help Topics" is system defined and localized and cannot be changed by the user.
*/
- (void)showAllHelpTopicsForSearchString:(NSString *)searchString;
@end
@interface NSApplication (NSUserInterfaceItemSearching)
/* Register an an object that conforms to NSUserInterfaceItemSearching with the application. You can register as many as you like. If you register the same instance more than once the subsequent registrations are ignored
*/
- (void)registerUserInterfaceItemSearchHandler:(id<NSUserInterfaceItemSearching>)handler API_AVAILABLE(macos(10.6));
/* Unregister an object that conforms to NSUserInterfaceItemSearching with the application. If you unregister the same instance more than once the subsequent registrations are ignored. Also, unregistering an instance that was never registered is a NOP.
*/
- (void)unregisterUserInterfaceItemSearchHandler:(id<NSUserInterfaceItemSearching>)handler API_AVAILABLE(macos(10.6));
/* returns YES if searchString matches the supplied range of stringToBeSearched according to Spotlight for Help default matching rules
* if found range is non null then the matching range is returned in it
*/
- (BOOL)searchString:(NSString *)searchString inUserInterfaceItemString:(NSString *)stringToSearch searchRange:(NSRange)searchRange foundRange:(nullable NSRange *)foundRange 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/NSColorPicking.h | /*
NSColorPicking.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <AppKit/NSColorPanel.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSButtonCell, NSColor, NSColorPanel, NSColorList, NSImage, NSView;
@protocol NSColorPickingDefault
/*
The following methods are implemented by the generic base class, NSColorPicker, and only need be implemented (overridden) by the CustomPicker developer if there is a need.
*/
/*
initWithPickerMask:colorPanel: allows you to return your custom color picker to the ColorPanel.
"mask" is the mask (if any) passed to the ColorPanel by the +setPickerMask: method. If your picker supports any of the bits in the mask, return "self", otherwise, return "nil" (default is "self" if not overridden, since if the "setPickerMask" method is never called, the ColorPanel will just start off with the normal picker modes, of which your custom mode will not be a part). This method can be used to turn off some (or all) of your subpickers, if you have any (like sliders). If this method returns "nil", the object will be freed.
"owningColorPanel" is the id of the instantiating ColorPanel.
If this method is overridden, the base class' (NSColorPicker's) initFromPickerMask method should be called before any subclass processing. The instance variable "colorPanel" is set in this method.
FOR PERFORMANCE, DO NOT LOAD .NIBS, ETC. HERE!! WAIT UNTIL provideNewView: in NSColorPickingCustom!
*/
- (nullable instancetype)initWithPickerMask:(NSUInteger)mask colorPanel:(NSColorPanel *)owningColorPanel;
/* Allows you to return a new image used in the toolbar. By default, you can simply have a .tiff file with the same name as your custom color picker class in the bundle, and will not need to implement this method.
*/
- (NSImage *)provideNewButtonImage;
- (void)insertNewButtonImage:(NSImage *)newButtonImage in:(NSButtonCell *)buttonCell;
- (void)viewSizeChanged:(nullable id)sender;
- (void)alphaControlAddedOrRemoved:(nullable id)sender;
- (void)attachColorList:(NSColorList *)colorList;
- (void)detachColorList:(NSColorList *)colorList;
- (void)setMode:(NSColorPanelMode)mode;
/* The tooltip to be used for the tool bar button.
*/
- (NSString *)buttonToolTip API_AVAILABLE(macos(10.5));
/* The minimum content size for your picker. The NSColorPanel will not allow resizing smaller than this size. By default, you will not have to do anything if you properly setup the Autosizing attributes in IB for your view.
*/
- (NSSize)minContentSize API_AVAILABLE(macos(10.5));
@end
/* NSColorPickingCustom MUST be implemented by the CustomPicker, or an error will occur!
*/
@protocol NSColorPickingCustom <NSColorPickingDefault>
/* Return NO if "mode" not supported.
*/
- (BOOL)supportsMode:(NSColorPanelMode)mode;
/* Return the current mode that your picker is in.
*/
- (NSColorPanelMode)currentMode;
/* Provide the view for your picker. initialRequest will be YES on very first call. At this point, you should load your nibs.
*/
- (NSView *)provideNewView:(BOOL)initialRequest;
/* Set your color picker's displayed color to newColor.
*/
- (void)setColor:(NSColor *)newColor;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSTextAttachment.h | #if (defined(USE_APPKIT_PUBLIC_HEADERS) && USE_APPKIT_PUBLIC_HEADERS) || !__has_include(<UIFoundation/NSTextAttachment.h>)
#include <TargetConditionals.h>
#if !TARGET_OS_IPHONE
/*
NSTextAttachment.h
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSAttributedString.h>
#import <AppKit/AppKitDefines.h>
#import <CoreGraphics/CGGeometry.h>
NS_ASSUME_NONNULL_BEGIN
enum {
NSAttachmentCharacter API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0)) API_UNAVAILABLE(watchos) = 0xFFFC // Replacement character is used for attachments
};
@class NSTextContainer;
@class NSLayoutManager;
@class NSImage;
@class NSView;
@class NSFileWrapper;
@class NSTextAttachmentViewProvider;
@class NSTextLayoutManager;
@protocol NSTextLocation;
@class NSTextAttachmentCell;
@protocol NSTextAttachmentCell;
// This protocol defines the interface to attachment objects from NSLayoutManager
@protocol NSTextAttachmentContainer <NSObject>
// This protocol is available only for Objective-C 2 or later architecture
// Returns the image object rendered by NSLayoutManager at imageBounds inside textContainer. It should return an image appropriate for the target rendering context derived by arguments to this method. The NSTextAttachment implementation returns -image when non-nil. If -image==nil, it returns an image based on -contents and -fileType properties.
- (nullable NSImage *)imageForBounds:(CGRect)imageBounds textContainer:(nullable NSTextContainer *)textContainer characterIndex:(NSUInteger)charIndex API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0)) API_UNAVAILABLE(watchos);
// Returns the layout bounds to the layout manager. The bounds origin is interpreted to match position inside lineFrag. The NSTextAttachment implementation returns -bounds if not CGRectZero; otherwise, it derives the bounds value from -[image size]. Conforming objects can implement more sophisticated logic for negotiating the frame size based on the available container space and proposed line fragment rect.
- (CGRect)attachmentBoundsForTextContainer:(nullable NSTextContainer *)textContainer proposedLineFragment:(CGRect)lineFrag glyphPosition:(CGPoint)position characterIndex:(NSUInteger)charIndex API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0)) API_UNAVAILABLE(watchos);
@end
// This protocol defines the interface to attachment objects from NSTextLayoutManager
@protocol NSTextAttachmentLayout <NSObject>
// Returns the image object rendered at bounds inside textContainer. It should return an image appropriate for the target rendering context derived by arguments to this method. The NSTextAttachment implementation returns -image when non-nil. If -image==nil, it returns an image based on -contents and -fileType properties.
- (nullable NSImage *)imageForBounds:(CGRect)bounds attributes:(NSDictionary<NSAttributedStringKey, id> *)attributes location:(id <NSTextLocation>)location textContainer:(nullable NSTextContainer *)textContainer API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
// Returns the layout bounds. The bounds origin is interpreted to match position inside proposedLineFragment. The NSTextAttachment implementation returns -bounds if not CGRectZero; otherwise, it derives the bounds value from image.size. Conforming objects can implement more sophisticated logic for negotiating the frame size based on the available container space and proposed line fragment rect.
- (CGRect)attachmentBoundsForAttributes:(NSDictionary<NSAttributedStringKey, id> *)attributes location:(id <NSTextLocation>)location textContainer:(nullable NSTextContainer *)textContainer proposedLineFragment:(CGRect)proposedLineFragment position:(CGPoint)position API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
// Returns the text attachment view provider corresponding to -fileType. The default implementation queries the text attachment view provider class via +[NSTextAttachment textAttachmentViewProviderClassForFileType:]. When non-nil, it instantiates a view, then, fills properties declared in NSTextAttachmentViewProvider if implemented
- (nullable NSTextAttachmentViewProvider *)viewProviderForParentView:(nullable NSView *)parentView location:(id <NSTextLocation>)location textContainer:(nullable NSTextContainer *)textContainer API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
@end
API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0)) API_UNAVAILABLE(watchos) @interface NSTextAttachment : NSObject <NSTextAttachmentLayout, NSTextAttachmentContainer, NSSecureCoding>
/**************************** Initialization ****************************/
// Designated initializer. Both arguments can be nil. When contentData==nil || uti==nil, the receiver is consider to be an attachment without document contents. In this case, the NSAttributedString methods writing external file format tries to save the return value of -[NSTextAttachment image] instead.
- (instancetype)initWithData:(nullable NSData *)contentData ofType:(nullable NSString *)uti NS_DESIGNATED_INITIALIZER API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0)) API_UNAVAILABLE(watchos);
// Previous designated initializer on OS X. This method invokes -initWithData:ofType: with nil arguments, then, fills -fileWrapper property.
- (instancetype)initWithFileWrapper:(nullable NSFileWrapper *)fileWrapper;
/**************************** Content properties ****************************/
// These two properties define the contents for the text attachment. Modifying these properties have a side effect of invalidating -image and -fileWrapper properties. -fileType is an UTI describing the format for -contents.
@property (nullable, copy) NSData *contents API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0)) API_UNAVAILABLE(watchos);
@property (nullable, copy) NSString *fileType API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0)) API_UNAVAILABLE(watchos);
/**************************** Rendering/layout properties ****************************/
// Image representing the text attachment contents. Modifying this property invalidates -contents, -fileType, and -FileWrapper properties.
@property (nullable, strong) NSImage *image API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0)) API_UNAVAILABLE(watchos);
// Defines the layout bounds of the receiver's graphical representation in the text coordinate system. The origin is at the glyph location on the text baseline. The default value is CGRectZero.
@property CGRect bounds API_AVAILABLE(macos(10.11), ios(7.0), tvos(9.0)) API_UNAVAILABLE(watchos);
/**************************** Non-image contents properties ****************************/
// Optionally, NSTextAttachment can be associated with a file wrapper. Modifying this property has a side effect of invalidating -image, -contents, and fileType properties.
@property (nullable, strong) NSFileWrapper *fileWrapper;
// The cell which handles user interaction. By default an instance of NSTextAttachmentCell is used.
@property (nullable, strong) id <NSTextAttachmentCell> attachmentCell API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos);
#pragma mark Advanced Layout Properties
// Layout padding before and after the text attachment bounds. The layout and rendering bounds X origin gets inset by the padding value. This affects the relationship between the text attachment bounds. 0.0 by default
@property CGFloat lineLayoutPadding API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
#pragma mark View-based attachments
// Factory methods for defining the mapping between UTI and text attachment view provider class
+ (nullable Class)textAttachmentViewProviderClassForFileType:(NSString *)fileType API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
+ (void)registerTextAttachmentViewProviderClass:(Class)textAttachmentViewProviderClass forFileType:(NSString *)fileType API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
// When YES, the text attachment tries to use a text attachment view returned by -viewProviderForParentView:location:textContainer:. YES by default
@property BOOL allowsTextAttachmentView API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
// Returns YES if the text attachment is configured to use text attachment views. By default, it checks -allowsTextAttachmentView, +textAttachmentViewClassForFileType:, and its contents
@property (readonly) BOOL usesTextAttachmentView API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos);
@end
@interface NSAttributedString (NSAttributedStringAttachmentConveniences)
// A convenience method for creating an attributed string containing attachment using NSAttachmentCharacter as the base character.
+ (NSAttributedString *)attributedStringWithAttachment:(NSTextAttachment *)attachment API_AVAILABLE(macos(10.0), ios(7.0), tvos(9.0)) API_UNAVAILABLE(watchos);
@end
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0)) API_UNAVAILABLE(watchos)
@interface NSTextAttachmentViewProvider : NSObject
- (instancetype)initWithTextAttachment:(NSTextAttachment *)textAttachment parentView:(nullable NSView *)parentView textLayoutManager:(nullable NSTextLayoutManager *)textLayoutManager location:(id <NSTextLocation>)location NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
@property (readonly, weak) NSTextAttachment *textAttachment;
@property (readonly, weak, nullable) NSTextLayoutManager *textLayoutManager;
@property (readonly, strong) id <NSTextLocation> location;
// View instantiation
// The getter first invokes loadView if the view hasn't been set yet. Subclasses must call super if they override the setter or getter.
@property(nullable, strong) NSView *view;
// This is where subclasses should create their custom view hierarchy. Should never be called directly.
- (void)loadView;
// This property determines the text attachment bounds policy. If YES, -[NSTextAttachment attachmentBoundsForAttributes:location:textContainer:proposedLineFragment:position:] consults the text attachment view provider for determining the bounds instead of using -bounds. NO by default
@property BOOL tracksTextAttachmentViewBounds;
// Invoked from -[NSTextAttachment attachmentBoundsForAttributes:location:textContainer:proposedLineFragment:position:]
- (CGRect)attachmentBoundsForAttributes:(NSDictionary<NSAttributedStringKey, id> *)attributes location:(id <NSTextLocation>)location textContainer:(nullable NSTextContainer *)textContainer proposedLineFragment:(CGRect)proposedLineFragment position:(CGPoint)position;
@end
@interface NSMutableAttributedString (NSMutableAttributedStringAttachmentConveniences)
- (void)updateAttachmentsFromPath:(NSString *)path;
@end
NS_ASSUME_NONNULL_END
#endif // !TARGET_OS_IPHONE
#else
#import <UIFoundation/NSTextAttachment.h>
#endif
#import <AppKit/NSTextAttachmentCell.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/NSAppleScriptExtensions.h | /*
NSAppleScriptExtensions.h
Application Kit
Copyright (c) 2002-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSAppleScript.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSAttributedString;
@interface NSAppleScript(NSExtensions)
// Return the syntax-highlighted source code of the script if the script has been compiled and its source code is available, nil otherwise. It is possible for an NSAppleScript that has been instantiated with -initWithContentsOfURL:error: to be a script for which the source code is not available, but is nonetheless executable.
@property (nullable, readonly, strong) NSAttributedString *richTextSource;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h | /*
NSEvent.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSTouch.h>
#import <AppKit/AppKitDefines.h>
#import <ApplicationServices/ApplicationServices.h>
#import <Foundation/NSObjCRuntime.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSDate.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSSet.h>
#import <IOKit/hidsystem/IOLLEvent.h>
#import <limits.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSGraphicsContext, NSWindow, NSTrackingArea;
typedef NS_ENUM(NSUInteger, NSEventType) { /* various types of events */
NSEventTypeLeftMouseDown = 1,
NSEventTypeLeftMouseUp = 2,
NSEventTypeRightMouseDown = 3,
NSEventTypeRightMouseUp = 4,
NSEventTypeMouseMoved = 5,
NSEventTypeLeftMouseDragged = 6,
NSEventTypeRightMouseDragged = 7,
NSEventTypeMouseEntered = 8,
NSEventTypeMouseExited = 9,
NSEventTypeKeyDown = 10,
NSEventTypeKeyUp = 11,
NSEventTypeFlagsChanged = 12,
NSEventTypeAppKitDefined = 13,
NSEventTypeSystemDefined = 14,
NSEventTypeApplicationDefined = 15,
NSEventTypePeriodic = 16,
NSEventTypeCursorUpdate = 17,
NSEventTypeScrollWheel = 22,
NSEventTypeTabletPoint = 23,
NSEventTypeTabletProximity = 24,
NSEventTypeOtherMouseDown = 25,
NSEventTypeOtherMouseUp = 26,
NSEventTypeOtherMouseDragged = 27,
/* The following event types are available on some hardware on 10.5.2 and later */
NSEventTypeGesture API_AVAILABLE(macos(10.5)) = 29,
NSEventTypeMagnify API_AVAILABLE(macos(10.5)) = 30,
NSEventTypeSwipe API_AVAILABLE(macos(10.5)) = 31,
NSEventTypeRotate API_AVAILABLE(macos(10.5)) = 18,
NSEventTypeBeginGesture API_AVAILABLE(macos(10.5)) = 19,
NSEventTypeEndGesture API_AVAILABLE(macos(10.5)) = 20,
NSEventTypeSmartMagnify API_AVAILABLE(macos(10.8)) = 32,
NSEventTypeQuickLook API_AVAILABLE(macos(10.8)) = 33,
NSEventTypePressure API_AVAILABLE(macos(10.10.3)) = 34,
NSEventTypeDirectTouch API_AVAILABLE(macos(10.10)) = 37,
NSEventTypeChangeMode API_AVAILABLE(macos(10.15)) = 38,
};
static const NSEventType NSLeftMouseDown API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeLeftMouseDown", macos(10.0,10.12)) = NSEventTypeLeftMouseDown;
static const NSEventType NSLeftMouseUp API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeLeftMouseUp", macos(10.0,10.12)) = NSEventTypeLeftMouseUp;
static const NSEventType NSRightMouseDown API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeRightMouseDown", macos(10.0,10.12)) = NSEventTypeRightMouseDown;
static const NSEventType NSRightMouseUp API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeRightMouseUp", macos(10.0,10.12)) = NSEventTypeRightMouseUp;
static const NSEventType NSMouseMoved API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeMouseMoved", macos(10.0,10.12)) = NSEventTypeMouseMoved;
static const NSEventType NSLeftMouseDragged API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeLeftMouseDragged", macos(10.0,10.12)) = NSEventTypeLeftMouseDragged;
static const NSEventType NSRightMouseDragged API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeRightMouseDragged", macos(10.0,10.12)) = NSEventTypeRightMouseDragged;
static const NSEventType NSMouseEntered API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeMouseEntered", macos(10.0,10.12)) = NSEventTypeMouseEntered;
static const NSEventType NSMouseExited API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeMouseExited", macos(10.0,10.12)) = NSEventTypeMouseExited;
static const NSEventType NSKeyDown API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeKeyDown", macos(10.0,10.12)) = NSEventTypeKeyDown;
static const NSEventType NSKeyUp API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeKeyUp", macos(10.0,10.12)) = NSEventTypeKeyUp;
static const NSEventType NSFlagsChanged API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeFlagsChanged", macos(10.0,10.12)) = NSEventTypeFlagsChanged;
static const NSEventType NSAppKitDefined API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeAppKitDefined", macos(10.0,10.12)) = NSEventTypeAppKitDefined;
static const NSEventType NSSystemDefined API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeSystemDefined", macos(10.0,10.12)) = NSEventTypeSystemDefined;
static const NSEventType NSApplicationDefined API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeApplicationDefined", macos(10.0,10.12)) = NSEventTypeApplicationDefined;
static const NSEventType NSPeriodic API_DEPRECATED_WITH_REPLACEMENT("NSEventTypePeriodic", macos(10.0,10.12)) = NSEventTypePeriodic;
static const NSEventType NSCursorUpdate API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeCursorUpdate", macos(10.0,10.12)) = NSEventTypeCursorUpdate;
static const NSEventType NSScrollWheel API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeScrollWheel", macos(10.0,10.12)) = NSEventTypeScrollWheel;
static const NSEventType NSTabletPoint API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeTabletPoint", macos(10.0,10.12)) = NSEventTypeTabletPoint;
static const NSEventType NSTabletProximity API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeTabletProximity", macos(10.0,10.12)) = NSEventTypeTabletProximity;
static const NSEventType NSOtherMouseDown API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeOtherMouseDown", macos(10.0,10.12)) = NSEventTypeOtherMouseDown;
static const NSEventType NSOtherMouseUp API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeOtherMouseUp", macos(10.0,10.12)) = NSEventTypeOtherMouseUp;
static const NSEventType NSOtherMouseDragged API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeOtherMouseDragged", macos(10.0,10.12)) = NSEventTypeOtherMouseDragged;
// For APIs introduced in Mac OS X 10.6 and later, this type is used with NS*Mask constants to indicate the events of interest.
typedef NS_OPTIONS(unsigned long long, NSEventMask) { /* masks for the types of events */
NSEventMaskLeftMouseDown = 1ULL << NSEventTypeLeftMouseDown,
NSEventMaskLeftMouseUp = 1ULL << NSEventTypeLeftMouseUp,
NSEventMaskRightMouseDown = 1ULL << NSEventTypeRightMouseDown,
NSEventMaskRightMouseUp = 1ULL << NSEventTypeRightMouseUp,
NSEventMaskMouseMoved = 1ULL << NSEventTypeMouseMoved,
NSEventMaskLeftMouseDragged = 1ULL << NSEventTypeLeftMouseDragged,
NSEventMaskRightMouseDragged = 1ULL << NSEventTypeRightMouseDragged,
NSEventMaskMouseEntered = 1ULL << NSEventTypeMouseEntered,
NSEventMaskMouseExited = 1ULL << NSEventTypeMouseExited,
NSEventMaskKeyDown = 1ULL << NSEventTypeKeyDown,
NSEventMaskKeyUp = 1ULL << NSEventTypeKeyUp,
NSEventMaskFlagsChanged = 1ULL << NSEventTypeFlagsChanged,
NSEventMaskAppKitDefined = 1ULL << NSEventTypeAppKitDefined,
NSEventMaskSystemDefined = 1ULL << NSEventTypeSystemDefined,
NSEventMaskApplicationDefined = 1ULL << NSEventTypeApplicationDefined,
NSEventMaskPeriodic = 1ULL << NSEventTypePeriodic,
NSEventMaskCursorUpdate = 1ULL << NSEventTypeCursorUpdate,
NSEventMaskScrollWheel = 1ULL << NSEventTypeScrollWheel,
NSEventMaskTabletPoint = 1ULL << NSEventTypeTabletPoint,
NSEventMaskTabletProximity = 1ULL << NSEventTypeTabletProximity,
NSEventMaskOtherMouseDown = 1ULL << NSEventTypeOtherMouseDown,
NSEventMaskOtherMouseUp = 1ULL << NSEventTypeOtherMouseUp,
NSEventMaskOtherMouseDragged = 1ULL << NSEventTypeOtherMouseDragged,
/* The following event masks are available on some hardware on 10.5.2 and later */
NSEventMaskGesture API_AVAILABLE(macos(10.5)) = 1ULL << NSEventTypeGesture,
NSEventMaskMagnify API_AVAILABLE(macos(10.5)) = 1ULL << NSEventTypeMagnify,
NSEventMaskSwipe API_AVAILABLE(macos(10.5)) = 1ULL << NSEventTypeSwipe,
NSEventMaskRotate API_AVAILABLE(macos(10.5)) = 1ULL << NSEventTypeRotate,
NSEventMaskBeginGesture API_AVAILABLE(macos(10.5)) = 1ULL << NSEventTypeBeginGesture,
NSEventMaskEndGesture API_AVAILABLE(macos(10.5)) = 1ULL << NSEventTypeEndGesture,
/* Note: You can only use these event masks on 64 bit. In other words, you cannot setup a local, nor global, event monitor for these event types on 32 bit. Also, you cannot search the event queue for them (nextEventMatchingMask:...) on 32 bit.
*/
NSEventMaskSmartMagnify API_AVAILABLE(macos(10.8)) = 1ULL << NSEventTypeSmartMagnify,
NSEventMaskPressure API_AVAILABLE(macos(10.10.3)) = 1ULL << NSEventTypePressure,
NSEventMaskDirectTouch API_AVAILABLE(macos(10.12.2)) = 1ULL << NSEventTypeDirectTouch,
NSEventMaskChangeMode API_AVAILABLE(macos(10.15)) = 1ULL << NSEventTypeChangeMode,
NSEventMaskAny = NSUIntegerMax,
};
static const NSEventMask NSLeftMouseDownMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskLeftMouseDown", macos(10.0,10.12)) = NSEventMaskLeftMouseDown;
static const NSEventMask NSLeftMouseUpMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskLeftMouseUp", macos(10.0,10.12)) = NSEventMaskLeftMouseUp;
static const NSEventMask NSRightMouseDownMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskRightMouseDown", macos(10.0,10.12)) = NSEventMaskRightMouseDown;
static const NSEventMask NSRightMouseUpMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskRightMouseUp", macos(10.0,10.12)) = NSEventMaskRightMouseUp;
static const NSEventMask NSMouseMovedMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskMouseMoved", macos(10.0,10.12)) = NSEventMaskMouseMoved;
static const NSEventMask NSLeftMouseDraggedMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskLeftMouseDragged", macos(10.0,10.12)) = NSEventMaskLeftMouseDragged;
static const NSEventMask NSRightMouseDraggedMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskRightMouseDragged", macos(10.0,10.12)) = NSEventMaskRightMouseDragged;
static const NSEventMask NSMouseEnteredMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskMouseEntered", macos(10.0,10.12)) = NSEventMaskMouseEntered;
static const NSEventMask NSMouseExitedMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskMouseExited", macos(10.0,10.12)) = NSEventMaskMouseExited;
static const NSEventMask NSKeyDownMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskKeyDown", macos(10.0,10.12)) = NSEventMaskKeyDown;
static const NSEventMask NSKeyUpMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskKeyUp", macos(10.0,10.12)) = NSEventMaskKeyUp;
static const NSEventMask NSFlagsChangedMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskFlagsChanged", macos(10.0,10.12)) = NSEventMaskFlagsChanged;
static const NSEventMask NSAppKitDefinedMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskAppKitDefined", macos(10.0,10.12)) = NSEventMaskAppKitDefined;
static const NSEventMask NSSystemDefinedMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskSystemDefined", macos(10.0,10.12)) = NSEventMaskSystemDefined;
static const NSEventMask NSApplicationDefinedMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskApplicationDefined", macos(10.0,10.12)) = NSEventMaskApplicationDefined;
static const NSEventMask NSPeriodicMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskPeriodic", macos(10.0,10.12)) = NSEventMaskPeriodic;
static const NSEventMask NSCursorUpdateMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskCursorUpdate", macos(10.0,10.12)) = NSEventMaskCursorUpdate;
static const NSEventMask NSScrollWheelMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskScrollWheel", macos(10.0,10.12)) = NSEventMaskScrollWheel;
static const NSEventMask NSTabletPointMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskTabletPoint", macos(10.0,10.12)) = NSEventMaskTabletPoint;
static const NSEventMask NSTabletProximityMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskTabletProximity", macos(10.0,10.12)) = NSEventMaskTabletProximity;
static const NSEventMask NSOtherMouseDownMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskOtherMouseDown", macos(10.0,10.12)) = NSEventMaskOtherMouseDown;
static const NSEventMask NSOtherMouseUpMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskOtherMouseUp", macos(10.0,10.12)) = NSEventMaskOtherMouseUp;
static const NSEventMask NSOtherMouseDraggedMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskOtherMouseDragged", macos(10.0,10.12)) = NSEventMaskOtherMouseDragged;
static const NSEventMask NSAnyEventMask API_DEPRECATED_WITH_REPLACEMENT("NSEventMaskAny", macos(10.0,10.12)) = NSUIntegerMax;
NS_INLINE NSEventMask NSEventMaskFromType(NSEventType type) { return (1UL << type); }
/* Device-independent bits found in event modifier flags */
typedef NS_OPTIONS(NSUInteger, NSEventModifierFlags) {
NSEventModifierFlagCapsLock = 1 << 16, // Set if Caps Lock key is pressed.
NSEventModifierFlagShift = 1 << 17, // Set if Shift key is pressed.
NSEventModifierFlagControl = 1 << 18, // Set if Control key is pressed.
NSEventModifierFlagOption = 1 << 19, // Set if Option or Alternate key is pressed.
NSEventModifierFlagCommand = 1 << 20, // Set if Command key is pressed.
NSEventModifierFlagNumericPad = 1 << 21, // Set if any key in the numeric keypad is pressed.
NSEventModifierFlagHelp = 1 << 22, // Set if the Help key is pressed.
NSEventModifierFlagFunction = 1 << 23, // Set if any function key is pressed.
// Used to retrieve only the device-independent modifier flags, allowing applications to mask off the device-dependent modifier flags, including event coalescing information.
NSEventModifierFlagDeviceIndependentFlagsMask = 0xffff0000UL
};
static const NSEventModifierFlags NSAlphaShiftKeyMask API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagCapsLock", macos(10.0,10.12)) = NSEventModifierFlagCapsLock;
static const NSEventModifierFlags NSShiftKeyMask API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagShift", macos(10.0,10.12)) = NSEventModifierFlagShift;
static const NSEventModifierFlags NSControlKeyMask API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagControl", macos(10.0,10.12)) = NSEventModifierFlagControl;
static const NSEventModifierFlags NSAlternateKeyMask API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagOption", macos(10.0,10.12)) = NSEventModifierFlagOption;
static const NSEventModifierFlags NSCommandKeyMask API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagCommand", macos(10.0,10.12)) = NSEventModifierFlagCommand;
static const NSEventModifierFlags NSNumericPadKeyMask API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagNumericPad", macos(10.0,10.12)) = NSEventModifierFlagNumericPad;
static const NSEventModifierFlags NSHelpKeyMask API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagHelp", macos(10.0,10.12)) = NSEventModifierFlagHelp;
static const NSEventModifierFlags NSFunctionKeyMask API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagFunction", macos(10.0,10.12)) = NSEventModifierFlagFunction;
static const NSEventModifierFlags NSDeviceIndependentModifierFlagsMask API_DEPRECATED_WITH_REPLACEMENT("NSEventModifierFlagDeviceIndependentFlagsMask", macos(10.0,10.12)) = NSEventModifierFlagDeviceIndependentFlagsMask;
/* pointer types for NSEventTypeTabletProximity events or mouse events with subtype NSEventSubtypeTabletProximity*/
typedef NS_ENUM(NSUInteger, NSPointingDeviceType) {
NSPointingDeviceTypeUnknown = NX_TABLET_POINTER_UNKNOWN,
NSPointingDeviceTypePen = NX_TABLET_POINTER_PEN,
NSPointingDeviceTypeCursor = NX_TABLET_POINTER_CURSOR,
NSPointingDeviceTypeEraser = NX_TABLET_POINTER_ERASER
};
static const NSPointingDeviceType NSUnknownPointingDevice API_DEPRECATED_WITH_REPLACEMENT("NSPointingDeviceTypeUnknown", macos(10.0,10.12)) = NSPointingDeviceTypeUnknown;
static const NSPointingDeviceType NSPenPointingDevice API_DEPRECATED_WITH_REPLACEMENT("NSPointingDeviceTypePen", macos(10.0,10.12)) = NSPointingDeviceTypePen;
static const NSPointingDeviceType NSCursorPointingDevice API_DEPRECATED_WITH_REPLACEMENT("NSPointingDeviceTypeCursor", macos(10.0,10.12)) = NSPointingDeviceTypeCursor;
static const NSPointingDeviceType NSEraserPointingDevice API_DEPRECATED_WITH_REPLACEMENT("NSPointingDeviceTypeEraser", macos(10.0,10.12)) = NSPointingDeviceTypeEraser;
/* button masks for NSEventTypeTabletPoint events or mouse events with subtype NSEventSubtypeTabletPoint */
typedef NS_OPTIONS(NSUInteger, NSEventButtonMask) {
NSEventButtonMaskPenTip = NX_TABLET_BUTTON_PENTIPMASK,
NSEventButtonMaskPenLowerSide = NX_TABLET_BUTTON_PENLOWERSIDEMASK,
NSEventButtonMaskPenUpperSide = NX_TABLET_BUTTON_PENUPPERSIDEMASK
};
static const NSEventButtonMask NSPenTipMask API_DEPRECATED_WITH_REPLACEMENT("NSEventButtonMaskPenTip", macos(10.0,10.12)) = NSEventButtonMaskPenTip;
static const NSEventButtonMask NSPenLowerSideMask API_DEPRECATED_WITH_REPLACEMENT("NSEventButtonMaskPenLowerSide", macos(10.0,10.12)) = NSEventButtonMaskPenLowerSide;
static const NSEventButtonMask NSPenUpperSideMask API_DEPRECATED_WITH_REPLACEMENT("NSEventButtonMaskPenUpperSide", macos(10.0,10.12)) = NSEventButtonMaskPenUpperSide;
typedef NS_OPTIONS(NSUInteger, NSEventPhase) {
NSEventPhaseNone = 0, // event not associated with a phase.
NSEventPhaseBegan = 0x1 << 0,
NSEventPhaseStationary = 0x1 << 1,
NSEventPhaseChanged = 0x1 << 2,
NSEventPhaseEnded = 0x1 << 3,
NSEventPhaseCancelled = 0x1 << 4,
NSEventPhaseMayBegin = 0x1 << 5,
} API_AVAILABLE(macos(10.7));
typedef NS_ENUM(NSInteger, NSEventGestureAxis) {
NSEventGestureAxisNone = 0,
NSEventGestureAxisHorizontal,
NSEventGestureAxisVertical
} API_AVAILABLE(macos(10.7));
typedef NS_OPTIONS(NSUInteger, NSEventSwipeTrackingOptions) {
NSEventSwipeTrackingLockDirection = 0x1 << 0, // Clamp gestureAmount to 0 if the user starts to swipe in the opposite direction than they started.
NSEventSwipeTrackingClampGestureAmount = 0x1 << 1 // Don't allow gestureAmount to go beyond +/-1.0
} API_AVAILABLE(macos(10.7));
typedef NS_ENUM(short, NSEventSubtype) {
/* event subtypes for NSEventTypeAppKitDefined events */
NSEventSubtypeWindowExposed = 0,
NSEventSubtypeApplicationActivated = 1,
NSEventSubtypeApplicationDeactivated = 2,
NSEventSubtypeWindowMoved = 4,
NSEventSubtypeScreenChanged = 8,
/* event subtypes for NSEventTypeSystemDefined events */
NSEventSubtypePowerOff = 1,
/* event subtypes for mouse events */
NSEventSubtypeMouseEvent = NX_SUBTYPE_DEFAULT,
NSEventSubtypeTabletPoint = NX_SUBTYPE_TABLET_POINT,
NSEventSubtypeTabletProximity = NX_SUBTYPE_TABLET_PROXIMITY,
NSEventSubtypeTouch API_AVAILABLE(macos(10.6)) = NX_SUBTYPE_MOUSE_TOUCH
};
static const NSEventSubtype NSWindowExposedEventType API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeWindowExposed", macos(10.0,10.12)) = NSEventSubtypeWindowExposed;
static const NSEventSubtype NSApplicationActivatedEventType API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeApplicationActivated", macos(10.0,10.12)) = NSEventSubtypeApplicationActivated;
static const NSEventSubtype NSApplicationDeactivatedEventType API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeApplicationDeactivated", macos(10.0,10.12)) = NSEventSubtypeApplicationDeactivated;
static const NSEventSubtype NSWindowMovedEventType API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeWindowMoved", macos(10.0,10.12)) = NSEventSubtypeWindowMoved;
static const NSEventSubtype NSScreenChangedEventType API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeScreenChanged", macos(10.0,10.12)) = NSEventSubtypeScreenChanged;
static const NSEventSubtype NSAWTEventType API_DEPRECATED("This subtype no longer exists", macos(10.10,10.12)) = (NSEventSubtype)16;
static const NSEventSubtype NSPowerOffEventType API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypePowerOff", macos(10.0,10.12)) = NSEventSubtypePowerOff;
static const NSEventSubtype NSMouseEventSubtype API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeMouseEvent", macos(10.0,10.12)) = NSEventSubtypeMouseEvent;
static const NSEventSubtype NSTabletPointEventSubtype API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeTabletPoint", macos(10.0,10.12)) = NSEventSubtypeTabletPoint;
static const NSEventSubtype NSTabletProximityEventSubtype API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeTabletProximity", macos(10.0,10.12)) = NSEventSubtypeTabletProximity;
static const NSEventSubtype NSTouchEventSubtype API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeTouch", macos(10.0,10.12)) = NSEventSubtypeTouch;
// NSPressureBehavior - The pressure gesture behavior that describes how a pressure gesture behaves and progresses
// In general, pressure gestures begin when stage reaches 1 and end when stage reaches 0. This corresponds to the simultaneously generated mouse down/up events.
typedef NS_ENUM(NSInteger, NSPressureBehavior) {
NSPressureBehaviorUnknown = -1,
// The default primary behavior when otherwise not explicitly configured. In 10.10.3 the default is NSPressureBehaviorPrimaryDeepClick.
NSPressureBehaviorPrimaryDefault = 0,
// Variable pressure with a small dynamic range after mouseDown.
// Mouse events: LeftMouse
// # of Stages: 1
// Allowed stage transitions: 1->0
// Actuations: mouseDown, mouseUp
// stageTransition: NO
NSPressureBehaviorPrimaryClick = 1,
// Variable pressure with a large dynamic range after mouseDown suitable for drawing and general pressure use.
// Mouse events: LeftMouse
// # of Stages: 1
// Allowed stage transitions: 1->0
// Actuations: mouseDown, mouseUp
// stageTransition: NO
NSPressureBehaviorPrimaryGeneric = 2,
// Variable pressure after mouseDown suitable for controlling speed. Used by NSAcceleratorButton
// Mouse events: LeftMouse
// # of Stages: 1
// Allowed stage transitions: 1->0
// Actuations: mouseDown, mouseUp
// stageTransition: NO
NSPressureBehaviorPrimaryAccelerator = 3,
// Toggle between stages 1 and 2 until drag or mouse up (e.g. Force Click)
// Mouse events: LeftMouse
// # of Stages: 2 (stage 2 is disabled once dragging starts)
// Allowed stage transitions: 1->0, 1->2, 2->1, 2->0
// Actuations: mouseDown, mouseUp, 1->2, 2->1
// stageTransition: into and release from stage 2
NSPressureBehaviorPrimaryDeepClick = 5,
// Toggle between stages 1 and 2 until mouse up (e.g. Force Click)
// Mouse events: LeftMouse
// # of Stages: 2
// Allowed stage transitions: 1->0, 1->2, 2->1, 2->0
// Actuations: mouseDown, mouseUp, 1->2, 2->1
// stageTransition: into and release from stage 2
NSPressureBehaviorPrimaryDeepDrag = 6,
}API_AVAILABLE(macos(10.10.3));
@interface NSEvent : NSObject <NSCopying, NSCoding>
/* these messages are valid for all events */
@property (readonly) NSEventType type;
@property (readonly) NSEventModifierFlags modifierFlags;
@property (readonly) NSTimeInterval timestamp;
@property (readonly, nullable, weak) NSWindow *window;
@property (readonly) NSInteger windowNumber;
@property (nullable, readonly, strong) NSGraphicsContext *context API_DEPRECATED("This method always returns nil. If you need access to the current drawing context, use [NSGraphicsContext currentContext] inside of a draw operation.", macos(10.0,10.12));
/* these messages are valid for all mouse down/up/drag events */
@property (readonly) NSInteger clickCount;
@property (readonly) NSInteger buttonNumber; // for NSOtherMouse events, but will return valid constants for NSLeftMouse and NSRightMouse
/* these messages are valid for all mouse down/up/drag and enter/exit events */
@property (readonly) NSInteger eventNumber;
/* -pressure is valid for all mouse down/up/drag events, and is also valid for NSEventTypeTabletPoint events on 10.4 or later and NSEventTypePressure on 10.10.3 or later */
@property (readonly) float pressure;
/* -locationInWindow is valid for all mouse-related events */
@property (readonly) NSPoint locationInWindow;
/* these messages are valid for scroll wheel events and mouse move/drag events. As of 10.5.2, deltaX and deltaY are also valid for swipe events. A non-0 deltaX will represent a horizontal swipe, -1 for swipe right and 1 for swipe left. A non-0 deltaY will represent a vertical swipe, -1 for swipe down and 1 for swipe up. As of 10.7, the preferred methods for scroll wheel events are scrollingDeltaX and scrollingDeltaY defined below.
*/
@property (readonly) CGFloat deltaX;
@property (readonly) CGFloat deltaY;
@property (readonly) CGFloat deltaZ; // 0 for most scroll wheel and mouse events
/* This message is valid for NSEventTypeScrollWheel events. A generic scroll wheel issues rather coarse scroll deltas. Some Apple mice and trackpads provide much more precise delta. This method determines the resolution of the scrollDeltaX and scrollDeltaY values.
*/
@property (readonly) BOOL hasPreciseScrollingDeltas API_AVAILABLE(macos(10.7));
/* The following two message are the preferred API for accessing NSEventTypeScrollWheel deltas. When -hasPreciseScrollingDeltas reutrns NO, multiply the returned value by line or row height. When -hasPreciseScrollingDeltas returns YES, scroll by the returned value (in points).
*/
@property (readonly) CGFloat scrollingDeltaX API_AVAILABLE(macos(10.7));
@property (readonly) CGFloat scrollingDeltaY API_AVAILABLE(macos(10.7));
/* This message is valid for NSEventTypeScrollWheel events. With the Magic Mouse and some trackpads, the user can flick thier finger resulting in a stream of scroll events that dissipate over time. The location of these scroll wheel events changes as the user moves the cursor. AppKit latches these scroll wheel events to the view that is under the cursor when the flick occurs. A custom view can use this method to recognize these momentum scroll events and further route the event to the appropriate sub component.
*/
@property (readonly) NSEventPhase momentumPhase API_AVAILABLE(macos(10.7));
/* valid for NSEventScrollWheel events. The user may choose to change the scrolling behavior such that it feels like they are moving the content instead of the scroll bar. To accomplish this, deltaX/Y and scrollingDeltaX/Y are automatically inverted for NSEventScrollWheel events according to the user's preferences. However, for some uses, the behavior should not respect the user preference. This method allows you to determine when the event has been inverted and compensate by multiplying -1 if needed.
*/
@property (getter=isDirectionInvertedFromDevice, readonly) BOOL directionInvertedFromDevice API_AVAILABLE(macos(10.7));
/* these messages are valid for keyup and keydown events */
@property (nullable, readonly, copy) NSString *characters;
@property (nullable, readonly, copy) NSString *charactersIgnoringModifiers;
/* This message is valid keyup and keydown events.
It returns the character(s) that would have been generated if a different modifier combination had been used.
It uses [self keyCode], the new modifiers and the current keyboard input source's layout data for re-translation. It entirely ignores the modifiers that are already present in the event and calling this method will not affect the dead key state for current text input.
If there is invalid data in this event, -charactersByApplyingModifiers will return nil.
*/
- (nullable NSString *)charactersByApplyingModifiers:(NSEventModifierFlags)modifiers API_AVAILABLE(macos(10.15));
/* the chars that would have been generated, regardless of modifier keys (except shift) */
@property (getter=isARepeat, readonly) BOOL ARepeat;
/* this message is valid for keyup, keydown and flagschanged events */
@property (readonly) unsigned short keyCode; /* device-independent key number */
/* these messages are valid for enter and exit events */
@property (readonly) NSInteger trackingNumber;
@property (nullable, readonly) void *userData NS_RETURNS_INNER_POINTER;
/* -trackingArea returns the NSTrackingArea that generated this event. It is possible for there to be no trackingArea associated with the event in some cases where the event corresponds to a trackingRect installed with -[NSView addTrackingRect:owner:userData:assumeInside:], in which case nil is returned. */
@property (nullable, readonly, strong) NSTrackingArea *trackingArea API_AVAILABLE(macos(10.5));
/* this message is valid for kit, system, and app-defined events */
/* this message is also valid for mouse events on 10.4 or later */
@property (readonly) NSEventSubtype subtype;
/* these messages are valid for kit, system, and app-defined events */
@property (readonly) NSInteger data1;
@property (readonly) NSInteger data2;
/* -eventRef and +eventWithEventRef: are valid for all events */
/* -eventRef returns an EventRef corresponding to the NSEvent. The EventRef is retained by the NSEvent, so will be valid as long as the NSEvent is valid, and will be released when the NSEvent is freed. You can use RetainEvent to extend the lifetime of the EventRef, with a corresponding ReleaseEvent when you are done with it. If there is no EventRef corresponding to the NSEvent, -eventRef will return NULL.
*/
@property (nullable, readonly) const void * /* EventRef */eventRef NS_RETURNS_INNER_POINTER API_AVAILABLE(macos(10.5));
/* +eventWithEventRef: returns an autoreleased NSEvent corresponding to the EventRef. The EventRef is retained by the NSEvent and will be released when the NSEvent is freed. If there is no NSEvent corresponding to the EventRef, +eventWithEventRef will return nil.
*/
+ (nullable NSEvent *)eventWithEventRef:(const void * /* EventRef */)eventRef API_AVAILABLE(macos(10.5));
/* -CGEvent returns an autoreleased CGEventRef corresponding to the NSEvent. If there is no CGEventRef corresponding to the NSEvent, -CGEvent will return NULL.
*/
@property (nullable, readonly) CGEventRef CGEvent API_AVAILABLE(macos(10.5));
/* +eventWithCGEvent: returns an autoreleased NSEvent corresponding to the CGEventRef. The CGEventRef is retained by the NSEvent and will be released when the NSEvent is freed. If there is no NSEvent corresponding to the CGEventRef, +eventWithEventRef will return nil.
*/
+ (nullable NSEvent *)eventWithCGEvent:(CGEventRef)cgEvent API_AVAILABLE(macos(10.5));
/* Enable or disable coalescing of mouse movement events, including mouse moved, mouse dragged, and tablet events. Coalescing is enabled by default.
*/
@property (class, getter=isMouseCoalescingEnabled) BOOL mouseCoalescingEnabled API_AVAILABLE(macos(10.5));
/* This message is valid for events of type NSEventTypeMagnify, on 10.5.2 or later */
@property (readonly) CGFloat magnification API_AVAILABLE(macos(10.5)); // change in magnification. This value should be added to the current scaling of an item to get the new scale factor.
/* this message is valid for mouse events with subtype NSEventSubtypeTabletPoint or NSEventSubtypeTabletProximity, and for NSEventTypeTabletPoint and NSEventTypeTabletProximity events */
@property (readonly) NSUInteger deviceID;
/* this message is valid for valid for mouse events with subtype NSEventSubtypeTabletPoint, and for NSEventTypeTabletPoint events. On 10.5.2 or later, it is also valid for NSEventTypeRotate events. */
@property (readonly) float rotation; // In degrees. For NSEventTypeTabletPoint, this is rotation of the pen. For NSEventTypeRotate, it is rotation on the track pad.
/* these messages are valid for mouse events with subtype NSEventSubtypeTabletPoint, and for NSEventTypeTabletPoint events */
/* absolute x coordinate in tablet space at full tablet resolution */
@property (readonly) NSInteger absoluteX;
/* absolute y coordinate in tablet space at full tablet resolution */
@property (readonly) NSInteger absoluteY;
/* absolute z coordinate in tablet space at full tablet resolution */
@property (readonly) NSInteger absoluteZ;
/* mask indicating which buttons are pressed.*/
@property (readonly) NSEventButtonMask buttonMask;
/* range is -1 to 1 for both axes */
@property (readonly) NSPoint tilt;
/* tangential pressure on the device; range is -1 to 1 */
@property (readonly) float tangentialPressure;
/* NSArray of 3 vendor defined shorts */
@property (readonly, strong) id vendorDefined;
/* these messages are valid for mouse events with subtype NSEventSubtypeTabletProximity, and for NSEventTypeTabletProximity events */
/* vendor defined, typically USB vendor ID */
@property (readonly) NSUInteger vendorID;
/* vendor defined tablet ID */
@property (readonly) NSUInteger tabletID;
/* index of the device on the tablet. Usually 0, except for tablets that support multiple concurrent devices */
@property (readonly) NSUInteger pointingDeviceID;
/* system assigned unique tablet ID */
@property (readonly) NSUInteger systemTabletID;
/* vendor defined pointing device type */
@property (readonly) NSUInteger vendorPointingDeviceType;
/* vendor defined serial number of pointing device */
@property (readonly) NSUInteger pointingDeviceSerialNumber;
/* vendor defined unique ID */
@property (readonly) unsigned long long uniqueID;
/* mask representing capabilities of device */
@property (readonly) NSUInteger capabilityMask;
/* mask representing capabilities of device */
@property (readonly) NSPointingDeviceType pointingDeviceType;
/* YES - entering; NO - leaving */
@property (getter=isEnteringProximity, readonly) BOOL enteringProximity;
- (NSSet<NSTouch *> *)touchesMatchingPhase:(NSTouchPhase)phase inView:(nullable NSView *)view API_AVAILABLE(macos(10.6));
/* Only valid for NSEventTypeGesture events. Equivalent to [event touchesMatchingPhase:NSTouchPhaseAny inView:nil] */
- (NSSet <NSTouch *> *)allTouches API_AVAILABLE(macos(10.12));
/* Only valid for NSEventTypeGesture events. Equivalent to [event touchesMatchingPhase:NSTouchPhaseAny inView:view] */
- (NSSet <NSTouch *> *)touchesForView:(NSView *)view API_AVAILABLE(macos(10.12));
/* An array of auxiliary NSTouch’s for the touch events that did not get delivered for a given main touch. This also includes an auxiliary version of the main touch itself. Only valid for NSEventTypeDirectTouch events.
*/
- (NSArray <NSTouch *> *)coalescedTouchesForTouch:(NSTouch *)touch API_AVAILABLE(macos(10.12.2));
/* The phase of a gesture scroll event. A gesture phrase are all the events that begin with a NSEventPhaseBegan and end with either a NSEventPhaseEnded or NSEventPhaseCancelled. All the gesture events are sent to the view under the cursor when the NSEventPhaseBegan occurred. A gesture scroll event starts with a NSEventPhaseBegan phase and ends with a NSPhaseEnded. Legacy scroll wheel events (say from a Mighty Mouse) and momentum scroll wheel events have a phase of NSEventPhaseNone.
Valid for NSEventTypeScrollWheel
*/
@property (readonly) NSEventPhase phase API_AVAILABLE(macos(10.7));
/* This message is valid for NSEventTypePressure events. Pressure gesture events go through multiple stages.
*/
@property (readonly) NSInteger stage API_AVAILABLE(macos(10.10.3));
/* This message is valid for NSEventTypePressure events. Positive stageTransition describes approaching the next stage of the pressure gesture. Negative stageTransition describes approaching release of the current stage.
*/
@property (readonly) CGFloat stageTransition API_AVAILABLE(macos(10.10.3));
/* This message is valid for Mouse events. The event mask describing the various events that you may also get during this event sequence. Useful for determining if the input device issuing this mouse event can also simultaneously issue NSEventTypePressure events.
*/
@property (readonly) NSEventMask associatedEventsMask API_AVAILABLE(macos(10.10.3));
/* this message is valid for NSEventTypePressure events */
@property (readonly) NSPressureBehavior pressureBehavior API_AVAILABLE(macos(10.11));
/* Returns the user's preference about using gesture scrolls as a way to track fluid swipes. This value is determined by the Mouse / Trackpad preference panel for the current user. Generally, NSScrollView will check this for you. However, if your app is not using an NSScrollView, or your NSResponder can receive scrollWheel messages without first being sent to an NSScrollView, then you should check this preference before calling -trackSwipeEventWithOptions:dampenAmountThresholdMin:max:usingHandler:
*/
@property (class, readonly, getter=isSwipeTrackingFromScrollEventsEnabled) BOOL swipeTrackingFromScrollEventsEnabled API_AVAILABLE(macos(10.7));
/* This method allows easy tracking and UI feedback of scroll events as fluid swipes. Fluid swipes are tracked not only to the end of the physical gesture phase by the user, but also to the completion of any UI animation that should be performed. Using this method allows your implementation to maintain a consistent fluid feel with other applications. Any gesture amount outside of the supplied minimum and maximum dampen amount is pre-dampened for you to provide an elastic feel.
The trackingHandler has the following parameters:
gestureAmount: the amount of gesture that you should display in the UI. This may be a fractional amount. Note: Upon completion, the gesture amount will animate to one of the following values: -1, 0, 1.
phase: the phase of the physical gesture as performed by the user. When the phase is either NSPhaseEnded, or NSPhaseCancelled, the use has physically ended the gesture successfully or not, respectively. Your handler will continue to be called with updated progress values to complete the fluid swipe animation with a phase of NSPhaseNone.
isComplete: Signifies the swipe and animation are complete and you should tear down any temporary animation objects. The trackingHandler is released and will not be called further.
*stop: A pointer to a BOOL allowing you to cancel further use of this trackingHandler by setting its value to YES. The trackingHandler is released appropriately.
Note: This method returns immediately and tracking is performed asynchronously.
Valid for Scroll events with a phase of NSEventPhaseBegan or NSEventPhaseChanged
*/
- (void)trackSwipeEventWithOptions:(NSEventSwipeTrackingOptions)options dampenAmountThresholdMin:(CGFloat)minDampenThreshold max:(CGFloat)maxDampenThreshold usingHandler:(void (^)(CGFloat gestureAmount, NSEventPhase phase, BOOL isComplete, BOOL *stop))trackingHandler API_AVAILABLE(macos(10.7));
/* used for initial delay and periodic behavior in tracking loops */
+ (void)startPeriodicEventsAfterDelay:(NSTimeInterval)delay withPeriod:(NSTimeInterval)period;
+ (void)stopPeriodicEvents;
/* apps will rarely create these objects */
+ (nullable NSEvent *)mouseEventWithType:(NSEventType)type location:(NSPoint)location modifierFlags:(NSEventModifierFlags)flags timestamp:(NSTimeInterval)time windowNumber:(NSInteger)wNum context:(nullable NSGraphicsContext* __unused)unusedPassNil eventNumber:(NSInteger)eNum clickCount:(NSInteger)cNum pressure:(float)pressure;
+ (nullable NSEvent *)keyEventWithType:(NSEventType)type location:(NSPoint)location modifierFlags:(NSEventModifierFlags)flags timestamp:(NSTimeInterval)time windowNumber:(NSInteger)wNum context:(nullable NSGraphicsContext* __unused)unusedPassNil characters:(NSString *)keys charactersIgnoringModifiers:(NSString *)ukeys isARepeat:(BOOL)flag keyCode:(unsigned short)code;
+ (nullable NSEvent *)enterExitEventWithType:(NSEventType)type location:(NSPoint)location modifierFlags:(NSEventModifierFlags)flags timestamp:(NSTimeInterval)time windowNumber:(NSInteger)wNum context:(nullable NSGraphicsContext* __unused)unusedPassNil eventNumber:(NSInteger)eNum trackingNumber:(NSInteger)tNum userData:(nullable void *)data;
+ (nullable NSEvent *)otherEventWithType:(NSEventType)type location:(NSPoint)location modifierFlags:(NSEventModifierFlags)flags timestamp:(NSTimeInterval)time windowNumber:(NSInteger)wNum context:(nullable NSGraphicsContext* __unused)unusedPassNil subtype:(short)subtype data1:(NSInteger)d1 data2:(NSInteger)d2;
// global mouse coordinates
@property (class, readonly) NSPoint mouseLocation;
/* modifier keys currently down. This returns the state of devices combined with synthesized events at the moment, independent of which events have been delivered via the event stream. */
@property (class, readonly) NSEventModifierFlags modifierFlags API_AVAILABLE(macos(10.6));
/* mouse buttons currently down. Returns indices of the mouse buttons currently down. 1 << 0 corresponds to leftMouse, 1 << 1 to rightMouse, and 1 << n, n >= 2 to other mouse buttons. This returns the state of devices combined with synthesized events at the moment, independent of which events have been delivered via the event stream, so this method is not suitable for tracking. */
@property (class, readonly) NSUInteger pressedMouseButtons API_AVAILABLE(macos(10.6));
/* the time in which a second click must occur in order to be considered a doubleClick. This is a system value so overrides will have no effect. */
@property (class, readonly) NSTimeInterval doubleClickInterval API_AVAILABLE(macos(10.6));
/* the time for which a key must be held down in order to generate the first key repeat event. This is a system value so overrides will have no effect. */
@property (class, readonly) NSTimeInterval keyRepeatDelay API_AVAILABLE(macos(10.6));
/* the time between subsequent key repeat events. This is a system value so overrides will have no effect. */
@property (class, readonly) NSTimeInterval keyRepeatInterval API_AVAILABLE(macos(10.6));
/*
API for monitoring events in other processes, or in your own process. For either +addGlobal or +addLocal, pass an event mask specifying which events you wish to monitor, and a block that will be called with the event to monitor.
Use +addGlobal to install an event monitor that receives copies of events posted to other applications. Events are delivered asynchronously to your app and you can only observe the event; you cannot modify or otherwise prevent the event from being delivered to its original target application. Key-related events may only be monitored if accessibility is enabled or if your application is trusted for accessibility access (see AXIsProcessTrusted in AXUIElement.h). Note that your handler will not be called for events that are sent to your own application.
Use +addLocal to install an event monitor that receives events before they are dispatched by -[NSApplication sendEvent:]. In this case, your block should either return a valid NSEvent (which may be the same as the incoming NSEvent, or may be a newly created NSEvent) to cause the event to be dispatched, or it may return nil to stop dispatching of the event. Note that your handler will not be called for events that are consumed by nested event-tracking loops such as control tracking, menu tracking, or window dragging; only events that are dispatched through -[NSApplication sendEvent:] will be passed to your handler.
In either case, the return value of the API is a retained NSObject. You typically do not need to retain and release the event monitor yourself, since the implementation will retain it while needed.
To remove the event monitor, under both garbage collection and non-GC, pass the return value from the +add API to +removeMonitor.
*/
+ (nullable id)addGlobalMonitorForEventsMatchingMask:(NSEventMask)mask handler:(void (^)(NSEvent *event))block API_AVAILABLE(macos(10.6));
+ (nullable id)addLocalMonitorForEventsMatchingMask:(NSEventMask)mask handler:(NSEvent* _Nullable (^)(NSEvent *event))block API_AVAILABLE(macos(10.6));
+ (void)removeMonitor:(id)eventMonitor API_AVAILABLE(macos(10.6));
@end
/* Unicodes we reserve for function keys on the keyboard, OpenStep reserves the range 0xF700-0xF8FF for this purpose. The availability of various keys will be system dependent. */
enum {
NSUpArrowFunctionKey = 0xF700,
NSDownArrowFunctionKey = 0xF701,
NSLeftArrowFunctionKey = 0xF702,
NSRightArrowFunctionKey = 0xF703,
NSF1FunctionKey = 0xF704,
NSF2FunctionKey = 0xF705,
NSF3FunctionKey = 0xF706,
NSF4FunctionKey = 0xF707,
NSF5FunctionKey = 0xF708,
NSF6FunctionKey = 0xF709,
NSF7FunctionKey = 0xF70A,
NSF8FunctionKey = 0xF70B,
NSF9FunctionKey = 0xF70C,
NSF10FunctionKey = 0xF70D,
NSF11FunctionKey = 0xF70E,
NSF12FunctionKey = 0xF70F,
NSF13FunctionKey = 0xF710,
NSF14FunctionKey = 0xF711,
NSF15FunctionKey = 0xF712,
NSF16FunctionKey = 0xF713,
NSF17FunctionKey = 0xF714,
NSF18FunctionKey = 0xF715,
NSF19FunctionKey = 0xF716,
NSF20FunctionKey = 0xF717,
NSF21FunctionKey = 0xF718,
NSF22FunctionKey = 0xF719,
NSF23FunctionKey = 0xF71A,
NSF24FunctionKey = 0xF71B,
NSF25FunctionKey = 0xF71C,
NSF26FunctionKey = 0xF71D,
NSF27FunctionKey = 0xF71E,
NSF28FunctionKey = 0xF71F,
NSF29FunctionKey = 0xF720,
NSF30FunctionKey = 0xF721,
NSF31FunctionKey = 0xF722,
NSF32FunctionKey = 0xF723,
NSF33FunctionKey = 0xF724,
NSF34FunctionKey = 0xF725,
NSF35FunctionKey = 0xF726,
NSInsertFunctionKey = 0xF727,
NSDeleteFunctionKey = 0xF728,
NSHomeFunctionKey = 0xF729,
NSBeginFunctionKey = 0xF72A,
NSEndFunctionKey = 0xF72B,
NSPageUpFunctionKey = 0xF72C,
NSPageDownFunctionKey = 0xF72D,
NSPrintScreenFunctionKey = 0xF72E,
NSScrollLockFunctionKey = 0xF72F,
NSPauseFunctionKey = 0xF730,
NSSysReqFunctionKey = 0xF731,
NSBreakFunctionKey = 0xF732,
NSResetFunctionKey = 0xF733,
NSStopFunctionKey = 0xF734,
NSMenuFunctionKey = 0xF735,
NSUserFunctionKey = 0xF736,
NSSystemFunctionKey = 0xF737,
NSPrintFunctionKey = 0xF738,
NSClearLineFunctionKey = 0xF739,
NSClearDisplayFunctionKey = 0xF73A,
NSInsertLineFunctionKey = 0xF73B,
NSDeleteLineFunctionKey = 0xF73C,
NSInsertCharFunctionKey = 0xF73D,
NSDeleteCharFunctionKey = 0xF73E,
NSPrevFunctionKey = 0xF73F,
NSNextFunctionKey = 0xF740,
NSSelectFunctionKey = 0xF741,
NSExecuteFunctionKey = 0xF742,
NSUndoFunctionKey = 0xF743,
NSRedoFunctionKey = 0xF744,
NSFindFunctionKey = 0xF745,
NSHelpFunctionKey = 0xF746,
NSModeSwitchFunctionKey = 0xF747
};
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSHelpManager.h | /*
NSHelpManager.h
Application Kit
Copyright (c) 1995-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSMapTable.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSBundle.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSApplication.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSAttributedString, NSWindow;
typedef NSString * NSHelpBookName NS_SWIFT_BRIDGED_TYPEDEF;
typedef NSString * NSHelpAnchorName NS_SWIFT_BRIDGED_TYPEDEF;
typedef NSString * NSHelpManagerContextHelpKey NS_SWIFT_BRIDGED_TYPEDEF;
NS_SWIFT_UI_ACTOR
@interface NSHelpManager : NSObject
@property (class, readonly, strong) NSHelpManager *sharedHelpManager;
@property (class, getter=isContextHelpModeActive) BOOL contextHelpModeActive;
- (void)setContextHelp:(NSAttributedString *)attrString forObject:(id)object;
- (void)removeContextHelpForObject:(id)object;
- (nullable NSAttributedString *)contextHelpForObject:(id)object;
- (BOOL)showContextHelpForObject:(id)object locationHint:(NSPoint)pt;
- (void)openHelpAnchor:(NSHelpAnchorName)anchor inBook:(nullable NSHelpBookName)book;
- (void)findString:(NSString *)query inBook:(nullable NSHelpBookName)book;
/* Register one or more help books in the given bundle. The main bundle is automatically registered by -openHelpAnchor:inBook: and -findString:inBook:. You can use -registerBooksInBundle: to register help books in a plugin bundle, for example. The Info.plist in the bundle should contain a help book directory path, which specifies one or more folders containing help books. Returns NO if the bundle doesn't contain any help books or if registration fails. Returns YES on successful registration. */
- (BOOL)registerBooksInBundle:(NSBundle *)bundle API_AVAILABLE(macos(10.6));
@end
//
// Notifications for the activation/deactivation of the context help mode
//
APPKIT_EXTERN NSNotificationName NSContextHelpModeDidActivateNotification;
APPKIT_EXTERN NSNotificationName NSContextHelpModeDidDeactivateNotification;
//
// Conveniences for accessing Help.plist
//
@interface NSBundle(NSBundleHelpExtension)
- (nullable NSAttributedString *)contextHelpForKey:(NSHelpManagerContextHelpKey)key; /* return nil if not found */
@end
//
// Convenience methods on NSApplication
//
@interface NSApplication(NSApplicationHelpExtension)
- (void)activateContextHelpMode:(nullable id)sender;
// Target method cover for [NSHelpManager setContextHelpModeActive:YES];
- (void)showHelp:(nullable id)sender;
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSPICTImageRep.h | /*
NSPICTImageRep.h
Application Kit
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSImageRep.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@interface NSPICTImageRep : NSImageRep
+ (nullable instancetype)imageRepWithData:(NSData *)pictData;
- (nullable instancetype)initWithData:(NSData *)pictData;
@property (readonly, copy) NSData *PICTRepresentation;
@property (readonly) NSRect boundingBox;
@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/NSPanGestureRecognizer.h | /*
NSPanGestureRecognizer.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 NSPanGestureRecognizer : 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.h dynamically returns YES to delay primary, secondary and other mouse events depending on this value.
*/
@property NSUInteger buttonMask; // Defaults to 0x1
/* Translation in the coordinate system of the specified view */
- (NSPoint)translationInView:(nullable NSView *)view;
- (void)setTranslation:(NSPoint)translation inView:(nullable NSView *)view;
/* Velocity of the pan in points/second in the coordinate system of the specified view */
- (NSPoint)velocityInView:(nullable NSView*)view;
/* Number of touches required to recognize the gesture when used in NSTouchBar */
@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/NSSecureTextField.h | /*
NSSecureTextField.h
Application Kit
Copyright (c) 1995-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSTextField.h>
#import <AppKit/NSTextFieldCell.h>
#import <AppKit/AppKitDefines.h>
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@interface NSSecureTextField : NSTextField
@end
@interface NSSecureTextFieldCell : NSTextFieldCell
@property BOOL echosBullets;
@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/NSStackView.h | /*
NSStackView.h
Application Kit
Copyright (c) 2012-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSApplication.h>
#import <AppKit/NSLayoutConstraint.h>
#import <AppKit/NSView.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSView;
@protocol NSStackViewDelegate;
/*
The gravity area describes the area within a StackView that a view will be placed.
This placement is also highly related to the set orientation and layoutDirection.
Gravity areas will align to a specific direction in the StackView, which are described through these enum values.
Each gravity area is a distinct portion of the StackView, and the constraints for spacing between gravities is described further in the documentation for the spacing property.
In addition to the gravity spacing constraints, the center gravity area also has a constraint tying it to the center of the StackView with a layout priority of NSLayoutPriorityDefaultLow.
For horizontally-oriented StackViews, NSStackViewGravityLeading, NSStackViewGravityCenter, and NSStackViewGravityTrailing should be used. Leading and trailing are described by the userInterfaceLayoutDirection of the StackView, (leading = left for NSUserInterfaceLayoutDirectionLeftToRight vs leading = right for NSUserInterfaceLayoutDirectionRightToLeft).
For a vertically-oriented StackView, NSStackViewGravityTop, NSStackViewGravityCenter, and NSStackViewGravityBottom should be used.
See also:
- insertView:atIndex:inGravity:
- viewsInGravity:
- setViews:inGravity:
- NSUserInterfaceLayoutOrientation
- NSUserInterfaceLayoutDirection
*/
typedef NS_ENUM(NSInteger, NSStackViewGravity) {
NSStackViewGravityTop = 1, // The top-most gravity area, should only be used when orientation = NSUserInterfaceLayoutOrientationVertical
NSStackViewGravityLeading = 1, // The leading gravity area (as described by userInterfaceLayoutDirection), should only be used when orientation = NSUserInterfaceLayoutOrientationHorizontal
NSStackViewGravityCenter = 2, // The center gravity area, this is the center regardless of orientation
NSStackViewGravityBottom = 3, // The bottom-most gravity area, should only be used when orientation = NSUserInterfaceLayoutOrientationVertical
NSStackViewGravityTrailing = 3 // The trailing gravity area (as described by userInterfaceLayoutDirection), should only be used when orientation = NSUserInterfaceLayoutOrientationHorizontal
} API_AVAILABLE(macos(10.9));
/* Distribution—the layout along the stacking axis.
All NSStackViewDistribution enum values fit first and last stacked views tightly to the container, except for NSStackViewDistributionGravityAreas.
*/
typedef NS_ENUM(NSInteger, NSStackViewDistribution) {
/// Default value. NSStackView will not have any special distribution behavior, relying on behavior described by gravity areas and set hugging priorities along the stacking axis.
NSStackViewDistributionGravityAreas = -1,
/// The effective hugging priority in the stacking axis is NSLayoutPriorityRequired, causing the stacked views to tightly fill the container along the stacking axis.
NSStackViewDistributionFill = 0,
/// Stacked views will have sizes maintained to be equal as much as possible along the stacking axis. The effective hugging priority in the stacking axis is NSLayoutPriorityRequired.
NSStackViewDistributionFillEqually,
/// Stacked views will have sizes maintained to be equal, proportionally to their intrinsicContentSizes, as much as possible. The effective hugging priority in the stacking axis is NSLayoutPriorityRequired.
NSStackViewDistributionFillProportionally,
/// The space separating stacked views along the stacking axis are maintained to be equal as much as possible while still maintaining the minimum spacing.
NSStackViewDistributionEqualSpacing,
/// Equal center-to-center spacing of the items is maintained as much as possible while still maintaining the minimum spacing between each view.
NSStackViewDistributionEqualCentering,
} API_AVAILABLE(macos(10.11));
/*
Visibility Priority describes the priority at which a view should be held (aka, not be detached).
In the case that clippingResistancePriority is optional (< NSLayoutPriorityRequired) and there's not enough space to display all of StackView's subviews, views are able to be detached from the StackView.
Views will be detached in order (from lowest to highest) of their visibility priority, and reattached in the reverse order (FILO).
If multiple views share the lowest visibility priority, all those views will be dropped when one needs to be. Likewise, groups of views with equal visibility priorities will wait to be reattached until they can all be readded.
A view with a higher visibility priority will never be detached while a lower priority view remains visible
See also:
- visibilityPriorityForView:
- setVisibilityPriority:ForView:
- clippingResistancePriority
- detachedViews
*/
typedef float NSStackViewVisibilityPriority NS_TYPED_EXTENSIBLE_ENUM API_AVAILABLE(macos(10.9));
static const NSStackViewVisibilityPriority NSStackViewVisibilityPriorityMustHold API_AVAILABLE(macos(10.9)) = 1000; //Maximum, default - the view will never be detached
static const NSStackViewVisibilityPriority NSStackViewVisibilityPriorityDetachOnlyIfNecessary API_AVAILABLE(macos(10.9)) = 900;
static const NSStackViewVisibilityPriority NSStackViewVisibilityPriorityNotVisible API_AVAILABLE(macos(10.9)) = 0; //Minimum - will force a view to be detached
/*
A value of NSStackViewSpacingUseDefault signifies that the spacing is the default spacing set with the StackView property.
See also:
- setCustomSpacing:afterView:
- customSpacingAfterView:
*/
static const CGFloat NSStackViewSpacingUseDefault API_AVAILABLE(macos(10.9)) = FLT_MAX;
#pragma mark - NSStackViewLayout
API_AVAILABLE(macos(10.9))
@interface NSStackView : NSView
+ (instancetype)stackViewWithViews:(NSArray<NSView *> *)views; // Returns an autoreleased horizontal StackView with the provided views set as the leading views, and has translatesAutoresizingMaskIntoConstraints set to NO.
#pragma mark General StackView Properties
@property (nullable, weak) id<NSStackViewDelegate> delegate;
/// Orientation of the StackView, defaults to NSUserInterfaceLayoutOrientationHorizontal
@property NSUserInterfaceLayoutOrientation orientation;
#if !TARGET_OS_IPHONE
/// Describes how subviews are aligned within the StackView, defaults to `NSLayoutAttributeCenterY` for horizontal stacks, `NSLayoutAttributeCenterX` for vertical stacks. Setting `NSLayoutAttributeNotAnAttribute` will cause the internal alignment constraints to not be created, and could result in an ambiguous layout. Setting an inapplicable attribute for the set orientation will result in the alignment being ignored (similar to its handling with NSLayoutAttributeNotAnAttribute). The alignment constraints are established at a priority of `NSLayoutPriorityDefaultLow` and are overridable for individual views using external constraints.
@property NSLayoutAttribute alignment;
#endif
/// Default padding inside the StackView, around all of the subviews.
@property NSEdgeInsets edgeInsets;
/// The spacing and sizing distribution of stacked views along the primary axis. Defaults to GravityAreas.
@property NSStackViewDistribution distribution API_AVAILABLE(macos(10.11));
/// Default (minimum) spacing between each view
@property CGFloat spacing;
/*
Set and get custom spacing after a view. This custom spacing is used instead of the default spacing set with the spacing property.
This is saved across layout updates, until the view is removed from the StackView or the custom spacing is changed.
A value of NSStackViewSpacingUseDefault signifies that the spacing is the default spacing set with the StackView property.
`view` must be managed by the StackView, an exception will be raised if not.
*/
- (void)setCustomSpacing:(CGFloat)spacing afterView:(NSView *)view;
- (CGFloat)customSpacingAfterView:(NSView *)view;
/// If YES, when a stacked view's `hidden` property is set to YES, the view will be detached from the stack and reattached when set to NO. Similarly, if the view has a lowered visibility priority and is detached from the stack view, it will be set as `hidden` rather than removed from the view hierarchy. Defaults to YES for apps linked on the 10.11 SDK or later.
@property BOOL detachesHiddenViews API_AVAILABLE(macos(10.11));
#pragma mark Arranged Subviews
/// The list of views that are arranged in a stack by the receiver. They are a subset of \c -subviews, with potential difference in ordering.
@property (readonly, copy) NSArray<__kindof NSView *> *arrangedSubviews API_AVAILABLE(macos(10.11));
/*!
* Adds a view to the end of the arrangedSubviews list. 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 to the arrangedSubviews list at a specific index.
* If the view is already in the arrangedSubviews list, it will move the view to the specified index (but not change 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 subview from the list of arranged subviews without removing it as a subview of the receiver.
* 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));
/// The arrangedSubviews that are currently detached/hidden.
@property (readonly, copy) NSArray<__kindof NSView *> *detachedViews;
#pragma mark Custom Priorities
/*
Sets and gets the visibility priorities for views in the StackView.
When detaching a view, it will first detach views with the lowest visibility priority.
If multiple views share the same lowest visibility priority, all of them will be dropped.
Defaults to `NSStackViewVisibilityPriorityMustHold`.
Setting the visibility priority to NSStackViewVisibilityPriorityNotVisible will force that view to be detached (regardless of available space), and will set the view to be hidden if `detachesHiddenViews` is set to `YES`.
`view` must be managed by the StackView, an exception will be raised if not.
*/
- (void)setVisibilityPriority:(NSStackViewVisibilityPriority)priority forView:(NSView *)view;
- (NSStackViewVisibilityPriority)visibilityPriorityForView:(NSView *)view;
/*
Priority at which the StackView will not clip its views, defaults to NSLayoutPriorityRequired
Clipping begins from the trailing and bottom sides of the StackView.
*/
#if !TARGET_OS_IPHONE
- (NSLayoutPriority)clippingResistancePriorityForOrientation:(NSLayoutConstraintOrientation)orientation;
- (void)setClippingResistancePriority:(NSLayoutPriority)clippingResistancePriority forOrientation:(NSLayoutConstraintOrientation)orientation;
/* Priority at which the StackView wants its internal spacing to be as small as possible, defaults to NSLayoutPriorityDefaultLow
Spacing within a StackView is managed completely by the StackView.
However, extra layout constraints can be added in conjunction with the StackView to create a more customized layout.
Below describes the constraints the StackView uses to space its internal views.
Spacing between view gravities have constraints with the following constraints:
- Length >= spacing @ NSLayoutPriorityRequired
- Length == spacing @ huggingPriority
Spacing between views (within a gravity) have the following constraints:
- Length >= spacing @ NSLayoutPriorityRequired
- Length == spacing @ MAX(NSLayoutPriorityDefaultHigh, huggingPriority)
*/
- (NSLayoutPriority)huggingPriorityForOrientation:(NSLayoutConstraintOrientation)orientation;
- (void)setHuggingPriority:(NSLayoutPriority)huggingPriority forOrientation:(NSLayoutConstraintOrientation)orientation;
#endif
@end
#pragma mark - NSStackViewDelegate
@protocol NSStackViewDelegate <NSObject>
@optional
/*
These are called when the StackView detaches or readds a view (or multiple views) after it was detached.
This is not called when a view is explicitly added or removed from the StackView
*/
- (void)stackView:(NSStackView *)stackView willDetachViews:(NSArray<NSView *> *)views;
- (void)stackView:(NSStackView *)stackView didReattachViews:(NSArray<NSView *> *)views;
@end
/* API that is intended for use when the `distribution` of the receiver is set to `NSStackViewDistributionGravityAreas`. */
@interface NSStackView (NSStackViewGravityAreas)
/*
Adds the view to the given gravity area at the end of that gravity area.
This method will update the StackView's layout, and could result in the StackView changing its size or views being detached / clipped.
*/
- (void)addView:(NSView *)view inGravity:(NSStackViewGravity)gravity;
/*
Adds the view to the given gravity area at the index within that gravity area.
Index numbers & counts are specific to each gravity area, and are indexed based on the set userInterfaceLayoutDirection.
(For a L2R layout, index 0 in the leading gravity is the furthest left index; for a R2L layout index 0 in the leading gravity is the furthest right index)
This method will update the StackView's layout, and could result in the StackView changing its size or views being detached / clipped.
An NSRangeException will be raised if the index is out of bounds
*/
- (void)insertView:(NSView *)view atIndex:(NSUInteger)index inGravity:(NSStackViewGravity)gravity;
/*
Will remove view from the StackView.
[view removeFromSuperview] will have the same behavior in the case that view is visible (not detached) from the StackView.
In the case that view had been detached, this method must be used to remove it from the StackView.
view must be managed by the StackView, an exception will be raised if not.
*/
- (void)removeView:(NSView *)view;
- (NSArray<__kindof NSView *> *)viewsInGravity:(NSStackViewGravity)gravity; // Getters will return the views that are contained by the corresponding gravity area, regardless of detach-status.
- (void)setViews:(NSArray<NSView *> *)views inGravity:(NSStackViewGravity)gravity; // Setters will update the views and the layout for that gravity area.
/*
Returns an array of all the views managed by this StackView, regardless of detach-status or gravity area.
This is indexed in the order of indexing within the StackView. Detached views are indexed at the positions they would have been if they were still attached.
*/
@property (readonly, copy) NSArray<__kindof NSView *> *views;
@end
@interface NSStackView (NSStackViewDeprecated)
/*
Property describing whether or not all spacing between views should be equivalent. Defaults to NO.
If set to YES, this modifies the constraints used internally for spacing in such manners:
- All spacing is >= spacing @ NSLayoutPriorityRequired
- All spacing is == spacing @ huggingPriority
- All spacing is == each other @ NSLayoutPriorityDefaultLow
- Custom spacing is ignored. StackView's spacing property is used as the minimum spacing between each view
*/
@property BOOL hasEqualSpacing API_DEPRECATED("Set -distribution to NSStackViewDistributionEqualSpacing instead.", macos(10.9,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/NSScrubber.h | /*
NSScrubber.h
Application Kit
Copyright (c) 2016-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSControl.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSScrubber, NSScrubberItemView, NSScrubberSelectionView, NSScrubberLayout, NSPanGestureRecognizer, NSPressGestureRecognizer, NSButton, NSNib;
#pragma mark Data Source & Delegate Protocols
@protocol NSScrubberDataSource <NSObject>
@required
- (NSInteger)numberOfItemsForScrubber:(NSScrubber *)scrubber API_AVAILABLE(macos(10.12.2));
- (__kindof NSScrubberItemView *)scrubber:(NSScrubber *)scrubber viewForItemAtIndex:(NSInteger)index API_AVAILABLE(macos(10.12.2));
@end
@protocol NSScrubberDelegate <NSObject>
@optional
- (void)scrubber:(NSScrubber *)scrubber didSelectItemAtIndex:(NSInteger)selectedIndex API_AVAILABLE(macos(10.12.2));
- (void)scrubber:(NSScrubber *)scrubber didHighlightItemAtIndex:(NSInteger)highlightedIndex API_AVAILABLE(macos(10.12.2));
- (void)scrubber:(NSScrubber *)scrubber didChangeVisibleRange:(NSRange)visibleRange API_AVAILABLE(macos(10.12.2));
- (void)didBeginInteractingWithScrubber:(NSScrubber *)scrubber API_AVAILABLE(macos(10.12.2));
- (void)didFinishInteractingWithScrubber:(NSScrubber *)scrubber API_AVAILABLE(macos(10.12.2));
- (void)didCancelInteractingWithScrubber:(NSScrubber *)scrubber API_AVAILABLE(macos(10.12.2));
@end
#pragma mark - Associated Types
/*!
* @typedef NSScrubberMode
* @discussion Determines the interaction mode for a NSScrubber control.
*
* @const NSScrubberModeFixed Panning over the control does not scroll, but instead highlights the element under the user’s finger. The highlighted element is selected the end of the gesture. If the gesture begins on top of the selected element, or if the @c continuous property is set to @c YES, the selection is changed immediately as the user pans.
* @const NSScrubberModeFree Panning over the control freely scrolls the scrubber content. Items are selected by tapping or pressing them without panning. If the @c continuous property is set to @c YES, the control automatically selects items as they scroll under the axis specified by the @c itemAlignment property; if @c itemAlignment is @c NSScrubberAlignmentNone, it is interpreted as @c NSScrubberAlignmentCenter for this purpose.
*/
typedef NS_ENUM(NSInteger, NSScrubberMode) {
NSScrubberModeFixed = 0,
NSScrubberModeFree
} API_AVAILABLE(macos(10.12.2));
/*!
* @typedef NSScrubberAlignment
* @discussion NSScrubberAlignment specifies the preferred alignment of elements within the control.
*
* @const NSScrubberAlignmentNone Specifies no preference for item alignment.
* @const NSScrubberAlignmentLeading Specifies that an item will be leading-aligned within the control.
* @const NSScrubberAlignmentTrailing Specifies that an item will be trailing-aligned within the control.
* @const NSScrubberAlignmentCenter Specifies that an item will be center-aligned within the control.
*/
typedef NS_ENUM(NSInteger, NSScrubberAlignment) {
NSScrubberAlignmentNone = 0,
NSScrubberAlignmentLeading,
NSScrubberAlignmentTrailing,
NSScrubberAlignmentCenter
} API_AVAILABLE(macos(10.12.2));
/*!
* @class NSScrubberSelectionStyle
* @abstract @c NSScrubberSelectionStyle is an abstract class that provides decorative accessory views for selected and highlighted items within a NSScrubber control. Class properties provide convenient access to built-in styles. For a completely custom style, subclassers can override @c -makeSelectionView to create and configure arbitrary @c NSScrubberSelectionView subclasses.
*
*/
API_AVAILABLE(macos(10.12.2)) NS_SWIFT_UI_ACTOR
@interface NSScrubberSelectionStyle : NSObject <NSCoding>
#pragma mark Built-in Styles
@property (class, strong, readonly) NSScrubberSelectionStyle *outlineOverlayStyle;
@property (class, strong, readonly) NSScrubberSelectionStyle *roundedBackgroundStyle;
#pragma mark Initialization & View Creation
- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
- (nullable __kindof NSScrubberSelectionView *)makeSelectionView;
@end
#pragma mark - Scrubber Control
/*!
* @class NSScrubber
* @abstract @c NSScrubber is a control designed for the NSTouchBar environment.
*
* @c NSScrubber arranges a finite number of "items" (represented by views of type @c NSScrubberItemView ) according to a layout object (see @c NSScrubberLayout ), and provides several methods for navigating and selecting those items.
*
* Clients provide data to @c NSScrubber via a data source object (see the @c NSScrubberDataSource protocol) and react to user interaction via a delegate object (see the @c NSScrubberDelegate protocol).
*
*/
API_AVAILABLE(macos(10.12.2))
@interface NSScrubber : NSView
#pragma mark Properties
@property (weak, nullable) id<NSScrubberDataSource> dataSource;
@property (weak, nullable) id<NSScrubberDelegate> delegate;
@property (strong) __kindof NSScrubberLayout *scrubberLayout;
/// Returns the number of items represented by the scrubber control.
@property (readonly) NSInteger numberOfItems;
/// The index of the currently highlighted item within the control. If there is no highlighted item, the value of this property is (-1).
@property (readonly) NSInteger highlightedIndex;
/// The index of the selected item within the control. If there is no selected item, the value of this property is (-1). Setting this property through the animator proxy will animate the selection change. Programmatic selection changes do not trigger delegate callbacks.
@property NSInteger selectedIndex;
/// Describes the interaction mode for the scrubber control. See the @c NSScrubberMode enumeration for a list of possible values. The default value is @c NSScrubberModeFixed.
@property NSScrubberMode mode;
/// If the value of @c itemAlignment is not @c NSScrubberAlignmentNone, the scrubber will ensure that some item rests at the preferred alignment within the control following a scrolling or paging interaction. The default value is @c NSScrubberAlignmentNone.
@property NSScrubberAlignment itemAlignment;
/// When @c continuous is @c YES, panning over the control in @c NSScrubberModeFixed will immediately select the item under the user's finger, and scrolling in @c NSScrubberModeFree will continuously select items as they pass through the current @c itemAlignment. The default is @c NO.
@property (getter=isContinuous) BOOL continuous;
/// When @c floatsSelectionViews is @c YES, the selection decorations provided by @c selectionBackgroundStyle and @c selectionOverlayStyle will smoothly float between selected items, rather than animating their entrance/exit in-place. The default is @c NO.
@property BOOL floatsSelectionViews;
/// Specifies a style of decoration to place behind items that are selected and/or highlighted. The default value is @c nil, indicating no built-in background decoration.
@property (strong, nullable) NSScrubberSelectionStyle *selectionBackgroundStyle;
/// Specifies a style of decoration to place above items that are selected and/or highlighted. The default value is @c nil, indicating no built-in overlay decoration.
@property (strong, nullable) NSScrubberSelectionStyle *selectionOverlayStyle;
/// If @c showsArrowButtons is @c YES, the control provides leading and trailing arrow buttons. Tapping an arrow button moves the selection index by one element; pressing and holding repeatedly moves the selection. The default is @c NO.
@property BOOL showsArrowButtons;
/// If @c showsAdditionalContentIndicators is @c YES, the control will draw a fade effect to indicate that there is additional unscrolled content. The default is @c NO.
@property BOOL showsAdditionalContentIndicators;
/// If set, @c backgroundColor is displayed behind the scrubber content. The background color is suppressed if the scrubber is assigned a non-nil @c backgroundView. The default value is @c nil.
@property (copy, nullable) NSColor *backgroundColor;
/// If non-nil, the @c backgroundView is displayed below the scrubber content. The view's layout is managed by @c NSScrubber to match the content area. If this property is non-nil, the @c backgroundColor property has no effect. The default value is @c nil.
@property (strong, nullable) NSView *backgroundView;
#pragma mark Initialization
- (instancetype)initWithFrame:(NSRect)frameRect NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
#pragma mark Data Manipulation
/// Invalidate all data within the scrubber control, triggering a reload of all content, and clearing the current selection.
- (void)reloadData;
/// Updates inside the @c performSequentialBatchUpdates block are processed and displayed all at once, including insertion, removal, moving, reloading items, and changing the selected index. Changes are performed iteratively using the same semantics as @c NSMutableArray. NSScrubber expects its dataSource to reflect the changes made inside @c -performSequentialBatchUpdates: immediately after the @c updateBlock finishes executing.
- (void)performSequentialBatchUpdates:(void(NS_NOESCAPE ^)(void))updateBlock;
/// Inserts new items at the specified indexes. NSScrubber will request views for each new index from the @c dataSource. This method uses the same semantics as @c NSMutableArray; each index in the set specifies the destination index after all previous insertions have occurred. Therefore, an NSIndexSet of [1,2,3] will result in three new contiguous items.
- (void)insertItemsAtIndexes:(NSIndexSet *)indexes;
/// Removes the items at the specified indexes. This method uses the same semantics as @c NSMutableArray.
- (void)removeItemsAtIndexes:(NSIndexSet *)indexes;
/// Reloads the items at the specified indexes. NSScrubber will request new views for each item and smoothly crossfade between them before discarding the original views.
- (void)reloadItemsAtIndexes:(NSIndexSet *)indexes;
/// Moves an item from one index to another. @c oldIndex refers to the item's index prior to the movement, whereas @c newIndex refers to the item's final location.
- (void)moveItemAtIndex:(NSInteger)oldIndex toIndex:(NSInteger)newIndex;
#pragma mark Interaction
/// Scrolls an item to a given alignment within the control. If @c NSScrubberAlignmentNone is provided, then the control scrolls the minimum amount necessary to make the item visible. Scrolling is animated if called on the animator proxy.
- (void)scrollItemAtIndex:(NSInteger)index toAlignment:(NSScrubberAlignment)alignment;
/// Returns the @c NSScrubberItemView for the given index, if one currently exists; returns @c nil otherwise.
- (nullable __kindof NSScrubberItemView *)itemViewForItemAtIndex:(NSInteger)index;
#pragma mark Item Reuse Queue
/// Registers a @c NSScrubberItemView class to be instantiated for the given @c itemIdentifier. Raises an exception if @c itemViewClass is not a subclass of @c NSScrubberItemView. Passing @c nil for @c itemViewClass removes a previous registration. Registrations made through this method do not persist through NSCoding.
- (void)registerClass:(nullable Class)itemViewClass forItemIdentifier:(NSUserInterfaceItemIdentifier)itemIdentifier;
/// Register a nib to be instantiated for the given @c itemIdentifier. The nib must contain a top-level object which is a subclass of NSScrubberItemView; otherwise, @c -makeItemWithIdentifier: may return @c nil for this identifier. Passing @c nil for @c nib removes a previous registration.
- (void)registerNib:(nullable NSNib *)nib forItemIdentifier:(NSUserInterfaceItemIdentifier)itemIdentifier;
/// Creates or reuses a @c NSScrubberItemView corresponding to the provided @c itemIdentifier. @c NSScrubber searches, in order: the reuse queue, the list of registered classes, and then the list of registered nibs. If the reuse queue is empty, and there is no Class or Interface Builder archive registered for the @c itemIdentifier, this method returns @c nil.
- (nullable __kindof NSScrubberItemView *)makeItemWithIdentifier:(NSUserInterfaceItemIdentifier)itemIdentifier owner:(nullable id)owner;
@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/NSPrintInfo.h | /*
NSPrintInfo.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSGeometry.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSDictionary.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSPrinter.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSPDFInfo, NSPrinter;
/* Valid values for the NSPrintOrientation attribute.
*/
typedef NS_ENUM(NSInteger, NSPaperOrientation) {
NSPaperOrientationPortrait = 0,
NSPaperOrientationLandscape = 1
} API_AVAILABLE(macos(10.9));
/* Valid values for the NSPrintHorizontalPagination and NSPrintVerticalPagination attributes.
*/
typedef NS_ENUM(NSUInteger, NSPrintingPaginationMode) {
NSPrintingPaginationModeAutomatic = 0,
NSPrintingPaginationModeFit = 1,
NSPrintingPaginationModeClip = 2
};
typedef NSString * NSPrintInfoAttributeKey NS_TYPED_EXTENSIBLE_ENUM;
/* Keys for page setup attributes that are recognized by NSPrintInfo.
*/
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintPaperName; // an NSString
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintPaperSize; // an NSValue containing an NSSize, in points
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintOrientation; // an NSNumber containing NSPaperOrientationPortrait or NSPaperOrientationLandscape
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintScalingFactor; // an NSNumber containing a floating-point percentage
/* Keys for pagination attributes that are recognized by NSPrintInfo.
*/
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintLeftMargin; // an NSNumber containing a measurement in floating-point points
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintRightMargin; // an NSNumber containing a measurement in floating-point points
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintTopMargin; // an NSNumber containing a measurement in floating-point points
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintBottomMargin; // an NSNumber containing a measurement in floating-point points
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintHorizontallyCentered; // an NSNumber containing a boolean value
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintVerticallyCentered; // an NSNumber containing a boolean value
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintHorizontalPagination; // an NSNumber containing NSPrintingPaginationModeAutomatic, NSPrintingPaginationModeFit, or NSPrintingPaginationModeClip
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintVerticalPagination; // an NSNumber containing NSPrintingPaginationModeAutomatic, NSPrintingPaginationModeFit, or NSPrintingPaginationModeClip
/* Keys for print job attributes that are recognized by NSPrintInfo.
*/
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintPrinter; // an NSPrinter
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintCopies; // an NSNumber containing the number of copies of the print job to be printed
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintAllPages; // an NSNumber containing a boolean value
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintFirstPage; // an NSNumber containing the one-based index of the first job in the page to print
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintLastPage; // an NSNumber containing the one-based index of the last job in the page to print
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintMustCollate; // an NSNumber containing a boolean value
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintReversePageOrder; // an NSNumber containing a boolean value
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintJobDisposition; // an NSPrintJobDispositionValue equal to NSPrintSpoolJob, NSPrintPreviewJob, NSPrintSaveJob, or NSPrintCancelJob
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintPagesAcross; // an NSNumber containing the number of logical pages to be placed across a physical sheet
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintPagesDown; // an NSNumber containing the number of logical pages to be placed down a physical sheet
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintTime; // an NSDate containing the time at which printing should begin
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintDetailedErrorReporting; // an NSNumber containing a boolean value
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintFaxNumber; // an NSString containing a fax number
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintPrinterName; // an NSString containing the name of a printer
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintSelectionOnly API_AVAILABLE(macos(10.6)); // an NSNumber containing a boolean value
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintJobSavingURL API_AVAILABLE(macos(10.6)); // an NSURL containing the location to which the job file will be saved, for NSPrintSaveJob
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintJobSavingFileNameExtensionHidden API_AVAILABLE(macos(10.6)); // A boolean NSNumber for whether the job file's name extension should be hidden, for NSPrintSaveJob
/* Keys for page adornment attributes that are recognized by NSPrintInfo.
*/
APPKIT_EXTERN NSPrintInfoAttributeKey const NSPrintHeaderAndFooter; // a boolean NSNumber for whether the results of -[NSView pageHeader] and -[NSView pageFooter] should be drawn on pages
/* Valid values for the NSPrintJobDisposition attribute.
*/
typedef NSString * NSPrintJobDispositionValue NS_TYPED_ENUM;
APPKIT_EXTERN NSPrintJobDispositionValue const NSPrintSpoolJob;
APPKIT_EXTERN NSPrintJobDispositionValue const NSPrintPreviewJob;
APPKIT_EXTERN NSPrintJobDispositionValue const NSPrintSaveJob;
APPKIT_EXTERN NSPrintJobDispositionValue const NSPrintCancelJob;
typedef NSString *NSPrintInfoSettingKey NS_SWIFT_BRIDGED_TYPEDEF;
@interface NSPrintInfo : NSObject<NSCopying, NSCoding>
/* Set or get the "shared" instance of NSPrintInfo. The shared print info object is the one that is used automatically by -[NSPageLayout runModal] and +[NSPrintOperation printOperationWithView:].
*/
@property (class, strong) NSPrintInfo *sharedPrintInfo;
/* Given a dictionary that contains attribute entries, initialize. Attributes that are recognized by the NSPrintInfo class will be silently validated in the context of the printer selected by the attributes dictionary, or the default printer if the attributes dictionary selects no printer. Attributes that are not recognized by the NSPrintInfo class will be preserved, and returned in the dictionary returned by the -dictionary method, but otherwise ignored. This is the designated initializer for this class.
*/
- (instancetype)initWithDictionary:(NSDictionary<NSPrintInfoAttributeKey, id> *)attributes NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
- (instancetype)init; // Convience method that calls through to initWithDictionary:nil
/* Return a dictionary that contains attribute entries. This dictionary may contain attributes that were not specified in the dictionary originally passed to this object by -initWithDictionary. Changes to this dictionary will be reflected in the values returned by subsequent invocations of other of this class' methods.
*/
- (NSMutableDictionary<NSPrintInfoAttributeKey, id> *)dictionary;
/* Set or get the values of the paper attributes. Because an NSPrintInfo's paper name, paper size, and orientation attributes must be kept consistent, invocation of any of the setting methods in this group may affect the values returned by subsequent invocations of any of the getting methods in this group. For example, paper name and paper size must always agree, and the value returned by -paperSize always takes orientation into account.
*/
@property (nullable, copy) NSPrinterPaperName paperName;
@property NSSize paperSize;
@property NSPaperOrientation orientation;
@property CGFloat scalingFactor API_AVAILABLE(macos(10.6));
/* Set or get the values of the pagination attributes.
*/
@property CGFloat leftMargin;
@property CGFloat rightMargin;
@property CGFloat topMargin;
@property CGFloat bottomMargin;
@property (getter=isHorizontallyCentered) BOOL horizontallyCentered;
@property (getter=isVerticallyCentered) BOOL verticallyCentered;
@property NSPrintingPaginationMode horizontalPagination;
@property NSPrintingPaginationMode verticalPagination;
/* Set or get the value of the job disposition attribute.
*/
@property (copy) NSPrintJobDispositionValue jobDisposition;
/* Set or get the destination printer specified by this object.
*/
@property (copy) NSPrinter *printer;
/* Validate all of the attributes encapsulated by this object. This method is invoked automatically before the object is used by an NSPrintOperation. This method may be overridden to perform validation of attributes that are not recognized by the NSPrintInfo class.
*/
- (void)setUpPrintOperationDefaultValues;
/* Return the imageable area of a page specified by this object, taking into account the current printer, paper, and orientation settings, but not scaling. "Imageable area" is the maximum area that can possibly be marked on by the printer hardware, not the area defined by the current margin settings. The rectangle is in a coordinate space measured by points, with (0, 0) being the lower-left corner of the oriented page and (paperWidth, paperHeight) being the upper-right corner of the oriented page. The imageable bounds may extend past the edges of the page when, for example, a printer driver specifies it so that borderless printing can be done reliably.
*/
@property (readonly) NSRect imageablePageBounds;
/* Return the human-readable name of the currently selected paper size, suitable for presentation in user interfaces. This will typically be different from the name returned by -paperName, which is almost never suitable for presentation to to the user.
*/
@property (nullable, readonly, copy) NSString *localizedPaperName;
/* Return the default printer, if one has been selected by the user, nil otherwise.
*/
@property (class, readonly, nullable, strong) NSPrinter *defaultPrinter;
/* The print info's print settings. You can put values in this dictionary to store them in any preset that the user creates while editing this print info with a print panel. Such values must be property list objects. This class is key-value coding (KVC) and key-value observing (KVO) compliant for "printSettings" so you can often bind controls in print panel accessory views directly to entries in this dictionary. You can also use this dictionary to get values that have been set by other parts of the printing system, like a printer driver's print dialog extension (the same sort of values that are returned by the Carbon Printing Manager's PMPrintSettingsGetValue() function). Other parts of the printing system often use key strings like "com.apple.print.PrintSettings.PMColorSyncProfileID" but dots like those in key strings wouldn't work well with KVC, so those dots are replaced with underscores in keys that appear in this dictionary, as in "com_apple_print_PrintSettings_PMColorSyncProfileID". You should use the same convention when adding entries to this dictionary.
*/
@property (readonly, strong) NSMutableDictionary<NSPrintInfoSettingKey, id> *printSettings API_AVAILABLE(macos(10.5));
/* Return a Printing Manager PMPrintSession, PMPageFormat, or PMPrintSettings object, respectively. The returned object is always consistent with the state of the NSPrintInfo at the moment the method is invoked, but isn't necessarily updated immediately if other NSPrintInfo methods like -setPaperSize: and -setPaperOrientation: are invoked. The returned object will always be valid (in the Printing Manager sense). If you set any values in the returned PMPageFormat or PMPrintSettings you should afterward invoke -updateFromPMPageFormat or -updateFromPMPrintSettings, respectively. You don't also have to call PMSessionValidatePageFormat() or PMSessionValidatePrintSettings() if you do that. You should not call PMRelease() for the returned object, except of course to balance any calls of PMRetain() you do.
*/
- (void *)PMPrintSession NS_RETURNS_INNER_POINTER API_AVAILABLE(macos(10.5)); // the result should be cast to PMPrintSession
- (void *)PMPageFormat NS_RETURNS_INNER_POINTER API_AVAILABLE(macos(10.5)); // the result should be cast to PMPageFormat
- (void *)PMPrintSettings NS_RETURNS_INNER_POINTER API_AVAILABLE(macos(10.5)); // the result should be cast to PMPrintSettings
/* Given that the NSPrintInfo's PMPageFormat or PMPrintSettings has been changed by something other than the NSPrintInfo itself, update the NSPrintInfo to be consistent.
*/
- (void)updateFromPMPageFormat API_AVAILABLE(macos(10.5));
- (void)updateFromPMPrintSettings API_AVAILABLE(macos(10.5));
/* Set or get whether only the selected content should be printed.
*/
@property (getter=isSelectionOnly) BOOL selectionOnly API_AVAILABLE(macos(10.6));
/* Update the receiver with all settings and attributes present in the given NSPDFInfo. Entries in the given NSPDFInfo's attributes dictionary will be copied into the receiver's attributes dictionary ([self dictionary]). If inPDFInfo is the result of an NSPDFPanel with the NSPDFPanelRequestsParentDirectory option enabled, you must first modify inPDFInfo.URL by appending a file name. If inPDFInfo.URL points to a directory, this method will throw an exception.
*/
- (void)takeSettingsFromPDFInfo:(NSPDFInfo *)inPDFInfo API_AVAILABLE(macos(10.9));
@end
@interface NSPrintInfo(NSDeprecated)
+ (void)setDefaultPrinter:(nullable NSPrinter *)printer API_DEPRECATED("NSPrintInfo's implementation has no effect", macos(10.0,10.2));
/* NSPrintInfo's implementation of this method recognizes only a small fixed set of paper names, and does not take the details of any particular printer into account.
*/
+ (NSSize)sizeForPaperName:(nullable NSPrinterPaperName)name API_DEPRECATED("Use -[NSPrinter pageSizeForPaper:] instead", macos(10.0,10.2));
@end
APPKIT_EXTERN NSString * const NSPrintFormName API_DEPRECATED("NSPrintInfo does not recognize this attribute", macos(10.0,10.2));
APPKIT_EXTERN NSString * const NSPrintJobFeatures API_DEPRECATED("NSPrintInfo does not recognize this attribute. -[NSPrintInfo setUpPrintOperationDefaultValues] sets a default value of an empty dictionary", macos(10.0,10.2));
APPKIT_EXTERN NSString * const NSPrintManualFeed API_DEPRECATED("NSPrintInfo does not recognize this attribute", macos(10.0,10.2));
APPKIT_EXTERN NSString * const NSPrintPagesPerSheet API_DEPRECATED("NSPrintInfo does not recognize this attribute. -[NSPrintInfo setUpPrintOperationDefaultValues] sets a default value of 1", macos(10.0,10.2));
APPKIT_EXTERN NSString * const NSPrintPaperFeed API_DEPRECATED("NSPrintInfo does not recognize this attribute", macos(10.0,10.2));
APPKIT_EXTERN NSString * const NSPrintSavePath API_DEPRECATED("Use NSPrintJobSavingURL instead", macos(10.0,10.6));
typedef NS_ENUM(NSUInteger, NSPrintingOrientation) {
NSPortraitOrientation API_DEPRECATED_WITH_REPLACEMENT("NSPaperOrientationPortrait", macos(10.0,10.14)) = 0,
NSLandscapeOrientation API_DEPRECATED_WITH_REPLACEMENT("NSPaperOrientationLandscape", macos(10.0,10.14)) = 1
} API_DEPRECATED_WITH_REPLACEMENT("NSPaperOrientation", macos(10.0,10.14));
/* Deprecated legacy printing pagination mode constants. Prefer to use NSPrintingPaginationMode values instead.
*/
static const NSPrintingPaginationMode NSAutoPagination API_DEPRECATED_WITH_REPLACEMENT("NSPrintingPaginationModeAutomatic", macos(10.0, 11.0)) = NSPrintingPaginationModeAutomatic;
static const NSPrintingPaginationMode NSFitPagination API_DEPRECATED_WITH_REPLACEMENT("NSPrintingPaginationModeFit", macos(10.0, 11.0)) = NSPrintingPaginationModeFit;
static const NSPrintingPaginationMode NSClipPagination API_DEPRECATED_WITH_REPLACEMENT("NSPrintingPaginationModeClip", macos(10.0, 11.0)) = NSPrintingPaginationModeClip;
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/NSProgressIndicator.h | /*
NSProgressIndicator.h
Application Kit
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSView.h>
#import <AppKit/NSCell.h>
#import <AppKit/AppKitDefines.h>
#import <Foundation/Foundation.h>
#import <Availability.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
typedef NS_ENUM(NSUInteger, NSProgressIndicatorStyle) {
NSProgressIndicatorStyleBar = 0,
NSProgressIndicatorStyleSpinning = 1
};
@interface NSProgressIndicator : NSView <NSAccessibilityProgressIndicator>
#pragma mark Options
@property (getter=isIndeterminate) BOOL indeterminate;
@property (getter=isBezeled) BOOL bezeled;
@property NSControlTint controlTint;
@property NSControlSize controlSize;
#pragma mark Determinate progress indicator
@property double doubleValue;
/* Equivalent to [self setDoubleValue:[self doubleValue] + delta].
*/
- (void)incrementBy:(double)delta;
@property double minValue;
@property double maxValue;
#pragma mark Indeterminate progress indicator
/* YES if the NSProgressIndicator uses a thread instead of a timer (defaults to NO).
*/
@property BOOL usesThreadedAnimation;
- (void)startAnimation:(nullable id)sender;
- (void)stopAnimation:(nullable id)sender;
@property NSProgressIndicatorStyle style;
/* For the spinning style, it will size the view to its default size. For the bar style, the height will be set to the recommended height.
*/
- (void)sizeToFit;
@property (getter=isDisplayedWhenStopped) BOOL displayedWhenStopped;
@end
#pragma mark Deprecated declarations
/* These constants do not accurately represent the geometry of NSProgressIndicator. Use `controlSize` and `sizeToFit` instead.
*/
typedef NS_ENUM(NSUInteger, NSProgressIndicatorThickness) {
NSProgressIndicatorPreferredThickness API_DEPRECATED("These constants do not accurately represent the geometry of NSProgressIndicator. Use `controlSize` and `sizeToFit` instead.", macos(10.0,10.14)) = 14,
NSProgressIndicatorPreferredSmallThickness API_DEPRECATED("These constants do not accurately represent the geometry of NSProgressIndicator. Use `controlSize` and `sizeToFit` instead.", macos(10.0,10.14)) = 10,
NSProgressIndicatorPreferredLargeThickness API_DEPRECATED("These constants do not accurately represent the geometry of NSProgressIndicator. Use `controlSize` and `sizeToFit` instead.", macos(10.0,10.14)) = 18,
NSProgressIndicatorPreferredAquaThickness API_DEPRECATED("These constants do not accurately represent the geometry of NSProgressIndicator. Use `controlSize` and `sizeToFit` instead.", macos(10.0,10.14)) = 12,
} API_DEPRECATED("These constants do not accurately represent the geometry of NSProgressIndicator. Use `controlSize` and `sizeToFit` instead.", macos(10.0,10.14));
/* Please instead use the more modern versions of these constants.
*/
static const NSProgressIndicatorStyle NSProgressIndicatorBarStyle API_DEPRECATED_WITH_REPLACEMENT("NSProgressIndicatorStyleBar", macos(10.2,10.14)) = NSProgressIndicatorStyleBar;
static const NSProgressIndicatorStyle NSProgressIndicatorSpinningStyle API_DEPRECATED_WITH_REPLACEMENT("NSProgressIndicatorStyleSpinning", macos(10.2,10.14)) = NSProgressIndicatorStyleSpinning;
@interface NSProgressIndicator (NSProgressIndicatorDeprecated)
- (NSTimeInterval)animationDelay API_DEPRECATED("The animationDelay property does nothing.", macos(10.0,10.6));
- (void)setAnimationDelay:(NSTimeInterval)delay API_DEPRECATED("The animationDelay property does nothing.", macos(10.0,10.6));
- (void)animate:(nullable id)sender API_DEPRECATED("Use -startAnimation and -stopAnimation instead.", 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/NSPopUpButtonCell.h | /*
NSPopUpButtonCell.h
Application Kit
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSMenu.h>
#import <AppKit/NSMenuItemCell.h>
#import <AppKit/NSMenuItem.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSMenu;
typedef NS_ENUM(NSUInteger, NSPopUpArrowPosition) {
NSPopUpNoArrow = 0,
NSPopUpArrowAtCenter = 1,
NSPopUpArrowAtBottom = 2
};
@interface NSPopUpButtonCell : NSMenuItemCell <NSMenuItemValidation>
- (instancetype)initTextCell:(NSString *)stringValue pullsDown:(BOOL)pullDown NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
// Overrides behavior of NSCell. This is the menu for the popup, not a context menu. PopUpButtonCells do not have context menus.
@property (nullable, strong) NSMenu *menu;
// Behavior settings
// If usesItemFromMenu is true, then pull down popup buttons always show the first item in the menu. That menu item is hidden via [menuItem setHidden:YES]; if you wish to make it visible you can unhide it with setHidden:NO
@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.
@property BOOL usesItemFromMenu;
// If YES (the default) the popup button will display an item from the menu. This will be the selected item for a popup or the first item for a pull-down. If this is NO, then the menu item set with -setMenuItem: is always displayed. This can be useful for a popup button that is an icon button that pops up a menu full of textual items, for example.
@property BOOL altersStateOfSelectedItem;
// This only has an effect for popups (it is ignored for pulldowns). If YES (the default) then the selected item gets its state set to NSOnState. If NO the items in the menu are left alone.
// 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:(nullable NSString *)string;
@property (nullable, readonly, strong) NSMenuItem *selectedItem;
@property (readonly) NSInteger indexOfSelectedItem;
- (void)synchronizeTitleAndSelectedItem;
// Title conveniences
- (NSString *)itemTitleAtIndex:(NSInteger)index;
@property (readonly, copy) NSArray<NSString *> *itemTitles;
@property (nullable, readonly, copy) NSString *titleOfSelectedItem;
- (void)attachPopUpWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (void)dismissPopUp;
- (void)performClickWithFrame:(NSRect)frame inView:(NSView *)controlView;
// Arrow position for bezel style and borderless popups.
@property NSPopUpArrowPosition arrowPosition;
@end
/* Notifications */
APPKIT_EXTERN NSNotificationName NSPopUpButtonCellWillPopUpNotification;
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/NSColorPickerTouchBarItem.h | /*
NSColorPickerTouchBarItem.h
Application Kit
Copyright (c) 2016-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSTouchBarItem.h>
#if TARGET_OS_IPHONE
@class UIImage, UIColor;
#endif
NS_ASSUME_NONNULL_BEGIN
@class NSViewController, NSColor, NSImage, NSString, NSColorList, NSColorSpace;
API_AVAILABLE(macos(10.12.2), ios(13.0))
@interface NSColorPickerTouchBarItem : NSTouchBarItem
/// Creates a bar item containing a button with the standard color picker icon that invokes the color picker.
+ (instancetype)colorPickerWithIdentifier:(NSTouchBarItemIdentifier)identifier;
/// Creates a bar item containing a button with the standard text color picker icon that invokes the color picker. Should be used when the item is used for picking text colors.
+ (instancetype)textColorPickerWithIdentifier:(NSTouchBarItemIdentifier)identifier;
/// Creates a bar item containing a button with the standard stroke color picker icon that invokes the color picker. Should be used when the item is used for picking stroke colors.
+ (instancetype)strokeColorPickerWithIdentifier:(NSTouchBarItemIdentifier)identifier;
/// Creates a bar item containing a button with the provided image that invokes the color picker.
#if !TARGET_OS_IPHONE
+ (instancetype)colorPickerWithIdentifier:(NSTouchBarItemIdentifier)identifier buttonImage:(NSImage *)image;
#else
+ (instancetype)colorPickerWithIdentifier:(NSTouchBarItemIdentifier)identifier buttonImage:(UIImage *)image API_AVAILABLE(ios(13.0));
#endif
/// The selected color of the picker.
#if !TARGET_OS_IPHONE
@property (copy) NSColor *color;
#else
@property (copy) UIColor *color API_AVAILABLE(ios(13.0));
#endif
/// Whether or not the picker should allow picking a color with non-1.0 alpha. Defaults to `!NSColor.ignoresAlpha`.
@property BOOL showsAlpha;
/// Controls the color spaces that the receiver is able to produce. If a color outside of the allowed spaces are displayed or selected, it will first be converted to the first color space in the array. `nil` signifies any color space is allowed. Empty array is an invalid value and will raise an exception if set. Defaults to `nil`.
@property (copy, nullable) NSArray<NSColorSpace *> *allowedColorSpaces API_AVAILABLE(macos(10.13)) API_UNAVAILABLE(ios);
/// The color list displayed in the list color picker. Defaults to the standard system color list. Setting a custom color list will disable the additional tints/shades that appear on long-press.
@property (strong, null_resettable) NSColorList *colorList API_UNAVAILABLE(ios);
/// The localized string labelling this item during user customization. The default value is the localized string of "Color Picker".
@property (readwrite, copy, null_resettable) NSString *customizationLabel;
@property (weak, nullable) id target;
@property (nullable) SEL action;
/// Enables or disabled the color picker. If it is currently being shown in a popover, it will be dismissed.
@property (getter=isEnabled) BOOL enabled;
@end
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSSharingService.h | /*
NSSharingService.h
Application Kit
Copyright (c) 2011-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSPasteboard.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSItemProvider.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
@class NSString, NSImage, NSView, NSError, NSWindow;
@class CKShare, CKContainer;
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
/**
Built-in sharing services
*/
typedef NSString * NSSharingServiceName NS_TYPED_EXTENSIBLE_ENUM;
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNameComposeEmail API_AVAILABLE(macos(10.8));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNameComposeMessage API_AVAILABLE(macos(10.8));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNameSendViaAirDrop API_AVAILABLE(macos(10.8));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNameAddToSafariReadingList API_AVAILABLE(macos(10.8));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNameAddToIPhoto API_AVAILABLE(macos(10.8));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNameAddToAperture API_AVAILABLE(macos(10.8));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNameUseAsDesktopPicture API_AVAILABLE(macos(10.8));
// Formerly built-in sharing services. Deprecated as of 10.14
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNamePostOnFacebook API_DEPRECATED("This service is no longer included with the system.", macos(10.8,10.14));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNamePostOnTwitter API_DEPRECATED("This service is no longer included with the system.", macos(10.8,10.14));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNamePostOnSinaWeibo API_DEPRECATED("This service is no longer included with the system.", macos(10.8,10.14));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNamePostOnTencentWeibo API_DEPRECATED("This service is no longer included with the system.", macos(10.8,10.14));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNamePostOnLinkedIn API_DEPRECATED("This service is no longer included with the system.", macos(10.8,10.14));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNameUseAsTwitterProfileImage API_DEPRECATED("This service is no longer included with the system.", macos(10.8,10.14));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNameUseAsFacebookProfileImage API_DEPRECATED("This service is no longer included with the system.", macos(10.8,10.14));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNameUseAsLinkedInProfileImage API_DEPRECATED("This service is no longer included with the system.", macos(10.8,10.14));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNamePostImageOnFlickr API_DEPRECATED("This service is no longer included with the system.", macos(10.8,10.14));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNamePostVideoOnVimeo API_DEPRECATED("This service is no longer included with the system.", macos(10.8,10.14));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNamePostVideoOnYouku API_DEPRECATED("This service is no longer included with the system.", macos(10.8,10.14));
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNamePostVideoOnTudou API_DEPRECATED("This service is no longer included with the system.", macos(10.8,10.14));
/**
This service differs from other NSSharingServices in that it allows the user to establish a persistent sharing session for the specified items with potentially many participants, instead of sending a copy of the items. You can invoke this service with an NSItemProvider that has registered a CKShare & CKContainer via either -registerCloudKitShare:container: or -registerCloudKitShareWithPreparationHandler:. (Registering other types on the same provider to enable other sharing services is allowed.)
When performed, this service gives the user the opportunity to invite participants and start sharing. If the content is already shared, the service instead allows the user to view or modify participation or stop sharing. To detect changes the service makes to the CKShare, implement -sharingService:didSaveShare: and -sharingService:didStopSharing:.
*/
APPKIT_EXTERN NSSharingServiceName const NSSharingServiceNameCloudSharing API_AVAILABLE(macos(10.12));
@protocol NSSharingServiceDelegate;
/**
NSSharingService can be used to share items to different kinds of local and remote services. Items are objects which respond to the NSPasteboardWriting protocol, like NSURL, NSImage or NSString. If an NSURL is a file URL (point to a video for example), then the content of the file will be shared. If the URL is remote, then the URL itself will be shared.
*/
API_AVAILABLE(macos(10.8))
@interface NSSharingService : NSObject
@property (nullable, weak) id <NSSharingServiceDelegate> delegate;
@property (readonly, copy) NSString *title;
@property (readonly, strong) NSImage *image;
@property (nullable, readonly, strong) NSImage *alternateImage;
/**
Title of the service in the Share menu. Can be modified.
*/
@property (copy) NSString *menuItemTitle API_AVAILABLE(macos(10.9));
#pragma mark -
// These properties are used for configuration of the service. They need to be set when the NSSharingService is created or in sharingService:willShareItems:
/// NSArray of NSString objects representing handles (example: email adresses)
@property (nullable, copy) NSArray<NSString *> *recipients API_AVAILABLE(macos(10.9));
@property (nullable, copy) NSString *subject API_AVAILABLE(macos(10.9));
// These read-only properties allow for querying of the shared content:
/// Message body as string
@property (nullable, readonly, copy) NSString *messageBody API_AVAILABLE(macos(10.9));
/// URL to access the post on Facebook, Twitter, Sina Weibo, etc. (also known as permalink)
@property (nullable, readonly, copy) NSURL *permanentLink API_AVAILABLE(macos(10.9));
/// Account name used for sending on Twitter or Sina Weibo
@property (nullable, readonly, copy) NSString *accountName API_AVAILABLE(macos(10.9));
/// NSArray of NSURL objects representing the files that were shared
@property (nullable, readonly, copy) NSArray<NSURL *> *attachmentFileURLs API_AVAILABLE(macos(10.9));
#pragma mark -
/**
Returns a list of NSSharingServices which could share all the provided items together. sharingServicesForItems can be used to build a custom UI, or to populate a contextual NSMenu.
The items represent the objects to be shared and must conform to the <NSPasteboardWriting> protocol or be an NSItemProvider or an NSDocument. (e.g. NSString, NSImage, NSURL, etc.)
*/
+ (NSArray<NSSharingService *> *)sharingServicesForItems:(NSArray *)items;
/**
Returns an NSSharingService representing one of the built-in services.
*/
+ (nullable NSSharingService *)sharingServiceNamed:(NSSharingServiceName)serviceName;
/**
Creates a custom NSSharingService object. Custom sharing services can be added to the NSSharingServicePicker with the sharingServicePicker:sharingServicesForItems:proposedSharingServices: delegate method.
*/
- (instancetype)initWithTitle:(NSString *)title image:(NSImage *)image alternateImage:(nullable NSImage *)alternateImage handler:(void (^)(void))block NS_DESIGNATED_INITIALIZER;
/**
Use -initWithTitle:image:alternateImage:handler: instead
*/
- (instancetype)init NS_UNAVAILABLE;
/**
Returns whether a service can do something with all the provided items. This can be used to validate a custom UI such as a dedicated Twitter button. If items is nil, the method will return YES when the service is configured. Therefore you could call it once at launch time with nil items to check whether to display the button or not, and then with real items to enable and disable the button depending on the context or selection.
The items represent the objects to be shared and must conform to the <NSPasteboardWriting> protocol or be an NSItemProvider or an NSDocument. (e.g. NSString, NSImage, NSURL, etc.)
*/
- (BOOL)canPerformWithItems:(nullable NSArray *)items;
/**
Manually performs the service on the provided items. In most cases this will display a sharing window.
The items represent the objects to be shared and must conform to the <NSPasteboardWriting> protocol or be an NSItemProvider or an NSDocument. (e.g. NSString, NSImage, NSURL, etc.)
*/
- (void)performWithItems:(NSArray *)items;
@end
/**
Use the sharing scope to specify the nature of the things you are sharing.
The sharing scope can be modified from the default value of NSSharingContentScopeItem by setting a different value in the out parameter in sharingService:sourceWindowForShareItems:sharingContentScope:.
*/
typedef NS_ENUM(NSInteger, NSSharingContentScope) {
/// NSSharingContentScopeItem: use when sharing a clearly identified item, e.g. a file represented by its icon.
NSSharingContentScopeItem,
/// NSSharingContentScopePartial: use when sharing a portion of a more global content, e.g. part of a webpage
NSSharingContentScopePartial,
/// NSSharingContentScopeFull: use when sharing the whole content of the current document, e.g. the url of the webpage
NSSharingContentScopeFull
} API_AVAILABLE(macos(10.8));
@protocol NSSharingServiceDelegate <NSObject>
@optional
- (void)sharingService:(NSSharingService *)sharingService willShareItems:(NSArray *)items;
- (void)sharingService:(NSSharingService *)sharingService didFailToShareItems:(NSArray *)items error:(NSError *)error;
- (void)sharingService:(NSSharingService *)sharingService didShareItems:(NSArray *)items;
// The following methods are invoked when the service is performed and the sharing window pops up, to present a transition between the original items and the sharing window.
- (NSRect)sharingService:(NSSharingService *)sharingService sourceFrameOnScreenForShareItem:(id)item;
/**
When non-nil, the image returned would be used for the transitioning animation. When nil, the transitioning animation is disabled.
*/
- (nullable NSImage *)sharingService:(NSSharingService *)sharingService transitionImageForShareItem:(id)item contentRect:(NSRect *)contentRect;
- (nullable NSWindow *)sharingService:(NSSharingService *)sharingService sourceWindowForShareItems:(NSArray *)items sharingContentScope:(NSSharingContentScope *)sharingContentScope;
/**
The following method is invoked when the service is performed and wants to display its contents in a popover. The delegate should return the view that will act as the anchor of the popover, along with the target rectangle within the bounds of that view and preferred edge of that rectangle for the popover to appear. The delegate may also return nil, indicating that there is no anchoring view currently available, in which case the service may attempt to display the service via some other means.
The service named NSSharingServiceNameCloudSharing prefers to display itself using a popover anchored to an "Add People" or "Share" button. If no such button is available or visible, return nil.
*/
- (nullable NSView *)anchoringViewForSharingService:(NSSharingService *)sharingService showRelativeToRect:(NSRect *)positioningRect preferredEdge:(NSRectEdge *)preferredEdge;
@end
typedef NS_OPTIONS(NSUInteger, NSCloudKitSharingServiceOptions) {
/// Allow the user to configure the share with the standard set of options.
NSCloudKitSharingServiceStandard = 0,
/// The user is allowed to share publicly.
NSCloudKitSharingServiceAllowPublic = 1 << 0,
/// The user is allowed to share privately.
NSCloudKitSharingServiceAllowPrivate = 1 << 1,
/// The user is allowed to grant participants read-only permissions.
NSCloudKitSharingServiceAllowReadOnly = 1 << 4,
/// The user is allowed to grant participants read/write permissions.
NSCloudKitSharingServiceAllowReadWrite = 1 << 5,
} API_AVAILABLE(macos(10.12));
@protocol NSCloudSharingServiceDelegate <NSSharingServiceDelegate>
@optional
/**
When an NSSharingServiceNameCloudSharing sharing service is dismissed it will invoke this method on the delegate, with an error if there was any. If the delegate implements this method, NSSharingServiceNameCloudSharing will not send -sharingService:didFailToShareItems:error: or -sharingService:didShareItems:.
*/
- (void)sharingService:(NSSharingService *)sharingService didCompleteForItems:(NSArray *)items error:(nullable NSError *)error;
/**
The options returned by this method describe how the user is allowed to configure the share: whether the share is public or private, and whether participants have read-only or read/write permissions. If this method is not implemented, NSCloudKitSharingServiceStandard is assumed.
*/
- (NSCloudKitSharingServiceOptions)optionsForSharingService:(NSSharingService *)cloudKitSharingService shareProvider:(NSItemProvider *)provider;
/**
When an NSSharingServiceNameCloudSharing sharing service successfully saves modifications to the CKShare, it will invoke this method on the delegate with the last-known state of the CKShare on the server.
*/
- (void)sharingService:(NSSharingService *)sharingService didSaveShare:(CKShare *)share;
/**
When an NSSharingServiceNameCloudSharing sharing service stops sharing it will delete the CKShare from the server, then invoke this method on the delegate with the last-known state of the CKShare.
*/
- (void)sharingService:(NSSharingService *)sharingService didStopSharing:(CKShare *)share;
@end
@interface NSItemProvider (NSCloudKitSharing)
/**
Use this method when you want to share a collection of CKRecords but don't currently have a CKShare. When the preparationHandler is called, you should create a new CKShare with the appropriate root CKRecord. After ensuring the share and all records have been saved to the server, invoke the preparationCompletionHandler with either the resulting CKShare and its CKContainer, or an NSError if saving failed. Invoking the service with a CKShare registered with this method will prompt the user to start sharing.
*/
- (void)registerCloudKitShareWithPreparationHandler:(void (^_Nonnull)(void (^ _Nonnull preparationCompletionHandler)(CKShare * _Nullable, CKContainer * _Nullable, NSError * _Nullable)))preparationHandler API_AVAILABLE(macos(10.12));
/**
Use this method when you have a CKShare that is already saved to the server. Invoking the service with a CKShare registerd with this method will allow the owner to make modifications to the share settings, or will allow a participant to view the share settings.
*/
- (void)registerCloudKitShare:(CKShare *)share container:(CKContainer *)container API_AVAILABLE(macos(10.12));
@end
@protocol NSSharingServicePickerDelegate;
API_AVAILABLE(macos(10.8))
@interface NSSharingServicePicker : NSObject
@property (nullable, weak) id <NSSharingServicePickerDelegate> delegate;
/**
Returns a new picker. The items represent the objects to be shared and must conform to the <NSPasteboardWriting> protocol or be an NSItemProvider or an NSDocument. (e.g. NSString, NSImage, NSURL, etc.)
*/
- (instancetype)initWithItems:(NSArray *)items NS_DESIGNATED_INITIALIZER;
/**
Use initWithItems: instead.
*/
- (instancetype)init NS_UNAVAILABLE;
/**
Shows the picker, populated with sharing services related to the instance items. When the user selects one of the sharing services, the sharing service will be performed. Note that this method must be called on mouseDown.
*/
- (void)showRelativeToRect:(NSRect)rect ofView:(NSView *)view preferredEdge:(NSRectEdge)preferredEdge;
@end
@protocol NSSharingServicePickerDelegate <NSObject>
@optional
/**
Allows the delegate to customize exactly what appears in the sharing service picker by reordering or removing the services before the picker is presented. It's possible to add custom services by mutating the proposedSharingServices array and adding new NSSharingService instances:
```objc
NSMutableArray *sharingServices = [proposedServices mutableCopy];
NSSharingService * customService = [[NSSharingService alloc] initWithTitle:@"Service Title"
image:image alternateImage:alternateImage
handler:^{ [self doCustomServiceWithItems:items]; } ];
[sharingServices addObject:customService];
return [sharingServices autorelease];
```
The items represent the objects to be shared and must conform to the <NSPasteboardWriting> protocol or be an NSItemProvider or an NSDocument. (e.g. NSString, NSImage, NSURL, etc.)
*/
- (NSArray<NSSharingService *> *)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker sharingServicesForItems:(NSArray *)items proposedSharingServices:(NSArray<NSSharingService *> *)proposedServices;
/**
Sent when the user has selected a service and the picker is about to execute it.
*/
- (nullable id <NSSharingServiceDelegate>)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker delegateForSharingService:(NSSharingService *)sharingService;
/**
Sent when the user has selected a service and before it is executed. Service will be nil if the picker was dismissed.
*/
- (void)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker didChooseSharingService:(nullable NSSharingService *)service;
@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/NSNibOutletConnector.h | /*
NSNibOutletConnector.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSNibConnector.h>
#import <AppKit/AppKitDefines.h>
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@interface NSNibOutletConnector : NSNibConnector
- (void)establishConnection;
@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/NSTokenField.h | /*
NSTokenField.h
Application Kit
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSTextContainer.h>
#import <AppKit/NSTextField.h>
#import <AppKit/NSTokenFieldCell.h>
#import <AppKit/AppKitDefines.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSTokenField;
@protocol NSTokenFieldDelegate <NSTextFieldDelegate>
@optional
// Each element in the array should be an NSString or an array of NSStrings.
// substring is the partial string that is being completed. tokenIndex is the index of the token being completed.
// selectedIndex allows you to return by reference an index specifying which of the completions should be selected initially.
// The default behavior is not to have any completions.
- (nullable NSArray *)tokenField:(NSTokenField *)tokenField completionsForSubstring:(NSString *)substring indexOfToken:(NSInteger)tokenIndex indexOfSelectedItem:(nullable NSInteger *)selectedIndex;
// return an array of represented objects you want to add.
// If you want to reject the add, return an empty array.
// returning nil will cause an error.
- (NSArray *)tokenField:(NSTokenField *)tokenField shouldAddObjects:(NSArray *)tokens atIndex:(NSUInteger)index;
// If you return nil or don't implement these delegate methods, we will assume
// editing string = display string = represented object
- (nullable NSString *)tokenField:(NSTokenField *)tokenField displayStringForRepresentedObject:(id)representedObject;
- (nullable NSString *)tokenField:(NSTokenField *)tokenField editingStringForRepresentedObject:(id)representedObject;
- (nullable id)tokenField:(NSTokenField *)tokenField representedObjectForEditingString:(NSString *)editingString;
// We put the string on the pasteboard before calling this delegate method.
// By default, we write the NSStringPboardType as well as an array of NSStrings.
- (BOOL)tokenField:(NSTokenField *)tokenField writeRepresentedObjects:(NSArray *)objects toPasteboard:(NSPasteboard *)pboard;
// Return an array of represented objects to add to the token field.
- (nullable NSArray *)tokenField:(NSTokenField *)tokenField readFromPasteboard:(NSPasteboard *)pboard;
// By default the tokens have no menu.
- (nullable NSMenu *)tokenField:(NSTokenField *)tokenField menuForRepresentedObject:(id)representedObject;
- (BOOL)tokenField:(NSTokenField *)tokenField hasMenuForRepresentedObject:(id)representedObject;
// This method allows you to change the style for individual tokens as well as have mixed text and tokens.
- (NSTokenStyle)tokenField:(NSTokenField *)tokenField styleForRepresentedObject:(id)representedObject;
@end
@interface NSTokenField : NSTextField
/* 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<NSTokenFieldDelegate> delegate;
/* Sets the default token style used for each new token. However, if the delegate implements tokenField:styleForRepresentedObject:, that return value will be used instead.
*/
@property NSTokenStyle tokenStyle;
@property NSTimeInterval completionDelay;
@property (class, readonly) NSTimeInterval defaultCompletionDelay;
@property (null_resettable, copy) NSCharacterSet *tokenizingCharacterSet;
@property (class, readonly, copy) NSCharacterSet *defaultTokenizingCharacterSet;
@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/AppKit.h | /*
AppKit.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
This file is included by all AppKit application source files for easy building. Using this file is preferred over importing individual files because it will use a precompiled version.
*/
#import <Foundation/Foundation.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/AppKitErrors.h>
#import <AppKit/NSGraphicsContext.h>
#import <AppKit/NSAccessibility.h>
#import <AppKit/NSActionCell.h>
#import <AppKit/NSAlert.h>
#import <AppKit/NSAnimationContext.h>
#import <AppKit/NSAppearance.h>
#import <AppKit/NSAppleScriptExtensions.h>
#import <AppKit/NSApplication.h>
#import <AppKit/NSBox.h>
#import <AppKit/NSButton.h>
#import <AppKit/NSButtonCell.h>
#import <AppKit/NSCandidateListTouchBarItem.h>
#import <AppKit/NSCell.h>
#import <AppKit/NSClipView.h>
#import <AppKit/NSCollectionView.h>
#import <AppKit/NSCollectionViewLayout.h>
#import <AppKit/NSCollectionViewCompositionalLayout.h>
#import <AppKit/NSCollectionViewFlowLayout.h>
#import <AppKit/NSCollectionViewGridLayout.h>
#import <AppKit/NSCollectionViewTransitionLayout.h>
#import <AppKit/NSColorSampler.h>
#import <AppKit/NSControl.h>
#import <AppKit/NSDiffableDataSource.h>
#import <AppKit/NSDockTile.h>
#import <AppKit/NSFont.h>
#import <AppKit/NSFontAssetRequest.h>
#import <AppKit/NSFontCollection.h>
#import <AppKit/NSFontDescriptor.h>
#import <AppKit/NSFontManager.h>
#import <AppKit/NSFontPanel.h>
#import <AppKit/NSForm.h>
#import <AppKit/NSFormCell.h>
#import <AppKit/NSMatrix.h>
#import <AppKit/NSMenu.h>
#import <AppKit/NSMenuItem.h>
#import <AppKit/NSColor.h>
#import <AppKit/NSColorSpace.h>
#import <AppKit/NSBitmapImageRep.h>
#import <AppKit/NSBrowser.h>
#import <AppKit/NSBrowserCell.h>
#import <AppKit/NSCachedImageRep.h>
#import <AppKit/NSCIImageRep.h>
#import <AppKit/NSColorList.h>
#import <AppKit/NSColorPanel.h>
#import <AppKit/NSColorPicking.h>
#import <AppKit/NSColorPicker.h>
#import <AppKit/NSColorPickerTouchBarItem.h>
#import <AppKit/NSColorWell.h>
#import <AppKit/NSUserInterfaceCompression.h>
#import <AppKit/NSCursor.h>
#import <AppKit/NSCustomImageRep.h>
#import <AppKit/NSCustomTouchBarItem.h>
#import <AppKit/NSDocument.h>
#import <AppKit/NSDocumentController.h>
#import <AppKit/NSDragging.h>
#import <AppKit/NSDraggingItem.h>
#import <AppKit/NSDraggingSession.h>
#import <AppKit/NSFilePromiseProvider.h>
#import <AppKit/NSFilePromiseReceiver.h>
#import <AppKit/NSEPSImageRep.h>
#import <AppKit/NSErrors.h>
#import <AppKit/NSEvent.h>
#import <AppKit/NSFileWrapperExtensions.h>
#import <AppKit/NSHelpManager.h>
#import <AppKit/NSGradient.h>
#import <AppKit/NSGraphics.h>
#import <AppKit/NSGroupTouchBarItem.h>
#import <AppKit/NSGestureRecognizer.h>
#import <AppKit/NSClickGestureRecognizer.h>
#import <AppKit/NSPanGestureRecognizer.h>
#import <AppKit/NSPressGestureRecognizer.h>
#import <AppKit/NSMagnificationGestureRecognizer.h>
#import <AppKit/NSRotationGestureRecognizer.h>
#import <AppKit/NSLayoutConstraint.h>
#import <AppKit/NSLayoutGuide.h>
#import <AppKit/NSLayoutAnchor.h>
#import <AppKit/NSImage.h>
#import <AppKit/NSImageCell.h>
#import <AppKit/NSImageRep.h>
#import <AppKit/NSImageView.h>
#import <AppKit/NSNib.h>
#import <AppKit/NSNibLoading.h>
#import <AppKit/NSPrinter.h>
#import <AppKit/NSScrubber.h>
#import <AppKit/NSScrubberItemView.h>
#import <AppKit/NSScrubberLayout.h>
#import <AppKit/NSSharingServicePickerTouchBarItem.h>
#import <AppKit/NSSliderAccessory.h>
#import <AppKit/NSSliderTouchBarItem.h>
#import <AppKit/NSSpeechRecognizer.h>
#import <AppKit/NSSpeechSynthesizer.h>
#import <AppKit/NSSpellChecker.h>
#import <AppKit/NSSplitView.h>
#import <AppKit/NSSplitViewController.h>
#import <AppKit/NSOpenPanel.h>
#import <AppKit/NSPageLayout.h>
#import <AppKit/NSPanel.h>
#import <AppKit/NSPasteboard.h>
#import <AppKit/NSPasteboardItem.h>
#import <AppKit/NSPopoverTouchBarItem.h>
#import <AppKit/NSPopUpButton.h>
#import <AppKit/NSPrintInfo.h>
#import <AppKit/NSPrintOperation.h>
#import <AppKit/NSPrintPanel.h>
#import <AppKit/NSPDFInfo.h>
#import <AppKit/NSPDFPanel.h>
#import <AppKit/NSResponder.h>
#import <AppKit/NSSavePanel.h>
#import <AppKit/NSMediaLibraryBrowserController.h>
#import <AppKit/NSScreen.h>
#import <AppKit/NSScrollView.h>
#import <AppKit/NSScroller.h>
#import <AppKit/NSSegmentedControl.h>
#import <AppKit/NSSegmentedCell.h>
#import <AppKit/NSSharingService.h>
#import <AppKit/NSSlider.h>
#import <AppKit/NSSliderCell.h>
#import <AppKit/NSSpellProtocol.h>
#import <AppKit/NSStackView.h>
#import <AppKit/NSSwitch.h>
#import <AppKit/NSGridView.h>
#import <AppKit/NSText.h>
#import <AppKit/NSTextCheckingClient.h>
#import <AppKit/NSTextCheckingController.h>
#import <AppKit/NSTextField.h>
#import <AppKit/NSTextFieldCell.h>
#import <AppKit/NSText.h>
#import <AppKit/NSTokenField.h>
#import <AppKit/NSTokenFieldCell.h>
#import <AppKit/NSTouchBar.h>
#import <AppKit/NSTouchBarItem.h>
#import <AppKit/NSTrackingArea.h>
#import <AppKit/NSTrackingSeparatorToolbarItem.h>
#import <AppKit/NSUserActivity.h>
#import <AppKit/NSView.h>
#import <AppKit/NSViewController.h>
#import <AppKit/NSWindow.h>
#import <AppKit/NSWindowTab.h>
#import <AppKit/NSWindowTabGroup.h>
#import <AppKit/NSWindowController.h>
#import <AppKit/NSWorkspace.h>
#import <AppKit/NSRunningApplication.h>
#import <AppKit/NSComboBox.h>
#import <AppKit/NSComboBoxCell.h>
#import <AppKit/NSTableCellView.h>
#import <AppKit/NSTableColumn.h>
#import <AppKit/NSTableHeaderCell.h>
#import <AppKit/NSTableHeaderView.h>
#import <AppKit/NSTableRowView.h>
#import <AppKit/NSTableView.h>
#import <AppKit/NSTableViewDiffableDataSource.h>
#import <AppKit/NSTableViewRowAction.h>
#import <AppKit/NSOutlineView.h>
#import <AppKit/NSAttributedString.h>
#import <AppKit/NSLayoutManager.h>
#import <AppKit/NSParagraphStyle.h>
#import <AppKit/NSTextStorage.h>
#import <AppKit/NSTextView.h>
#import <AppKit/NSTextContainer.h>
#import <AppKit/NSTextAttachment.h>
#import <AppKit/NSInputManager.h>
#import <AppKit/NSInputServer.h>
#import <AppKit/NSStringDrawing.h>
#import <AppKit/NSRulerMarker.h>
#import <AppKit/NSRulerView.h>
#import <AppKit/NSSecureTextField.h>
#import <AppKit/NSInterfaceStyle.h>
#import <AppKit/NSNibDeclarations.h>
#import <AppKit/NSProgressIndicator.h>
#import <AppKit/NSTabView.h>
#import <AppKit/NSTabViewController.h>
#import <AppKit/NSTabViewItem.h>
#import <AppKit/NSMenuItemCell.h>
#import <AppKit/NSPopUpButtonCell.h>
#import <AppKit/NSAffineTransform.h>
#import <AppKit/NSBezierPath.h>
#import <AppKit/NSPICTImageRep.h>
#import <AppKit/NSStatusBar.h>
#import <AppKit/NSStatusBarButton.h>
#import <AppKit/NSStatusItem.h>
#import <AppKit/NSSound.h>
#import <AppKit/NSMovie.h>
#import <AppKit/NSPDFImageRep.h>
#import <AppKit/NSDrawer.h>
#import <AppKit/NSOpenGL.h>
#import <AppKit/NSOpenGLLayer.h>
#import <AppKit/NSOpenGLView.h>
#import <AppKit/NSApplicationScripting.h>
#import <AppKit/NSDocumentScripting.h>
#import <AppKit/NSTextStorageScripting.h>
#import <AppKit/NSToolbar.h>
#import <AppKit/NSToolbarItem.h>
#import <AppKit/NSToolbarItemGroup.h>
#import <AppKit/NSMenuToolbarItem.h>
#import <AppKit/NSSharingServicePickerToolbarItem.h>
#import <AppKit/NSWindowScripting.h>
#import <AppKit/NSStepper.h>
#import <AppKit/NSStepperCell.h>
#import <AppKit/NSGlyphInfo.h>
#import <AppKit/NSShadow.h>
#import <AppKit/NSATSTypesetter.h>
#import <AppKit/NSGlyphGenerator.h>
#import <AppKit/NSSearchField.h>
#import <AppKit/NSSearchFieldCell.h>
#import <AppKit/NSController.h>
#import <AppKit/NSObjectController.h>
#import <AppKit/NSArrayController.h>
#import <AppKit/NSDictionaryController.h>
#import <AppKit/NSTreeNode.h>
#import <AppKit/NSTreeController.h>
#import <AppKit/NSUserDefaultsController.h>
#import <AppKit/NSKeyValueBinding.h>
#import <AppKit/NSTextList.h>
#import <AppKit/NSTextTable.h>
#import <AppKit/NSDatePickerCell.h>
#import <AppKit/NSDatePicker.h>
#import <AppKit/NSLevelIndicatorCell.h>
#import <AppKit/NSLevelIndicator.h>
#import <AppKit/NSAnimation.h>
#import <AppKit/NSPersistentDocument.h>
#import <AppKit/NSRuleEditor.h>
#import <AppKit/NSPredicateEditor.h>
#import <AppKit/NSPredicateEditorRowTemplate.h>
#import <AppKit/NSPathCell.h>
#import <AppKit/NSPathControl.h>
#import <AppKit/NSPathComponentCell.h>
#import <AppKit/NSPathControlItem.h>
#import <AppKit/NSPageController.h>
#import <AppKit/NSPopover.h>
#import <AppKit/NSTextInputClient.h>
#import <AppKit/NSTextInputContext.h>
#import <AppKit/NSUserInterfaceItemSearching.h>
#import <AppKit/NSUserInterfaceLayout.h>
#import <AppKit/NSTouch.h>
#import <AppKit/NSWindowRestoration.h>
#import <AppKit/NSTextAlternatives.h>
#import <AppKit/NSStoryboard.h>
#import <AppKit/NSStoryboardSegue.h>
#import <AppKit/NSVisualEffectView.h>
#import <AppKit/NSItemProvider.h>
#import <AppKit/NSTitlebarAccessoryViewController.h>
#import <AppKit/NSDataAsset.h>
#import <AppKit/NSAlignmentFeedbackFilter.h>
#import <AppKit/NSHapticFeedback.h>
#import <AppKit/NSPressureConfiguration.h>
#import <AppKit/NSButtonTouchBarItem.h>
#import <AppKit/NSPickerTouchBarItem.h>
#import <AppKit/NSStepperTouchBarItem.h>
#import <AppKit/NSTintConfiguration.h>
#import <AppKit/NSSearchToolbarItem.h>
#import <AppKit/NSTextRange.h>
#import <AppKit/NSTextSelection.h>
#import <AppKit/NSTextSelectionNavigation.h>
#import <AppKit/NSTextContentManager.h>
#import <AppKit/NSTextElement.h>
#import <AppKit/NSTextLayoutFragment.h>
#import <AppKit/NSTextLayoutManager.h>
#import <AppKit/NSTextLineFragment.h>
#import <AppKit/NSTextViewportLayoutController.h>
#import <AppKit/NSTextAttachmentCell.h>
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSGraphicsContext.h | /*
NSGraphicsContext.h
Application Kit
Copyright (c) 1997-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSGraphics.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSDictionary.h>
#import <CoreGraphics/CGContext.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSString;
@class NSWindow;
@class NSBitmapImageRep;
/* Attributes that can be passed to graphicsContextWithAttributes: method */
typedef NSString * NSGraphicsContextAttributeKey NS_TYPED_ENUM;
APPKIT_EXTERN NSGraphicsContextAttributeKey NSGraphicsContextDestinationAttributeName; // Can be an instance of NSWindow, NSMutableData, NSBitmapImageRep, or NSURL.
APPKIT_EXTERN NSGraphicsContextAttributeKey NSGraphicsContextRepresentationFormatAttributeName; // Specifies destination file format. Used only for NSMutableData or NSURL destinations
// Supported file format
typedef NSString * NSGraphicsContextRepresentationFormatName NS_TYPED_ENUM;
APPKIT_EXTERN NSGraphicsContextRepresentationFormatName NSGraphicsContextPSFormat;
APPKIT_EXTERN NSGraphicsContextRepresentationFormatName NSGraphicsContextPDFFormat;
typedef NS_ENUM(NSUInteger, NSImageInterpolation) {
NSImageInterpolationDefault = 0,
NSImageInterpolationNone = 1,
NSImageInterpolationLow = 2, /* Low quality, fast interpolation. */
NSImageInterpolationMedium API_AVAILABLE(macos(10.6)) = 4, /* Medium quality, slower than NSImageInterpolationLow. */
NSImageInterpolationHigh = 3 /* Highest quality, slower than NSImageInterpolationMedium. */
};
@interface NSGraphicsContext : NSObject
// Instantiates from an appropriate concrete subclass depending on NSGraphicsContextDestinationAttributeName attribute
+ (nullable NSGraphicsContext *)graphicsContextWithAttributes:(NSDictionary<NSGraphicsContextAttributeKey, id> *)attributes;
// Convenience cover method for [NSGraphicsContext graphicsContextWithAttributes:[NSDictionary dictionaryWithObject:<NSWindow instance> forKey:NSGraphicsContextDestinationAttributeName]]
+ (NSGraphicsContext *)graphicsContextWithWindow:(NSWindow *)window;
/* Convenience cover method for [NSGraphicsContext graphicsContextWithAttributes:[NSDictionary dictionaryWithObject:<NSBitmapImageRep instance> forKey:NSGraphicsContextDestinationAttributeName]]. Only NSBitmapImageRep instances with isPlanar == NO are supported.
*/
+ (nullable NSGraphicsContext *)graphicsContextWithBitmapImageRep:(NSBitmapImageRep *)bitmapRep;
/* Instantiates from a CGContextRef. initialFlippedState is used to determine the return value from -isFlipped when no view is focused in the context.
*/
+ (NSGraphicsContext *)graphicsContextWithCGContext:(CGContextRef)graphicsPort flipped:(BOOL)initialFlippedState API_AVAILABLE(macos(10.10));
// Setting and identifying the current context in the thread
@property (class, nullable, strong) NSGraphicsContext *currentContext;
// Convenience cover method for [[NSGraphicsContext currentContext] isDrawingToScreen]
+ (BOOL)currentContextDrawingToScreen;
// Calls -saveGraphicsState on the current context, and pushes it on the per-thread stack.
+ (void)saveGraphicsState;
// Pops a context from the per-thread stack, makes it current, and calls -restoreGraphicsState on it.
+ (void)restoreGraphicsState;
// Returns attributes used to create this instance
@property (nullable, readonly, copy) NSDictionary<NSGraphicsContextAttributeKey, id> *attributes;
// Testing the drawing destination
@property (getter=isDrawingToScreen, readonly) BOOL drawingToScreen;
// Controlling the context
- (void)saveGraphicsState;
- (void)restoreGraphicsState;
- (void)flushGraphics;
@property (readonly) CGContextRef CGContext NS_RETURNS_INNER_POINTER API_AVAILABLE(macos(10.10));
/* Returns the flip state of the receiver. The state is determined by messaging -isFlipped to the focus view in the context. If no view has focus, returns NO unless the receiver is instantiated via graphicsContextWithGraphicsPort:drawingToScreen:flipped: with initialFlippedState == YES.
*/
@property (getter=isFlipped, readonly) BOOL flipped;
@end
@interface NSGraphicsContext(NSGraphicsContext_RenderingOptions)
@property BOOL shouldAntialias;
@property NSImageInterpolation imageInterpolation;
@property NSPoint patternPhase;
@property NSCompositingOperation compositingOperation;
@property NSColorRenderingIntent colorRenderingIntent API_AVAILABLE(macos(10.5));
@end
@class CIContext;
@interface NSGraphicsContext (NSQuartzCoreAdditions)
@property (nullable, readonly, strong) CIContext *CIContext;
@end
@interface NSGraphicsContext (NSGraphicsContextDeprecated)
+ (void)setGraphicsState:(NSInteger)gState API_DEPRECATED("This method has no effect", macos(10.0,10.10));
- (null_unspecified id)focusStack API_DEPRECATED("", macos(10.0,10.6));
- (void)setFocusStack:(null_unspecified id)stack API_DEPRECATED("", macos(10.0,10.6));
+ (NSGraphicsContext *)graphicsContextWithGraphicsPort:(void *)graphicsPort flipped:(BOOL)initialFlippedState API_DEPRECATED_WITH_REPLACEMENT("graphicsContextWithCGContext:flipped:", macos(10.0,10.14));
@property (readonly) void *graphicsPort NS_RETURNS_INNER_POINTER API_DEPRECATED_WITH_REPLACEMENT("CGContext", macos(10.0,10.14));
@end
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSRuleEditor.h | /*
NSRuleEditor.h
Application Kit
Copyright (c) 2006-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSControl.h>
/* An NSRuleEditor is a class that allows the user to create and configure a list of options. The view has a delegate which offers a tree of choices to the view. The choices are presented by the view to the user as a row of popup buttons, static text fields, and custom views. Each row in the list represents a particular path down the tree of choices. An example of part of a tree of choices and a path through it:
----| contains -------> [CUSTOM TEXT FIELD]
Name-------------| | starts with |
Kind | ends with-------|
Creation date | is
Modification date
Each node in the tree is represented by a "criterion," which can be any object. As the user chooses from the popup menus, the rule editor view will query its delegate for the child criteria of the chosen criterion. The only restriction on the criteria is that two criterions should be considered equal by isEqual: if they represent the same node, and must not be equal if they represent different nodes. The path through the tree for a given row is represented by the array of criteria for the row. For example, the criteria for the above selection would represent "Name", "ends with", and the custom text field; the manner in which the criteria represent those values is up to the developer.
There are two types of rows - standard rows and header rows (NSRuleEditorRowTypeSimple and NSRuleEditorRowTypeCompound). A header row can contain other rows, but a standard row cannot. Header rows and standard rows can have different trees of criteria. The amount and style of row nesting is configurable.
Every time a row is created or modified, the rule editor view will query its delegate view for a "display value" for each new criteriion in the row. The display value is what is presented to the user, and must be a NSString, NSView, or NSMenuItem. When a criterion is selected in the row, the rule editor will query the criterion for its child criteria and then each of the children for their display value. If there are multiple children, a popup button is formed from the string values and menu items. If there is only one child, its display value is displayed as a static text field (if it is a string) or as a view (if the value is a view).
NSRuleEditor has some optional support for predicates. For each row, it will ask its delegate for various parts of a predicate, which are returned in a dictionary. Assuming the delegate returns enough parts for each row, the parts are then combined to form a predicate for the entire view. This is expressed in the "predicate" property for the view. Subclassers can modify the predicate for each row as it is constructed. Setting a predicate back on the view is not supported.
NSRuleEditor exposes one binding, "rows." The "rows" binding may be bound to an ordered to-many relation (e.g. NSMutableArray). Each object in the relation should have the following properties:
@"rowType" -> integer representing the type of the row (NSRuleEditorRowType)
@"subrows" -> ordered to-many relation (e.g. NSMutableArray) containing the directly nested subrows for the given row
@"displayValues" -> ordered to-many relation containing the display values for the row
@"criteria" -> ordered to-many relation containing the criteria for the row
These key paths can be set using the set*KeyPath: methods below
*/
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSIndexSet, NSView, NSPredicate, NSString, NSViewAnimation;
@protocol NSRuleEditorDelegate;
/* The following strings are to be used as keys to the dictionary returned from the optional method ruleEditor: predicatePartsForCriterion: withDisplayValue: inRow: . In order to construct a valid predicate, the union of the dictionaries for each item in the row must contain the required parts as described below: */
typedef NSString * NSRuleEditorPredicatePartKey NS_TYPED_ENUM;
APPKIT_EXTERN NSRuleEditorPredicatePartKey const NSRuleEditorPredicateLeftExpression; /* The value of this key should be an NSExpression representing the left expression in the predicate; this value is required for a non-nil comparison predicate */
APPKIT_EXTERN NSRuleEditorPredicatePartKey const NSRuleEditorPredicateRightExpression; /* The value of this key should be an NSExpression representing the right expression in the predicate; this value is required for a non-nil comparison predicate */
APPKIT_EXTERN NSRuleEditorPredicatePartKey const NSRuleEditorPredicateComparisonModifier; /* NSNumber representing the NSComparisonPredicateModifier of the predicate; this value is optional and, if not specified, NSDirectPredicateModifier is assumed */
APPKIT_EXTERN NSRuleEditorPredicatePartKey const NSRuleEditorPredicateOptions; /* NSNumber representing NSComparisonPredicateOptions; these are bitwise ORed together when constructing a predicate. If none is specified, 0 (no options) is assumed. */
APPKIT_EXTERN NSRuleEditorPredicatePartKey const NSRuleEditorPredicateOperatorType; /* NSNumber representing NSPredicateOperatorType; this value is required for a non-nil comparison predicate */
APPKIT_EXTERN NSRuleEditorPredicatePartKey const NSRuleEditorPredicateCustomSelector; /* NSString representing a custom selector; if specified, this will override the operator type, options, and comparison modifier */
APPKIT_EXTERN NSRuleEditorPredicatePartKey const NSRuleEditorPredicateCompoundType; /* NSNumber representing a NSCompoundPredicateType; if specified, the other keys are ignored and the predicate for the row will be an NSCompoundPredicate predicate, whose subpredicates are the predicates of the subrows of the given row. */
typedef NS_ENUM(NSUInteger, NSRuleEditorNestingMode) {
NSRuleEditorNestingModeSingle, /* Only a single row is allowed. Plus/minus buttons will not be shown */
NSRuleEditorNestingModeList, /* Allows a single list, with no nesting and no compound rows */
NSRuleEditorNestingModeCompound, /* Unlimited nesting and compound rows; this is the default */
NSRuleEditorNestingModeSimple /* One compound row at the top with subrows beneath it, and no further nesting allowed */
};
typedef NS_ENUM(NSUInteger, NSRuleEditorRowType) {
NSRuleEditorRowTypeSimple,
NSRuleEditorRowTypeCompound
};
@interface NSRuleEditor : NSControl
/* -- Configuring NSRuleEditor -- */
/* Clients can call this method to set and get the delegate for the NSRuleEditor. NSRuleEditor requires a delegate that implements the required NSRuleEditorDelegateMethods methods to function. */
@property (nullable, weak) id<NSRuleEditorDelegate> delegate;
/* Clients can call this to automatically set a formatting dictionary based on the strings file with the given name. Setting a formatting strings file searches the main bundle, and the bundle containing this nib, for a (possibly localized) strings file resource with the given name, loads it, and sets it as the formatting dictionary. The resulting dictionary can be obtained with -[NSRuleEditor formattingDictionary]. If you set the formatting dictionary explicitly with -[NSRuleEditor setFormattingDictionary:], then it sets the current formattingStringsFilename to nil */
@property (nullable, copy) NSString *formattingStringsFilename;
/* Clients can call this to set (and get) a formatting dictionary on the NSRuleEditor. The formatting dictionary should have NSString keys and NSString values. The syntax of the keys and values is the same as the syntax for strings files. */
@property (nullable, copy) NSDictionary<NSString *, NSString *> *formattingDictionary;
/* Clients can call this to indicate that the available criteria may have changed and should be refetched from the delegate, and the popups recalculated. If any item in a given row is "orphaned" (no longer reported as a child of its previous parent), those rows have their critieria and display values set to valid choices. */
- (void)reloadCriteria;
/* Clients call this to set and get the nesting mode for the NSRuleEditor. This is generally set at view creation time and not modified after. The default is NSRuleEditorNestingModeCompound. */
@property NSRuleEditorNestingMode nestingMode;
/* Clients call this to set and get the height of each row. This method changes the receiver's frame and marks it for redisplay. */
@property CGFloat rowHeight;
/* Clients call this to set the editable property of the control. Users can only interact with editable NSRuleEditors. The default is YES. */
@property (getter=isEditable) BOOL editable;
/* Rule editors that have the canRemoveAllRows property set to NO prevent the user from emptying the rule editor by deleting all the rows. The rule editor can still be emptied programatically. The default is YES. */
@property BOOL canRemoveAllRows;
/* -- Predicate support -- */
/* Clients can call this to obtain the predicate for the view if the delegate implements - ruleEditor: predicatePartsForItem: withValue: inRow:row: . If the delegate does not, or if the delegate does not return enough parts to construct a full predicate, this method returns nil. */
@property (nullable, readonly, strong) NSPredicate *predicate;
/* Clients can call this to indicates that the predicate should be generated again from the delegate (by invoking the corresponding delegate method), typically because something has changed (for example, a view's value). */
- (void)reloadPredicate;
/* This method returns the predicate for a given row. Clients should rarely have a need to call this directly, but it can be overridden to perform specialized predicate handling for certain criteria or display values. */
- (nullable NSPredicate *)predicateForRow:(NSInteger)row;
/* -- Obtaining row information -- */
/* Clients can call this to determine the number of rows */
@property (readonly) NSInteger numberOfRows;
/* Clients can call this to determine the immediate subrows of the given row. Pass -1 to get the top-level rows. Rows are numbered starting at 0. If rowIndex is less than -1 or greater than or equal to the number of rows, this raises an NSRangeException. */
- (NSIndexSet *)subrowIndexesForRow:(NSInteger)rowIndex;
/* Clients call this to obtain all of the currently chosen items for the given row. These are the same items that are returned from the delegate method - ruleEditor: child: forCriterion: withRowType: */
- (NSArray *)criteriaForRow:(NSInteger)row;
/* Clients call this to obtain all of the chosen values (strings, views, or menu items) for row. These are the same values that are returned from the delegate method - ruleEditor: valueForItem: inRow: */
- (NSArray *)displayValuesForRow:(NSInteger)row;
/* Clients call this to map from a display value (string, view, or menu item) back to a row. This method searches each row via pointer equality for the given display value, which may be present as an alternative in a popup menu for that row. It returns the index of the row containing the given value, or NSNotFound. Raises NSInvalidArgumentException if displayValue is nil. */
- (NSInteger)rowForDisplayValue:(id)displayValue;
/* Clients call this to determine the type of the row. If rowIndex is less than 0 or greater than or equal to the number of rows, this raises an NSRangeException */
- (NSRuleEditorRowType)rowTypeForRow:(NSInteger)rowIndex;
/* Clients call this to determine the parent row of rowIndex. If rowIndex is a root row, this returns -1. If rowIndex is less than 0 or greater than or equal to the number of rows, this raises an NSRangeException */
- (NSInteger)parentRowForRow:(NSInteger)rowIndex;
/* -- Manipulating rows -- */
/* Adds "initial" rows, or a row to the end - useful as the target for the outside + button */
- (void)addRow:(nullable id)sender;
/* Clients call this to add a new row at the given index with the given type as a subrow of the parent row. Pass -1 to indicate that it should be a root row. If parentRow >= rowIndex, or if rowIndex would fall amongst the children of some other parent, or if the nesting mode forbids this configuration, an NSInvalidArgumentException is raised. */
- (void)insertRowAtIndex:(NSInteger)rowIndex withType:(NSRuleEditorRowType)rowType asSubrowOfRow:(NSInteger)parentRow animate:(BOOL)shouldAnimate;
/* Clients call this to modify the row at a given index to contain the passed-in items and values. It is your responsibility to ensure that each item in the array is a child of the previous item, and that the first item is a root item for the row type. If the last item has child items, then the items array will be extended by querying the delegate for child items until a childless item is reached. If the values array contains fewer objects than the (possibly extended) criteria array, then the delegate will be queried to construct the remaining display values. If you want the delegate to be queried for all the criteria or all the display values, pass empty arrays; do not pass nil. Raises NSRangeException if rowIndex is equal to or larger than the number of rows, or less than 0. Raises an NSInvalidArgumentException if criteria or values is nil. */
- (void)setCriteria:(NSArray *)criteria andDisplayValues:(NSArray *)values forRowAtIndex:(NSInteger)rowIndex;
/* Clients call this to remove the row at the given index. Any subrows of the deleted row are adopted by the parent of the deleted row, or are made root rows. Raises NSRangeException if rowIndex is equal to or larger than the number of rows, or less than 0. */
- (void)removeRowAtIndex:(NSInteger)rowIndex;
/* Clients call this to delete rows at the given indexes. If includeSubrows is YES, then the subrows of the deleted rows will be deleted as well; if includeSubrows is NO, then each subrow will be adopted by its first non-deleted ancestor, or will become a root row. Raises NSRangeException if any index in rowIndexes is equal to or larger than the number of rows, or less than 0. */
- (void)removeRowsAtIndexes:(NSIndexSet *)rowIndexes includeSubrows:(BOOL)includeSubrows;
/* Clients call this to determine the indexes of the selected rows. */
@property (readonly, copy) NSIndexSet *selectedRowIndexes;
/* Clients call this to modify the selected row indexes. Raises NSRangeException if any index in rowIndexes is equal to or larger than the number of rows, or less than 0. */
- (void)selectRowIndexes:(NSIndexSet *)indexes byExtendingSelection:(BOOL)extend;
/* -- Bindings support -- */
/* Sets the class used when creating a new row in the "rows" binding; this class should be KVC and KVO compliant for the key paths listed below. By default this is NSMutableDictionary */
@property (assign) Class rowClass;
/* Set and get the key path for the row type, which is used to get the row type in the "rows" binding. The row type is a value property of type NSRuleEditorRowType. The default is @"rowType". */
@property (copy) NSString *rowTypeKeyPath;
/* Set and get the key path for the subrows, which is used to determined nested rows in the "rows" binding. The subrows property is an ordered to-many relationship containing additional bound row objects. The default is @"subrows". */
@property (copy) NSString *subrowsKeyPath;
/* Set and get the criteria key path, which determines the criteria for a row in the "rows" binding. (The criteria objects are what the delegate returns from - ruleEditor: child: forCriterion: withRowType:). The criteria property is an ordered to-many relationship. The default is @"criteria". */
@property (copy) NSString *criteriaKeyPath;
/* Set and get the display values key path, which determines the display values for a row (the display values are what the delegate returns from - ruleEditor: displayValueForCriterion: inRow:). The criteria property is an ordered to-many relationship. The default is @"displayValues". */
@property (copy) NSString *displayValuesKeyPath;
@end
@protocol NSRuleEditorDelegate <NSObject>
@required
/* -- Required delegate methods -- */
/* When called, you should return the number of child items of the given criterion. If criterion is nil, you should return the number of root criteria for the given row type. Implementation of this method is required. */
- (NSInteger)ruleEditor:(NSRuleEditor *)editor numberOfChildrenForCriterion:(nullable id)criterion withRowType:(NSRuleEditorRowType)rowType;
/* When called, you should return the child of the given item at the given index. If criterion is nil, return the root criterion for the given row type at the given index. Implementation of this method is required. */
- (id)ruleEditor:(NSRuleEditor *)editor child:(NSInteger)index forCriterion:(nullable id)criterion withRowType:(NSRuleEditorRowType)rowType;
/* When called, you should return a value for the given criterion. The value should be an instance of NSString, NSView, or NSMenuItem. If the value is an NSView or NSMenuItem, you must ensure it is unique for every invocation of this method; that is, do not return a particular instance of NSView or NSMenuItem more than once. Implementation of this method is required. */
- (id)ruleEditor:(NSRuleEditor *)editor displayValueForCriterion:(id)criterion inRow:(NSInteger)row;
@optional
/* -- Optional delegate methods -- */
/* When called, you should return an NSDictionary representing the parts of the predicate determined by the given criterion and value. The keys of the dictionary should be the strings shown above that begin with NSRuleEditorPredicate..., and the values should be as described in the comments adjacent to the keys. Implementation of this method is optional. */
- (nullable NSDictionary<NSRuleEditorPredicatePartKey, id> *)ruleEditor:(NSRuleEditor *)editor predicatePartsForCriterion:(id)criterion withDisplayValue:(id)value inRow:(NSInteger)row;
/* If ruleEditorRowsDidChange: is implemented, NSRuleEditor will automatically register its delegate to receive NSRuleEditorRowsDidChangeNotification notifications to this method. Implementation of this method is optional. */
- (void)ruleEditorRowsDidChange:(NSNotification *)notification;
@end
/* Posted to the default notification center whenever the view's rows change.
* The object is the NSRuleEditor; there is no userInfo */
APPKIT_EXTERN NSNotificationName const NSRuleEditorRowsDidChangeNotification;
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/NSLevelIndicator.h | /*
NSLevelIndicator.h
Application Kit
Copyright (c) 2004-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSControl.h>
#import <AppKit/NSLevelIndicatorCell.h>
#import <AppKit/AppKitDefines.h>
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
typedef NS_ENUM(NSInteger, NSLevelIndicatorPlaceholderVisibility) {
/* Placeholders are always displayed for standalone indicators. For level indicators inside a table view, placeholders draw only in the selected row and while the control is being edited. */
NSLevelIndicatorPlaceholderVisibilityAutomatic = 0,
/* Always display placeholders */
NSLevelIndicatorPlaceholderVisibilityAlways = 1,
/* Only display placeholders while the control is being edited */
NSLevelIndicatorPlaceholderVisibilityWhileEditing = 2
};
@interface NSLevelIndicator : NSControl {
}
@property NSLevelIndicatorStyle levelIndicatorStyle API_AVAILABLE(macos(10.10));
@property (getter=isEditable) BOOL editable API_AVAILABLE(macos(10.13));
#pragma mark Value Thresholds
@property double minValue;
@property double maxValue;
@property double warningValue;
@property double criticalValue;
#pragma mark Tick Marks
@property NSTickMarkPosition tickMarkPosition;
@property NSInteger numberOfTickMarks;
@property NSInteger numberOfMajorTickMarks;
- (double)tickMarkValueAtIndex:(NSInteger)index;
- (NSRect)rectOfTickMarkAtIndex:(NSInteger)index;
#pragma mark Custom Colors
/*! Sets the fill color used by Continuous and Discrete Capacity indicators when drawing the "normal" state, and by the Rating indicator when drawing stars. The default value is a system-defined color which may vary between level indicator styles and OS releases. */
@property (copy, null_resettable) NSColor *fillColor API_AVAILABLE(macos(10.13));
/*! Sets the fill color used by Continuous and Discrete Capacity indicators when drawing values above the "warning" threshold. The default value is a system-defined color which may vary between level indicator styles and OS releases. */
@property (copy, null_resettable) NSColor *warningFillColor API_AVAILABLE(macos(10.13));
/*! Sets the fill color used by Continuous and Discrete Capacity indicators when drawing values above the "critical" threshold. The default value is a system-defined color which may vary between level indicator styles and OS releases. */
@property (copy, null_resettable) NSColor *criticalFillColor API_AVAILABLE(macos(10.13));
#pragma mark Capacity Indicator Options
@property BOOL drawsTieredCapacityLevels API_AVAILABLE(macos(10.13));
#pragma mark Rating Indicator Options
/*! For a Rating-style indicator, sets the conditions under which Rating placeholders are displayed. This property currently has no effect for other indicator styles. The default value is \c NSLevelIndicatorPlaceholderVisibilityAutomatic. */
@property NSLevelIndicatorPlaceholderVisibility placeholderVisibility API_AVAILABLE(macos(10.13));
/*! If non-nil, sets the image used by the Rating indicator style in place of the default star image. The default value is nil. */
@property (strong, nullable) NSImage *ratingImage API_AVAILABLE(macos(10.13));
/*! If non-nil, sets the image used by the Rating indicator style in place of the default faded placeholder image. The default value is nil.
If the custom placeholder is a template image, its fill opacity can be adjusted by modifying the opacity of the template image.
If both a ratingImage and ratingPlaceholderImage are set, each rating position is sized such that either image will fit without scaling (i.e. sized to the maximum width and height of both images). */
@property (strong, nullable) NSImage *ratingPlaceholderImage API_AVAILABLE(macos(10.13));
@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/NSSliderAccessory.h | /*
NSSliderAccessory.h
Application Kit
Copyright (c) 2016-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSAccessibility.h>
#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
@class UIImage;
#endif
NS_ASSUME_NONNULL_BEGIN
@class NSSlider, NSSliderAccessoryBehavior, NSImage;
API_AVAILABLE(macos(10.12), ios(13.0)) NS_SWIFT_UI_ACTOR
@interface NSSliderAccessory : NSObject <NSCoding>
/// Creates an image-based accessory
#if !TARGET_OS_IPHONE
+ (NSSliderAccessory *)accessoryWithImage:(NSImage *)image;
#else
+ (NSSliderAccessory *)accessoryWithImage:(UIImage *)image API_AVAILABLE(ios(13.0));
#endif
/// The effect on interaction with the accessory. Defaults to `automaticBehavior`
@property (copy) NSSliderAccessoryBehavior *behavior;
/// Whether or not the accessory is interactive and draws with an enabled appearance. Defaults to YES.
@property (getter=isEnabled) BOOL enabled;
@end
#if !TARGET_OS_IPHONE
@interface NSSliderAccessory () <NSAccessibility, NSAccessibilityElement>
@end
#endif
API_AVAILABLE(macos(10.12), ios(13.0)) NS_SWIFT_UI_ACTOR
@interface NSSliderAccessoryBehavior : NSObject <NSCoding, NSCopying>
/// The behavior is automatically picked to be the system standard for the slider's current context, e.g. NSTouchBarItems have `.valueStep` behavior.
@property (class, readonly, copy) NSSliderAccessoryBehavior *automaticBehavior;
/// The value of the slider moves towards the associated value for the accessory with by a delta of the slider's `altIncrementValue`.
@property (class, readonly, copy) NSSliderAccessoryBehavior *valueStepBehavior;
/// The value of the slider is reset to the associated value for the accessory.
@property (class, readonly, copy) NSSliderAccessoryBehavior *valueResetBehavior;
/// The action is sent to the target on interaction. The optional first parameter is an NSSliderAccessory.
+ (NSSliderAccessoryBehavior *)behaviorWithTarget:(nullable id)target action:(SEL)action;
/// The handler block is invoked on interaction. This variant is not codable and will assert in `-encodeWithCoder:`.
+ (NSSliderAccessoryBehavior *)behaviorWithHandler:(void(^)(NSSliderAccessory *))handler;
/// Override point for custom subclasses to handle interaction.
- (void)handleAction:(NSSliderAccessory *)sender;
@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/NSTableView.h | /*
NSTableView.h
Application Kit
Copyright (c) 1995-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <AppKit/NSControl.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSDragging.h>
#import <AppKit/NSUserInterfaceValidation.h>
#import <AppKit/NSTextView.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSTableHeaderView, NSTableColumn, NSIndexSet, NSMutableIndexSet, NSTableRowView, NSNib, NSTableViewRowAction, NSSortDescriptor;
@protocol NSTableViewDelegate, NSTableViewDataSource;
/* In drag and drop, used to specify a dropOperation. For example, given a table with N rows (numbered with row 0 at the top visually), a row of N-1 and operation of NSTableViewDropOn would specify a drop on the last row. To specify a drop below the last row, one would use a row of N and NSTableViewDropAbove for the operation.
*/
typedef NS_ENUM(NSUInteger, NSTableViewDropOperation) {
NSTableViewDropOn,
NSTableViewDropAbove
};
typedef NS_ENUM(NSUInteger, NSTableViewColumnAutoresizingStyle) {
/* Turn off column autoresizing
*/
NSTableViewNoColumnAutoresizing = 0,
/* Autoresize all columns by distributing equal shares of space simultaneously
*/
NSTableViewUniformColumnAutoresizingStyle,
/* Autoresize each table column one at a time. Proceed to the next column when
the current column can no longer be autoresized (when it reaches maximum/minimum size).
*/
NSTableViewSequentialColumnAutoresizingStyle, // Start with the last autoresizable column, proceed to the first.
NSTableViewReverseSequentialColumnAutoresizingStyle, // Start with the first autoresizable column, proceed to the last.
/* Autoresize only one table column one at a time. When that table column can no longer be
resized, stop autoresizing. Normally you should use one of the Sequential autoresizing
modes instead.
*/
NSTableViewLastColumnOnlyAutoresizingStyle,
NSTableViewFirstColumnOnlyAutoresizingStyle
};
/* Grid styles for the gridStyleMask.
*/
typedef NS_OPTIONS(NSUInteger, NSTableViewGridLineStyle) {
NSTableViewGridNone = 0,
NSTableViewSolidVerticalGridLineMask = 1 << 0,
NSTableViewSolidHorizontalGridLineMask = 1 << 1,
NSTableViewDashedHorizontalGridLineMask API_AVAILABLE(macos(10.7)) = 1 << 3, // Draw the horizontal grid as a dashed line
};
typedef NS_ENUM(NSInteger, NSTableViewRowSizeStyle) {
/* The table will use the system default layout size: small, medium or large. */
NSTableViewRowSizeStyleDefault = -1,
/* The table will use the -rowHeight or ask the delegate for a variable row height (if implemented) and cell layout is not changed. */
NSTableViewRowSizeStyleCustom = 0,
/* The table will use a row height specified for a small/medium or large table.
It is required that all sizes be fully tested and supported if NSTableViewRowSizeStyleCustom is not used.
Some standard Aqua metrics may be applied to cells based on the current size. Specifically, the metrics will be applied to the NSTableCellView's textField and imageView outlets. Don't use these and add your own outlets if you wish to control the metrics yourself. */
NSTableViewRowSizeStyleSmall = 1,
NSTableViewRowSizeStyleMedium = 2,
NSTableViewRowSizeStyleLarge = 3,
} API_AVAILABLE(macos(10.7));
typedef NS_ENUM(NSInteger, NSTableViewStyle) {
/* Automatically infers the effectiveStyle from the table view hierarchy.
*/
NSTableViewStyleAutomatic,
/* Edge-to-edge style with standard content padding at the ends of each row. This content padding is constant and independent of intercellSpacing.
*/
NSTableViewStyleFullWidth,
/* Inset style with rounded corners selection
*/
NSTableViewStyleInset,
/* The source list style of NSTableView. Setting this style will have the side effect of setting the background color to "source list".
Additionally in NSOutlineView, the following properties may change to get the standard "source list" look: indentationPerLevel, rowHeight and intercellSpacing. After setting the style it is possible to change any of the other properties as required.
In 10.11, if the background color has been changed from the "source list" background color to something else, the table will no longer draw the selection as a source list blur style, and instead will draw a normal selection highlight.
This replaces NSTableViewSelectionHighlightStyleSourceList which is to be deprecated.
*/
NSTableViewStyleSourceList,
/* A plain style. No insets, padding or any other kind of decoration applied to the row or its background. The cells are equally spaced in the row using intercellSpacing.width.
*/
NSTableViewStylePlain
} API_AVAILABLE(macos(11.0));
typedef NS_ENUM(NSInteger, NSTableViewSelectionHighlightStyle) {
/* The highlight style to show no highlight at all. Available in MacOS 10.6 and higher.
*/
NSTableViewSelectionHighlightStyleNone API_AVAILABLE(macos(10.6)) = -1,
/* The regular highlight style of NSTableView. On the current OS, a light blue ([NSColor alternateSelectedControlColor]) or light gray color ([NSColor secondarySelectedControlColor]) is used to highlight selected rows.
*/
NSTableViewSelectionHighlightStyleRegular = 0,
/* Deprecated. See NSTableViewStyleSourceList.
*/
NSTableViewSelectionHighlightStyleSourceList API_DEPRECATED("Set the NSTableView.style property to NSTableViewStyleSourceList instead.", macos(10.5, 12.0)) = 1,
};
typedef NS_ENUM(NSInteger, NSTableViewDraggingDestinationFeedbackStyle) {
/* Provides no feedback when the user drags over the table view. This option exists to allow subclasses to implement their dragging destination highlighting, or to make it not show anything all.
*/
NSTableViewDraggingDestinationFeedbackStyleNone = -1,
/* Draws a solid selection rectangle background on drop target rows, and an insertion marker between rows. This style should be used in most cases.
*/
NSTableViewDraggingDestinationFeedbackStyleRegular = 0,
/* On Mac OS 10.0.2, this style is now identical to NSTableViewDraggingDestinationFeedbackStyleRegular. On previous released it draws an outline on drop target rows, and an insertion marker between rows. This style will automatically be set for source lists when [table setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleSourceList] is called, as it is the standard look for Source Lists, but may be used in other areas as needed.
*/
NSTableViewDraggingDestinationFeedbackStyleSourceList = 1,
/* Provides a gap insertion when dragging over the table. Note that this style is only officially supported for View Based TableViews, but may partially work in Cell Based TableViews. The decision to use the gap style (compared to another style) can be made in tableView:draggingSession:willBeginAtPoint:forRowIndexes:, or it can dynamically be changed.
*/
NSTableViewDraggingDestinationFeedbackStyleGap API_AVAILABLE(macos(10.9)) = 2,
} API_AVAILABLE(macos(10.6));
/* NSTableRowActionEdge is used in the delegate method: tableView:rowActionsForRow:edge: */
typedef NS_ENUM(NSInteger, NSTableRowActionEdge) {
NSTableRowActionEdgeLeading, // Action buttons that appear on the leading (or left) edge of an NSTableRowView
NSTableRowActionEdgeTrailing, // Action buttons that appear on the trailing (or right) edge of an NSTableRowView
} API_AVAILABLE(macos(10.11));
typedef NSString * NSTableViewAutosaveName NS_SWIFT_BRIDGED_TYPEDEF;
@interface NSTableView : NSControl <NSUserInterfaceValidations, NSTextViewDelegate, NSDraggingSource, NSAccessibilityTable>
- (instancetype)initWithFrame:(NSRect)frameRect NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
/* Get and set the dataSource. The dataSource can implement methods in the protocol NSTableViewDataSource. Some methods are required, unless bindings are used, in which case they are optional. The dataSource is a weak reference (non retained) in non garbage collected applications. Under garbage collected apps, it is a strong reference. The default value is 'nil'.
*/
@property (nullable, weak) id <NSTableViewDataSource> dataSource;
/* Get and set the delegate. The delegate can implement methods in the protocol NSTableViewDelegate. All delegate methods are optional. The delegate is a weak reference (non retained) in non garbage collected applications. Under garbage collected apps, it is a strong reference. The default value is 'nil'.
*/
@property (nullable, weak) id <NSTableViewDelegate> delegate;
/* Get and set the headerView. Calling -setHeaderView:nil will remove the headerView. Calling -setHeaderView: may have the side effect of tiling the enclosingScrollView to accommodate the size change. The default value is a new NSTableHeaderView instance.
*/
@property (nullable, strong) NSTableHeaderView *headerView;
/* Get and set the cornerView. The cornerView is the view that appears directly to the right of the headerView above the vertical NSScroller. The scroller must be present for the cornerView to be shown. Calling -setCornerView: may have the side effect of tiling the enclosingScrollView to accommodate the size change. The default value is an internal class that properly fills in the corner.
*/
@property (nullable, strong) NSView *cornerView;
/* Get and set the allowsColumnReordering. Controls whether or not columns can be drag-reordered. The default value is YES.
*/
@property BOOL allowsColumnReordering;
/* Get and set the allowsColumnResizing. Controls whether the user can attempt to resize columns by dragging between headers. If flag is YES the user can resize columns; if flag is NO the user can't. Columns can only be resized if a column allows user resizing. See -[NSTableColumn setResizingMask:] for more details. You can always change columns programmatically regardless of this setting. The default value is YES.
*/
@property BOOL allowsColumnResizing;
/* Get and set the columnAutoresizingStyle. This controls resizing in response to a tableView frame size change, usually done by dragging a window larger that has an auto-resized tableView inside it. The default value is NSTableViewLastColumnOnlyAutoresizingStyle.
Compatability Note: This method replaces -setAutoresizesAllColumnsToFit: on 10.4 and higher.
*/
@property NSTableViewColumnAutoresizingStyle columnAutoresizingStyle;
/* Get and set the gridStyleMask. Values can be bitwise or'ed together, however, only one horizontal style can be used at a time. The default value is NSTableViewGridNone.
*/
@property NSTableViewGridLineStyle gridStyleMask;
/* Get and set the intercellSpacing. This is the spacing that appears between cells. The default value is NSMakeSize(3, 2).
*/
@property NSSize intercellSpacing;
/* Get and set the use of alternatingRowBackgroundColors. This configures the table to use either the standard alternating row colors, or a solid color for its background. The default value is NO.
*/
@property BOOL usesAlternatingRowBackgroundColors;
/* Get and set the backgroundColor. On Mac OS 10.5 and higher, the alpha portion of 'color' is properly used when drawing the backgroundColor. To have a transparent tableView, set the backgroundColor to [NSColor clearColor], and set the enclosing NSScrollView to not draw its background with: [[tableView enclosingScrollView] setDrawsBackground:NO]. NSTableView uses NSCompositeSourceOver when drawing the background color. The default value is [NSColor controlBackgroundColor].
*/
@property (copy) NSColor *backgroundColor;
/* Get and set the gridColor. This value is only used when the gridStyleMask is not equal to NSTableViewGridNone. The default value is [NSColor gridColor].
*/
@property (copy) NSColor *gridColor;
/* Get and set the rowSizeStyle. The default value is NSTableViewRowSizeStyleCustom, which allows the table to behave as it traditionally has. If the value is not NSTableViewRowSizeStyleCustom, then all three sizes must be properly supported by the view or cell. Changing the rowSizeStyle will automatically update the rowHeight if NSTableViewRowSizeStyleCustom is not used, and the rowHeight should not be changed. It is a recommendation that the variable row height delegate method should generally NOT be implemented when using a non-custom style, and instead the standard provided row heights should be used.
*/
@property NSTableViewRowSizeStyle rowSizeStyle API_AVAILABLE(macos(10.7));
/* Returns the effective row size style for the table. If the rowSizeStyle is NSTableViewRowSizeStyleDefault, then this method returns the default size for this particular table.
*/
@property (readonly) NSTableViewRowSizeStyle effectiveRowSizeStyle API_AVAILABLE(macos(10.7));
/* Get and set the rowHeight. The value must be greater than 0. Calling -setRowHeight: with a non-pixel aligning (fractional) value will be forced to a pixel aligning (integral) value. For variable row height tableViews (ones that have the delegate implement -tableView:heightOfRow:), -rowHeight will be used to draw alternating rows past the last row in the tableView. The actual -rectOfRow: is equal to the -rowHeight plus the intercellSpacing.height. The default value is 17.0 for applications linked on 10.5 and higher (the height acceptable for [NSFont systemFontSize]). The default value is 16.0 for 10.4 and lower. Group rows will follow the system defined height.
*/
@property CGFloat rowHeight;
/* If the delegate implements -tableView:heightOfRow:, this method immediately re-tiles the table view using row heights it provides.
*/
- (void)noteHeightOfRowsWithIndexesChanged:(NSIndexSet *)indexSet;
/* Returns a reference to the array of NSTableColumn instances in the NSTableView. Includes columns that are -isHidden. It is recommended to make a copy of the array if you are going to manipulate the NSTableView by using -addTableColumn:, -removeTableColumn: or -moveColumn:toColumn:.
*/
@property (readonly, copy) NSArray<NSTableColumn *> *tableColumns;
/* Simply a cover method to return the number of NSTableColumn instances in the NSTableView. Includes columns that are -isHidden.
*/
@property (readonly) NSInteger numberOfColumns;
/* Returns the numberOfRows. It may call to the dataSource to acquire the count. numberOfRows will return 0 if there are no visible columns.
*/
@property (readonly) NSInteger numberOfRows;
/* Adds 'tableColumn' to the end of the -tableColumns array and retiles the tableView. 'tableColumn' must be non-nil, otherwise an exception will be raised.
*/
- (void)addTableColumn:(NSTableColumn *)tableColumn;
/* Removes 'tableColumn' from the -tableColumns array and retiles the tableView.
*/
- (void)removeTableColumn:(NSTableColumn *)tableColumn;
/* Moves the the tableColumn at 'oldIndex' to 'newIndex'. 'oldIndex' and 'newIndex' must be in the range: 0 to [tableView numberOfColumns]-1, otherwise an exception will be raised.
*/
- (void)moveColumn:(NSInteger)oldIndex toColumn:(NSInteger)newIndex;
/* Returns the first index of the NSTableColumn instance with the -identifier that isEqual to 'identifier'. Returns -1 if 'identifier' can not be found. In 10.7, the identifier was changed from NSString to id.
*/
- (NSInteger)columnWithIdentifier:(NSUserInterfaceItemIdentifier)identifier;
/* Returns the first NSTableColumn instance with the -identifier that isEqual to 'identifier'. Returns nil if 'identifier' can not be found. In 10.7, the identifier was changed from NSString to id.
*/
- (nullable NSTableColumn *)tableColumnWithIdentifier:(NSUserInterfaceItemIdentifier)identifier;
/* Causes the table to tile in size appropriate for the content. This method will be called automatically when necessary, and generally does not need to be called.
*/
- (void)tile;
- (void)sizeToFit;
- (void)sizeLastColumnToFit;
- (void)scrollRowToVisible:(NSInteger)row;
- (void)scrollColumnToVisible:(NSInteger)column;
/* Reloads the table.
View Based TableView: This drops all known views, and row heights, and lazily reloads all information. The selected rows are not maintained. To properly maintain selection, use the insert/remove/move API.
*/
- (void)reloadData;
/*
Cell Based TableView: This method tells the table that there may be more (or less) rows available and to reload state based on that information.
View Based TableView: This method can only be used to increase or decrease the number of rows in the table. The table will query the datasource for the new number of rows, and properly insert (or remove) rows at the end of the table as necessary with an animation. This method does *NOT* work for NSOutlineView, and should not be called.
*/
- (void)noteNumberOfRowsChanged;
/* Updates a particular row of cells for a given set of 'rowIndexes' in 'columnIndexes'. For cells that are visible, appropriate dataSource and delegate methods will be called and the cells will be redrawn. For tables that support variable row heights, the row height will not be re-queried from the delegate; -noteHeightOfRowsWithIndexesChanged: should be used if a row height change is required.
*/
- (void)reloadDataForRowIndexes:(NSIndexSet *)rowIndexes columnIndexes:(NSIndexSet *)columnIndexes API_AVAILABLE(macos(10.6));
/*
Cell Based TableView: Returns the column and row that is being edited. editedRow will be -1 if there is no editing session happening. editedColumn will be -1 if there is no editing session, or the currently edited row is a "full width" row.
View Based TableView: Not applicable. Subviews are responsible for editing.
*/
@property (readonly) NSInteger editedColumn;
@property (readonly) NSInteger editedRow;
@property (readonly) NSInteger clickedColumn;
@property (readonly) NSInteger clickedRow;
@property (nullable) SEL doubleAction;
/* Sorting Support
The array of sort descriptors is archived. Sort descriptors will persist along with other column information if an -autosaveName is set. Calling -setSortDescriptors: may have the side effect of calling -tableView:sortDescriptorsDidChange: on the -dataSource/
*/
@property (copy) NSArray<NSSortDescriptor *> *sortDescriptors;
/* Support for little "indicator" images in table header cells.
*/
- (void)setIndicatorImage:(nullable NSImage *)image inTableColumn:(NSTableColumn *)tableColumn;
- (nullable NSImage *)indicatorImageInTableColumn:(NSTableColumn *)tableColumn;
/* Support for highlightable column header, for use with row selection.
*/
@property (nullable, weak) NSTableColumn *highlightedTableColumn;
#pragma mark -
#pragma mark ***** Drag and Drop *****
/* Get and set verticalMotionCanBeginDrag. If -verticalMotionCanBeginDrag is YES, then click + a vertical drag of the mouse will drag the clicked item(s). If NO, it will do a "drag select". The default value is YES.
*/
@property BOOL verticalMotionCanBeginDrag;
/* The return value indicates whether the receiver can attempt to initiate a row drag at 'mouseDownPoint'. Return NO to disallow initiating drags at the given location.
For applications linked on and after Leopard, NSCell hit testing will determine if a row can be dragged or not. Custom cells should properly implement [NSCell(NSCellHitTest) hitTestForEvent:inRect:ofView]; see NSCell.h for more information. NSTableView will not begin a drag if cell returns NSCellHitTrackableArea (ie: NSButtonCells).
*/
- (BOOL)canDragRowsWithIndexes:(NSIndexSet *)rowIndexes atPoint:(NSPoint)mouseDownPoint;
/* This method computes and returns an image to use for dragging. Override this to return a custom image. 'dragRows' represents the rows participating in the drag. 'tableColumns' represent the columns that should be in the output image. Note that drawing may be clipped to the visible rows, and columns. 'dragEvent' is a reference to the mouse down event that began the drag. 'dragImageOffset' is an in/out parameter. This method will be called with dragImageOffset set to NSZeroPoint, but it can be modified to re-position the returned image. A dragImageOffset of NSZeroPoint will cause the image to be centered under the mouse.
Compatability Note: This method replaces dragImageForRows:event:dragImageOffset:. If present, this is used instead of the deprecated method.
*/
- (NSImage *)dragImageForRowsWithIndexes:(NSIndexSet *)dragRows tableColumns:(NSArray<NSTableColumn *> *)tableColumns event:(NSEvent *)dragEvent offset:(NSPointPointer)dragImageOffset;
/* Configures the default value returned from -draggingSourceOperationMaskForLocal:. An isLocal value of YES indicates that 'mask' applies when the destination object is in the same application. A isLocal value of NO indicates that 'mask' applies when the destination object in an application outside the receiver's application. NSTableView will archive the values you set for each isLocal setting.
*/
- (void)setDraggingSourceOperationMask:(NSDragOperation)mask forLocal:(BOOL)isLocal;
/* To be used from validateDrop: if you wish to "re-target" the proposed drop. To specify a drop on the second row, one would specify row=2, and dropOperation=NSTableViewDropOn. To specify a drop below the last row, one would specify row=[tableView numberOfRows], and dropOperation=NSTableViewDropAbove. To specify a drop on the entire tableview, one would specify row=-1 and dropOperation=NSTableViewDropOn.
*/
- (void)setDropRow:(NSInteger)row dropOperation:(NSTableViewDropOperation)dropOperation;
#pragma mark -
#pragma mark ***** Selection *****
/* Get and set allowsMultipleSelection. If -allowsMultipleSelection is YES, multiple items can be selected in various ways (modifier-clicking items, shift-arrow selection extending, etc). The default value is NO.
*/
@property BOOL allowsMultipleSelection;
/* Get and set allowsEmptySelection. If -allowsEmptySelection is YES, all rows can be deselected by the user. Otherwise, it is enforced that one row must be left selected at any given time. The default value is YES.
*/
@property BOOL allowsEmptySelection;
/* Get and set allowsColumnSelection. If -allowsColumnSelection is YES, clicking on column headers can select that column (which is reflected in -selectedColumnIndexes). The default value is NO.
*/
@property BOOL allowsColumnSelection;
- (void)selectAll:(nullable id)sender;
- (void)deselectAll:(nullable id)sender;
/* Sets the column selection using the indexes. Selection is set/extended based on the extend flag.
Compatability Note: This method replaces selectColumn:byExtendingSelection:
If a subclasser implements only the deprecated single-index method (selectColumn:byExtendingSelection:), the single-index method will be invoked for each index. If a subclasser implements the multi-index method (selectColumnIndexes:byExtendingSelection:), the deprecated single-index version method will not be used. This allows subclassers already overriding the single-index method to still receive a selection message. Note: to avoid cycles, subclassers of this method and single-index method should not call each other.
*/
- (void)selectColumnIndexes:(NSIndexSet *)indexes byExtendingSelection:(BOOL)extend;
/* Sets the row selection using 'indexes'. Selection is set/extended based on the extend flag. On 10.5 and greater, selectRowIndexes:byExtendingSelection: will allow you to progrmatically select more than one index, regardless of the allowsMultipleSelection and allowsEmptySelection options set on the table.
View Based TableViews: This method is animatable by using the animator proxy. IE: [tableView.animator selectRowIndexes:.. byExtendingSelection:..];
Compatability Note: This method replaces selectRow:byExtendingSelection:
If a subclasser implements only the deprecated single-index method (selectRow:byExtendingSelection:), the single-index method will be invoked for each index. If a subclasser implements the multi-index method (selectRowIndexes:byExtendingSelection:), the deprecated single-index version method will not be used. This allows subclassers already overriding the single-index method to still receive a selection message. Note: to avoid cycles, subclassers of this method and single-index method should not call each other.
*/
- (void)selectRowIndexes:(NSIndexSet *)indexes byExtendingSelection:(BOOL)extend;
@property (readonly, copy) NSIndexSet *selectedColumnIndexes;
@property (readonly, copy) NSIndexSet *selectedRowIndexes;
- (void)deselectColumn:(NSInteger)column;
- (void)deselectRow:(NSInteger)row;
@property (readonly) NSInteger selectedColumn;
@property (readonly) NSInteger selectedRow;
- (BOOL)isColumnSelected:(NSInteger)column;
- (BOOL)isRowSelected:(NSInteger)row;
@property (readonly) NSInteger numberOfSelectedColumns;
@property (readonly) NSInteger numberOfSelectedRows;
#pragma mark -
#pragma mark ***** Properties *****
/* Allow type selection in this tableView. The default value is YES.
*/
@property BOOL allowsTypeSelect API_AVAILABLE(macos(10.5));
/* The table view style. Defaults to NSTableViewStyleAutomatic
*/
@property NSTableViewStyle style API_AVAILABLE(macos(11.0));
/* The effective style when style is NSTableViewStyleAutomatic. Otherwise, it returns the same value as style.
*/
@property (readonly) NSTableViewStyle effectiveStyle API_AVAILABLE(macos(11.0));
/* Gets and sets the current selection highlight style. The default value is NSTableViewSelectionHighlightStyleRegular.
*/
@property NSTableViewSelectionHighlightStyle selectionHighlightStyle API_AVAILABLE(macos(10.5));
/* Gets and sets the dragging destination feedback style. The default value is NSTableViewDraggingDestinationFeedbackStyleRegular for all tables. However, changing the -selectionHighlightStyle to NSTableViewSelectionHighlightStyleSourceList will automatically change the -draggingDestinationFeedbackStyle to NSTableViewDraggingDestinationFeedbackStyleSourceList.
*/
@property NSTableViewDraggingDestinationFeedbackStyle draggingDestinationFeedbackStyle API_AVAILABLE(macos(10.6));
/* Returns the rectangle for 'column'. Returns NSZeroRect if the NSTableColumn at 'column' has -isHidden == YES, or if 'column' is less than 0, or if 'column' is greater than or equal to the number of columns in the NSTableView.
*/
- (NSRect)rectOfColumn:(NSInteger)column;
/* Returns the rectange for 'row'. If 'row' is < 0 or >= [self numberOfRows], then NSZeroRect is returned.
*/
- (NSRect)rectOfRow:(NSInteger)row;
/* Returns the indexes for columns in 'rect'. NSTableColumns which have -isHidden == YES are not returned. If 'rect' is empty, no indexes will be returned. Introduced in Mac OS 10.5.
*/
- (NSIndexSet *)columnIndexesInRect:(NSRect)rect API_AVAILABLE(macos(10.5));
/* Returns the range of rows in 'rect'. If 'rect' is empty, or if there are no rows, an empty range will be returned. If 'rect' is outside of -[NSTableView bounds], 'rect' will be intersected to only look in the bounds.
*/
- (NSRange)rowsInRect:(NSRect)rect;
/* Returns the column index at 'point', or -1 if 'point' is outside of all table columns.
*/
- (NSInteger)columnAtPoint:(NSPoint)point;
- (NSInteger)rowAtPoint:(NSPoint)point;
/* Returns the frame of the cell at 'row' / 'column'. If the 'row' is a "full width" row, the frame returned will be equal to the width of the row. If the NSTableColumn at 'column' has -isHidden == YES, or if the values are outside acceptable ranges, NSZeroRect is returned.
*/
- (NSRect)frameOfCellAtColumn:(NSInteger)column row:(NSInteger)row;
/*
* Persistence methods
*/
@property (nullable, copy) NSTableViewAutosaveName autosaveName;
/* On Mac OS 10.4 and higher, the NSTableColumn width and location is saved. On Mac OS 10.5 and higher, the NSTableColumn 'isHidden' state is also saved. The 'autosaveName' must be set for 'autosaveTableColumns' to take effect.
*/
@property BOOL autosaveTableColumns;
/* On Mac OS 10.5 and higher, NSTableView supports sub-cell focusing. The following set of methods control the focusing.
*/
/* View Based TableView: This method attempts to make the view at 'column/row' the first responder, which will begin editing if the view supports editing.
Cell Based TableView: This method edits the NSCell located at 'column/row' by calling the following NSCell method:
- (void)editWithFrame:(NSRect)rect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)delegate event:(NSEvent *)event;
or, if 'select' is YES:
- (void)selectWithFrame:(NSRect)rect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)delegate start:(NSInteger)selStart length:(NSInteger)selLength;
*/
- (void)editColumn:(NSInteger)column row:(NSInteger)row withEvent:(nullable NSEvent *)event select:(BOOL)select;
/* View Based TableView: This method should not be subclassed or overridden for a "View Based TableView". Instead, row drawing customization can be done by subclassing NSTableRowView.
Cell Based TableView: This method can be overriden to customize drawing for 'row'.
*/
- (void)drawRow:(NSInteger)row clipRect:(NSRect)clipRect;
/* View Based TableView: This method should not be subclassed or overridden for a "View Based TableView". Instead, row drawing customization can be done by subclassing NSTableRowView.
Cell Based TableView: This method can be overriden to customize selection highlighting.
10.10: This method will not be called if the selectionHighlightStyle is set to NSTableViewSelectionHighlightStyleSourceList.
*/
- (void)highlightSelectionInClipRect:(NSRect)clipRect;
/* Override to customize grid drawing.
*/
- (void)drawGridInClipRect:(NSRect)clipRect;
/* Override to customize background drawing.
*/
- (void)drawBackgroundInClipRect:(NSRect)clipRect;
#pragma mark -
#pragma mark ***** View Based TableView Support *****
/* View Based TableView: Access to a view (or row view) for a particular 'row' / 'column'. Returns 'nil' if there is no view at that location. An exception will be thrown if 'row' is not within the numberOfRows. The returned result is always an 'id' for easy assignment to local types, however, -viewAtColumn:row: will always return an NSView, and rowViewAtRow: will always return an NSTableRowView (or subclass thereof). The returned result should generally not be held onto for longer than the current run loop cycle.
This method will first attempt to return a currently displayed view in the visible area. If there is no visible view, and makeIfNecessary is YES, a prepared temporary view is returned. If makeIfNecessary is NO, and the view is not visible, nil will be returned. In general, makeIfNecessary should be YES if you require a resulting view, and NO if you only want to update properties on a view only if it is available (generally this means it is visible).
*/
- (nullable __kindof NSView *)viewAtColumn:(NSInteger)column row:(NSInteger)row makeIfNecessary:(BOOL)makeIfNecessary API_AVAILABLE(macos(10.7));
- (nullable __kindof NSTableRowView *)rowViewAtRow:(NSInteger)row makeIfNecessary:(BOOL)makeIfNecessary API_AVAILABLE(macos(10.7));
/* View Based TableView: Access to the row/column for a particular view. Returns -1 if the view is not an instance of, or a subview of NSTableRowView. This is typically needed in the action method for an NSButton (or NSControl) to find out what row (and column) the action should be performed on. The implementation is O(n) where n is the number of visible rows, so this method should generally not be called within a loop.
*/
- (NSInteger)rowForView:(NSView *)view API_AVAILABLE(macos(10.7));
- (NSInteger)columnForView:(NSView *)view API_AVAILABLE(macos(10.7));
/* View Based TableView: Returns an autoreleased view with a particular 'identifier'. Typically the 'identifier' is associated with a particular "cell view" in IB. The TableView will automatically instantiate the embedded view with the provided owner. This method will typically be called by the delegate in -viewForTableColumn:row:, but it can also be overridden to provide custom views for a particular 'identifier'. This method may also return a reused view with the same 'identifier' that was no longer available on screen. 'identifier' can not be nil. Note that 'owner' will get an 'awakeFromNib:' call each time the object is instantiated.
*/
- (nullable __kindof NSView *)makeViewWithIdentifier:(NSUserInterfaceItemIdentifier)identifier owner:(nullable id)owner API_AVAILABLE(macos(10.7));
/* Enumerates all available NSTableRowViews. This includes all views in the -visibleRect, however, it may also include ones that are "in flight" due to animations or other various attributes of the table.
*/
- (void)enumerateAvailableRowViewsUsingBlock:(void (NS_NOESCAPE ^)(__kindof NSTableRowView *rowView, NSInteger row))handler API_AVAILABLE(macos(10.7));
/* View Based TableView: Group rows can optionally appear floating. Group rows are rows that the delegate responds YES to tableView:isGroupRow:. NSOutlineView will only float expandable group rows that are expanded. The default value is YES. This property is encoded and decoded in the nib.
*/
@property BOOL floatsGroupRows API_AVAILABLE(macos(10.7));
/* View Based TableView: rowActionsVisible can be queried to determine if the "row actions" (see: tableView:rowActionsForRow:edge:) are visible or not. Set rowActionsVisible=NO to hide the row actions. Setting rowActionsVisible=YES is currently not supported and will throw an exception. This property is not encoded in the nib.
*/
@property BOOL rowActionsVisible API_AVAILABLE(macos(10.11));
#pragma mark -
#pragma mark ***** Insert / Remove / Delete Rows *****
/* NSTableView Animation Options */
typedef NS_OPTIONS(NSUInteger, NSTableViewAnimationOptions) {
/* Use to not apply any animation effect (the default). Specifying any animation from the effect groups below negates this effect.
*/
NSTableViewAnimationEffectNone = 0x0,
/* Row animation Effect (optional). The effect can be combined with other any NSTableViewRowAnimationSlide* option.
*/
NSTableViewAnimationEffectFade = 0x1, // Fades in new rows.
NSTableViewAnimationEffectGap = 0x2, // Creates a gap for newly inserted rows. This is useful for drag and drop animations that animate to a newly opened gap and should be used in -tableView:acceptDrop:row:dropOperation:.
/* Row Animation Sliding (optional). Currently only one option from this group may be specified at a time.
*/
NSTableViewAnimationSlideUp = 0x10, // Animates a row in or out by sliding upward.
NSTableViewAnimationSlideDown = 0x20, // Animates a row in or out by sliding downward.
NSTableViewAnimationSlideLeft = 0x30, // Animates a row in by sliding from the left. Animates a row out by sliding towards the left.
NSTableViewAnimationSlideRight = 0x40, // Animates a row in by sliding from the right. Animates a row out by sliding towards the right.
} API_AVAILABLE(macos(10.7));
/* View Based TableView: Multiple row changes (inserts/deletes/moves/scrolling) can be animated simultaneously by surrounding calls around a beginUpdates/endUpdates pair. When changing rows, the prior state before -beginUpdates is the starting point assumed for all deletion and move calls. Calls are nestable. -selectedRowIndexes is properly maintained based on the series of inserts/deletes/moves. If a selected row is deleted, a selection changed notification will happen after endUpdates is called. It is not necessary to call beginUpdates/endUpdates if only one insertion/deletion/move is happening. Note that these methods should be called to reflect changes in your model; they do not make any underlying model changes.
Cell Based TableView: Any row modifications must first be wrapped in a -beginUpdates/-endUpdates block -- this is required to properly maintain state and to allow animations to happen.
*/
- (void)beginUpdates API_AVAILABLE(macos(10.7));
- (void)endUpdates API_AVAILABLE(macos(10.7));
/* Inserts a new rows located at the final positions passed to by 'indexes'. This is similar to NSMutableArray's -insertObjects:atIndexes: The -numberOfRows in the TableView will automatically be increased by the count in 'indexes'. Calling this method multiple times within the same beginUpdates/endUpdates block is allowed, and changes are processed incrementally. This method should not be called for NSOutlineView (use -insertItemsAtIndexes:inParent:withAnimation: instead). The "Cell Based TableView" must first call -beginUpdates before calling this method. This method can also be used when "usesStaticContents=YES".
*/
- (void)insertRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)animationOptions API_AVAILABLE(macos(10.7));
/* Removes a row currently at each row in 'indexes'. This is similar to NSMutableArray's -removeObjectsAtIndexes:. The row indexes should be with respect to the current state displayed in the TableView, and not the final state (since the rows do not exist in the final state). The -numberOfRows in the TableView will automatically be decreased by the count in 'indexes'. Calling this method multiple times within the same beginUpdates/endUpdates block is allowed, and changes are processed incrementally. This method should not be called for NSOutlineView (use -removeItemsAtIndexes:inParent:withAnimation: instead). The "Cell Based TableView" must first call -beginUpdates before calling this method. This method can also be used when "usesStaticContents=YES".
*/
- (void)removeRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)animationOptions API_AVAILABLE(macos(10.7));
/* Moves a row from the prior 'oldIndex' to 'newIndex' in an animated fashion (if needed). This is similar to removing a row at 'oldIndex' and inserting it back at 'newIndex', except the same view is used and simply has its position updated to the new location. This method can be called multiple times within the same beginUpdates/endUpdates block. This method should not be called for NSOutlineView (use -moveItemAtIndex:inParent:toIndex:inParent: instead). The "Cell Based TableView" must first call -beginUpdates before calling this method. This method can also be used when "usesStaticContents=YES".
*/
- (void)moveRowAtIndex:(NSInteger)oldIndex toIndex:(NSInteger)newIndex API_AVAILABLE(macos(10.7));
/* View Based TableView: API to hide and unhide rows. Sometimes, it is better or easier to simply hide a row instead of permanently removing it from the table. Hiding it allows the model to not change, but the UI to appear as though it doesn't exist. Hidden rows will have a zero height, and not be selectable by the user (but can still be programmatically selected). Be aware that hiding a selected row will leave it selected. Hiding a row will call the delegate methods tableView:didRemoveRowView:forRow:, and unhiding will subsequently call tableView:didAddRowView:forRow:.
*/
- (void)hideRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)rowAnimation API_AVAILABLE(macos(10.11));
- (void)unhideRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)rowAnimation API_AVAILABLE(macos(10.11));
/* Returns the indexes that are currently hidden. Indexes are hidden by calling hideRowsAtIndexes:. Sometimes during drag and drop operations certain indexes will be automatically hidden.
*/
@property (readonly, copy) NSIndexSet *hiddenRowIndexes API_AVAILABLE(macos(10.11));
/* View Based TableView: Registers (or associates) the 'nib' with 'identifier' so the table can instantiate views from it when a view with 'identifier' is requested. Generally, this means one calls -makeViewWithIdentifier:'identifier' owner:, and there was no NIB created at design time for this particular table view that could be found. This allows dynamic loading of nibs that can be associated with the table. To remove a previously associated NIB for a given identifier, pass in 'nil' for the nib value.
*/
- (void)registerNib:(nullable NSNib *)nib forIdentifier:(NSUserInterfaceItemIdentifier)identifier API_AVAILABLE(macos(10.8));
/* View Based TableView: Returns a dictionary of all registered nibs. The keys are the identifier, and the value is the NSNib that is registered.
*/
@property (nullable, readonly, copy) NSDictionary<NSUserInterfaceItemIdentifier, NSNib *> *registeredNibsByIdentifier API_AVAILABLE(macos(10.8));
/* View Based TableView: The subclass can implement this method to be alerted when a new 'rowView' has been added to the table. At this point, the subclass can choose to add in extra views, or modify any properties on 'rowView'. Be sure to call 'super'.
*/
- (void)didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row API_AVAILABLE(macos(10.7));
/* View Based TableView: The subclass can implement this method to be alerted when 'rowView' has been removed from the table. The removed 'rowView' may be reused by the table, so any additionally inserted views should be removed at this point. A 'row' parameter is included. 'row' will be '-1' for rows that are being deleted from the table, and no longer have a valid row, otherwise it will be the valid row that is being removed due to it being moved off screen. Be sure to call 'super'.
*/
- (void)didRemoveRowView:(NSTableRowView *)rowView forRow:(NSInteger)row API_AVAILABLE(macos(10.7));
/* View Based TableView: The table view keeps all views added to the table around while usesStaticContents=YES. Views can be removed by calling removeRowsAtIndexes:withAnimation:. The datasource does not need to implement numberOfRowsInTableView: when usesStaticContents=YES. Static views are encoded and decoded with the table view. Views can also dynamically be inserted into the table view by using insertRowIndexes:withAnimation:, however, this requires an implementation of tableView:viewForTableColumn:row: to provide the newly inserted view, which is then kept around statically.
*/
@property BOOL usesStaticContents API_AVAILABLE(macos(10.10));
/* Get and set the user interface layout direction. When set to NSUserInterfaceLayoutDirectionRightToLeft, the Table View will flip the visual order of the table columns, while the logical order remains as it was. For applications linked against 10.11 or earlier, NSTableView will ignore this property and always render in left-to-right.
*/
@property NSUserInterfaceLayoutDirection userInterfaceLayoutDirection API_AVAILABLE(macos(10.8));
/* View Based TableViews: When set to YES, the table will utilize autolayout for the row heights. Set the rowHeight property to provide an estimated row height for views that are not yet loaded. This is not required, but it is recommended in order to provide a proper estimate for the scroll bars. The delegate method -tableView:heightOfRow: can still be used to provide a more specific estimated row height. Note that a rowView's height is set to the rowHeight plus intercellSpacing.height, so an estimated rowHeight should have the intercellSpacing.height subtracted from it. The default value is NO. This value is encoded.
*/
@property BOOL usesAutomaticRowHeights API_AVAILABLE(macos(10.13));
@end
#pragma mark -
@protocol NSTableViewDelegate <NSControlTextEditingDelegate>
@optional
#pragma mark -
#pragma mark ***** View Based TableView Support *****
/* View Based TableView:
Non-bindings: This method is required if you wish to turn on the use of NSViews instead of NSCells. The implementation of this method will usually call -[tableView makeViewWithIdentifier:[tableColumn identifier] owner:self] in order to reuse a previous view, or automatically unarchive an associated prototype view for that identifier. The -frame of the returned view is not important, and it will be automatically set by the table. 'tableColumn' will be nil if the row is a group row. Returning nil is acceptable, and a view will not be shown at that location. The view's properties should be properly set up before returning the result.
Bindings: This method is optional if at least one identifier has been associated with the TableView at design time. If this method is not implemented, the table will automatically call -[self makeViewWithIdentifier:[tableColumn identifier] owner:[tableView delegate]] to attempt to reuse a previous view, or automatically unarchive an associated prototype view. If the method is implemented, the developer can setup properties that aren't using bindings.
The autoresizingMask of the returned view will automatically be set to NSViewHeightSizable to resize properly on row height changes.
*/
- (nullable NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row API_AVAILABLE(macos(10.7));
/* View Based TableView: The delegate can optionally implement this method to return a custom NSTableRowView for a particular 'row'. The reuse queue can be used in the same way as documented in tableView:viewForTableColumn:row:. The returned view will have attributes properly set to it before it is added to the tableView. Returning nil is acceptable. If nil is returned, or this method isn't implemented, a regular NSTableRowView will be created and used.
*/
- (nullable NSTableRowView *)tableView:(NSTableView *)tableView rowViewForRow:(NSInteger)row API_AVAILABLE(macos(10.7));
/* View Based TableView: Optional: This delegate method can be used to know when a new 'rowView' has been added to the table. At this point, you can choose to add in extra views, or modify any properties on 'rowView'.
*/
- (void)tableView:(NSTableView *)tableView didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row API_AVAILABLE(macos(10.7));
/* View Based TableView: Optional: This delegate method can be used to know when 'rowView' has been removed from the table. The removed 'rowView' may be reused by the table so any additionally inserted views should be removed at this point. A 'row' parameter is included. 'row' will be '-1' for rows that are being deleted from the table and no longer have a valid row, otherwise it will be the valid row that is being removed due to it being moved off screen.
*/
- (void)tableView:(NSTableView *)tableView didRemoveRowView:(NSTableRowView *)rowView forRow:(NSInteger)row API_AVAILABLE(macos(10.7));
#pragma mark -
#pragma mark ***** Cell Based TableView Support (deprecated) *****
/* Note: cell-based NSTableViews are deprecated in Mac OS 10.10. Prefer the view-based interface.
*/
/* Allows the delegate to provide further setup for 'cell' in 'tableColumn'/'row'. It is not safe to do drawing inside this method, and you should only setup state for 'cell'.
*/
- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row;
- (BOOL)tableView:(NSTableView *)tableView shouldEditTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row;
/* Optional - Tool Tip Support
When the user pauses over a cell, the value returned from this method will be displayed in a tooltip. 'point' represents the current mouse location in view coordinates. If you don't want a tooltip at that location, return an empty string. On entry, 'rect' represents the proposed active area of the tooltip. By default, rect is computed as [cell drawingRectForBounds:cellFrame]. To control the default active area, you can modify the 'rect' parameter.
*/
- (NSString *)tableView:(NSTableView *)tableView toolTipForCell:(NSCell *)cell rect:(NSRectPointer)rect tableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row mouseLocation:(NSPoint)mouseLocation;
/* Optional - Expansion ToolTip support
View Based TableView: This method is not called or used.
Cell Based TableView: Implement this method and return NO to prevent an expansion tooltip from appearing for a particular cell in a given row and tableColumn. See NSCell.h for more information on expansion tool tips.
*/
- (BOOL)tableView:(NSTableView *)tableView shouldShowCellExpansionForTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row API_AVAILABLE(macos(10.5));
/* Optional - Custom tracking support
It is possible to control the ability to track a cell or not. Normally, only selectable or selected cells can be tracked. If you implement this method, cells which are not selectable or selected can be tracked, and vice-versa. For instance, this allows you to have an NSButtonCell in a table which does not change the selection, but can still be clicked on and tracked.
*/
- (BOOL)tableView:(NSTableView *)tableView shouldTrackCell:(NSCell *)cell forTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row API_AVAILABLE(macos(10.5));
/* Optional - Different cells for each row
A different data cell can be returned for any particular tableColumn and row, or a cell that will be used for the entire row (a full width cell). The returned cell should properly implement copyWithZone:, since the cell may be copied by NSTableView. If the tableColumn is non-nil, and nil is returned, then the table will use the default cell from [tableColumn dataCellForRow:row].
When each row is being drawn, this method will first be called with a nil tableColumn. At this time, you can return a cell that will be used to draw the entire row, acting like a group. If you do return a cell for the 'nil' tableColumn, be prepared to have the other corresponding datasource and delegate methods to be called with a 'nil' tableColumn value. If don't return a cell, the method will be called once for each tableColumn in the tableView, as usual.
*/
- (nullable NSCell *)tableView:(NSTableView *)tableView dataCellForTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row API_AVAILABLE(macos(10.5));
#pragma mark -
#pragma mark ***** Common Delegate Methods *****
/* Optional - called whenever the user is about to change the selection. Return NO to prevent the selection from being changed at that time.
*/
- (BOOL)selectionShouldChangeInTableView:(NSTableView *)tableView;
/* Optional - Return YES if 'row' should be selected and NO if it should not. For better performance and better control over the selection, you should use tableView:selectionIndexesForProposedSelection:.
*/
- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)row;
/* Optional - Return a set of new indexes to select when the user changes the selection with the keyboard or mouse. If implemented, this method will be called instead of tableView:shouldSelectRow:. This method may be called multiple times with one new index added to the existing selection to find out if a particular index can be selected when the user is extending the selection with the keyboard or mouse. Note that 'proposedSelectionIndexes' will contain the entire newly suggested selection, and you can return the existing selection to avoid changing the selection.
*/
- (NSIndexSet *)tableView:(NSTableView *)tableView selectionIndexesForProposedSelection:(NSIndexSet *)proposedSelectionIndexes API_AVAILABLE(macos(10.5));
- (BOOL)tableView:(NSTableView *)tableView shouldSelectTableColumn:(nullable NSTableColumn *)tableColumn;
- (void)tableView:(NSTableView *)tableView mouseDownInHeaderOfTableColumn:(NSTableColumn *)tableColumn;
- (void)tableView:(NSTableView *)tableView didClickTableColumn:(NSTableColumn *)tableColumn;
- (void)tableView:(NSTableView *)tableView didDragTableColumn:(NSTableColumn *)tableColumn;
/* Optional - Variable Row Heights
Implement this method to support a table with varying row heights. The height returned by this method should not include intercell spacing. Returning a height of -1 will default to the rowHeight of the tableView for normal rows, and the system defined height for group rows. Performance Considerations: For large tables in particular, you should make sure that this method is efficient. NSTableView may cache the values this method returns, but this should NOT be depended on, as all values may not be cached. To signal a row height change, call -noteHeightOfRowsWithIndexesChanged:. For a given row, the same row height should always be returned until -noteHeightOfRowsWithIndexesChanged: is called, otherwise unpredictable results will happen. NSTableView automatically invalidates its entire row height cache in -reloadData, and -noteNumberOfRowsChanged.
*/
- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row;
/* Optional - Type select support
Implement this method if you want to control the string that is used for type selection. You may want to change what is searched for based on what is displayed, or simply return nil for that 'tableColumn' or 'row' to not be searched. By default, all cells with text in them are searched. The default value for cell-based tables when this delegate method is not implemented is [[tableView preparedCellAtColumn:tableColumn row:row] stringValue], and this value can be returned from the delegate method if desired.
*/
- (nullable NSString *)tableView:(NSTableView *)tableView typeSelectStringForTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row API_AVAILABLE(macos(10.5));
/* Optional - Type select support
Implement this method if you want to control how type selection works. Return the first row that matches searchString from within the range of startRow to endRow. It is possible for endRow to be less than startRow if the search will wrap. Return -1 when there is no match. Include startRow as a possible match, but do not include endRow. It is not necessary to implement this method in order to support type select.
*/
- (NSInteger)tableView:(NSTableView *)tableView nextTypeSelectMatchFromRow:(NSInteger)startRow toRow:(NSInteger)endRow forString:(NSString *)searchString API_AVAILABLE(macos(10.5));
/* Optional - Type select support
Implement this method if you would like to prevent a type select from happening based on the current event and current search string. Generally, this will be called from keyDown: and the event will be a key event. The search string will be nil if no type select has began.
*/
- (BOOL)tableView:(NSTableView *)tableView shouldTypeSelectForEvent:(NSEvent *)event withCurrentSearchString:(nullable NSString *)searchString API_AVAILABLE(macos(10.5));
/* Optional - Group rows.
Implement this method and return YES to indicate a particular row should have the "group row" style drawn for that row. If the cell in that row is an NSTextFieldCell and contains only a stringValue, the "group row" style attributes will automatically be applied for that cell. Group rows are drawn differently depending on the selectionHighlightStyle. For NSTableViewSelectionHighlightStyleRegular, there is a blue gradient background. For NSTableViewSelectionHighlightStyleSourceList, the text is light blue, and there is no background. Also see the related floatsGroupRows property.
*/
- (BOOL)tableView:(NSTableView *)tableView isGroupRow:(NSInteger)row API_AVAILABLE(macos(10.5));
/* Optional - Autosizing table columns
Implement this method if you want to control how wide a column is made when the user double clicks on the resize divider. By default, NSTableView iterates every row in the table, accesses a cell via preparedCellAtRow:column:, and requests the "cellSize" to find the appropriate largest width to use. For large row counts, a monte carlo simulation is done instead of iterating every row. For performance and accurate results, it is recommended that this method is implemented when using large tables.
*/
- (CGFloat)tableView:(NSTableView *)tableView sizeToFitWidthOfColumn:(NSInteger)column API_AVAILABLE(macos(10.6));
/* Optional - Control of column reordering.
Specifies if the column can be reordered to a new location, or not. 'columnIndex' is the column that is being dragged. The actual NSTableColumn instance can be retrieved from the [tableView tableColumns] array. 'newColumnIndex' is the new proposed target location for 'columnIndex'. When a column is initially dragged by the user, the delegate is first called with a 'newColumnIndex' of -1. Returning NO will disallow that column from being reordered at all. Returning YES allows it to be reordered, and the delegate will be called again when the column reaches a new location. If this method is not implemented, all columns are considered reorderable.
*/
- (BOOL)tableView:(NSTableView *)tableView shouldReorderColumn:(NSInteger)columnIndex toColumn:(NSInteger)newColumnIndex API_AVAILABLE(macos(10.6));
/* Optional - Row actions for a "swipe to delete" feature to show a button on the left or right of a row to do some action (typically deletion).
View Based TableView: Return an array of NSTableViewRowAction objects to be shown on the ‘edge’, where the NSTableRowActionEdge is either the leading or trailing edge of an NSTableRowView. The edge is determined automatically by the table based on the swipe direction. Return an empty array to not show any actions on a given edge.
*/
- (NSArray<NSTableViewRowAction *> *)tableView:(NSTableView *)tableView rowActionsForRow:(NSInteger)row edge:(NSTableRowActionEdge)edge API_AVAILABLE(macos(10.11));
#pragma mark -
#pragma mark ***** Notifications *****
- (void)tableViewSelectionDidChange:(NSNotification *)notification;
- (void)tableViewColumnDidMove:(NSNotification *)notification;
- (void)tableViewColumnDidResize:(NSNotification *)notification;
/* Optional - Called when the selection is about to be changed, but note, tableViewSelectionIsChanging: is only called when mouse events are changing the selection and not keyboard events.
*/
- (void)tableViewSelectionIsChanging:(NSNotification *)notification;
@end
APPKIT_EXTERN NSNotificationName NSTableViewSelectionDidChangeNotification;
APPKIT_EXTERN NSNotificationName NSTableViewColumnDidMoveNotification; // @"NSOldColumn", @"NSNewColumn"
APPKIT_EXTERN NSNotificationName NSTableViewColumnDidResizeNotification; // @"NSTableColumn", @"NSOldWidth"
APPKIT_EXTERN NSNotificationName NSTableViewSelectionIsChangingNotification;
// The NSTableViewRowViewKey is the key that View Based TableView uses to identify the NIB containing the template row view. You can specify a custom row view (without any code) by associating this key with the appropriate NIB name in IB.
APPKIT_EXTERN NSUserInterfaceItemIdentifier const NSTableViewRowViewKey API_AVAILABLE(macos(10.7)); // @"NSTableViewRowViewKey"
#pragma mark -
@protocol NSTableViewDataSource <NSObject>
@optional
#pragma mark -
#pragma mark ***** Required Methods (unless bindings are used) *****
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView;
/* This method is required for the "Cell Based" TableView, and is optional for the "View Based" TableView. If implemented in the latter case, the value will be set to the view at a given row/column if the view responds to -setObjectValue: (such as NSControl and NSTableCellView). Note that NSTableCellView does not actually display the objectValue, and its value is to be used for bindings. See NSTableCellView.h for more information.
*/
- (nullable id)tableView:(NSTableView *)tableView objectValueForTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row;
#pragma mark -
#pragma mark ***** Optional Methods *****
/* NOTE: This method is not called for the View Based TableView.
*/
- (void)tableView:(NSTableView *)tableView setObjectValue:(nullable id)object forTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row;
/* Sorting support
This is the indication that sorting needs to be done. Typically the data source will sort its data, reload, and adjust selections.
*/
- (void)tableView:(NSTableView *)tableView sortDescriptorsDidChange:(NSArray<NSSortDescriptor *> *)oldDescriptors;
/* Dragging Source Support - Required for multi-image dragging. Implement this method to allow the table to be an NSDraggingSource that supports multiple item dragging. Return a custom object that implements NSPasteboardWriting (or simply use NSPasteboardItem). If this method is implemented, then tableView:writeRowsWithIndexes:toPasteboard: will not be called.
*/
- (nullable id <NSPasteboardWriting>)tableView:(NSTableView *)tableView pasteboardWriterForRow:(NSInteger)row API_AVAILABLE(macos(10.7));
/* Dragging Source Support - Optional. Implement this method to know when the dragging session is about to begin and to potentially modify the dragging session.'rowIndexes' are the row indexes being dragged, excluding rows that were not dragged due to tableView:pasteboardWriterForRow: returning nil. The order will directly match the pasteboard writer array used to begin the dragging session with [NSView beginDraggingSessionWithItems:event:source]. Hence, the order is deterministic, and can be used in -tableView:acceptDrop:row:dropOperation: when enumerating the NSDraggingInfo's pasteboard classes.
*/
- (void)tableView:(NSTableView *)tableView draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint forRowIndexes:(NSIndexSet *)rowIndexes API_AVAILABLE(macos(10.7));
/* Dragging Source Support - Optional. Implement this method to know when the dragging session has ended. This delegate method can be used to know when the dragging source operation ended at a specific location, such as the trash (by checking for an operation of NSDragOperationDelete).
*/
- (void)tableView:(NSTableView *)tableView draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation API_AVAILABLE(macos(10.7));
/* Dragging Destination Support - Required for multi-image dragging. Implement this method to allow the table to update dragging items as they are dragged over the view. Typically this will involve calling [draggingInfo enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:] and setting the draggingItem's imageComponentsProvider to a proper image based on the content. For View Based TableViews, one can use NSTableCellView's -draggingImageComponents. For cell based TableViews, use NSCell's draggingImageComponentsWithFrame:inView:.
*/
- (void)tableView:(NSTableView *)tableView updateDraggingItemsForDrag:(id <NSDraggingInfo>)draggingInfo API_AVAILABLE(macos(10.7));
/* Dragging Source Support - Optional for single-image dragging. Implement this method to support single-image dragging. Use the more modern tableView:pasteboardWriterForRow: to support multi-image dragging. This method is called after it has been determined that a drag should begin, but before the drag has been started. To refuse the drag, return NO. To start a drag, return YES and place the drag data onto the pasteboard (data, owner, etc...). The drag image and other drag related information will be set up and provided by the table view once this call returns with YES. 'rowIndexes' contains the row indexes that will be participating in the drag.
*/
- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard API_DEPRECATED("Use -tableView:pasteboardWriterForRow: instead", macos(10.4, 10.15));
/* Dragging Destination Support - This method is used by NSTableView to determine a valid drop target. Based on the mouse position, the table view will suggest a proposed drop 'row' and 'dropOperation'. This method must return a value that indicates which NSDragOperation the data source will perform. The data source may "re-target" a drop, if desired, by calling setDropRow:dropOperation: and returning something other than NSDragOperationNone. One may choose to re-target for various reasons (eg. for better visual feedback when inserting into a sorted position).
*/
- (NSDragOperation)tableView:(NSTableView *)tableView validateDrop:(id <NSDraggingInfo>)info proposedRow:(NSInteger)row proposedDropOperation:(NSTableViewDropOperation)dropOperation;
/* Dragging Destination Support - This method is called when the mouse is released over an NSTableView that previously decided to allow a drop via the validateDrop method. The data source should incorporate the data from the dragging pasteboard at this time. 'row' and 'dropOperation' contain the values previously set in the validateDrop: method.
*/
- (BOOL)tableView:(NSTableView *)tableView acceptDrop:(id <NSDraggingInfo>)info row:(NSInteger)row dropOperation:(NSTableViewDropOperation)dropOperation;
/* Dragging Destination Support - NSTableView data source objects can support file promised drags by adding NSFilesPromisePboardType to the pasteboard in tableView:writeRowsWithIndexes:toPasteboard:. NSTableView implements -namesOfPromisedFilesDroppedAtDestination: to return the results of this data source method. This method should returns an array of filenames for the created files (filenames only, not full paths). The URL represents the drop location. For more information on file promise dragging, see documentation on the NSDraggingSource protocol and -namesOfPromisedFilesDroppedAtDestination:.
*/
- (NSArray<NSString *> *)tableView:(NSTableView *)tableView namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination forDraggedRowsWithIndexes:(NSIndexSet *)indexSet API_DEPRECATED("Use NSFilePromiseReceiver objects instead", macos(10.0,10.13));
@end
@interface NSObject(NSTableViewDataSourceDeprecated)
/*
* Deprecated delegate methods
*/
/* Deprecated in Mac OS 10.4. You should implement tableView:writeRowsWithIndexes:toPasteboard: instead. See that method for more details.
*/
- (BOOL)tableView:(NSTableView *)tableView writeRows:(NSArray *)rows toPasteboard:(NSPasteboard *)pboard API_DEPRECATED("", macos(10.0,10.4));
@end
/* Deprecated methods */
@interface NSTableView(NSDeprecated)
/* Deprecated in Mac OS 10.3. Calls setGridStyleMask:, setting grid style to either None, or vertical and horizonal solid grid lines as appropriate.
*/
- (void)setDrawsGrid:(BOOL)flag API_DEPRECATED("", macos(10.0,10.3));
/* Deprecated in Mac OS 10.3. Returns YES if gridStyleMask returns anything other than NSTableViewGridNone.
*/
- (BOOL)drawsGrid API_DEPRECATED("", macos(10.0,10.3));
/* Deprecated in Mac OS 10.3. You should use selectColumnIndexes:byExtendingSelection: instead. See that method for more details.
*/
- (void)selectColumn:(NSInteger)column byExtendingSelection:(BOOL)extend API_DEPRECATED("", macos(10.0,10.3));
/* Deprecated in Mac OS 10.3. You should use selectRowIndexes:byExtendingSelection: instead. See that method for more details.
*/
- (void)selectRow:(NSInteger)row byExtendingSelection:(BOOL)extend API_DEPRECATED("", macos(10.0,10.3));
/* Deprecated in Mac OS 10.3. You should use selectedColumnIndexes instead.
*/
- (NSEnumerator *)selectedColumnEnumerator API_DEPRECATED("", macos(10.0,10.3));
/* Deprecated in Mac OS 10.3. You should use selectedRowIndexes instead.
*/
- (NSEnumerator *)selectedRowEnumerator API_DEPRECATED("", macos(10.0,10.3));
/* Deprecated in Mac OS 10.4. You should use / override dragImageForRowsWithIndexes:tableColumns:event:dragImageOffset: instead.
*/
- (nullable NSImage *)dragImageForRows:(NSArray *)dragRows event:(NSEvent *)dragEvent dragImageOffset:(NSPointPointer)dragImageOffset API_DEPRECATED("", macos(10.0,10.4));
/* Deprecated in Mac OS 10.4. You should use setColumnAutoresizingStyle: instead. To preserve compatibility, if flag is YES, This method calls setColumnAutoresizingStyle:NSTableViewUniformColumnAutoresizingStyle. If flag is NO, this method calls setColumnAutoresizingStyle:NSTableViewLastColumnOnlyAutoresizingStyle.
*/
- (void)setAutoresizesAllColumnsToFit:(BOOL)flag API_DEPRECATED("", macos(10.0,10.4));
- (BOOL)autoresizesAllColumnsToFit API_DEPRECATED("", macos(10.0,10.4));
/* Deprecated in Mac OS 10.5. Since an NSTableColumn can have visible=NO, it is no longer possible to return a valid range of columns given a rect. Use columnIndexesInRect:
*/
- (NSRange)columnsInRect:(NSRect)rect API_DEPRECATED("", macos(10.0,10.5));
/* Cell-based NSTableViews are deprecated in Mac OS 10.10. Use view-based NSTableViews instead.
*/
- (nullable NSCell *)preparedCellAtColumn:(NSInteger)column row:(NSInteger)row API_DEPRECATED("Use View Based TableView and -viewAtColumn:row:", macos(10.5,10.10));
- (BOOL)textShouldBeginEditing:(NSText *)textObject API_DEPRECATED("Use a View Based TableView with an NSTextField", macos(10.0,10.10));
- (BOOL)textShouldEndEditing:(NSText *)textObject API_DEPRECATED("Use a View Based TableView with an NSTextField", macos(10.0,10.10));
- (void)textDidBeginEditing:(NSNotification *)notification API_DEPRECATED("Use a View Based TableView with an NSTextField", macos(10.0,10.10));
- (void)textDidEndEditing:(NSNotification *)notification API_DEPRECATED("Use a View Based TableView with an NSTextField", macos(10.0,10.10));
- (void)textDidChange:(NSNotification *)notification API_DEPRECATED("Use a View Based TableView with an NSTextField", macos(10.0,10.10));
- (BOOL)shouldFocusCell:(NSCell *)cell atColumn:(NSInteger)column row:(NSInteger)row API_DEPRECATED("Use a View Based TableView; observe the window’s firstResponder for focus change notifications", macos(10.6,10.10));
- (NSInteger)focusedColumn API_DEPRECATED("Use a View Based TableView and observe the window.firstResponder", macos(10.5,10.10));
- (void)setFocusedColumn:(NSInteger)focusedColumn API_DEPRECATED("Use a View Based TableView; make a particular view the first responder with [window makeFirstResponder:view] to focus it.", macos(10.6,10.10));
- (void)performClickOnCellAtColumn:(NSInteger)column row:(NSInteger)row API_DEPRECATED("Use a View Based TableView; directly interact with a particular view as required and call -performClick: on it, if necessary", macos(10.6,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/NSMenuItem.h | /*
NSMenuItem.h
Application Kit
Copyright (c) 1996-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSUserInterfaceItemIdentification.h>
#import <AppKit/NSUserInterfaceValidation.h>
#import <AppKit/NSView.h>
#import <AppKit/NSCell.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSMenu;
@class NSImage, NSAttributedString, NSView;
@interface NSMenuItem : NSObject <NSCopying, NSCoding, NSValidatedUserInterfaceItem, NSUserInterfaceItemIdentification, NSAccessibilityElement, NSAccessibility>
@property (class) BOOL usesUserKeyEquivalents;
+ (NSMenuItem *)separatorItem;
- (instancetype)initWithTitle:(NSString *)string action:(nullable SEL)selector keyEquivalent:(NSString *)charCode NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
/* Never call the set method directly it is there only for subclassers.
*/
@property (nullable, assign) NSMenu *menu;
@property (readonly) BOOL hasSubmenu;
@property (nullable, strong) NSMenu *submenu;
/* Returns the NSMenuItem whose submenu contains the receiver, or nil if the receiver does not have a parent item.
*/
@property (nullable, readonly, assign) NSMenuItem *parentItem API_AVAILABLE(macos(10.6));
@property (copy) NSString *title;
@property (nullable, copy) NSAttributedString *attributedTitle;
@property (getter=isSeparatorItem, readonly) BOOL separatorItem;
@property (copy) NSString *keyEquivalent;
@property NSEventModifierFlags keyEquivalentModifierMask;
@property (readonly, copy) NSString *userKeyEquivalent;
/* By default, when a menu item is hidden, its key equivalent is ignored. By setting this property to YES, you allow a hidden item's key equivalent to be considered when searching for a menu item that matches a key event. This is useful to provide a keyboard shortcut when it's not necessary to have a visible menu item in the menubar. Note that Apple HI guidelines generally recommend that keyboard shortcuts should be clearly indicated in a menu, so this property should be used only rarely. */
@property BOOL allowsKeyEquivalentWhenHidden API_AVAILABLE(macos(10.13));
/* Suppose the system detects a given key equivalent that is not reachable in the current keyboard layout; it will localize the key equivalent to something reachable. By setting this property to NO, you will opt-out this menu item from the system-provided localization. YES by default for apps linked against 12.0 and later SDK. */
@property BOOL allowsAutomaticKeyEquivalentLocalization API_AVAILABLE(macos(12.0));
/* Suppose the system detects a given key equivalent with the following input string [ ] { } ( ) < > ← → in a right-to-left user interface environment (NSUserInterfaceLayoutDirectionRightToLeft); in that case, the system will automatically mirror the key equivalent. For example, a pair of menu items with key equivalents { and } will be localized to } and { in a right-to-left user interface. By setting this property to NO, you will opt-out this menu item of automatically mirroring in RTL. It would be best only to do this if your shortcut action will result in some sort of directional change in the UI, e.g. text alignment or a D-pad in a game. YES by default for apps linked against 12.0 and later SDK. */
@property BOOL allowsAutomaticKeyEquivalentMirroring API_AVAILABLE(macos(12.0));
@property (nullable, strong) NSImage *image;
@property NSControlStateValue state;
@property (null_resettable, strong) NSImage *onStateImage; // checkmark by default
@property (nullable, strong) NSImage *offStateImage; // none by default
@property (null_resettable, strong) NSImage *mixedStateImage; // horizontal line by default
@property (getter=isEnabled) BOOL enabled;
@property (getter=isAlternate) BOOL alternate;
@property NSInteger indentationLevel;
@property (nullable, weak) id target;
@property (nullable) SEL action;
@property NSInteger tag;
@property (nullable, strong) id representedObject;
/* Set (and get) the view for a menu item. By default, a menu item has a nil view.
A menu item with a view does not draw its title, state, font, or other standard drawing attributes, and assigns drawing responsibility entirely to the view. Keyboard equivalents and type-select continue to use the key equivalent and title as normal.
A menu item with a view sizes itself according to the view's frame, and the width of the other menu items. The menu item will always be at least as wide as its view, but it may be wider. If you want your view to auto-expand to fill the menu item, then make sure that its autoresizing mask has NSViewWidthSizable set; in that case, the view's width at the time setView: is called will be treated as the minimum width for the view. A menu will resize itself as its containing views change frame size. Changes to the view's frame during tracking are reflected immediately in the menu.
A view in a menu item will receive mouse and keyboard events normally. During non-sticky menu tracking (manipulating menus with the mouse button held down), a view in a menu item will receive mouseDragged: events.
Animation is possible via the usual mechanism (set a timer to call setNeedsDisplay: or display), but because menu tracking occurs in the NSEventTrackingRunLoopMode, you must add the timer to the run loop in that mode.
When the menu is opened, the view is added to a window; when the menu is closed the view is removed from the window. Override viewDidMoveToWindow in your view for a convenient place to start/stop animations, reset tracking rects, etc., but do not attempt to move or otherwise modify the window.
When a menu item is copied via NSCopying, any attached view is copied via archiving/unarchiving. Menu item views are not supported in the Dock menu. */
@property (nullable, strong) NSView *view API_AVAILABLE(macos(10.5));
/* Indicates whether the menu item should be drawn highlighted or not. */
@property (getter=isHighlighted, readonly) BOOL highlighted API_AVAILABLE(macos(10.5));
/* Set (and get) the visibility of a menu item. Hidden menu items (or items with a hidden superitem) do not appear in a menu and do not participate in command key matching. isHiddenOrHasHiddenAncestor returns YES if the item is hidden or any of its superitems are hidden. */
@property (getter=isHidden) BOOL hidden API_AVAILABLE(macos(10.5));
@property (getter=isHiddenOrHasHiddenAncestor, readonly) BOOL hiddenOrHasHiddenAncestor API_AVAILABLE(macos(10.5));
@property (nullable, copy) NSString *toolTip;
@end
@interface NSView (NSViewEnclosingMenuItem)
/* Returns the menu item containing the receiver or any of its superviews in the view hierarchy, or nil if the receiver's view hierarchy is not in a menu item. */
@property (nullable, readonly, strong) NSMenuItem *enclosingMenuItem API_AVAILABLE(macos(10.5));
@end
APPKIT_EXTERN NSUserInterfaceItemIdentifier const NSMenuItemImportFromDeviceIdentifier API_AVAILABLE(macos(10.14)); // Continuity Camera menu item.
// The NSMenuItem protocol is deprecated. Use the NSMenuItem class in your code.
#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 2)
API_DEPRECATED("", macos(10.0,10.6))
#endif
@protocol NSMenuItem;
/* The following methods are deprecated. They have never done anything useful in Mac OS X. */
@interface NSMenuItem (NSDeprecated)
- (void)setMnemonicLocation:(NSUInteger)location API_DEPRECATED("", macos(10.0,10.6));
- (NSUInteger)mnemonicLocation API_DEPRECATED("", macos(10.0,10.6));
- (null_unspecified NSString *)mnemonic API_DEPRECATED("", macos(10.0,10.6));
- (void)setTitleWithMnemonic:(NSString *)stringWithAmpersand API_DEPRECATED_WITH_REPLACEMENT("setTitle:", macos(10.0,10.13));
@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/NSTableHeaderView.h | /*
NSTableHeaderView.h
Application Kit
Copyright (c) 1995-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSView.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSTableView;
@class NSColor;
@class NSImage;
@class NSCursor;
@interface NSTableHeaderView : NSView <NSViewToolTipOwner>
@property (nullable, weak) NSTableView *tableView;
// Returns -1 if there is no column being dragged
@property (readonly) NSInteger draggedColumn;
@property (readonly) CGFloat draggedDistance;
@property (readonly) NSInteger resizedColumn;
- (NSRect)headerRectOfColumn:(NSInteger)column;
- (NSInteger)columnAtPoint:(NSPoint)point;
@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/NSTextContent.h | /*
NSTextContent.h
Application Kit
Copyright (c) 2020-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <AppKit/AppKitDefines.h>
#import <Availability.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
typedef NSString* NSTextContentType NS_TYPED_ENUM;
APPKIT_EXTERN API_AVAILABLE(macos(11.0)) NSTextContentType const NSTextContentTypeUsername;
APPKIT_EXTERN API_AVAILABLE(macos(11.0)) NSTextContentType const NSTextContentTypePassword;
APPKIT_EXTERN API_AVAILABLE(macos(11.0)) NSTextContentType const NSTextContentTypeOneTimeCode;
@protocol NSTextContent
@property (nullable, copy) NSTextContentType contentType API_AVAILABLE(macos(11.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/NSTintConfiguration.h | /*
NSTintConfiguration.h
Application Kit
Copyright (c) 2020-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSColor.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
API_AVAILABLE(macos(11.0))
@interface NSTintConfiguration : NSObject <NSCopying, NSSecureCoding>
/*!
Specifies that content should be tinted using the system default for its context.
For example, a source list icon's default tint matches the active Accent Color.
*/
@property (class, readonly, strong) NSTintConfiguration *defaultTintConfiguration;
/*!
Specifies that content should prefer a monochrome appearance.
Monochrome content remains monochrome regardless of the system Accent Color.
*/
@property (class, readonly, strong) NSTintConfiguration *monochromeTintConfiguration;
/*!
Specifies that content should be tinted with a particular color whenever the app's preferred Accent Color is in use, i.e. when the system Accent Color is configured to "Multicolor". If the system Accent Color is configured to any other color, this tint configuration defers to the Accent Color.
This type of configuration should be used for custom colors that are designed to match an app-specific Accent Color, but would mismatch a user-selected color.
*/
+ (instancetype)tintConfigurationWithPreferredColor:(NSColor *)color;
/*!
Specifies that content should be tinted with a specific color value.
The specified color value is used regardless of the system Accent Color.
*/
+ (instancetype)tintConfigurationWithFixedColor:(NSColor *)color;
/*!
The base NSColor supplied when creating the tint configuration object. If the receiver wasn't created using a base NSColor, this property returns nil.
*/
@property (readonly, nullable, strong) NSColor *baseTintColor;
/*!
An equivalent NSColor matching the effective content tint of the receiver. If the receiver can't be represented as a NSColor, this property returns nil.
*/
@property (readonly, nullable, strong) NSColor *equivalentContentTintColor;
/*!
If YES, the tint configuration alters its effect based on the user's preferred Accent Color. Otherwise, the tint configuration produces a constant effect regardless of the Accent Color preference.
*/
@property (readonly) BOOL adaptsToUserAccentColor;
@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/NSRunningApplication.h | /*
NSRunningApplication.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
/* NSRunningApplication is a class to manipulate and provide information for a single instance of an application. Only user applications are tracked; this does not provide information about every process on the system.
Some properties of an application are fixed, such as the bundle identifier. Other properties may vary over time, such as whether the app is hidden. Properties that vary can be observed with KVO, in which case the description comment for the method will mention it.
Properties that vary over time are inherently race-prone. For example, a hidden app may unhide itself at any time. To ameliorate this, properties persist until the next turn of the main run loop in a common mode. For example, if you repeatedly poll an unhidden app for its hidden property without allowing the run loop to run, it will continue to return NO, even if the app hides, until the next turn of the run loop.
NSRunningApplication is thread safe, in that its properties are returned atomically. However, it is still subject to the main run loop policy described above. If you access an instance of NSRunningApplication from a background thread, be aware that its time-varying properties may change from under you as the main run loop runs (or not).
An NSRunningApplication instance remains valid after the application exits. However, most properties lose their significance, and some properties may not be available on a terminated application.
To access the list of all running applications, use the -runningApplications method on NSWorkspace.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <AppKit/NSWorkspace.h>
#import <AppKit/AppKitDefines.h>
/* The following flags are for activateWithOptions:. */
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
typedef NS_OPTIONS(NSUInteger, NSApplicationActivationOptions) {
/* By default, activation brings only the main and key windows forward. If you specify NSApplicationActivateAllWindows, all of the application's windows are brought forward. */
NSApplicationActivateAllWindows = 1 << 0,
/* By default, activation deactivates the calling app (assuming it was active), and then the new app is activated only if there is no currently active application. This prevents the new app from stealing focus from the user, if the app is slow to activate and the user has switched to a different app in the interim. However, if you specify NSApplicationActivateIgnoringOtherApps, the application is activated regardless of the currently active app, potentially stealing focus from the user.
You ALMOST NEVER want to pass this flag, because stealing key focus produces a very bad user experience. */
NSApplicationActivateIgnoringOtherApps = 1 << 1
};
/* The following activation policies control whether and how an application may be activated. They are determined by the Info.plist. */
typedef NS_ENUM(NSInteger, NSApplicationActivationPolicy) {
/* The application is an ordinary app that appears in the Dock and may have a user interface. This is the default for bundled apps, unless overridden in the Info.plist. */
NSApplicationActivationPolicyRegular,
/* The application does not appear in the Dock and does not have a menu bar, but it may be activated programmatically or by clicking on one of its windows. This corresponds to LSUIElement=1 in the Info.plist. */
NSApplicationActivationPolicyAccessory,
/* The application does not appear in the Dock and may not create windows or be activated. This corresponds to LSBackgroundOnly=1 in the Info.plist. This is also the default for unbundled executables that do not have Info.plists. */
NSApplicationActivationPolicyProhibited
};
@class NSLock, NSDate, NSImage, NSURL;
API_AVAILABLE(macos(10.6))
@interface NSRunningApplication : NSObject
/* Indicates that the process is an exited application. This is observable through KVO. */
@property (readonly, getter=isTerminated) BOOL terminated;
/* Indicates that the process is finished launching, which corresponds to the NSApplicationDidFinishLaunching internal notification. This is observable through KVO. Some applications do not post this notification and so are never reported as finished launching. */
@property (readonly, getter=isFinishedLaunching) BOOL finishedLaunching;
/* Indicates whether the application is currently hidden. This is observable through KVO. */
@property (readonly, getter=isHidden) BOOL hidden;
/* Indicates whether the application is currently frontmost. This is observable through KVO. */
@property (readonly, getter=isActive) BOOL active;
/* Indicates whether the application currently owns the menu bar. This is observable through KVO. */
@property (readonly) BOOL ownsMenuBar API_AVAILABLE(macos(10.7));
/* Indicates the activation policy of the application. This is observable through KVO (the type is usually fixed, but may be changed through a call to -[NSApplication setActivationPolicy:]). */
@property (readonly) NSApplicationActivationPolicy activationPolicy;
/* Indicates the name of the application. This is dependent on the current localization of the referenced app, and is suitable for presentation to the user. */
@property (nullable, readonly, copy) NSString *localizedName;
/* Indicates the CFBundleIdentifier of the application, or nil if the application does not have an Info.plist. */
@property (nullable, readonly, copy) NSString *bundleIdentifier;
/* Indicates the URL to the application's bundle, or nil if the application does not have a bundle. */
@property (nullable, readonly, copy) NSURL *bundleURL;
/* Indicates the URL to the application's executable. */
@property (nullable, readonly, copy) NSURL *executableURL;
/* Indicates the process identifier (pid) of the application. Do not rely on this for comparing processes. Use isEqual: instead. Not all applications have a pid. Applications without a pid return -1 from this method. This is observable through KVO (an application's pid may change if it is automatically terminated). */
@property (readonly) pid_t processIdentifier;
/* Indicates the date when the application was launched. This property is not available for all applications. Specifically, it is not available for applications that were launched without going through LaunchServices. */
@property (nullable, readonly, copy) NSDate *launchDate;
/* Returns the icon of the application. */
@property (nullable, readonly, strong) NSImage *icon;
/* Indicates the executing processor architecture for the application, as an NSBundleExecutableArchitecture from NSBundle.h. */
@property (readonly) NSInteger executableArchitecture;
/* Attempts to hide or unhide the receiver. These methods return true if the request to hide or unhide was successfully sent, false if not (for example, if the application has quit, or is of a type that cannot be unhidden). */
- (BOOL)hide;
- (BOOL)unhide;
/* Attempts to activate the receiver. This method return true if the request to activate was successfully sent, false if not (for example, if the application has quit, or is of a type that cannot be activated). */
- (BOOL)activateWithOptions:(NSApplicationActivationOptions)options;
/* Attempts to quit the receiver normally. This method returns true if the request was successfully sent, false if not (for example, if the application is no longer running). This method may return before the receiver exits; you should observe the terminated property or listen for the notification to detect when the app has exited. */
- (BOOL)terminate;
/* Attempts to force the receiver to quit. This method returns true if the request was successfully sent, false if not (for example, if the application is no longer running). This method may return before the receiver exits; you should observe the terminated property or listen for the notification to detect when the app has exited. */
- (BOOL)forceTerminate;
/* Returns an array of currently running applications with the given bundle identifier, or an empty array if no apps match. */
+ (NSArray<NSRunningApplication *> *)runningApplicationsWithBundleIdentifier:(NSString *)bundleIdentifier;
/* Returns the running application with the given process identifier, or nil if no application has that pid. Applications that do not have PIDs cannot be returned from this method. */
+ (nullable instancetype)runningApplicationWithProcessIdentifier:(pid_t)pid;
/* Returns an NSRunningApplication representing this application. */
@property (class, readonly, strong) __kindof NSRunningApplication *currentApplication;
/*
* Cause any applications that are invisibly still running (see NSProcessInfo.h automatic termination methods and docs) to terminate as if triggered by system memory pressure
* This is intended for installer apps and the like to make sure that nothing is unexpectedly relying on the files they're replacing
*/
+ (void) terminateAutomaticallyTerminableApplications;
@end
@interface NSWorkspace (NSWorkspaceRunningApplications)
/* Returns an array of NSRunningApplications representing currently running applications. The order of the array is unspecified, but it is stable, meaning that the relative order of particular applications will not change across multiple calls to runningApplications.
Similar to NSRunningApplication's properties, this property will only change when the main run loop is run in a common mode. Instead of polling, use key-value observing to be notified of changes to this array property.
This property is thread safe, in that it may be called from background threads and the result is returned atomically. This property is observable through KVO.
*/
@property (readonly, copy) NSArray<NSRunningApplication *> *runningApplications 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/NSErrors.h | /*
NSErrors.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/AppKitDefines.h>
@class NSString;
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
// The following strings are the names of exceptions the AppKit can raise
APPKIT_EXTERN NSExceptionName NSTextLineTooLongException;
APPKIT_EXTERN NSExceptionName NSTextNoSelectionException;
APPKIT_EXTERN NSExceptionName NSWordTablesWriteException;
APPKIT_EXTERN NSExceptionName NSWordTablesReadException;
APPKIT_EXTERN NSExceptionName NSTextReadException;
APPKIT_EXTERN NSExceptionName NSTextWriteException;
APPKIT_EXTERN NSExceptionName NSPasteboardCommunicationException;
APPKIT_EXTERN NSExceptionName NSPrintingCommunicationException;
APPKIT_EXTERN NSExceptionName NSAbortModalException;
APPKIT_EXTERN NSExceptionName NSAbortPrintingException;
APPKIT_EXTERN NSExceptionName NSIllegalSelectorException;
APPKIT_EXTERN NSExceptionName NSAppKitVirtualMemoryException;
APPKIT_EXTERN NSExceptionName NSBadRTFDirectiveException;
APPKIT_EXTERN NSExceptionName NSBadRTFFontTableException;
APPKIT_EXTERN NSExceptionName NSBadRTFStyleSheetException;
APPKIT_EXTERN NSExceptionName NSTypedStreamVersionException;
APPKIT_EXTERN NSExceptionName NSTIFFException;
APPKIT_EXTERN NSExceptionName NSPrintPackageException;
APPKIT_EXTERN NSExceptionName NSBadRTFColorTableException;
APPKIT_EXTERN NSExceptionName NSDraggingException;
APPKIT_EXTERN NSExceptionName NSColorListIOException;
APPKIT_EXTERN NSExceptionName NSColorListNotEditableException;
APPKIT_EXTERN NSExceptionName NSBadBitmapParametersException;
APPKIT_EXTERN NSExceptionName NSWindowServerCommunicationException;
APPKIT_EXTERN NSExceptionName NSFontUnavailableException;
APPKIT_EXTERN NSExceptionName NSPPDIncludeNotFoundException;
APPKIT_EXTERN NSExceptionName NSPPDParseException;
APPKIT_EXTERN NSExceptionName NSPPDIncludeStackOverflowException;
APPKIT_EXTERN NSExceptionName NSPPDIncludeStackUnderflowException;
APPKIT_EXTERN NSExceptionName NSRTFPropertyStackOverflowException;
APPKIT_EXTERN NSExceptionName NSAppKitIgnoredException;
APPKIT_EXTERN NSExceptionName NSBadComparisonException;
APPKIT_EXTERN NSExceptionName NSImageCacheException;
APPKIT_EXTERN NSExceptionName NSNibLoadingException;
APPKIT_EXTERN NSExceptionName NSBrowserIllegalDelegateException;
APPKIT_EXTERN NSExceptionName NSAccessibilityException API_DEPRECATED("Exceptions are no longer appropriate for indicating errors in accessibility API. Unexpected values should be handled through appropriate type checking.", macos(10.1,10.11));
API_UNAVAILABLE_END
NS_ASSUME_NONNULL_END
|
0 | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework | repos/simulations/libs/system-sdk/macos12/System/Library/Frameworks/AppKit.framework/Headers/NSWorkspace.h | /*
NSWorkspace.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/NSFileManager.h>
#import <AppKit/AppKitDefines.h>
#import <mach/machine.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSColor, NSError, NSImage, NSView, NSNotificationCenter, NSURL, NSScreen, NSRunningApplication, NSWorkspaceOpenConfiguration, NSAppleEventDescriptor;
@class UTType;
typedef NS_OPTIONS(NSUInteger, NSWorkspaceIconCreationOptions) {
NSExcludeQuickDrawElementsIconCreationOption = 1 << 1,
NSExclude10_4ElementsIconCreationOption = 1 << 2
};
@interface NSWorkspace : NSObject
/* Get the shared instance of NSWorkspace. This method will create an instance of NSWorkspace if it has not been created yet. You should not attempt to instantiate instances of NSWorkspace yourself, and you should not attempt to subclass NSWorkspace. */
@property (class, readonly, strong) NSWorkspace *sharedWorkspace;
/* Returns the NSNotificationCenter for this NSWorkspace. All notifications in this header file must be registered on this notification center. If you register on other notification centers, you will not receive the notifications. */
@property (readonly, strong) NSNotificationCenter *notificationCenter;
/* Open a URL, using the default handler for the URL's scheme. */
- (BOOL)openURL:(NSURL *)url;
/* Open a URL asynchronously with the given configuration. The completion handler is called on a concurrent queue with either the NSRunningApplication on success, or an NSError on failure. */
- (void)openURL:(NSURL *)url configuration:(NSWorkspaceOpenConfiguration *)configuration completionHandler:(void (^ _Nullable)(NSRunningApplication *_Nullable app, NSError *_Nullable error))completionHandler API_AVAILABLE(macos(10.15));
/* Open URLs in a specified application with the given configuration. The completion handler is called on a concurrent queue with either the NSRunningApplication on success, or an NSError on failure. */
- (void)openURLs:(NSArray<NSURL *> *)urls withApplicationAtURL:(NSURL *)applicationURL configuration:(NSWorkspaceOpenConfiguration *)configuration completionHandler:(void (^ _Nullable)(NSRunningApplication *_Nullable app, NSError *_Nullable error))completionHandler API_AVAILABLE(macos(10.15));
/* Launch the application at the specified URL with the given configuration. The completion handler is called on a concurrent queue with either the NSRunningApplication on success, or an NSError on failure. */
- (void)openApplicationAtURL:(NSURL *)applicationURL configuration:(NSWorkspaceOpenConfiguration *)configuration completionHandler:(void (^ _Nullable)(NSRunningApplication *_Nullable app, NSError *_Nullable error))completionHandler API_AVAILABLE(macos(10.15));
/* Activate the Finder and open a window selecting the file at the given path. If fullPath is nil, this will instead open the directory specified by rootFullPath, and not select any file. If rootFullPath is the empty string (@""), the file is selected in the main viewer. Otherwise, a new file viewer is opened.
*/
- (BOOL)selectFile:(nullable NSString *)fullPath inFileViewerRootedAtPath:(NSString *)rootFullPath;
/* Activate the Finder, and open one or more windows selecting the files at the given fileURLs. */
- (void)activateFileViewerSelectingURLs:(NSArray<NSURL *> *)fileURLs API_AVAILABLE(macos(10.6));
/* Displays a Spotlight search results window in Finder for the specified query string. Finder becomes the active application, if possible. The user can further refine the search via the Finder UI. Returns YES if the communication with Finder was successful.
*/
- (BOOL)showSearchResultsForQueryString:(NSString *)queryString API_AVAILABLE(macos(10.6));
/* noteFileSystemChanged: informs listeners of a filesystem change, using the FNNotifyByPath() API. As the FNNotify API has been supplanted by the FSEvents API, the use of this method is discouraged. */
- (void)noteFileSystemChanged:(NSString *)path;
/* Indicates whether a given directory is a package. Returns YES if the file is a package, NO if not, or if the file does not exist or the operation otherwise failed. A file may be a package because its filename extension indicates so (for example, .framework) or because it has the package bit set. */
- (BOOL)isFilePackageAtPath:(NSString *)fullPath;
/* Returns the icon for a file at a given path, or a generic icon if the operation fails. */
- (NSImage *)iconForFile:(NSString *)fullPath;
/* Returns the icon for a group of files at the given paths. */
- (nullable NSImage *)iconForFiles:(NSArray<NSString *> *)fullPaths;
/* Get the icon for a given type object. Returns a default icon if the operation fails. */
- (NSImage *)iconForContentType:(UTType *)contentType API_AVAILABLE(macos(11.0));
/* If image is not nil, this sets a custom icon for the file at the given path. If image is nil, this removes any custom icon at the given path. Returns YES if successful, NO if not. */
- (BOOL)setIcon:(nullable NSImage *)image forFile:(NSString *)fullPath options:(NSWorkspaceIconCreationOptions)options;
/* Get the array of file labels as NSStrings. The file label index for a particular file is available as a property on the URL. You may listen for NSWorkspaceDidChangeFileLabelsNotification to be notified when these change. */
@property (readonly, copy) NSArray<NSString *> *fileLabels API_AVAILABLE(macos(10.6));
/* Get the corresponding array of file label colors. This array has the same number of elements as fileLabels, and the color at a given index corresponds to the label at the same index . You may listen for NSWorkspaceDidChangeFileLabelsNotification to be notified when these change. */
@property (readonly, copy) NSArray<NSColor *> *fileLabelColors API_AVAILABLE(macos(10.6));
/* Asynchronous file operations. recycleURLs moves the given files to the trash, and duplicateURLs duplicates them in the same manner as the Finder. If completionHandler is not nil, it will be called when the operation is complete, on the same dispatch queue that was used for the recycleURLs: call. Within the completion handler, the newURLs dictionary parameter maps the given URLs to their new URLs in the Trash. Files that could not be moved to the Trash will not be present in the dictionary.
If the operation succeeded for every file, the error parameter will be nil. If it failed for one or more files, the error parameter will describe the overall result of the operation in a manner suitable for presentation to the user. The completionHandler may be nil if you are not interested in the results.
These methods may show a progress indicator, or other user interface elements, at AppKit's discretion. In Mac OS X 10.6, these methods require that the main run loop be run in a common mode.
*/
- (void)recycleURLs:(NSArray<NSURL *> *)URLs completionHandler:(void (^ _Nullable)(NSDictionary<NSURL *, NSURL *> * newURLs, NSError * _Nullable error))handler API_AVAILABLE(macos(10.6));
- (void)duplicateURLs:(NSArray<NSURL *> *)URLs completionHandler:(void (^ _Nullable)(NSDictionary<NSURL *, NSURL *> * newURLs, NSError * _Nullable error))handler API_AVAILABLE(macos(10.6));
/* Gets information about the filesystem. fullPath is the path to any file or directory on the filesystem, including the filesystem's mount point. The returned values have the following significance:
- isRemovable: whether the filesystem is backed by removable media, such as a CD or floppy disk.
- isWritable: whether the filesystem can be written to
- isUnmountable: whether the filesystem can be unmounted.
- description: typically the type of the volume or the name of the filesystem
- the file system type, for example, 'hfs'
*/
- (BOOL)getFileSystemInfoForPath:(NSString *)fullPath isRemovable:(nullable BOOL *)removableFlag isWritable:(nullable BOOL *)writableFlag isUnmountable:(nullable BOOL *)unmountableFlag description:(NSString * _Nullable * _Nullable)description type:(NSString * _Nullable * _Nullable)fileSystemType;
/* Attempt to eject the volume mounted at the given path. Returns YES if successful, NO if not, for example, if the volume is not ejectable. */
- (BOOL)unmountAndEjectDeviceAtPath:(NSString *)path;
/* Same as unmountAndEjectDeviceAtPath, except it takes an NSURL and returns an NSError. */
- (BOOL)unmountAndEjectDeviceAtURL:(NSURL *)url error:(NSError **)error API_AVAILABLE(macos(10.6));
/* extendPowerOffBy: is currently not implemented. Do not use it. */
- (NSInteger)extendPowerOffBy:(NSInteger)requested;
/* Attempt to hide all other applications. */
- (void)hideOtherApplications;
/* Get the URL for the application with the given identifier. This uses various heuristics in case multiple apps have the same bundle ID. This returns nil if no app has the bundle identifier.*/
- (nullable NSURL *)URLForApplicationWithBundleIdentifier:(NSString *)bundleIdentifier API_AVAILABLE(macos(10.6));
/* Get the URL for all copies of an application with the given identifier. The system sorts the resulting array based on each application's suitability to launch. The first application is considered the best available match. This returns the empty array if no app has the bundle identifier. */
- (NSArray<NSURL *> *)URLsForApplicationsWithBundleIdentifier:(NSString *)bundleIdentifier API_AVAILABLE(macos(12.0));
/* Returns the URL to the default application that would be used to open the given URL, as if the file were double clicked in the Finder (for file URLs). This returns nil if no app can open it, or if the file does not exist. */
- (nullable NSURL *)URLForApplicationToOpenURL:(NSURL *)url API_AVAILABLE(macos(10.6));
/* Returns URLs to all available applications that can open the given URL. The system sorts the resulting array based on each application's suitability to open the given URL. The first application is considered the best available match. This returns the empty array if no app can open it, or if the file does not exist. */
- (NSArray<NSURL *> *)URLsForApplicationsToOpenURL:(NSURL *)url API_AVAILABLE(macos(12.0));
/* Sets the default handler for files with the same UTType as the one specified. Does not apply to non-file URLs. Some UTTypes require user consent before you can change their handlers. If a change requires user consent, the system will ask the user asynchronously before invoking the completion handler. */
- (void)setDefaultApplicationAtURL:(NSURL *)applicationURL toOpenContentTypeOfFileAtURL:(NSURL *)url completionHandler:(void (^_Nullable)(NSError *_Nullable error))completionHandler API_AVAILABLE(macos(12.0));
/* Sets the default handler for URLs with the same scheme as the one specified. Some URL schemes require user consent before you can change their handlers. If a change requires user consent, the system will ask the user asynchronously before invoking the completion handler. */
- (void)setDefaultApplicationAtURL:(NSURL *)applicationURL toOpenURLsWithScheme:(NSString *)urlScheme completionHandler:(void (^_Nullable)(NSError *_Nullable error))completionHandler API_AVAILABLE(macos(12.0));
/* Sets the default handler for the specified file (rather than all files like it.) Does not apply to non-file URLs. Some files require user consent before you can change their handlers. Write access to the specified URL is required. If a change requires user consent, the system will ask the user asynchronously before invoking the completion handler. */
- (void)setDefaultApplicationAtURL:(NSURL *)applicationURL toOpenFileAtURL:(NSURL *)url completionHandler:(void (^_Nullable)(NSError *_Nullable error))completionHandler API_AVAILABLE(macos(12.0));
/* Returns the URL to the default application that would be used to open the given URL, as if the file were double clicked in the Finder. This returns nil if no app can open it. */
- (nullable NSURL *)URLForApplicationToOpenContentType:(UTType *)contentType API_AVAILABLE(macos(12.0));
/* Returns URLs to all available applications that can open the given UTType. The system sorts the resulting array based on each application's suitability to open the given UTType. The first application is considered the best available match. This returns the empty array if no app can open it. */
- (NSArray<NSURL *> *)URLsForApplicationsToOpenContentType:(UTType *)contentType API_AVAILABLE(macos(12.0));
/* Sets the default handler for the specified UTType. Some types require user consent before you can change their handlers. If a change requires user consent, the system will ask the user asynchronously before invoking the completion handler. */
- (void)setDefaultApplicationAtURL:(NSURL *)applicationURL toOpenContentType:(UTType *)contentType completionHandler:(void (^_Nullable)(NSError *_Nullable error))completionHandler API_AVAILABLE(macos(12.0));
/* Gets the frontmost application, which is the application that will receive key events. This is observable through KVO. */
@property (nullable, readonly, strong) NSRunningApplication *frontmostApplication API_AVAILABLE(macos(10.7));
/* Gets the menu bar owning application, which is the application that currently owns and draws the menu bar. This is observable through KVO. */
@property (nullable, readonly, strong) NSRunningApplication *menuBarOwningApplication API_AVAILABLE(macos(10.7));
@end
API_AVAILABLE(macos(10.15))
@interface NSWorkspaceOpenConfiguration : NSObject <NSCopying>
/* Instantiates a configuration object with default values. Equivalent to [[[NSWorkspaceOpenConfiguration alloc] init] autorelease]. */
+ (instancetype)configuration;
/* Display user interface elements if needed, including errors and authentication. Defaults to YES.
The completion handler will not be invoked until the user dismisses any such UI.
Gatekeeper UI is not affected and will always be presented if needed. */
@property BOOL promptsUserIfNeeded;
/* Add the application instance or documents to the Recent Items menu. Defaults to YES. */
@property BOOL addsToRecentItems;
/* Bring the application instance to the foreground. Defaults to YES. */
@property BOOL activates;
/* Hide the application instance. Defaults to NO. */
@property BOOL hides;
/* Hide other application instances. Defaults to NO. */
@property BOOL hidesOthers;
/* Print documents and URLs instead of opening them. Defaults to NO. */
@property (getter=isForPrinting) BOOL forPrinting;
/* Ignore any running instance of the application and launch a new one. Defaults to NO (i.e. prefers to reuse a running instance). When createsNewApplicationInstance is YES, the value of allowsRunningApplicationSubstitution is not consulted. */
@property BOOL createsNewApplicationInstance;
/* If an instance of an application is already running, but the running instance is at a different URL (and is capable of opening the provided URLs), use the running application. Defaults to YES. Set this to NO if you are letting the user select between specific versions of an application or letting them choose a particular installation. */
@property BOOL allowsRunningApplicationSubstitution;
/* Command-line arguments to pass to a new application instance. Defaults to @[].
Only applies when a new application instance is created.
The path to the application instance is always automatically inserted as the first argument.
If the calling process is sandboxed, the value of this property is ignored. */
@property (copy) NSArray<NSString *> *arguments;
/* Environment variables to set in a new application instance. Defaults to @{}.
Only applies when a new application instance is created.
Additional environment variables may be included by the system. */
@property (copy) NSDictionary<NSString *, NSString *> *environment;
/* The first NSAppleEventDescriptor to send to the new app. If an instance of the app is already running, this is sent to that app. Defaults to nil. When nil, a default apple event will be sent, if required. */
@property (strong, nullable) NSAppleEventDescriptor *appleEvent;
/* A cpu_type_t (from <mach/machine.h>) that specifies the architecture to launch. Ignored if a new instance is not launched. Defaults to CPU_TYPE_ANY. When CPU_TYPE_ANY, the system will decide the preferred architecture based on those present in the executable. */
@property cpu_type_t architecture;
/* Only open the provided URL if it is a valid universal link with an application configured to open it. If there is no application configured, or the user disabled using it to open the link, then the open will fail with an error. Defaults to NO. */
@property BOOL requiresUniversalLinks;
@end
/* The following keys may be specified or returned in the options dictionary for setDesktopImageURL:forScreen:options:error: and desktopImageOptionsForScreen:. */
typedef NSString * NSWorkspaceDesktopImageOptionKey NS_TYPED_ENUM;
/* The value is an NSNumber containing an NSImageScaling. If this is not specified, NSImageScaleProportionallyUpOrDown is used. Note: NSImageScaleProportionallyDown is not currently supported.
*/
APPKIT_EXTERN NSWorkspaceDesktopImageOptionKey const NSWorkspaceDesktopImageScalingKey API_AVAILABLE(macos(10.6));
/* The value is an NSNumber containing a BOOL, which affects the interpretation of Proportional scaling types. A NO value will make the image fully visible, but there may be empty space on the sides or top and bottom. A YES value will cause the image to fill the entire screen, but the image may be clipped. If this is not specified, NO is assumed. Non-proportional scaling types ignore this value.
*/
APPKIT_EXTERN NSWorkspaceDesktopImageOptionKey const NSWorkspaceDesktopImageAllowClippingKey API_AVAILABLE(macos(10.6));
/* The value is an NSColor, which is used to fill any empty space around the image. If not specified, a default value is used. Currently, only colors that use or can be converted to use NSCalibratedRGBColorSpace are supported, and any alpha value is ignored.
*/
APPKIT_EXTERN NSWorkspaceDesktopImageOptionKey const NSWorkspaceDesktopImageFillColorKey API_AVAILABLE(macos(10.6));
/* Desktop images */
@interface NSWorkspace (NSDesktopImages)
/* Sets the desktop image for the given screen to the image at the given URL. The URL must be a file URL and may not be nil. The options dictionary may contain any of the NSWorkspaceDesktopImage keys, which control how the image is scaled on the screen. This returns YES if the image was successfully set; otherwise, NO is returned and an error is returned by reference.
You should normally NOT present a user interface for picking the options. Instead, just choose appropriate defaults and allow the user to adjust them in the System Preference Pane.
*/
- (BOOL)setDesktopImageURL:(NSURL *)url forScreen:(NSScreen *)screen options:(NSDictionary<NSWorkspaceDesktopImageOptionKey, id> *)options error:(NSError **)error API_AVAILABLE(macos(10.6));
/* Returns the URL for the desktop image for the given screen.
*/
- (nullable NSURL *)desktopImageURLForScreen:(NSScreen *)screen API_AVAILABLE(macos(10.6));
/* Returns the options dictionary for the desktop image for the given screen.
*/
- (nullable NSDictionary<NSWorkspaceDesktopImageOptionKey, id> *)desktopImageOptionsForScreen:(NSScreen *)screen API_AVAILABLE(macos(10.6));
@end
typedef NS_ENUM(NSInteger, NSWorkspaceAuthorizationType) {
NSWorkspaceAuthorizationTypeCreateSymbolicLink,
NSWorkspaceAuthorizationTypeSetAttributes,
NSWorkspaceAuthorizationTypeReplaceFile,
} API_AVAILABLE(macos(10.14));
API_AVAILABLE(macos(10.14))
@interface NSWorkspaceAuthorization : NSObject
@end
@interface NSWorkspace (NSWorkspaceAuthorization)
- (void)requestAuthorizationOfType:(NSWorkspaceAuthorizationType)type completionHandler:(void (^)(NSWorkspaceAuthorization * _Nullable authorization, NSError * _Nullable error))completionHandler API_AVAILABLE(macos(10.14));
@end
@interface NSFileManager (NSWorkspaceAuthorization)
/* The following method returns an NSFileManager instance that can perform file system operations previously allowed by the user via -[NSWorkspace requestAuthorizationOfType:completionHandler:]. Each NSWorkspaceAuthorization you receive requires creating a new NSFileManager instance using this method.
Only the following NSFileManager methods currently take advantage of an authorization:
-createSymbolicLinkAtURL:withDestinationURL:error: (NSWorkspaceAuthorizationTypeCreateSymbolicLink)
-setAttributes:ofItemAtPath:error: (NSWorkspaceAuthorizationTypeSetAttributes)
-replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: (NSWorkspaceAuthorizationTypeReplaceFile)
Note that an NSWorkspaceAuthorizationTypeSetAttributes authorization only enables -setAttributes:ofItemAtPath:error: to modify the following attributes:
- NSFileOwnerAccountID
- NSFileGroupOwnerAccountID
- NSFilePosixPermissions
Also note that for -replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error:, the backupItemName and options parameters will be ignored.
These methods may also fail with any of the following errors:
- NSWorkspaceAuthorizationInvalidError: The provided NSWorkspaceAuthorization expired or is invalid.
- NSFileWriteUnknownError: The application failed to communicate with a helper process, or a file system error occurred.
- NSFileWriteNoPermissionError: The operation failed for any other reason, including the user denying access to the resource, or access to a resource is denied by system policy.
All other NSFileManager methods invoked on this instance will behave normally.
*/
+ (instancetype)fileManagerWithAuthorization:(NSWorkspaceAuthorization *)authorization API_AVAILABLE(macos(10.14));
@end
/* Application notifications */
/* In Mac OS X 10.6 and later, all application notifications have the following key in their userInfo. Its value is an instance of NSRunningApplication, representing the affected app.
*/
APPKIT_EXTERN NSString * const NSWorkspaceApplicationKey API_AVAILABLE(macos(10.6));
APPKIT_EXTERN NSNotificationName NSWorkspaceWillLaunchApplicationNotification; // see above
APPKIT_EXTERN NSNotificationName NSWorkspaceDidLaunchApplicationNotification; // see above
APPKIT_EXTERN NSNotificationName NSWorkspaceDidTerminateApplicationNotification; // see above
APPKIT_EXTERN NSNotificationName const NSWorkspaceDidHideApplicationNotification API_AVAILABLE(macos(10.6));
APPKIT_EXTERN NSNotificationName const NSWorkspaceDidUnhideApplicationNotification API_AVAILABLE(macos(10.6));
APPKIT_EXTERN NSNotificationName const NSWorkspaceDidActivateApplicationNotification API_AVAILABLE(macos(10.6));
APPKIT_EXTERN NSNotificationName const NSWorkspaceDidDeactivateApplicationNotification API_AVAILABLE(macos(10.6));
/* Volume notifications */
/* In Mac OS X 10.6 and later, the following keys are available in the userInfo of NSWorkspaceDidMountNotification, NSWorkspaceWillUnmountNotification, NSWorkspaceDidUnmountNotification, and NSWorkspaceDidRenameVolumeNotification.
*/
APPKIT_EXTERN NSString * const NSWorkspaceVolumeLocalizedNameKey API_AVAILABLE(macos(10.6)); //NSString containing the user-visible name of the volume
APPKIT_EXTERN NSString * const NSWorkspaceVolumeURLKey API_AVAILABLE(macos(10.6)); //NSURL containing the mount path of the volume
/* The following additional keys are provided in the userInfo of NSWorkspaceDidRenameVolumeNotification.
*/
APPKIT_EXTERN NSString * const NSWorkspaceVolumeOldLocalizedNameKey API_AVAILABLE(macos(10.6)); //NSString containing the old user-visible name of the volume
APPKIT_EXTERN NSString * const NSWorkspaceVolumeOldURLKey API_AVAILABLE(macos(10.6)); //NSURL containing the old mount path of the volume
APPKIT_EXTERN NSNotificationName NSWorkspaceDidMountNotification; // @"NSDevicePath"
APPKIT_EXTERN NSNotificationName NSWorkspaceDidUnmountNotification; // @"NSDevicePath"
APPKIT_EXTERN NSNotificationName NSWorkspaceWillUnmountNotification; // @"NSDevicePath"
/* NSWorkspaceDidRenameVolumeNotification is posted when a volume changes its name and/or mount path. These typically change simultaneously, in which case only one notification is posted.
*/
APPKIT_EXTERN NSNotificationName const NSWorkspaceDidRenameVolumeNotification API_AVAILABLE(macos(10.6));
/* Power notifications */
APPKIT_EXTERN NSNotificationName const NSWorkspaceWillPowerOffNotification;
APPKIT_EXTERN NSNotificationName NSWorkspaceWillSleepNotification;
APPKIT_EXTERN NSNotificationName NSWorkspaceDidWakeNotification;
APPKIT_EXTERN NSNotificationName const NSWorkspaceScreensDidSleepNotification API_AVAILABLE(macos(10.6));
APPKIT_EXTERN NSNotificationName const NSWorkspaceScreensDidWakeNotification API_AVAILABLE(macos(10.6));
/* Session notifications */
APPKIT_EXTERN NSNotificationName NSWorkspaceSessionDidBecomeActiveNotification;
APPKIT_EXTERN NSNotificationName NSWorkspaceSessionDidResignActiveNotification;
/* Miscellaneous notifications */
/* NSWorkspaceDidChangeFileLabelsNotification is posted when the user changes a file label color name or the color itself. The notification object is always NSWorkspace, and there is no user info.
*/
APPKIT_EXTERN NSNotificationName const NSWorkspaceDidChangeFileLabelsNotification API_AVAILABLE(macos(10.6));
APPKIT_EXTERN NSNotificationName const NSWorkspaceActiveSpaceDidChangeNotification API_AVAILABLE(macos(10.6));
/* Everything remaining in this header is deprecated and should not be used. */
typedef NSString * NSWorkspaceFileOperationName API_DEPRECATED("", macos(10.0,10.11)) NS_TYPED_ENUM;
typedef NS_OPTIONS(NSUInteger, NSWorkspaceLaunchOptions) {
NSWorkspaceLaunchAndPrint API_DEPRECATED("Use -[NSWorkspaceOpenConfiguration setForPrinting:YES] instead.", macos(10.3, 11.0)) = 0x00000002,
NSWorkspaceLaunchWithErrorPresentation API_DEPRECATED("Use -[NSWorkspaceOpenConfiguration setPromptsUserIfNeeded:YES] instead.", macos(10.3, 11.0)) = 0x00000040,
NSWorkspaceLaunchInhibitingBackgroundOnly API_DEPRECATED("This option does nothing.", macos(10.3, 11.0)) = 0x00000080,
NSWorkspaceLaunchWithoutAddingToRecents API_DEPRECATED("Use -[NSWorkspaceOpenConfiguration setAddsToRecentItems:YES] instead.", macos(10.3, 11.0)) = 0x00000100,
NSWorkspaceLaunchWithoutActivation API_DEPRECATED("Use -[NSWorkspaceOpenConfiguration setActivates:NO] instead.", macos(10.3, 11.0)) = 0x00000200,
NSWorkspaceLaunchAsync API_DEPRECATED("When using NSWorkspaceOpenConfiguration, all launches are asynchronous.", macos(10.3, 11.0)) = 0x00010000,
NSWorkspaceLaunchNewInstance API_DEPRECATED("Use -[NSWorkspaceOpenConfiguration setCreatesNewApplicationInstance:YES] instead.", macos(10.3, 11.0)) = 0x00080000,
NSWorkspaceLaunchAndHide API_DEPRECATED("Use -[NSWorkspaceOpenConfiguration setHides:YES] instead.", macos(10.3, 11.0)) = 0x00100000,
NSWorkspaceLaunchAndHideOthers API_DEPRECATED("Use -[NSWorkspaceOpenConfiguration setHidesOthers:YES] instead.", macos(10.3, 11.0)) = 0x00200000,
NSWorkspaceLaunchDefault API_DEPRECATED("Use NSWorkspaceOpenConfiguration instead.", macos(10.3, 11.0)) = NSWorkspaceLaunchAsync,
// Deprecated classic options
NSWorkspaceLaunchAllowingClassicStartup API_DEPRECATED("The Classic environment is no longer supported.", macos(10.3,10.11)) = 0x00020000,
NSWorkspaceLaunchPreferringClassic API_DEPRECATED("The Classic environment is no longer supported.", macos(10.3,10.11)) = 0x00040000,
};
/* The following keys can be used in the configuration dictionary of the launchApplicationAtURL:, openURL:, and openURL:withApplicationAtURL: methods. Each key is optional, and if omitted, default behavior is applied. */
typedef NSString * NSWorkspaceLaunchConfigurationKey API_DEPRECATED("Use NSWorkspaceOpenConfiguration instead.", macos(10.6, 11.0)) NS_TYPED_ENUM;
APPKIT_EXTERN NSWorkspaceLaunchConfigurationKey const NSWorkspaceLaunchConfigurationAppleEvent API_DEPRECATED("Use -[NSWorkspaceOpenConfiguration setAppleEvent:] instead.", macos(10.6, 11.0)); //the first NSAppleEventDescriptor to send to the new app. If an instance of the app is already running, this is sent to that app.
APPKIT_EXTERN NSWorkspaceLaunchConfigurationKey const NSWorkspaceLaunchConfigurationArguments API_DEPRECATED("Use -[NSWorkspaceOpenConfiguration setArguments:] instead.", macos(10.6, 11.0)); //an NSArray of NSStrings, passed to the new app in the argv parameter. Ignored if a new instance is not launched.
APPKIT_EXTERN NSWorkspaceLaunchConfigurationKey const NSWorkspaceLaunchConfigurationEnvironment API_DEPRECATED("Use -[NSWorkspaceOpenConfiguration setEnvironment:] instead.", macos(10.6, 11.0)); //an NSDictionary, mapping NSStrings to NSStrings, containing environment variables to set for the new app. Ignored if a new instance is not launched.
APPKIT_EXTERN NSWorkspaceLaunchConfigurationKey const NSWorkspaceLaunchConfigurationArchitecture API_DEPRECATED("Do not specify an architecutre. When unspecified, the architecture for a new application instance will be determined based on the available architectures in its executable.", macos(10.6, 11.0)); //an NSNumber containing an NSBundleExecutableArchitecture (from NSBundle.h). Ignored if a new instance is not launched.
@interface NSWorkspace (NSDeprecated)
/* Open a file at some path. If you use the variant without the withApplication: parameter, or if you pass nil for this parameter, the default application is used. The appName parameter may be a full path to an application, or just the application's name, with or without the .app extension. If you pass YES for andDeactivate:, or call a variant without this parameter, the calling app is deactivated before the new app is launched, so that the new app may come to the foreground unless the user switches to another application in the interim. Passing YES for andDeactivate: is generally recommended.
*/
- (BOOL)openFile:(NSString *)fullPath API_DEPRECATED("Use -[NSWorkspace openURL:] instead.", macos(10.0, 11.0));
- (BOOL)openFile:(NSString *)fullPath withApplication:(nullable NSString *)appName API_DEPRECATED("Use -[NSWorkspace openURLs:withApplicationAtURL:configuration:completionHandler:] instead.", macos(10.0, 11.0));
- (BOOL)openFile:(NSString *)fullPath withApplication:(nullable NSString *)appName andDeactivate:(BOOL)flag API_DEPRECATED("Use -[NSWorkspace openURLs:withApplicationAtURL:configuration:completionHandler:] instead.", macos(10.0, 11.0));
/* Launches an application. The appName may be a full path to the app, or the name alone, with or without the .app extension. */
- (BOOL)launchApplication:(NSString *)appName API_DEPRECATED("Use -[NSWorkspace openApplicationAtURL:configuration:completionHandler:] instead.", macos(10.0, 11.0));
/* Launches the app at the given URL. If the app is successfully launched, a reference to the new running app is returned. If the app is already running, and NSWorkspaceLaunchNewInstance is not specified, then a reference to the existing app is returned. If the app could not be launched, nil is returned and an NSError is returned by reference.
The configuration dictionary can be used to pass additional options to the app. The configuration dictionary may be empty, in which case default behavior applies.
*/
- (nullable NSRunningApplication *)launchApplicationAtURL:(NSURL *)url options:(NSWorkspaceLaunchOptions)options configuration:(NSDictionary<NSWorkspaceLaunchConfigurationKey, id> *)configuration error:(NSError **)error API_DEPRECATED("Use -[NSWorkspace openApplicationAtURL:configuration:completionHandler:] instead.", macos(10.6, 11.0));
/* Opens the given URL in an the application that claims it. An NSRunningApplication instance representing the app that the URL was opened in is returned. If the app could not be launched or no app claims the URL, nil is returned and an NSError is returned by reference. The options and configuration parameters are the same as those in launchApplicationAtURL:options:configuration:error:. */
- (nullable NSRunningApplication *)openURL:(NSURL *)url options:(NSWorkspaceLaunchOptions)options configuration:(NSDictionary<NSWorkspaceLaunchConfigurationKey, id> *)configuration error:(NSError **)error API_DEPRECATED("Use -[NSWorkspace openURL:configuration:completionHandler:] instead.", macos(10.10, 11.0));
/* Opens the given URLs in the application at applicationURL. Returns the NSRunningApplication for the app the URLs were opened in. If the app could not be launched, nil is returned and an NSError is returned by reference. The options and configuration parameters are the same as those in launchApplicationAtURL:options:configuration:error:. */
- (nullable NSRunningApplication *)openURLs:(NSArray<NSURL *> *)urls withApplicationAtURL:(NSURL *)applicationURL options:(NSWorkspaceLaunchOptions)options configuration:(NSDictionary<NSWorkspaceLaunchConfigurationKey, id> *)configuration error:(NSError **)error API_DEPRECATED("Use -[NSWorkspace openURLs:withApplicationAtURL:configuration:completionHandler:] instead.", macos(10.10, 11.0));
/* This currently does the same thing as launchApplication:. Its use is discouraged. */
- (BOOL)launchApplication:(NSString *)appName showIcon:(BOOL)showIcon autolaunch:(BOOL)autolaunch API_DEPRECATED("Use -[NSWorkspace openApplicationAtURL:configuration:completionHandler:] instead.", macos(10.0, 11.0));
/* Get the full path for a given application name, which may or may not have the .app extension. This indicates the application that will be opened by methods such as launchApplication:. If the application could not be found, returns nil. */
- (nullable NSString *)fullPathForApplication:(NSString *)appName API_DEPRECATED("Use -[NSWorkspace URLForApplicationWithBundleIdentifier:] instead.", macos(10.0, 11.0));
/* Get the path for the application with the given identifier. This uses various heuristics in case multiple apps have the same bundle ID. */
- (nullable NSString *)absolutePathForAppBundleWithIdentifier:(NSString *)bundleIdentifier API_DEPRECATED("Use -[NSWorkspace URLForApplicationWithBundleIdentifier:] instead.", macos(10.0, 11.0));
/* The following methods launch an app with the given bundle identifier. The descriptor describes the first AppleEvent to be sent to the process. The launchIdentifier is currently of no significance.
If the application is already running, and NSWorkspaceLaunchNewInstance is not specified in the options, then the descriptor is delivered to the currently running app, and YES is returned.
*/
- (BOOL)launchAppWithBundleIdentifier:(NSString *)bundleIdentifier options:(NSWorkspaceLaunchOptions)options additionalEventParamDescriptor:(nullable NSAppleEventDescriptor *)descriptor launchIdentifier:(NSNumber * _Nullable * _Nullable)identifier API_DEPRECATED("Use -[NSWorkspace openApplicationAtURL:configuration:completionHandler:] instead.", macos(10.0, 11.0));
- (BOOL)openURLs:(NSArray<NSURL *> *)urls withAppBundleIdentifier:(nullable NSString *)bundleIdentifier options:(NSWorkspaceLaunchOptions)options additionalEventParamDescriptor:(nullable NSAppleEventDescriptor *)descriptor launchIdentifiers:(NSArray<NSNumber *> * _Nullable * _Nullable)identifiers API_DEPRECATED("Use -[NSWorkspace openURLs:withApplicationAtURL:configuration:completionHandler:] instead.", macos(10.10, 11.0));
- (BOOL)openTempFile:(NSString *)fullPath API_DEPRECATED("", macos(10.0,10.6));
- (void)findApplications API_DEPRECATED("", macos(10.0,10.6));
- (void)noteUserDefaultsChanged API_DEPRECATED("", macos(10.0,10.6));
- (void)slideImage:(NSImage *)image from:(NSPoint)fromPoint to:(NSPoint)toPoint API_DEPRECATED("", macos(10.0,10.6));
- (void)checkForRemovableMedia API_DEPRECATED("", macos(10.0,10.6));
- (void)noteFileSystemChanged API_DEPRECATED("", macos(10.0,10.6));
- (BOOL)fileSystemChanged API_DEPRECATED("", macos(10.0,10.6));
- (BOOL)userDefaultsChanged API_DEPRECATED("", macos(10.0,10.6));
- (nullable NSArray *)mountNewRemovableMedia API_DEPRECATED("", macos(10.0,10.6));
/* The following methods return information about an application as a dictionary containing as many of the following keys as are available:
NSApplicationPath (the full path to the application, as a string)
NSApplicationName (the application's name, as a string)
NSApplicationBundleIdentifier (the application's bundle identifier, as a string)
NSApplicationProcessIdentifier (the application's process id, as an NSNumber)
NSApplicationProcessSerialNumberHigh (the high long of the PSN, as an NSNumber)
NSApplicationProcessSerialNumberLow (the low long of the PSN, as an NSNumber)
The same information will now be provided in the userInfo of the NSWorkspace notifications for application launch and termination.
*/
/* Get an NSDictionary representing the currently frontmost app, with the above keys. The NSWorkspaceApplicationKey is also provided. On Mac OS X 10.7 and later, use -frontmostApplication. */
- (nullable NSDictionary *)activeApplication API_DEPRECATED("Use -[NSWorkspace frontmostApplication] instead.", macos(10.0,10.11));
/* Get the mount paths of all volumes. Despite its name, this method returns URLs for network volumes as well. On Mac OS X 10.6 and later, use -[NSFileManager mountedVolumeURLsIncludingResourceValuesForKeys:options:] instead. */
- (nullable NSArray *)mountedLocalVolumePaths API_DEPRECATED("Use -[NSFileManager mountedVolumeURLsIncludingResourceValuesForKeys:options:] instead.", macos(10.0,10.11));
/* Get the mount paths of all volumes backed by removable media, such as DVDs. On Mac OS X 10.6 and later, use -[NSFileManager mountedVolumeURLsIncludingResourceValuesForKeys:options:] instead. */
- (nullable NSArray *)mountedRemovableMedia API_DEPRECATED("Use -[NSFileManager mountedVolumeURLsIncludingResourceValuesForKeys:options:] instead.", macos(10.0,10.11));
/* Gets an array of NSDictionaries with the above keys. In addition, the NSWorkspaceApplicationKey is provided, and vends an instance of NSRunningApplication. This method does not return applications that are UIElement or BackgroundOnly. To access the entire list of running applications, use the -[NSWorkspace runningApplications] method, declared in NSRunningApplication.h.
*/
- (nullable NSArray *)launchedApplications API_DEPRECATED("Use -[NSWorkspace runningApplications] instead.", macos(10.0,10.7));
/* Open a file with an animation. This currently does the same thing as openFile: and its use is discouraged. */
- (BOOL)openFile:(NSString *)fullPath fromImage:(nullable NSImage *)image at:(NSPoint)point inView:(nullable NSView *)view API_DEPRECATED("Use -[NSWorkspace openURL:] instead.", macos(10.0,10.11));
/* Performs the given file operation, blocking until complete. source should be the directory containing the file(s). For operations that require a destination, such as Move and Copy, destination should be the destination directory; otherwise it should be nil. files is an array of file names that are in the source directory.
A value is returned by reference in the tag parameter, either 0 for success, or -1 for failure. tag may be NULL.
*/
- (BOOL)performFileOperation:(NSWorkspaceFileOperationName)operation source:(NSString *)source destination:(NSString *)destination files:(NSArray *)files tag:(nullable NSInteger *)tag API_DEPRECATED("", macos(10.0,10.11));
/* Get, by reference, the name of the app used to open a file at the given path, and the type of the file. The type of the file will either be a filename extension or an HFS type encoded with NSFileTypeForHFSTypeCode(). Both strings are returned autoreleased. The method returns YES if successful, NO if not. */
- (BOOL)getInfoForFile:(NSString *)fullPath application:(NSString * _Nullable* _Nullable)appName type:(NSString * _Nullable* _Nullable)type API_DEPRECATED("Use -[NSWorkspace URLForApplicationToOpenURL:] to get the URL of an application that will open a given item, or -[NSURL getResourceValue:forKey:error:] with NSURLContentTypeKey to get the type of the given item.", macos(10.0, 12.0));
/* Get the icon for a given file type. The file type may be a filename extension, or a HFS code encoded via NSFileTypeForHFSTypeCode, or a Universal Type Identifier (UTI). Returns a default icon if the operation fails. */
- (NSImage *)iconForFileType:(NSString *)fileType API_DEPRECATED("Use -[NSWorkspace iconForContentType:] instead.", macos(10.0, 12.0));
/* Given an absolute file path, return the uniform type identifier (UTI) of the file, if one can be determined. Otherwise, return nil after setting *outError to an NSError that encapsulates the reason why the file's type could not be determined. If the file at the end of the path is a symbolic link the type of the symbolic link will be returned.
You can invoke this method to get the UTI of an existing file. To get the UTI of a URL, use the NSURLTypeIdentifierKey file system resource key from NSURL.h.
*/
- (nullable NSString *)typeOfFile:(NSString *)absoluteFilePath error:(NSError **)outError API_DEPRECATED("Use -[NSURL getResourceValue:forKey:error:] with NSURLContentTypeKey instead.", macos(10.5, 12.0));
/* Given a UTI, return a string that describes the document type and is fit to present to the user, or nil for failure.
You can invoke this method to get the name of a type that must be shown to the user, in an alert about your application's inability to handle the type, for instance.
*/
- (nullable NSString *)localizedDescriptionForType:(NSString *)typeName API_DEPRECATED("Use UTType.localizedDescription instead.", macos(10.5, 12.0));
/* Given a UTI, return the best file name extension to use when creating a file of that type, or nil for failure.
You can invoke this method when your application has only the base name of a file that's being written and it has to append a file name extension so that the file's type can be reliably identified later on.
*/
- (nullable NSString *)preferredFilenameExtensionForType:(NSString *)typeName API_DEPRECATED("Use UTType.preferredFilenameExtension instead.", macos(10.5, 12.0));
/* Given a file name extension and a UTI, return YES if the file name extension is a valid tag for the identified type, NO otherwise.
You can invoke this method when your application needs to check if a file name extension can be used to reliably identify the type later on. For example, NSSavePanel uses this method to validate any extension that the user types in the panel's file name field.
*/
- (BOOL)filenameExtension:(NSString *)filenameExtension isValidForType:(NSString *)typeName API_DEPRECATED("Use +[UTType typesWithTag:tagClass:conformingToType:] to get a list of candidate types, then check if the input type conforms to any of them.", macos(10.5, 12.0));
/* Given two UTIs, return YES if the first "conforms to" to the second in the uniform type identifier hierarchy, NO otherwise. This method will always return YES if the two strings are equal, so you can also use it with other kinds of type name, including those declared in CFBundleTypeName Info.plist entries in apps that don't take advantage of the support for UTIs that was added to Cocoa in Mac OS 10.5.
You can invoke this method when your application must determine whether it can handle a file of a known type, returned by -typeOfFile:error: for instance.
Use this method instead of merely comparing UTIs for equality.
*/
- (BOOL)type:(NSString *)firstTypeName conformsToType:(NSString *)secondTypeName API_DEPRECATED("Use -[UTType conformsToType:] instead.", macos(10.5, 12.0));
@end
/* Possible values for operation in performFileOperation:...
*/
APPKIT_EXTERN NSWorkspaceFileOperationName NSWorkspaceMoveOperation API_DEPRECATED("Use -[NSFileManager moveItemAtURL:toURL:error:] instead.", macos(10.0,10.11));
APPKIT_EXTERN NSWorkspaceFileOperationName NSWorkspaceCopyOperation API_DEPRECATED("Use -[NSFileManager copyItemAtURL:toURL:error:] instead.", macos(10.0,10.11));
APPKIT_EXTERN NSWorkspaceFileOperationName NSWorkspaceLinkOperation API_DEPRECATED("Use -[NSFileManager linkItemAtURL:toURL:error:] instead.", macos(10.0,10.11));
APPKIT_EXTERN NSWorkspaceFileOperationName NSWorkspaceCompressOperation API_DEPRECATED("This operation is unimplemented.", macos(10.0,10.11));
APPKIT_EXTERN NSWorkspaceFileOperationName NSWorkspaceDecompressOperation API_DEPRECATED("This operation is unimplemented.", macos(10.0,10.11));
APPKIT_EXTERN NSWorkspaceFileOperationName NSWorkspaceEncryptOperation API_DEPRECATED("This operation is unimplemented.", macos(10.0,10.11));
APPKIT_EXTERN NSWorkspaceFileOperationName NSWorkspaceDecryptOperation API_DEPRECATED("This operation is unimplemented.", macos(10.0,10.11));
APPKIT_EXTERN NSWorkspaceFileOperationName NSWorkspaceDestroyOperation API_DEPRECATED("Use -[NSFileManager removeItemAtURL:error:] instead.", macos(10.0,10.11));
APPKIT_EXTERN NSWorkspaceFileOperationName NSWorkspaceRecycleOperation API_DEPRECATED("Use -[NSWorkspace recycleURLs:completionHandler:] instead.", macos(10.0,10.11));
APPKIT_EXTERN NSWorkspaceFileOperationName NSWorkspaceDuplicateOperation API_DEPRECATED("Use -[NSWorkspace duplicateURLs:completionHandler:] instead.", macos(10.0,10.11));
APPKIT_EXTERN NSNotificationName NSWorkspaceDidPerformFileOperationNotification API_DEPRECATED("", macos(10.0,10.11)); // @"NSOperationNumber"
APPKIT_EXTERN NSString * NSPlainFileType API_DEPRECATED("", macos(10.0,10.6));
APPKIT_EXTERN NSString * NSDirectoryFileType API_DEPRECATED("", macos(10.0,10.6));
APPKIT_EXTERN NSString * NSApplicationFileType API_DEPRECATED("", macos(10.0,10.6));
APPKIT_EXTERN NSString * NSFilesystemFileType API_DEPRECATED("", macos(10.0,10.6));
APPKIT_EXTERN NSString * NSShellCommandFileType API_DEPRECATED("", macos(10.0,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/NSTextCheckingClient.h | /*
NSTextCheckingClient.h
Application Kit
Copyright (c) 2018-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObject.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSRange.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSAttributedString.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSTextInputClient.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSAttributedString, NSView, NSCandidateListTouchBarItem;
typedef NS_ENUM(NSInteger, NSTextInputTraitType) {
NSTextInputTraitTypeDefault,
NSTextInputTraitTypeNo,
NSTextInputTraitTypeYes,
};
@protocol NSTextInputTraits
@optional
@property NSTextInputTraitType autocorrectionType;
@property NSTextInputTraitType spellCheckingType;
@property NSTextInputTraitType grammarCheckingType;
@property NSTextInputTraitType smartQuotesType;
@property NSTextInputTraitType smartDashesType;
@property NSTextInputTraitType smartInsertDeleteType;
@property NSTextInputTraitType textReplacementType;
@property NSTextInputTraitType dataDetectionType;
@property NSTextInputTraitType linkDetectionType;
@property NSTextInputTraitType textCompletionType;
@end
@protocol NSTextCheckingClient <NSTextInputClient, NSTextInputTraits>
@required
/* These methods suppose that ranges of text in the document may have attached to them certain annotations relevant for text checking, represented by dictionaries with various keys, such as NSSpellingStateAttributeName for ranges of text marked as misspelled. They allow an NSTextCheckingController instance to set and retrieve these annotations, and to perform other actions required for text checking. The keys and values in these annotation dictionaries will always be strings.
*/
/* In all of these methods, the standard range adjustment policy is as follows: if the specified range lies only partially within the bounds of the document, the receiver is responsible for adjusting the range so as to limit it to the bounds of the document. If the specified range is {NSNotFound, 0}, then the receiver should replace it with the entire range of the document. Otherwise, if none of the range lies within the bounds of the document, then these methods should have no effect, and return nil where appropriate. The beginning and end of the document are not considered as lying outside of the bounds of the document, and zero-length ranges are acceptable (although in some cases they may have no effect).
*/
/* Returns annotated string specified by range. The range should be adjusted according to the standard range adjustment policy, and in addition for this method alone it should be adjusted to begin and end on paragraph boundaries (with possible exceptions for paragraphs exceeding some maximum length). If the range lies within the bounds of the document but is of zero length, it should be adjusted to include the enclosing paragraph. This method should return nil if none of the range lies within the bounds of the document, but if only a zero-length portion of the adjusted range lies within the bounds of the document, as may happen with an empty document or at the end of the document, then an empty attributed string should be returned rather than nil. If the return value is non-nil and actualRange is non-NULL, then actualRange returns the actual adjusted range used.
*/
- (nullable NSAttributedString *)annotatedSubstringForProposedRange:(NSRange)range actualRange:(nullable NSRangePointer)actualRange;
/* The receiver replaces any existing annotations on the specified range with the provided annotations. The range should be adjusted according to the standard range adjustment policy. Has no effect if the adjusted range has zero length.
*/
- (void)setAnnotations:(NSDictionary<NSAttributedStringKey, NSString *> *)annotations range:(NSRange)range;
/* The receiver adds the specified annotation to the specified range. The range should be adjusted according to the standard range adjustment policy. Has no effect if the adjusted range has zero length.
*/
- (void)addAnnotations:(NSDictionary<NSAttributedStringKey, NSString *> *)annotations range:(NSRange)range;
/* The receiver removes the specified annotation from the specified range. The range should be adjusted according to the standard range adjustment policy. Has no effect if the adjusted range has zero length.
*/
- (void)removeAnnotation:(NSAttributedStringKey)annotationName range:(NSRange)range;
/* The receiver replaces the text in the specified range with the corrected text from annotatedString, or inserts it if the range has zero length, and replaces existing annotations (if any) with those in annotatedString. The range should be adjusted according to the standard range adjustment policy.
*/
- (void)replaceCharactersInRange:(NSRange)range withAnnotatedString:(NSAttributedString *)annotatedString;
/* The receiver selects the text in the specified range and where appropriate scrolls so that it is at least partially visible. A zero-length selection corresponds to an insertion point. The range should be adjusted according to the standard range adjustment policy.
*/
- (void)selectAndShowRange:(NSRange)range;
/* Returns the view displaying the first logical area for range, and the corresponding rect in view coordinates. The range should be adjusted according to the standard range adjustment policy. May return nil if the range is not being displayed, or if none of the range lies within the bounds of the document. A zero-length selection corresponds to an insertion point, and this should return an appropriate view and rect if the adjusted range is of zero length, provided it lies within the bounds of the document (including at the end of the document) and is being displayed. If the return value is non-nil and actualRange is non-NULL, then actualRange returns the range of text displayed in the returned rect.
*/
- (nullable NSView *)viewForRange:(NSRange)range firstRect:(nullable NSRectPointer)firstRect actualRange:(nullable NSRangePointer)actualRange;
/* Returns the appropriate candidate list touch bar item for displaying touch bar candidates, if any.
*/
- (nullable NSCandidateListTouchBarItem *)candidateListTouchBarItem;
@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/NSRulerView.h | /*
NSRulerView.h
Application Kit
Copyright (c) 1994-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSArray.h>
#import <AppKit/NSView.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSScrollView, NSRulerMarker;
typedef NS_ENUM(NSUInteger, NSRulerOrientation) {
NSHorizontalRuler,
NSVerticalRuler
};
typedef NSString * NSRulerViewUnitName NS_TYPED_EXTENSIBLE_ENUM;
APPKIT_EXTERN NSRulerViewUnitName const NSRulerViewUnitInches API_AVAILABLE(macos(10.13));
APPKIT_EXTERN NSRulerViewUnitName const NSRulerViewUnitCentimeters API_AVAILABLE(macos(10.13));
APPKIT_EXTERN NSRulerViewUnitName const NSRulerViewUnitPoints API_AVAILABLE(macos(10.13));
APPKIT_EXTERN NSRulerViewUnitName const NSRulerViewUnitPicas API_AVAILABLE(macos(10.13));
@interface NSRulerView : NSView
/************************* Registering new units *************************/
+ (void)registerUnitWithName:(NSRulerViewUnitName)unitName abbreviation:(NSString *)abbreviation unitToPointsConversionFactor:(CGFloat)conversionFactor stepUpCycle:(NSArray<NSNumber *> *)stepUpCycle stepDownCycle:(NSArray<NSNumber *> *)stepDownCycle;
/**************************** Initialization ****************************/
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithScrollView:(nullable NSScrollView *)scrollView orientation:(NSRulerOrientation)orientation NS_DESIGNATED_INITIALIZER;
// The designated initializer. A ruler's size is controlled by its NSScrollView. initWithFrame: is overridden to call this. The view is initialized with an unrealistically small default frame which will be reset in due time by the NSScrollView.
/**************************** Basic setup ****************************/
@property (nullable, weak) NSScrollView *scrollView;
// A ruler uses its scrollView to finds its document view to see whether it should be flipped. The set method is generally called only by the scroll view itself. You should not have to set this.
@property NSRulerOrientation orientation;
// Either NSHorizontalRuler or NSVerticalRuler. The set method is generally called by the ruler's scroll view. You should not have to set this.
/**************************** Ruler geometry ****************************/
@property (readonly) CGFloat baselineLocation;
// Returns the location of the baseline. The location is a y position for horizontal rulers and an x position for vertical ones. The value is based on the sizes of the various areas of the ruler, some of which can be set below.
@property (readonly) CGFloat requiredThickness;
// The required height for a horizontal ruler or the required width for a vertical ruler. Used by the scrollview when tiling. The value is based on the sizes of the various areas of the ruler, some of which can be set below.
@property CGFloat ruleThickness;
// The rule size is the height of the area used to draw the ruler hash marks in a horizontal ruler or the width of that area in a vertical ruler. This value will be interpretted in the coordinate system of the ruler's superview (like the ruler's frame).
@property CGFloat reservedThicknessForMarkers;
// This indicates to the ruler how much room it should leave for objects which sit above or to the left of the rule (such as tab stops, margins, etc...). Default is 15.0. If you expect that no view in your document view will ever put objects on the ruler, you can set this to 0.0. If objects are ever set on the ruler, and not enough space was reserved for them, the ruler grows itself and retiles the scroll view.
@property CGFloat reservedThicknessForAccessoryView;
// This indicates to the ruler how much room it should leave for the accessory view. Default is 0.0. If you expect that a view in your document view will put an accessory view in the ruler, you can set this to make room fror it from the start. If an accessory view is ever set for the ruler, and space was not reserved for it or it is bigger than the space reserved, the ruler grows the reserved space to be big enough and retiles the scroll view. If you know that several different accessory views will be used it is best to set this to the height of the tallest one for horizontal rulers or the width of the widest one for vertical rulers. If the reserved thickness is larger than an actual accessory view set into the ruler, the accessory view is centered in the thickness.
/**************************** Rule configuration ****************************/
@property (copy) NSRulerViewUnitName measurementUnits;
// The units of the ruler start out with the user's preferred measurement. They can be changed if desired. The units set must be registered with the ruler factory. By default Inches, Centimeters, Picas, and Points are supported.
@property CGFloat originOffset;
// How far to offset the ruler's zero hash mark (and label) from the document view's bounds origin.
/**************************** Client view setup ****************************/
@property (nullable, weak) NSView *clientView;
- (void)addMarker:(NSRulerMarker *)marker;
- (void)removeMarker:(NSRulerMarker *)marker;
@property (nullable, copy) NSArray<NSRulerMarker *> *markers;
// Ruler objects sit on the ruler at a specific location. They can be manipulatable by the user, and if they are manipulated the current client is informed of the change. Once a bunch of objects has been set, objects can be added or removed individually.
- (BOOL)trackMarker:(NSRulerMarker *)marker withMouseEvent:(NSEvent *)event;
// Given a ruler object and a mouse event (either MouseDown or MouseDragged) this will take over the tracking of the mouse until MouseUp. While tracking it will snap to the baseline of the ruler when it gets within a certain distance. At that point it becomes stuck to the baseline (this may happen immediately) and won't come off below (or to the right of) the ruler. It may still be dragged off the baseline upward (or leftward) if its removable. It is strongly recommended that any ruler object that acan be added to the ruler should be removable as well and it must be movable. When the mouse goes up, if the object is currently stuck to the baseline it is added to the ruler (and the client object is notified), if its not stuck on the baseline, it is not added.
@property (nullable, strong) NSView *accessoryView;
// A rulers accessory view is drawn below or to the right of the rule. It can contain arbitrary controls.
- (void)moveRulerlineFromLocation:(CGFloat)oldLocation toLocation:(CGFloat)newLocation;
// This method can be used to draw temporary lines in the rule. NSRulerMarkers use this during dragging to draw the part of the line they draw from themselves across the scroll views contents which appears in the rule area. You can use this method to draw ticks in the ruler (for example) to show the position or extent of an object while it is being dragged in the document. oldLocation is the last position that the line was at or -1.0 if this is the first time it is being drawn. newLocation is where the line should be or -1.0 if you are just trying to get an old line erased.
/*********************** Drawing and hash invalidation ***********************/
- (void)invalidateHashMarks;
// Forces recalculation of the hash mark dictionary next time any display is done. You should not generally have to call this method.
- (void)drawHashMarksAndLabelsInRect:(NSRect)rect;
// You should never need to call this, but you might want to override it. This method is called by -drawRect: to draw the actual hash marks and labels on the ruler.
- (void)drawMarkersInRect:(NSRect)rect;
// You should never need to call this, but you might want to override it. This method is called by -drawRect: to draw the ruler objects on the ruler. If you want to do something different you can override this.
/**************************** Key overrides ****************************/
@property (getter=isFlipped, readonly) BOOL flipped;
// A vertical ruler mimics the flippedness of the documentView of it's scrollView. A horizontal ruler is always flipped (for ease of drawing).
@end
// This informal protocol defines the communication between a ruler and its client view during mouse tracking.
@interface NSView (NSRulerMarkerClientViewDelegation)
- (BOOL)rulerView:(NSRulerView *)ruler shouldMoveMarker:(NSRulerMarker *)marker;
// This is sent when a drag operation is just beginning for a ruler marker already on the ruler. If the ruler object should be allowed to either move or remove, return YES. If you return NO, all tracking is abandoned and nothing happens.
- (CGFloat)rulerView:(NSRulerView *)ruler willMoveMarker:(NSRulerMarker *)marker toLocation:(CGFloat)location;
// This is sent continuously while the mouse is being dragged. The client can constrian the movement by returning a different location. Receipt of one or more of these messages does not guarantee that the corresponding "did" method will be called. Only movable objects will send this message.
- (void)rulerView:(NSRulerView *)ruler didMoveMarker:(NSRulerMarker *)marker;
// This is called if the NSRulerMarker actually ended up with a different location than it started with after the drag completes. It is not called if the object gets removed, or if the object gets dragged around and dropped right where it was. Only movable objects will send this message.
- (BOOL)rulerView:(NSRulerView *)ruler shouldRemoveMarker:(NSRulerMarker *)marker;
// This is sent each time the object is dragged off the baseline enough that if it were dropped, it would be removed. It can be sent multiple times in the course of a drag. Return YES if it's OK to remove the object, NO if not. Receipt of this message does not guarantee that the corresponding "did" method will be called. Only removable objects will send this message.
- (void)rulerView:(NSRulerView *)ruler didRemoveMarker:(NSRulerMarker *)marker;
// This is sent if the object is actually removed. The object has been removed from the ruler when this message is sent.
- (BOOL)rulerView:(NSRulerView *)ruler shouldAddMarker:(NSRulerMarker *)marker;
// This is sent when a drag operation is just beginning for a ruler marker that is being added. If the ruler object should be allowed to add, return YES. If you return NO, all tracking is abandoned and nothing happens.
- (CGFloat)rulerView:(NSRulerView *)ruler willAddMarker:(NSRulerMarker *)marker atLocation:(CGFloat)location;
// This is sent continuously while the mouse is being dragged during an add operation and the new object is stuck on the baseline. The client can constrian the movement by returning a different location. Receipt of one or more of these messages does not guarantee that the corresponding "did" method will be called. Any object sending these messages is not yet added to the ruler it is being dragged on.
- (void)rulerView:(NSRulerView *)ruler didAddMarker:(NSRulerMarker *)marker;
// This is sent after the object has been added to the ruler.
- (void)rulerView:(NSRulerView *)ruler handleMouseDown:(NSEvent *)event;
// This is sent when the user clicks in the rule area of the ruler. The "rule" area is the area below the baseline where the hash marks and labels are drawn. A common use for this method would be to make clicking in the rule be a shortcut for adding the most common type of ruler object for a particuar client. NSTextView will use this to insert a new left tab (as a short cut to dragging one out of the well in the accessory view).
- (void)rulerView:(NSRulerView *)ruler willSetClientView:(NSView *)newClient;
// This is sent to the existing client before it is replaced by the new client. The existing client can catch this to clean up any cached state it keeps while it is the client of a ruler.
- (CGFloat)rulerView:(NSRulerView *)ruler locationForPoint:(NSPoint)point API_AVAILABLE(macos(10.7));
- (NSPoint)rulerView:(NSRulerView *)ruler pointForLocation:(CGFloat)point API_AVAILABLE(macos(10.7));
// This additional mapping allows mapping between location and point for clients with rotated coordinate system (e.g., vertical text view).
@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/NSRulerMarker.h | /*
NSRulerMarker.h
Application Kit
Copyright (c) 1994-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 NSEvent, NSImage, NSRulerView;
@interface NSRulerMarker : NSObject <NSCopying, NSCoding>
/**************************** Initialization ****************************/
/* Designated initializer. Location is expressed in the client view's bounds coordinates. Location is the x position if the ruler is horizontal or the y position if the ruler is vertical. The image will not be scaled or rotated. The image origin indicates the point in the image that will be placed on the ruler's baseline at the given location and is expressed in the image's coordinate system. NSRulerMarkers are movable but not removable by default. A removable object should have its dimmed image set.
*/
- (instancetype)initWithRulerView:(NSRulerView *)ruler markerLocation:(CGFloat)location image:(NSImage *)image imageOrigin:(NSPoint)imageOrigin NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
/*********************** Query/Set basic attributes ***********************/
/* Returns the ruler.
*/
@property (readonly, weak) NSRulerView *ruler;
/* The location is set by the -init... method and the -setLocation: method. Location is an x position for horizontal rulers or a y position for vertical rulers. It is expressed in the client view's coordinate system.
*/
@property CGFloat markerLocation;
/* The image is what's drawn in the ruler.
*/
@property (strong) NSImage *image;
/* The image is drawn such that the image origin is on the baseline of the ruler at the object's location.
*/
@property NSPoint imageOrigin;
/* Objects are movable, but not removable by default. Movable means the ruler object can be dragged by the user. Removable means it can be deleted by the user.
*/
@property (getter=isMovable) BOOL movable;
@property (getter=isRemovable) BOOL removable;
/* Returns YES if the ruler object is currently being dragged.
*/
@property (getter=isDragging, readonly) BOOL dragging;
/* The representedObject of an NSRulerMarker is purely for the client's use. It must be able to copy itself. A represented object should be some small object. The text object uses NSStrings for most ruler objects or NSTextTab objects for tab stops.
*/
@property (nullable, strong) id<NSCopying> representedObject;
/************************** Ruler facilities **************************/
/* Returns the rect that would be occupied by the object's image in the ruler's bounds coordinates. This takes the flippedness of the ruler into account.
*/
@property (readonly) NSRect imageRectInRuler;
/* Returns the height or width (depending on the ruler's orientation) required in the ruler to display the object.
*/
@property (readonly) CGFloat thicknessRequiredInRuler;
/* Draws the object at it's current location. Only rect needs to be drawn.
*/
- (void)drawRect:(NSRect)rect;
/* Handles the given mmouseDown event. Performs a modal tracking loop until mouseUp allowing the object to be moved, if movable or removed, if removable.
*/
- (BOOL)trackMouse:(NSEvent *)mouseDownEvent adding:(BOOL)isAdding;
@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/NSTouch.h | /*
NSTouch.h
Application Kit
Copyright (c) 2009-2021, Apple Inc.
All rights reserved.
*/
#import <Foundation/NSObjCRuntime.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSDate.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
@class NSView;
typedef NS_OPTIONS(NSUInteger, NSTouchPhase) {
NSTouchPhaseBegan = 1U << 0,
NSTouchPhaseMoved = 1U << 1,
NSTouchPhaseStationary = 1U << 2,
NSTouchPhaseEnded = 1U << 3,
NSTouchPhaseCancelled = 1U << 4,
NSTouchPhaseTouching = NSTouchPhaseBegan | NSTouchPhaseMoved | NSTouchPhaseStationary,
NSTouchPhaseAny = NSUIntegerMax
} API_AVAILABLE(macos(10.7));
typedef NS_ENUM(NSInteger, NSTouchType) {
NSTouchTypeDirect, // A direct touch from a finger (on a screen)
NSTouchTypeIndirect, // An indirect touch (not a screen)
} API_AVAILABLE(macos(10.12.2));
typedef NS_OPTIONS(NSUInteger, NSTouchTypeMask) {
NSTouchTypeMaskDirect = (1 << NSTouchTypeDirect), // A direct touch from a finger (on a screen)
NSTouchTypeMaskIndirect = (1 << NSTouchTypeIndirect), // An indirect touch (not a screen)
} API_AVAILABLE(macos(10.12.2));
NS_INLINE NSTouchTypeMask NSTouchTypeMaskFromType(NSTouchType type) { return (1 << type); }
/* Unlike the iPhone, NSTouch objects do not persist for the life of the touch.
*/
API_AVAILABLE(macos(10.6))
@interface NSTouch : NSObject <NSCopying>
/* Properties of this touch */
/* Use the identity property to track changes to a particular touch during the touch's life. While touch identities may be re-used, they are unique during the life of the touch, even when multiple devices are present. Note: identity objects implement the NSCopying protocol so that they may be used as keys in an NSDictionary. Use isEqual: to compare two touch identities.
*/
@property (readonly, strong) id<NSObject, NSCopying> identity;
@property (readonly) NSTouchPhase phase;
@property (readonly) NSPoint normalizedPosition; // Scaled absolute position is in [0,1], where (0, 0) is the lower left of the surface.
@property (readonly, getter=isResting) BOOL resting;
/* Properties of the underlying touch device */
@property (nullable, readonly, strong) id device; // The digitizer that generated the touch. Useful to distinguish touches emanating from multiple-device scenario
/* The range of the touch device in points (72ppi). Note: 0,0 is the lower left of the surface.
*/
@property (readonly) NSSize deviceSize;
@end
@interface NSTouch (NSTouchBar)
/* A touch can only be one type at a time */
@property(readonly) NSTouchType type API_AVAILABLE(macos(10.12.2));
/* These two methods are only valid for Direct touches. A nil view means the touch location in the root container of touch. */
- (NSPoint)locationInView:(nullable NSView *)view API_AVAILABLE(macos(10.12.2));
- (NSPoint)previousLocationInView:(nullable NSView *)view 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/NSSwitch.h | /*
NSSwitch.h
Application Kit
Copyright (c) 2019-2021, Apple Inc.
All rights reserved.
*/
#import <AppKit/NSControl.h>
#import <AppKit/AppKitDefines.h>
NS_ASSUME_NONNULL_BEGIN
APPKIT_API_UNAVAILABLE_BEGIN_MACCATALYST
API_AVAILABLE(macos(10.15))
@interface NSSwitch : NSControl <NSAccessibilitySwitch>
/* The current position of the switch. The values `NSControlStateValueOff` and `NSControlStateValueOn` indicate that the switch is in either the off or on position respectively. If the state property is set to any other value, it is interpreted as on.
If set through the animator proxy, the switch animates to the new value.
*/
@property NSControlStateValue state;
@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.