Skip to content

Commit

Permalink
Merge pull request #23 from serjepatoff/master
Browse files Browse the repository at this point in the history
Added 10.15 SDK (from Command Line Tools for Xcode 11)
  • Loading branch information
phracker authored Oct 6, 2019
2 parents 13e3d66 + 0c17980 commit ef9fe35
Show file tree
Hide file tree
Showing 30,536 changed files with 9,413,477 additions and 1 deletion.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added MacOSX10.15.sdk/Entitlements.plist
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// SFContentBlockerManager.h
// SafariServices
//
// Copyright © 2016 Apple Inc. All rights reserved.
//

#import <SafariServices/SFFoundation.h>

#if __OBJC2__

#import <Foundation/Foundation.h>
#import <SafariServices/SFError.h>

NS_ASSUME_NONNULL_BEGIN

@class SFContentBlockerState;

SF_CLASS_AVAILABLE_MAC_SAFARI(10_0)
@interface SFContentBlockerManager : NSObject

+ (void)reloadContentBlockerWithIdentifier:(NSString *)identifier completionHandler:(void (^ _Nullable)(NSError * _Nullable error))completionHandler;
+ (void)getStateOfContentBlockerWithIdentifier:(NSString *)identifier completionHandler:(void (^)(SFContentBlockerState * _Nullable state, NSError * _Nullable error))completionHandler;

@end

NS_ASSUME_NONNULL_END

#endif // __OBJC2__
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// SFContentBlockerState.h
// SafariServices
//
// Copyright © 2016 Apple Inc. All rights reserved.
//

#import <SafariServices/SFFoundation.h>

#if __OBJC2__

#import <Foundation/Foundation.h>

SF_CLASS_AVAILABLE_MAC_SAFARI(10_0)
@interface SFContentBlockerState : NSObject

@property (nonatomic, readonly, getter=isEnabled) BOOL enabled;

@end

#endif // __OBJC2__
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// SFError.h
// SafariServices
//
// Copyright © 2016 Apple Inc. All rights reserved.
//

#import <SafariServices/SFFoundation.h>

#if __OBJC2__

#import <Foundation/Foundation.h>

SF_EXTERN NSString * const SFErrorDomain SF_AVAILABLE_MAC_SAFARI(10_0);

typedef NS_ENUM(NSInteger, SFErrorCode) {
SFErrorNoExtensionFound = 1,
SFErrorNoAttachmentFound = 2,
SFErrorLoadingInterrupted = 3,
} SF_ENUM_AVAILABLE_MAC_SAFARI(10_0);

#endif // __OBJC2__
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
//
// SFFoundation.h
// SafariServices
//
// Copyright © 2016 Apple Inc. All rights reserved.
//

#import <Availability.h>

#ifdef __cplusplus
#define SF_EXTERN extern "C" __attribute__((visibility ("default")))
#else
#define SF_EXTERN extern __attribute__((visibility ("default")))
#endif

#define SF_AVAILABLE_MAC_SAFARI(_safari) SF_AVAILABLE_MAC_SAFARI_##_safari
#define SF_CLASS_AVAILABLE_MAC_SAFARI(_safari) SF_CLASS_AVAILABLE_MAC_SAFARI_##_safari
#define SF_ENUM_AVAILABLE_MAC_SAFARI(_safari) SF_ENUM_AVAILABLE_MAC_SAFARI_##_safari
#define SF_DEPRECATED_MAC_SAFARI(_safariIntroduced, _safariDeprecated, ...) SF_DEPRECATED_MAC_SAFARI_##_safariIntroduced##_##_safariDeprecated(__VA_ARGS__)

#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
#define SF_AVAILABLE_MAC_SAFARI_13_0 NS_AVAILABLE_MAC(10_15)
#define SF_CLASS_AVAILABLE_MAC_SAFARI_13_0 NS_CLASS_AVAILABLE_MAC(10_15)
#define SF_ENUM_AVAILABLE_MAC_SAFARI_13_0 NS_ENUM_AVAILABLE_MAC(10_15)
#else
#define SF_AVAILABLE_MAC_SAFARI_13_0 __attribute__((weak_import))
#define SF_CLASS_AVAILABLE_MAC_SAFARI_13_0 __attribute__((visibility("default"))) __attribute__((weak_import))
#define SF_ENUM_AVAILABLE_MAC_SAFARI_13_0
#endif

#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101404
#define SF_AVAILABLE_MAC_SAFARI_12_1 NS_AVAILABLE_MAC(10_14_4)
#define SF_CLASS_AVAILABLE_MAC_SAFARI_12_1 NS_CLASS_AVAILABLE_MAC(10_14_4)
#define SF_ENUM_AVAILABLE_MAC_SAFARI_12_1 NS_ENUM_AVAILABLE_MAC(10_14_4)
#else
#define SF_AVAILABLE_MAC_SAFARI_12_1 __attribute__((weak_import))
#define SF_CLASS_AVAILABLE_MAC_SAFARI_12_1 __attribute__((visibility("default"))) __attribute__((weak_import))
#define SF_ENUM_AVAILABLE_MAC_SAFARI_12_1
#endif

#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
#define SF_AVAILABLE_MAC_SAFARI_12_0 NS_AVAILABLE_MAC(10_14)
#define SF_CLASS_AVAILABLE_MAC_SAFARI_12_0 NS_CLASS_AVAILABLE_MAC(10_14)
#define SF_ENUM_AVAILABLE_MAC_SAFARI_12_0 NS_ENUM_AVAILABLE_MAC(10_14)
#else
#define SF_AVAILABLE_MAC_SAFARI_12_0 __attribute__((weak_import))
#define SF_CLASS_AVAILABLE_MAC_SAFARI_12_0 __attribute__((visibility("default"))) __attribute__((weak_import))
#define SF_ENUM_AVAILABLE_MAC_SAFARI_12_0
#endif

#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101304
#define SF_AVAILABLE_MAC_SAFARI_11_1 NS_AVAILABLE_MAC(10_13_4)
#define SF_CLASS_AVAILABLE_MAC_SAFARI_11_1 NS_CLASS_AVAILABLE_MAC(10_13_4)
#define SF_ENUM_AVAILABLE_MAC_SAFARI_11_1 NS_ENUM_AVAILABLE_MAC(10_13_4)
#else
#define SF_AVAILABLE_MAC_SAFARI_11_1 __attribute__((weak_import))
#define SF_CLASS_AVAILABLE_MAC_SAFARI_11_1 __attribute__((visibility("default"))) __attribute__((weak_import))
#define SF_ENUM_AVAILABLE_MAC_SAFARI_11_1
#endif

#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
#define SF_DEPRECATED_MAC_SAFARI_10_0_11_0(_message) NS_DEPRECATED_MAC(10_12, 10_13, _message)
#define SF_AVAILABLE_MAC_SAFARI_11_0 NS_AVAILABLE_MAC(10_13)
#define SF_CLASS_AVAILABLE_MAC_SAFARI_11_0 NS_CLASS_AVAILABLE_MAC(10_13)
#define SF_ENUM_AVAILABLE_MAC_SAFARI_11_0 NS_ENUM_AVAILABLE_MAC(10_13)
#else
#define SF_DEPRECATED_MAC_SAFARI_10_0_11_0(_message)
#define SF_AVAILABLE_MAC_SAFARI_11_0 __attribute__((weak_import))
#define SF_CLASS_AVAILABLE_MAC_SAFARI_11_0 __attribute__((visibility("default"))) __attribute__((weak_import))
#define SF_ENUM_AVAILABLE_MAC_SAFARI_11_0
#endif

#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101204
#define SF_AVAILABLE_MAC_SAFARI_10_1 NS_AVAILABLE_MAC(10_12_4)
#define SF_CLASS_AVAILABLE_MAC_SAFARI_10_1 NS_CLASS_AVAILABLE_MAC(10_12_4)
#define SF_ENUM_AVAILABLE_MAC_SAFARI_10_1 NS_ENUM_AVAILABLE_MAC(10_12_4)
#else
#define SF_AVAILABLE_MAC_SAFARI_10_1 __attribute__((weak_import))
#define SF_CLASS_AVAILABLE_MAC_SAFARI_10_1 __attribute__((visibility("default"))) __attribute__((weak_import))
#define SF_ENUM_AVAILABLE_MAC_SAFARI_10_1
#endif

#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
#define SF_AVAILABLE_MAC_SAFARI_10_0 NS_AVAILABLE_MAC(10_12)
#define SF_CLASS_AVAILABLE_MAC_SAFARI_10_0 NS_CLASS_AVAILABLE_MAC(10_12)
#define SF_ENUM_AVAILABLE_MAC_SAFARI_10_0 NS_ENUM_AVAILABLE_MAC(10_12)
#else
#define SF_AVAILABLE_MAC_SAFARI_10_0 __attribute__((weak_import))
#define SF_CLASS_AVAILABLE_MAC_SAFARI_10_0 __attribute__((visibility("default"))) __attribute__((weak_import))
#define SF_ENUM_AVAILABLE_MAC_SAFARI_10_0
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// SFSafariApplication.h
// SafariServices
//
// Copyright © 2016 Apple Inc. All rights reserved.
//

#import <SafariServices/SFFoundation.h>

#if __OBJC2__

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class NSRunningApplication;
@class SFSafariWindow;

SF_CLASS_AVAILABLE_MAC_SAFARI(10_0)
@interface SFSafariApplication : NSObject

+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;

/// Calls the completion handler with the active browser window.
+ (void)getActiveWindowWithCompletionHandler:(void (^)(SFSafariWindow * _Nullable activeWindow))completionHandler;

/// Calls the completion handler with all currently open windows ordered front to back.
+ (void)getAllWindowsWithCompletionHandler:(void (^)(NSArray<SFSafariWindow *> *windows))completionHandler SF_AVAILABLE_MAC_SAFARI(12_1);

/// Opens a new window with a tab containing the URL to pass in.
+ (void)openWindowWithURL:(NSURL *)url completionHandler:(void (^ _Nullable)(SFSafariWindow * _Nullable window))completionHandler;

/// This will cause -validateToolbarItemInWindow:completionHandler: to be called on all windows, to let the extension update enabled states or badges of its toolbar items.
+ (void)setToolbarItemsNeedUpdate;

/// Gets an NSRunningApplication instance with information about the app that this extension is connected to.
+ (void)getHostApplicationWithCompletionHandler:(void (^)(NSRunningApplication *hostApplication))completionHandler SF_AVAILABLE_MAC_SAFARI(11_0);

/// Opens Safari Extensions preferences and selects extension with the identifier.
+ (void)showPreferencesForExtensionWithIdentifier:(NSString *)identifier completionHandler:(void (^ _Nullable)(NSError * _Nullable error))completionHandler NS_EXTENSION_UNAVAILABLE("Not available to extensions");

// Dispatches a message to the Safari Extension with the given identifier.
+ (void)dispatchMessageWithName:(NSString *)messageName toExtensionWithIdentifier:(NSString *)identifier userInfo:(nullable NSDictionary<NSString *, id> *)userInfo completionHandler:(void (^ _Nullable)(NSError * _Nullable error))completionHandler NS_EXTENSION_UNAVAILABLE("Not available to extensions") SF_AVAILABLE_MAC_SAFARI(10_1);

@end

NS_ASSUME_NONNULL_END

#endif // __OBJC2__
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// SFSafariExtension.h
// SafariServices
//
// Copyright © 2018 Apple Inc. All rights reserved.
//

#import <SafariServices/SFFoundation.h>

#if __OBJC2__

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

SF_CLASS_AVAILABLE_MAC_SAFARI(12_1)
@interface SFSafariExtension : NSObject

+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;

/// Calls the completion handler with the base URI of the extension.
+ (void)getBaseURIWithCompletionHandler:(void (^)(NSURL * _Nullable baseURI))completionHandler;

@end

NS_ASSUME_NONNULL_END

#endif // __OBJC2__
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// SFSafariExtensionHandler.h
// SafariServices
//
// Copyright © 2016 Apple Inc. All rights reserved.
//

#if __OBJC2__

#import <Foundation/Foundation.h>
#import <SafariServices/SFFoundation.h>
#import <SafariServices/SFSafariExtensionHandling.h>

NS_ASSUME_NONNULL_BEGIN

SF_CLASS_AVAILABLE_MAC_SAFARI(10_0)
@interface SFSafariExtensionHandler : NSObject <NSExtensionRequestHandling, SFSafariExtensionHandling>
@end

NS_ASSUME_NONNULL_END

#endif // __OBJC2__
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
//
// SFSafariExtensionHandling.h
// SafariServices
//
// Copyright © 2016 Apple Inc. All rights reserved.
//

#if __OBJC2__

#import <Foundation/Foundation.h>
#import <SafariServices/SFFoundation.h>

@class SFSafariExtensionViewController;
@class SFSafariPage;
@class SFSafariWindow;

NS_ASSUME_NONNULL_BEGIN

@protocol SFSafariExtensionHandling <NSObject>

@optional
/// This is called when a content script from an extension dispatches a message to the app extension.
- (void)messageReceivedWithName:(NSString *)messageName fromPage:(SFSafariPage *)page userInfo:(nullable NSDictionary<NSString *, id> *)userInfo;

/// This is called when the extension's containing app dispatches a message to the app extension.
- (void)messageReceivedFromContainingAppWithName:(NSString *)messageName userInfo:(nullable NSDictionary<NSString *, id> *)userInfo SF_AVAILABLE_MAC_SAFARI(10_1);

/// This is called when the extension's toolbar item is clicked.
- (void)toolbarItemClickedInWindow:(SFSafariWindow *)window;

/// This is called when Safari's state changed in some way that would require the extension's toolbar item to be validated again.
- (void)validateToolbarItemInWindow:(SFSafariWindow *)window validationHandler:(void (^)(BOOL enabled, NSString *badgeText))validationHandler;

/// This is called when one of the extension's context menu items is selected.
- (void)contextMenuItemSelectedWithCommand:(NSString *)command inPage:(SFSafariPage *)page userInfo:(nullable NSDictionary<NSString *, id> *)userInfo;

/// This is called before context menu is shown, and provides a way to validate individual context menu items.
- (void)validateContextMenuItemWithCommand:(NSString *)command inPage:(SFSafariPage *)page userInfo:(nullable NSDictionary<NSString *, id> *)userInfo validationHandler:(void (^)(BOOL shouldHide, NSString * _Nullable text))validationHandler SF_AVAILABLE_MAC_SAFARI(10_1);

/// This is called when the extension's popover is about to be opened.
- (void)popoverWillShowInWindow:(SFSafariWindow *)window;

/// This is called after the extension's popover is closed.
- (void)popoverDidCloseInWindow:(SFSafariWindow *)window;

/// Returns the extension popover's view controller.
- (SFSafariExtensionViewController *)popoverViewController;

/// This is called when Safari is about to load a page that the extension has stated it wants to add additional headers for.
- (void)additionalRequestHeadersForURL:(NSURL *)url completionHandler:(void (^)(NSDictionary<NSString *, NSString *> * _Nullable))completionHandler SF_AVAILABLE_MAC_SAFARI(11_1);

/// This is called when a content blocker associated with this Safari App Extension performs a blocking action.
- (void)contentBlockerWithIdentifier:(NSString *)contentBlockerIdentifier blockedResourcesWithURLs:(NSArray<NSURL *> *)urls onPage:(SFSafariPage *)page SF_AVAILABLE_MAC_SAFARI(13_0);

/// This is called when a page in Safari navigates to a URL. The URL will be nil when the extension doesn't have access to it.
- (void)page:(SFSafariPage *)page willNavigateToURL:(nullable NSURL *)url SF_AVAILABLE_MAC_SAFARI(13_0);

@end

NS_ASSUME_NONNULL_END

#endif // __OBJC2__
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// SFSafariExtensionManager.h
// Safari
//
// Copyright © 2016 Apple Inc. All rights reserved.
//

#import <SafariServices/SFFoundation.h>

#if __OBJC2__

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class SFSafariExtensionState;

SF_CLASS_AVAILABLE_MAC_SAFARI(10_0)
@interface SFSafariExtensionManager : NSObject

+ (void)getStateOfSafariExtensionWithIdentifier:(NSString *)identifier completionHandler:(void (^)(SFSafariExtensionState * _Nullable state, NSError * _Nullable error))completionHandler;

@end

NS_ASSUME_NONNULL_END

#endif // __OBJC2__
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// SFSafariExtensionState.h
// Safari
//
// Copyright © 2016 Apple Inc. All rights reserved.
//

#import <SafariServices/SFFoundation.h>

#if __OBJC2__

#import <Foundation/Foundation.h>

SF_CLASS_AVAILABLE_MAC_SAFARI(10_0)
@interface SFSafariExtensionState : NSObject

@property (nonatomic, readonly, getter=isEnabled) BOOL enabled;

@end

#endif // __OBJC2__
Loading

0 comments on commit ef9fe35

Please sign in to comment.