forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sdk_forward_declarations.h
394 lines (311 loc) · 12.8 KB
/
sdk_forward_declarations.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file contains forward declarations for items in later SDKs than the
// default one with which Chromium is built (currently 10.10).
// If you call any function from this header, be sure to check at runtime for
// respondsToSelector: before calling these functions (else your code will crash
// on older OS X versions that chrome still supports).
#ifndef BASE_MAC_SDK_FORWARD_DECLARATIONS_H_
#define BASE_MAC_SDK_FORWARD_DECLARATIONS_H_
#import <AppKit/AppKit.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import <CoreWLAN/CoreWLAN.h>
#import <IOBluetooth/IOBluetooth.h>
#import <ImageCaptureCore/ImageCaptureCore.h>
#import <LocalAuthentication/LocalAuthentication.h>
#import <QuartzCore/QuartzCore.h>
#include <stdint.h>
#include "base/base_export.h"
#include "base/mac/availability.h"
// ----------------------------------------------------------------------------
// Define typedefs, enums, and protocols not available in the version of the
// OSX SDK being compiled against.
// ----------------------------------------------------------------------------
#if !defined(MAC_OS_X_VERSION_10_11) || \
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11
enum {
NSPressureBehaviorUnknown = -1,
NSPressureBehaviorPrimaryDefault = 0,
NSPressureBehaviorPrimaryClick = 1,
NSPressureBehaviorPrimaryGeneric = 2,
NSPressureBehaviorPrimaryAccelerator = 3,
NSPressureBehaviorPrimaryDeepClick = 5,
NSPressureBehaviorPrimaryDeepDrag = 6
};
typedef NSInteger NSPressureBehavior;
@interface NSPressureConfiguration : NSObject
- (instancetype)initWithPressureBehavior:(NSPressureBehavior)pressureBehavior;
@end
enum {
NSSpringLoadingHighlightNone = 0,
NSSpringLoadingHighlightStandard,
NSSpringLoadingHighlightEmphasized
};
typedef NSUInteger NSSpringLoadingHighlight;
#endif // MAC_OS_X_VERSION_10_11
#if !defined(MAC_OS_X_VERSION_10_12) || \
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
// The protocol was formalized by the 10.12 SDK, but it was informally used
// before.
@protocol CAAnimationDelegate
- (void)animationDidStart:(CAAnimation*)animation;
- (void)animationDidStop:(CAAnimation*)animation finished:(BOOL)finished;
@end
@protocol CALayerDelegate
@end
#endif // MAC_OS_X_VERSION_10_12
#if !defined(MAC_OS_X_VERSION_10_13_2) || \
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13_2
enum {
LABiometryTypeNone = 0,
LABiometryTypeFaceID = 1,
LABiometryTypeTouchID = 2
};
typedef NSInteger LABiometryType;
@interface LAContext (HighSierraPointTwoSDK)
@property(nonatomic, readonly) LABiometryType biometryType;
@end
#endif // MAC_OS_X_VERSION_10_13_2
// ----------------------------------------------------------------------------
// Define NSStrings only available in newer versions of the OSX SDK to force
// them to be statically linked.
// ----------------------------------------------------------------------------
extern "C" {
#if !defined(MAC_OS_X_VERSION_10_10) || \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10
BASE_EXPORT extern NSString* const CIDetectorTypeQRCode;
BASE_EXPORT extern NSString* const NSUserActivityTypeBrowsingWeb;
BASE_EXPORT extern NSString* const NSAppearanceNameVibrantDark;
BASE_EXPORT extern NSString* const NSAppearanceNameVibrantLight;
#endif // MAC_OS_X_VERSION_10_10
} // extern "C"
// ----------------------------------------------------------------------------
// If compiling against an older version of the OSX SDK, declare classes and
// functions that are available in newer versions of the OSX SDK. If compiling
// against a newer version of the OSX SDK, redeclare those same classes and
// functions to suppress -Wpartial-availability warnings.
// ----------------------------------------------------------------------------
// Once Chrome no longer supports OSX 10.9, everything within this preprocessor
// block can be removed.
#if !defined(MAC_OS_X_VERSION_10_10) || \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10
@interface NSUserActivity (YosemiteSDK)
@property(readonly, copy) NSString* activityType;
@property(copy) NSDictionary* userInfo;
@property(copy) NSURL* webpageURL;
@property(copy) NSString* title;
- (instancetype)initWithActivityType:(NSString*)activityType;
- (void)becomeCurrent;
- (void)invalidate;
@end
@interface CBUUID (YosemiteSDK)
- (NSString*)UUIDString;
@end
@interface NSViewController (YosemiteSDK)
- (void)viewDidLoad;
@end
@interface NSWindow (YosemiteSDK)
- (void)setTitlebarAppearsTransparent:(BOOL)flag;
@end
@interface NSProcessInfo (YosemiteSDK)
@property(readonly) NSOperatingSystemVersion operatingSystemVersion;
@end
@interface NSLayoutConstraint (YosemiteSDK)
@property(getter=isActive) BOOL active;
+ (void)activateConstraints:(NSArray*)constraints;
@end
@interface NSVisualEffectView (YosemiteSDK)
- (void)setState:(NSVisualEffectState)state;
@end
@class NSVisualEffectView;
@interface CIQRCodeFeature (YosemiteSDK)
@property(readonly) CGRect bounds;
@property(readonly) CGPoint topLeft;
@property(readonly) CGPoint topRight;
@property(readonly) CGPoint bottomLeft;
@property(readonly) CGPoint bottomRight;
@property(readonly, copy) NSString* messageString;
@end
@class CIQRCodeFeature;
@interface NSView (YosemiteSDK)
- (BOOL)isAccessibilitySelectorAllowed:(SEL)selector;
@property(copy) NSString* accessibilityLabel;
@end
#endif // MAC_OS_X_VERSION_10_10
// Once Chrome no longer supports OSX 10.10.2, everything within this
// preprocessor block can be removed.
#if !defined(MAC_OS_X_VERSION_10_10_3) || \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10_3
@interface NSEvent (Yosemite_3_SDK)
@property(readonly) NSInteger stage;
@end
#endif // MAC_OS_X_VERSION_10_10
// ----------------------------------------------------------------------------
// Define NSStrings only available in newer versions of the OSX SDK to force
// them to be statically linked.
// ----------------------------------------------------------------------------
extern "C" {
#if !defined(MAC_OS_X_VERSION_10_11) || \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11
BASE_EXPORT extern NSString* const CIDetectorTypeText;
#endif // MAC_OS_X_VERSION_10_11
} // extern "C"
// Once Chrome no longer supports OSX 10.10, everything within this
// preprocessor block can be removed.
#if !defined(MAC_OS_X_VERSION_10_11) || \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11
@class NSLayoutDimension;
@class NSLayoutXAxisAnchor;
@class NSLayoutYAxisAnchor;
@interface NSObject (ElCapitanSDK)
- (NSLayoutConstraint*)constraintEqualToConstant:(CGFloat)c;
- (NSLayoutConstraint*)constraintGreaterThanOrEqualToConstant:(CGFloat)c;
@end
@interface NSView (ElCapitanSDK)
- (void)setPressureConfiguration:(NSPressureConfiguration*)aConfiguration
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* bottomAnchor API_AVAILABLE(macos(10.11));
@property(readonly, strong)
NSLayoutDimension* widthAnchor API_AVAILABLE(macos(10.11));
@end
@interface NSWindow (ElCapitanSDK)
- (void)performWindowDragWithEvent:(NSEvent*)event;
@end
@interface CIRectangleFeature (ElCapitanSDK)
@property(readonly) CGRect bounds;
@end
@class CIRectangleFeature;
#endif // MAC_OS_X_VERSION_10_11
// Once Chrome no longer supports OSX 10.11, everything within this
// preprocessor block can be removed.
#if !defined(MAC_OS_X_VERSION_10_12) || \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12
@interface NSWindow (SierraSDK)
@property(class) BOOL allowsAutomaticWindowTabbing;
@end
#endif // MAC_OS_X_VERSION_10_12
// Once Chrome no longer supports OSX 10.12.0, everything within this
// preprocessor block can be removed.
#if !defined(MAC_OS_X_VERSION_10_12_1) || \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12_1
@interface NSButton (SierraPointOneSDK)
@property(copy) NSColor* bezelColor;
@property BOOL imageHugsTitle;
+ (instancetype)buttonWithTitle:(NSString*)title
target:(id)target
action:(SEL)action;
+ (instancetype)buttonWithImage:(NSImage*)image
target:(id)target
action:(SEL)action;
+ (instancetype)buttonWithTitle:(NSString*)title
image:(NSImage*)image
target:(id)target
action:(SEL)action;
@end
@interface NSSegmentedControl (SierraPointOneSDK)
+ (instancetype)segmentedControlWithImages:(NSArray*)images
trackingMode:(NSSegmentSwitchTracking)trackingMode
target:(id)target
action:(SEL)action;
@end
@interface NSTextField (SierraPointOneSDK)
+ (instancetype)labelWithAttributedString:
(NSAttributedString*)attributedStringValue;
@end
#endif // MAC_OS_X_VERSION_10_12_1
// Once Chrome no longer supports OSX 10.12, everything within this
// preprocessor block can be removed.
#if !defined(MAC_OS_X_VERSION_10_13) || \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_13
// VNRequest forward declarations.
@class VNRequest;
typedef void (^VNRequestCompletionHandler)(VNRequest* request, NSError* error);
@interface VNRequest : NSObject<NSCopying>
- (instancetype)initWithCompletionHandler:
(VNRequestCompletionHandler)completionHandler NS_DESIGNATED_INITIALIZER;
@property(readonly, nonatomic, copy) NSArray* results;
@end
// VNDetectFaceLandmarksRequest forward declarations.
@interface VNImageBasedRequest : VNRequest
@end
@protocol VNFaceObservationAccepting<NSObject>
@end
@interface VNDetectFaceLandmarksRequest
: VNImageBasedRequest<VNFaceObservationAccepting>
@end
// VNImageRequestHandler forward declarations.
typedef NSString* VNImageOption NS_STRING_ENUM;
@interface VNImageRequestHandler : NSObject
- (instancetype)initWithCIImage:(CIImage*)image
options:(NSDictionary<VNImageOption, id>*)options;
- (BOOL)performRequests:(NSArray<VNRequest*>*)requests error:(NSError**)error;
@end
// VNFaceLandmarks2D forward declarations.
@interface VNFaceLandmarkRegion : NSObject
@property(readonly) NSUInteger pointCount;
@end
@interface VNFaceLandmarkRegion2D : VNFaceLandmarkRegion
@property(readonly, assign)
const CGPoint* normalizedPoints NS_RETURNS_INNER_POINTER;
@end
@interface VNFaceLandmarks2D : NSObject
@property(readonly) VNFaceLandmarkRegion2D* leftEye;
@property(readonly) VNFaceLandmarkRegion2D* rightEye;
@property(readonly) VNFaceLandmarkRegion2D* outerLips;
@property(readonly) VNFaceLandmarkRegion2D* nose;
@end
// VNFaceObservation forward declarations.
@interface VNObservation : NSObject<NSCopying, NSSecureCoding>
@end
@interface VNDetectedObjectObservation : VNObservation
@property(readonly, nonatomic, assign) CGRect boundingBox;
@end
@interface VNFaceObservation : VNDetectedObjectObservation
@property(readonly, nonatomic, strong) VNFaceLandmarks2D* landmarks;
@end
// VNDetectBarcodesRequest forward declarations.
typedef NSString* VNBarcodeSymbology NS_STRING_ENUM;
@interface VNDetectBarcodesRequest : VNImageBasedRequest
@property(readwrite, nonatomic, copy) NSArray<VNBarcodeSymbology>* symbologies;
@end
// VNBarcodeObservation forward declarations.
@interface VNRectangleObservation : VNDetectedObjectObservation
@end
@interface VNBarcodeObservation : VNRectangleObservation
@property(readonly, nonatomic, copy) NSString* payloadStringValue;
@end
#endif // MAC_OS_X_VERSION_10_13
// Once Chrome no longer supports macOS 10.13, everything within this
// preprocessor block can be removed.
#if !defined(MAC_OS_X_VERSION_10_14) || \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14
typedef NSString* NSAppearanceName;
@interface NSApplication (ForwardDeclare)
@property(strong) NSAppearance* appearance;
@property(readonly, strong) NSAppearance* effectiveAppearance;
@end
@interface NSAppearance (ForwardDeclare)
- (NSAppearanceName)bestMatchFromAppearancesWithNames:
(NSArray<NSAppearanceName>*)appearances;
@end
BASE_EXPORT extern NSAppearanceName const NSAppearanceNameDarkAqua;
#endif
// ----------------------------------------------------------------------------
// The symbol for kCWSSIDDidChangeNotification is available in the
// CoreWLAN.framework for OSX versions 10.6 through 10.10. The symbol is not
// declared in the OSX 10.9+ SDK, so when compiling against an OSX 10.9+ SDK,
// declare the symbol.
// ----------------------------------------------------------------------------
BASE_EXPORT extern "C" NSString* const kCWSSIDDidChangeNotification;
// Once Chrome is built with at least the macOS 10.13 SDK, everything within
// this preprocessor block can be removed.
#if !defined(MAC_OS_X_VERSION_10_13)
typedef NSString* NSTextCheckingOptionKey;
#endif
#endif // BASE_MAC_SDK_FORWARD_DECLARATIONS_H_