OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file contains forward declarations for items in later SDKs than the | 5 // This file contains forward declarations for items in later SDKs than the |
6 // default one with which Chromium is built (currently 10.6). | 6 // default one with which Chromium is built (currently 10.6). |
7 // If you call any function from this header, be sure to check at runtime for | 7 // If you call any function from this header, be sure to check at runtime for |
8 // respondsToSelector: before calling these functions (else your code will crash | 8 // respondsToSelector: before calling these functions (else your code will crash |
9 // on older OS X versions that chrome still supports). | 9 // on older OS X versions that chrome still supports). |
10 | 10 |
11 #ifndef BASE_MAC_SDK_FORWARD_DECLARATIONS_H_ | 11 #ifndef BASE_MAC_SDK_FORWARD_DECLARATIONS_H_ |
12 #define BASE_MAC_SDK_FORWARD_DECLARATIONS_H_ | 12 #define BASE_MAC_SDK_FORWARD_DECLARATIONS_H_ |
13 | 13 |
14 #import <AppKit/AppKit.h> | 14 #import <AppKit/AppKit.h> |
15 #import <CoreWLAN/CoreWLAN.h> | |
16 #import <ImageCaptureCore/ImageCaptureCore.h> | |
17 #import <IOBluetooth/objc/IOBluetoothDevice.h> | |
18 #import <IOBluetooth/objc/IOBluetoothDeviceInquiry.h> | |
19 #import <IOBluetooth/objc/IOBluetoothHostController.h> | |
15 | 20 |
16 #if !defined(MAC_OS_X_VERSION_10_7) || \ | 21 #if !defined(MAC_OS_X_VERSION_10_7) || \ |
17 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 | 22 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 |
18 | 23 |
19 enum { | 24 enum { |
20 NSEventPhaseNone = 0, // event not associated with a phase. | 25 NSEventPhaseNone = 0, // event not associated with a phase. |
21 NSEventPhaseBegan = 0x1 << 0, | 26 NSEventPhaseBegan = 0x1 << 0, |
22 NSEventPhaseStationary = 0x1 << 1, | 27 NSEventPhaseStationary = 0x1 << 1, |
23 NSEventPhaseChanged = 0x1 << 2, | 28 NSEventPhaseChanged = 0x1 << 2, |
24 NSEventPhaseEnded = 0x1 << 3, | 29 NSEventPhaseEnded = 0x1 << 3, |
25 NSEventPhaseCancelled = 0x1 << 4 | 30 NSEventPhaseCancelled = 0x1 << 4 |
26 }; | 31 }; |
27 typedef NSUInteger NSEventPhase; | 32 typedef NSUInteger NSEventPhase; |
28 | 33 |
29 enum { | 34 enum { |
35 NSFullScreenWindowMask = 1 << 14, | |
36 }; | |
37 | |
38 enum { | |
39 NSApplicationPresentationFullScreen = 1 << 10, | |
40 }; | |
41 | |
42 enum { | |
43 NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7, | |
44 NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8, | |
45 }; | |
46 | |
47 enum { | |
30 NSEventSwipeTrackingLockDirection = 0x1 << 0, | 48 NSEventSwipeTrackingLockDirection = 0x1 << 0, |
31 NSEventSwipeTrackingClampGestureAmount = 0x1 << 1, | 49 NSEventSwipeTrackingClampGestureAmount = 0x1 << 1, |
32 }; | 50 }; |
33 typedef NSUInteger NSEventSwipeTrackingOptions; | 51 typedef NSUInteger NSEventSwipeTrackingOptions; |
34 | 52 |
35 enum { | 53 enum { |
36 NSWindowAnimationBehaviorDefault = 0, | 54 NSWindowAnimationBehaviorDefault = 0, |
37 NSWindowAnimationBehaviorNone = 2, | 55 NSWindowAnimationBehaviorNone = 2, |
38 NSWindowAnimationBehaviorDocumentWindow = 3, | 56 NSWindowAnimationBehaviorDocumentWindow = 3, |
39 NSWindowAnimationBehaviorUtilityWindow = 4, | 57 NSWindowAnimationBehaviorUtilityWindow = 4, |
40 NSWindowAnimationBehaviorAlertPanel = 5 | 58 NSWindowAnimationBehaviorAlertPanel = 5 |
41 }; | 59 }; |
42 typedef NSInteger NSWindowAnimationBehavior; | 60 typedef NSInteger NSWindowAnimationBehavior; |
43 | 61 |
62 enum { | |
63 NSWindowDocumentVersionsButton = 6, | |
64 NSWindowFullScreenButton, | |
65 }; | |
66 typedef NSUInteger NSWindowButton; | |
67 | |
44 @interface NSEvent (LionSDK) | 68 @interface NSEvent (LionSDK) |
45 + (BOOL)isSwipeTrackingFromScrollEventsEnabled; | 69 + (BOOL)isSwipeTrackingFromScrollEventsEnabled; |
46 | 70 |
47 - (NSEventPhase)momentumPhase; | 71 - (NSEventPhase)momentumPhase; |
48 - (NSEventPhase)phase; | 72 - (NSEventPhase)phase; |
49 - (CGFloat)scrollingDeltaX; | 73 - (CGFloat)scrollingDeltaX; |
50 - (CGFloat)scrollingDeltaY; | 74 - (CGFloat)scrollingDeltaY; |
51 - (void)trackSwipeEventWithOptions:(NSEventSwipeTrackingOptions)options | 75 - (void)trackSwipeEventWithOptions:(NSEventSwipeTrackingOptions)options |
52 dampenAmountThresholdMin:(CGFloat)minDampenThreshold | 76 dampenAmountThresholdMin:(CGFloat)minDampenThreshold |
53 max:(CGFloat)maxDampenThreshold | 77 max:(CGFloat)maxDampenThreshold |
54 usingHandler:(void (^)(CGFloat gestureAmount, | 78 usingHandler:(void (^)(CGFloat gestureAmount, |
55 NSEventPhase phase, | 79 NSEventPhase phase, |
56 BOOL isComplete, | 80 BOOL isComplete, |
57 BOOL *stop))trackingHandler; | 81 BOOL *stop))trackingHandler; |
58 | 82 |
59 - (BOOL)isDirectionInvertedFromDevice; | 83 - (BOOL)isDirectionInvertedFromDevice; |
60 | 84 |
61 @end | 85 @end |
62 | 86 |
63 @interface CALayer (LionAPI) | 87 @interface NSApplication (LionSDK) |
88 - (void)disableRelaunchOnLogin; | |
89 @end | |
90 | |
91 @interface CALayer (LionSDK) | |
64 - (CGFloat)contentsScale; | 92 - (CGFloat)contentsScale; |
65 - (void)setContentsScale:(CGFloat)contentsScale; | 93 - (void)setContentsScale:(CGFloat)contentsScale; |
66 @end | 94 @end |
67 | 95 |
68 @interface NSScreen (LionSDK) | 96 @interface NSScreen (LionSDK) |
69 - (CGFloat)backingScaleFactor; | 97 - (CGFloat)backingScaleFactor; |
70 - (NSRect)convertRectToBacking:(NSRect)aRect; | 98 - (NSRect)convertRectToBacking:(NSRect)aRect; |
71 @end | 99 @end |
72 | 100 |
73 @interface NSWindow (LionSDK) | 101 @interface NSWindow (LionSDK) |
74 - (CGFloat)backingScaleFactor; | 102 - (CGFloat)backingScaleFactor; |
75 - (NSWindowAnimationBehavior)animationBehavior; | 103 - (NSWindowAnimationBehavior)animationBehavior; |
76 - (void)setAnimationBehavior:(NSWindowAnimationBehavior)newAnimationBehavior; | 104 - (void)setAnimationBehavior:(NSWindowAnimationBehavior)newAnimationBehavior; |
105 - (void)toggleFullScreen:(id)sender; | |
106 - (void)setRestorable:(BOOL)flag; | |
107 @end | |
108 | |
109 @interface NSCursor (LionSDKDeclarations) | |
110 + (NSCursor*)IBeamCursorForVerticalLayout; | |
77 @end | 111 @end |
78 | 112 |
79 @interface NSAnimationContext (LionSDK) | 113 @interface NSAnimationContext (LionSDK) |
80 + (void)runAnimationGroup:(void (^)(NSAnimationContext *context))changes | 114 + (void)runAnimationGroup:(void (^)(NSAnimationContext *context))changes |
81 completionHandler:(void (^)(void))completionHandler; | 115 completionHandler:(void (^)(void))completionHandler; |
82 @end | 116 @end |
83 | 117 |
118 @interface NSView (LionSDK) | |
119 - (NSSize)convertSizeFromBacking:(NSSize)size; | |
120 - (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag; | |
121 @end | |
122 | |
123 @interface NSObject (ICCameraDeviceDelegateLionSDK) | |
124 - (void)deviceDidBecomeReadyWithCompleteContentCatalog:(ICDevice*)device; | |
125 - (void)didDownloadFile:(ICCameraFile*)file | |
126 error:(NSError*)error | |
127 options:(NSDictionary*)options | |
128 contextInfo:(void*)contextInfo; | |
129 @end | |
130 | |
131 @interface NSScroller (LionSDK) | |
132 + (NSInteger)preferredScrollerStyle; | |
133 @end | |
134 | |
135 @interface CWInterface (LionSDK) | |
136 - (BOOL)associateToNetwork:(CWNetwork*)network | |
137 password:(NSString*)password | |
138 error:(NSError**)error; | |
139 - (NSSet*)scanForNetworksWithName:(NSString*)networkName | |
140 error:(NSError**)error; | |
141 @end | |
142 | |
143 enum CWChannelBand { | |
144 kCWChannelBandUnknown = 0, | |
145 kCWChannelBand2GHz = 1, | |
146 kCWChannelBand5GHz = 2, | |
147 }; | |
148 | |
149 @interface CWChannel : NSObject | |
150 @property(readonly) CWChannelBand channelBand; | |
151 @end | |
152 | |
153 @interface CWNetwork (LionSDK) | |
154 @property(readonly) CWChannel* wlanChannel; | |
155 @end | |
156 | |
157 @interface IOBluetoothHostController (LionSDK) | |
158 - (NSString*)nameAsString; | |
159 - (BluetoothHCIPowerState)powerState; | |
160 @end | |
161 | |
162 @protocol IOBluetoothDeviceInquiryDelegate | |
163 - (void)deviceInquiryStarted:(IOBluetoothDeviceInquiry*)sender; | |
164 - (void)deviceInquiryDeviceFound:(IOBluetoothDeviceInquiry*)sender | |
165 device:(IOBluetoothDevice*)device; | |
166 - (void)deviceInquiryComplete:(IOBluetoothDeviceInquiry*)sender | |
167 error:(IOReturn)error | |
168 aborted:(BOOL)aborted; | |
169 @end | |
170 | |
171 @interface IOBluetoothDevice (LionSDK) | |
172 - (NSString*)addressString; | |
173 - (unsigned int)classOfDevice; | |
174 - (BluetoothConnectionHandle)connectionHandle; | |
175 - (BluetoothHCIRSSIValue)rawRSSI; | |
176 - (NSArray*)services; | |
177 - (IOReturn)performSDPQuery:(id)target uuids:(NSArray*)uuids; | |
178 @end | |
179 | |
84 #endif // MAC_OS_X_VERSION_10_7 | 180 #endif // MAC_OS_X_VERSION_10_7 |
85 | 181 |
182 | |
86 #if !defined(MAC_OS_X_VERSION_10_8) || \ | 183 #if !defined(MAC_OS_X_VERSION_10_8) || \ |
87 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8 | 184 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8 |
185 | |
88 enum { | 186 enum { |
89 NSEventPhaseMayBegin = 0x1 << 5 | 187 NSEventPhaseMayBegin = 0x1 << 5 |
90 }; | 188 }; |
189 | |
91 #endif // MAC_OS_X_VERSION_10_8 | 190 #endif // MAC_OS_X_VERSION_10_8 |
92 | 191 |
192 | |
193 #if !defined(MAC_OS_X_VERSION_10_9) || \ | |
194 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9 | |
195 | |
196 // NSProgress is public API in 10.9, but a version of it exists and is usable | |
197 // in 10.8. | |
198 | |
199 @interface NSProgress : NSObject | |
200 | |
201 - (instancetype)initWithParent:(NSProgress*)parentProgressOrNil | |
202 userInfo:(NSDictionary*)userInfoOrNil; | |
203 @property (copy) NSString* kind; | |
204 | |
205 @property int64_t totalUnitCount; | |
206 @property int64_t completedUnitCount; | |
207 | |
208 @property (getter=isCancellable) BOOL cancellable; | |
209 @property (getter=isPausable) BOOL pausable; | |
210 @property (readonly, getter=isCancelled) BOOL cancelled; | |
211 @property (readonly, getter=isPaused) BOOL paused; | |
212 @property (copy) void (^cancellationHandler)(void); | |
213 @property (copy) void (^pausingHandler)(void); | |
214 - (void)cancel; | |
215 - (void)pause; | |
216 | |
217 - (void)setUserInfoObject:(id)objectOrNil forKey:(NSString*)key; | |
218 - (NSDictionary*)userInfo; | |
219 | |
220 @property (readonly, getter=isIndeterminate) BOOL indeterminate; | |
221 @property (readonly) double fractionCompleted; | |
222 | |
223 - (void)publish; | |
224 - (void)unpublish; | |
225 | |
226 @end | |
227 | |
228 @interface NSView (MavericksSDK) | |
229 // Flatten all child views that did not call setWantsLayer:YES into this | |
Mark Mentovai
2014/06/06 21:09:02
This file doesn’t contain usage comments like this
Avi (use Gerrit)
2014/06/06 21:13:10
Done.
| |
230 // view's CALayer. | |
231 - (void)setCanDrawSubviewsIntoLayer:(BOOL)flag; | |
232 @end | |
233 | |
234 enum { | |
235 NSWindowOcclusionStateVisible = 1UL << 1, | |
236 }; | |
237 typedef NSUInteger NSWindowOcclusionState; | |
238 | |
239 @interface NSWindow (MavericksSDK) | |
240 - (NSWindowOcclusionState)occlusionState; | |
241 @end | |
242 | |
243 #endif // MAC_OS_X_VERSION_10_9 | |
244 | |
93 #endif // BASE_MAC_SDK_FORWARD_DECLARATIONS_H_ | 245 #endif // BASE_MAC_SDK_FORWARD_DECLARATIONS_H_ |
OLD | NEW |