#if (defined(USE_UIKIT_PUBLIC_HEADERS) && USE_UIKIT_PUBLIC_HEADERS) || !__has_include() // // UIPasteboard.h // UIKit // // Copyright (c) 2008-2018 Apple Inc. All rights reserved. // #import #import NS_HEADER_AUDIT_BEGIN(nullability, sendability) typedef NSString * UIPasteboardName NS_TYPED_EXTENSIBLE_ENUM; UIKIT_EXTERN UIPasteboardName const UIPasteboardNameGeneral API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); UIKIT_EXTERN NSString *const UIPasteboardNameFind API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos) API_DEPRECATED("The Find pasteboard is no longer available.", ios(3.0, 10.0)); typedef NSString * UIPasteboardDetectionPattern NS_TYPED_ENUM API_AVAILABLE(ios(14.0)); /// NSString value, suitable for implementing "Paste and Go" UIKIT_EXTERN UIPasteboardDetectionPattern const UIPasteboardDetectionPatternProbableWebURL API_AVAILABLE(ios(14.0)); /// NSString value, suitable for implementing "Paste and Search" UIKIT_EXTERN UIPasteboardDetectionPattern const UIPasteboardDetectionPatternProbableWebSearch API_AVAILABLE(ios(14.0)); /// NSNumber value UIKIT_EXTERN UIPasteboardDetectionPattern const UIPasteboardDetectionPatternNumber API_AVAILABLE(ios(14.0)); /// Array of DDMatchLink values UIKIT_EXTERN UIPasteboardDetectionPattern const UIPasteboardDetectionPatternLink NS_REFINED_FOR_SWIFT API_AVAILABLE(ios(15.0)); /// Array of DDMatchPhoneNumber values UIKIT_EXTERN UIPasteboardDetectionPattern const UIPasteboardDetectionPatternPhoneNumber NS_REFINED_FOR_SWIFT API_AVAILABLE(ios(15.0)); /// Array of DDMatchEmailAddress values UIKIT_EXTERN UIPasteboardDetectionPattern const UIPasteboardDetectionPatternEmailAddress NS_REFINED_FOR_SWIFT API_AVAILABLE(ios(15.0)); /// Array of DDMatchAddress values UIKIT_EXTERN UIPasteboardDetectionPattern const UIPasteboardDetectionPatternPostalAddress NS_REFINED_FOR_SWIFT API_AVAILABLE(ios(15.0)); /// Array of DDMatchCalendarEvent values UIKIT_EXTERN UIPasteboardDetectionPattern const UIPasteboardDetectionPatternCalendarEvent NS_REFINED_FOR_SWIFT API_AVAILABLE(ios(15.0)); /// Array of DDMatchShipmentTrackingNumber values UIKIT_EXTERN UIPasteboardDetectionPattern const UIPasteboardDetectionPatternShipmentTrackingNumber NS_REFINED_FOR_SWIFT API_AVAILABLE(ios(15.0)); /// Array of DDMatchFlightNumber values UIKIT_EXTERN UIPasteboardDetectionPattern const UIPasteboardDetectionPatternFlightNumber NS_REFINED_FOR_SWIFT API_AVAILABLE(ios(15.0)); /// Array of DDMatchMoneyAmount values UIKIT_EXTERN UIPasteboardDetectionPattern const UIPasteboardDetectionPatternMoneyAmount NS_REFINED_FOR_SWIFT API_AVAILABLE(ios(15.0)); @class UIColor, UIImage; UIKIT_EXTERN API_AVAILABLE(ios(3.0)) API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos) NS_SWIFT_SENDABLE @interface UIPasteboard : NSObject @property(class, nonatomic, readonly) UIPasteboard *generalPasteboard; + (nullable UIPasteboard *)pasteboardWithName:(UIPasteboardName)pasteboardName create:(BOOL)create; + (UIPasteboard *)pasteboardWithUniqueName; @property(readonly,nonatomic) UIPasteboardName name; + (void)removePasteboardWithName:(UIPasteboardName)pasteboardName; @property(readonly,getter=isPersistent,nonatomic) BOOL persistent; - (void)setPersistent:(BOOL)persistent API_DEPRECATED("Do not set persistence on pasteboards. This property is set automatically.", ios(3.0, 10.0)); @property(readonly,nonatomic) NSInteger changeCount; // Item provider interface @property (nonatomic, copy) NSArray<__kindof NSItemProvider *> *itemProviders API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(watchos, tvos); - (void)setItemProviders:(NSArray *)itemProviders localOnly:(BOOL)localOnly expirationDate:(NSDate * _Nullable)expirationDate API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(watchos, tvos); // Automatically creates item providers wrapping the objects passed in. - (void)setObjects:(NSArray> *)objects API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(watchos, tvos); - (void)setObjects:(NSArray> *)objects localOnly:(BOOL)localOnly expirationDate:(NSDate * _Nullable)expirationDate API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(watchos, tvos); // First item @property(nonatomic, readonly) NSArray * pasteboardTypes; - (BOOL)containsPasteboardTypes:(NSArray *)pasteboardTypes; - (nullable NSData *)dataForPasteboardType:(NSString *)pasteboardType; - (nullable id)valueForPasteboardType:(NSString *)pasteboardType; - (void)setValue:(id)value forPasteboardType:(NSString *)pasteboardType; - (void)setData:(NSData *)data forPasteboardType:(NSString *)pasteboardType; // Multiple items @property(readonly,nonatomic) NSInteger numberOfItems; - (nullable NSArray *> *)pasteboardTypesForItemSet:(nullable NSIndexSet*)itemSet; - (BOOL)containsPasteboardTypes:(NSArray *)pasteboardTypes inItemSet:(nullable NSIndexSet *)itemSet; - (nullable NSIndexSet *)itemSetWithPasteboardTypes:(NSArray *)pasteboardTypes; - (nullable NSArray *)valuesForPasteboardType:(NSString *)pasteboardType inItemSet:(nullable NSIndexSet *)itemSet; - (nullable NSArray *)dataForPasteboardType:(NSString *)pasteboardType inItemSet:(nullable NSIndexSet *)itemSet; // Direct access @property(nonatomic,copy) NSArray *> *items; - (void)addItems:(NSArray *> *)items; typedef NSString * UIPasteboardOption NS_TYPED_ENUM API_AVAILABLE(ios(10.0)); UIKIT_EXTERN UIPasteboardOption const UIPasteboardOptionExpirationDate API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos) API_AVAILABLE(ios(10.0)) NS_SWIFT_NAME(UIPasteboardOption.expirationDate); // Value: NSDate. UIKIT_EXTERN UIPasteboardOption const UIPasteboardOptionLocalOnly API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos) API_AVAILABLE(ios(10.0)) NS_SWIFT_NAME(UIPasteboardOption.localOnly); // Value: NSNumber, boolean. - (void)setItems:(NSArray *> *)items options:(NSDictionary *)options API_AVAILABLE(ios(10.0)); @property(nullable,nonatomic,copy) NSString *string API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); @property(nullable,nonatomic,copy) NSArray *strings API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); @property(nullable,nonatomic,copy) NSURL *URL API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); @property(nullable,nonatomic,copy) NSArray *URLs API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); @property(nullable,nonatomic,copy) UIImage *image API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); @property(nullable,nonatomic,copy) NSArray *images API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); @property(nullable,nonatomic,copy) UIColor *color API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); @property(nullable,nonatomic,copy) NSArray *colors API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); // Queries @property (nonatomic, readonly) BOOL hasStrings API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos) API_AVAILABLE(ios(10.0)); @property (nonatomic, readonly) BOOL hasURLs API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos) API_AVAILABLE(ios(10.0)); @property (nonatomic, readonly) BOOL hasImages API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos) API_AVAILABLE(ios(10.0)); @property (nonatomic, readonly) BOOL hasColors API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos) API_AVAILABLE(ios(10.0)); // Detection /// Detects patterns in the first pasteboard item. /// /// @param patterns Detect only these patterns. /// @param completionHandler Receives which patterns were detected, or an error. - (void)detectPatternsForPatterns:(NSSet *)patterns completionHandler:(void(^)(NSSet * _Nullable, NSError * _Nullable))completionHandler NS_REFINED_FOR_SWIFT API_AVAILABLE(ios(14.0)); /// Detects patterns in the specified pasteboard items. /// /// @param patterns Detect only these patterns. /// @param itemSet Specifies which pasteboard items by their position. Nil means all items. /// @param completionHandler Receives which patterns were detected per item specified, /// or an error. - (void)detectPatternsForPatterns:(NSSet *)patterns inItemSet:(NSIndexSet * _Nullable)itemSet completionHandler:(void(^)(NSArray *> * _Nullable, NSError * _Nullable))completionHandler NS_REFINED_FOR_SWIFT API_AVAILABLE(ios(14.0)); /// Detects patterns and corresponding values in the first pasteboard item. /// /// @param patterns Detect only these patterns. /// @param completionHandler Receives which patterns and values were detected, or an error. - (void)detectValuesForPatterns:(NSSet *)patterns completionHandler:(void(^)(NSDictionary * _Nullable, NSError * _Nullable))completionHandler NS_REFINED_FOR_SWIFT API_AVAILABLE(ios(14.0)); /// Detects patterns and corresponding values in the specified pasteboard items. /// /// @param patterns Detect only these patterns. /// @param itemSet Specifies which pasteboard items by their position. Nil means all items. /// @param completionHandler Receives which patterns and values were detected per item specified, /// or an error. - (void)detectValuesForPatterns:(NSSet *)patterns inItemSet:(NSIndexSet * _Nullable)itemSet completionHandler:(void(^)(NSArray *> * _Nullable, NSError * _Nullable))completionHandler NS_REFINED_FOR_SWIFT API_AVAILABLE(ios(14.0)); @end // Notification UIKIT_EXTERN NSNotificationName const UIPasteboardChangedNotification API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); UIKIT_EXTERN NSString *const UIPasteboardChangedTypesAddedKey API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); UIKIT_EXTERN NSString *const UIPasteboardChangedTypesRemovedKey API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); UIKIT_EXTERN NSNotificationName const UIPasteboardRemovedNotification API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); // Types UIKIT_EXTERN NSArray *UIPasteboardTypeListString API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); UIKIT_EXTERN NSArray *UIPasteboardTypeListURL API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); UIKIT_EXTERN NSArray *UIPasteboardTypeListImage API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); UIKIT_EXTERN NSArray *UIPasteboardTypeListColor API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos); // Use the following type in setItems: or setItems:options: to automatically insert appropriate UTIs for supported types. // Supported types are: NSString, NSURL, UIImage, UIColor, NSAttributedString. UIKIT_EXTERN NSString * const UIPasteboardTypeAutomatic API_UNAVAILABLE(tvos) API_UNAVAILABLE(watchos) API_AVAILABLE(ios(10.0)); NS_HEADER_AUDIT_END(nullability, sendability) #else #import #endif