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
3 // found in the LICENSE file.
5 // This file contains forward declarations for items in later SDKs than the
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
8 // respondsToSelector: before calling these functions (else your code will crash
9 // on older OS X versions that chrome still supports).
11 #ifndef BASE_MAC_SDK_FORWARD_DECLARATIONS_H_
12 #define BASE_MAC_SDK_FORWARD_DECLARATIONS_H_
14 #import <AppKit/AppKit.h>
15 #import <CoreWLAN/CoreWLAN.h>
16 #import <ImageCaptureCore/ImageCaptureCore.h>
17 #import <IOBluetooth/IOBluetooth.h>
19 #include "base/base_export.h"
21 #if !defined(MAC_OS_X_VERSION_10_7) || \
22 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
25 NSEventPhaseNone
= 0, // event not associated with a phase.
26 NSEventPhaseBegan
= 0x1 << 0,
27 NSEventPhaseStationary
= 0x1 << 1,
28 NSEventPhaseChanged
= 0x1 << 2,
29 NSEventPhaseEnded
= 0x1 << 3,
30 NSEventPhaseCancelled
= 0x1 << 4
32 typedef NSUInteger NSEventPhase
;
35 NSFullScreenWindowMask
= 1 << 14,
39 NSApplicationPresentationFullScreen
= 1 << 10,
43 NSWindowCollectionBehaviorFullScreenPrimary
= 1 << 7,
44 NSWindowCollectionBehaviorFullScreenAuxiliary
= 1 << 8,
48 NSEventSwipeTrackingLockDirection
= 0x1 << 0,
49 NSEventSwipeTrackingClampGestureAmount
= 0x1 << 1,
51 typedef NSUInteger NSEventSwipeTrackingOptions
;
54 NSWindowAnimationBehaviorDefault
= 0,
55 NSWindowAnimationBehaviorNone
= 2,
56 NSWindowAnimationBehaviorDocumentWindow
= 3,
57 NSWindowAnimationBehaviorUtilityWindow
= 4,
58 NSWindowAnimationBehaviorAlertPanel
= 5
60 typedef NSInteger NSWindowAnimationBehavior
;
63 NSWindowDocumentVersionsButton
= 6,
64 NSWindowFullScreenButton
,
66 typedef NSUInteger NSWindowButton
;
68 @interface
NSEvent (LionSDK
)
69 + (BOOL
)isSwipeTrackingFromScrollEventsEnabled
;
71 - (NSEventPhase
)momentumPhase
;
72 - (NSEventPhase
)phase
;
73 - (CGFloat
)scrollingDeltaX
;
74 - (CGFloat
)scrollingDeltaY
;
75 - (void)trackSwipeEventWithOptions
:(NSEventSwipeTrackingOptions
)options
76 dampenAmountThresholdMin
:(CGFloat
)minDampenThreshold
77 max
:(CGFloat
)maxDampenThreshold
78 usingHandler
:(void (^)(CGFloat gestureAmount
,
81 BOOL
*stop
))trackingHandler
;
83 - (BOOL
)isDirectionInvertedFromDevice
;
87 @interface
NSApplication (LionSDK
)
88 - (void)disableRelaunchOnLogin
;
91 @interface
CALayer (LionSDK
)
92 - (CGFloat
)contentsScale
;
93 - (void)setContentsScale
:(CGFloat
)contentsScale
;
96 @interface
NSScreen (LionSDK
)
97 - (CGFloat
)backingScaleFactor
;
98 - (NSRect
)convertRectToBacking
:(NSRect
)aRect
;
101 @interface
NSWindow (LionSDK
)
102 - (CGFloat
)backingScaleFactor
;
103 - (NSWindowAnimationBehavior
)animationBehavior
;
104 - (void)setAnimationBehavior
:(NSWindowAnimationBehavior
)newAnimationBehavior
;
105 - (void)toggleFullScreen
:(id
)sender
;
106 - (void)setRestorable
:(BOOL
)flag
;
109 @interface
NSCursor (LionSDKDeclarations
)
110 + (NSCursor
*)IBeamCursorForVerticalLayout
;
113 @interface
NSAnimationContext (LionSDK
)
114 + (void)runAnimationGroup
:(void (^)(NSAnimationContext
*context
))changes
115 completionHandler
:(void (^)(void))completionHandler
;
116 @
property(copy
) void(^completionHandler
)(void);
119 @interface
NSView (LionSDK
)
120 - (NSSize
)convertSizeFromBacking
:(NSSize
)size
;
121 - (void)setWantsBestResolutionOpenGLSurface
:(BOOL
)flag
;
124 @interface
NSObject (ICCameraDeviceDelegateLionSDK
)
125 - (void)deviceDidBecomeReadyWithCompleteContentCatalog
:(ICDevice
*)device
;
126 - (void)didDownloadFile
:(ICCameraFile
*)file
127 error
:(NSError
*)error
128 options
:(NSDictionary
*)options
129 contextInfo
:(void*)contextInfo
;
132 @interface
NSScroller (LionSDK
)
133 + (NSInteger
)preferredScrollerStyle
;
136 @interface
CWInterface (LionSDK
)
137 - (BOOL
)associateToNetwork
:(CWNetwork
*)network
138 password
:(NSString
*)password
139 error
:(NSError
**)error
;
140 - (NSSet
*)scanForNetworksWithName
:(NSString
*)networkName
141 error
:(NSError
**)error
;
145 kCWChannelBandUnknown
= 0,
146 kCWChannelBand2GHz
= 1,
147 kCWChannelBand5GHz
= 2,
150 @interface CWChannel
: NSObject
151 @
property(readonly
) CWChannelBand channelBand
;
154 @interface
CWNetwork (LionSDK
)
155 @
property(readonly
) CWChannel
* wlanChannel
;
158 @interface
IOBluetoothHostController (LionSDK
)
159 - (NSString
*)nameAsString
;
160 - (BluetoothHCIPowerState
)powerState
;
164 kBluetoothFeatureLESupportedController
= (1 << 6L),
167 @protocol IOBluetoothDeviceInquiryDelegate
168 - (void)deviceInquiryStarted
:(IOBluetoothDeviceInquiry
*)sender
;
169 - (void)deviceInquiryDeviceFound
:(IOBluetoothDeviceInquiry
*)sender
170 device
:(IOBluetoothDevice
*)device
;
171 - (void)deviceInquiryComplete
:(IOBluetoothDeviceInquiry
*)sender
172 error
:(IOReturn
)error
173 aborted
:(BOOL
)aborted
;
176 @interface
IOBluetoothL2CAPChannel (LionSDK
)
177 @
property(readonly
) BluetoothL2CAPMTU outgoingMTU
;
180 @interface
IOBluetoothDevice (LionSDK
)
181 - (NSString
*)addressString
;
182 - (unsigned int)classOfDevice
;
183 - (BluetoothConnectionHandle
)connectionHandle
;
184 - (BluetoothHCIRSSIValue
)rawRSSI
;
185 - (NSArray
*)services
;
186 - (IOReturn
)performSDPQuery
:(id
)target uuids
:(NSArray
*)uuids
;
189 BASE_EXPORT
extern "C" NSString
* const NSWindowWillEnterFullScreenNotification
;
191 #endif // MAC_OS_X_VERSION_10_7
193 #if !defined(MAC_OS_X_VERSION_10_8) || \
194 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8
197 NSEventPhaseMayBegin
= 0x1 << 5
200 @interface
NSColor (MountainLionSDK
)
201 - (CGColorRef
)CGColor
;
204 #endif // MAC_OS_X_VERSION_10_8
207 #if !defined(MAC_OS_X_VERSION_10_9) || \
208 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
210 // NSProgress is public API in 10.9, but a version of it exists and is usable
213 @interface NSProgress
: NSObject
215 - (instancetype
)initWithParent
:(NSProgress
*)parentProgressOrNil
216 userInfo
:(NSDictionary
*)userInfoOrNil
;
217 @
property (copy
) NSString
* kind
;
219 @property
int64_t totalUnitCount
;
220 @property
int64_t completedUnitCount
;
222 @
property (getter
=isCancellable
) BOOL cancellable
;
223 @
property (getter
=isPausable
) BOOL pausable
;
224 @
property (readonly
, getter
=isCancelled
) BOOL cancelled
;
225 @
property (readonly
, getter
=isPaused
) BOOL paused
;
226 @
property (copy
) void (^cancellationHandler
)(void);
227 @
property (copy
) void (^pausingHandler
)(void);
231 - (void)setUserInfoObject
:(id
)objectOrNil forKey
:(NSString
*)key
;
232 - (NSDictionary
*)userInfo
;
234 @
property (readonly
, getter
=isIndeterminate
) BOOL indeterminate
;
235 @
property (readonly
) double fractionCompleted
;
242 @interface
NSScreen (MavericksSDK
)
243 + (BOOL
)screensHaveSeparateSpaces
;
246 @interface
NSView (MavericksSDK
)
247 - (void)setCanDrawSubviewsIntoLayer
:(BOOL
)flag
;
251 NSWindowOcclusionStateVisible
= 1UL << 1,
253 typedef NSUInteger NSWindowOcclusionState
;
255 @interface
NSWindow (MavericksSDK
)
256 - (NSWindowOcclusionState
)occlusionState
;
259 #endif // MAC_OS_X_VERSION_10_9
261 #if !defined(MAC_OS_X_VERSION_10_10) || \
262 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10
264 @interface NSUserActivity
: NSObject
266 @
property (readonly
, copy
) NSString
* activityType
;
267 @
property (copy
) NSURL
* webPageURL
;
271 BASE_EXPORT
extern "C" NSString
* const NSUserActivityTypeBrowsingWeb
;
273 #endif // MAC_OS_X_VERSION_10_10
275 #endif // BASE_MAC_SDK_FORWARD_DECLARATIONS_H_