| 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> | 15 #import <CoreWLAN/CoreWLAN.h> |
| 16 #import <ImageCaptureCore/ImageCaptureCore.h> | 16 #import <ImageCaptureCore/ImageCaptureCore.h> |
| 17 #import <IOBluetooth/IOBluetooth.h> | 17 #import <IOBluetooth/IOBluetooth.h> |
| 18 | 18 |
| 19 #include "base/base_export.h" | 19 #include "base/base_export.h" |
| 20 | 20 |
| 21 // ---------------------------------------------------------------------------- |
| 22 // Either define or forward declare classes only available in OSX 10.7+. |
| 23 // ---------------------------------------------------------------------------- |
| 24 |
| 25 #if !defined(MAC_OS_X_VERSION_10_7) || \ |
| 26 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 |
| 27 |
| 28 @interface CWChannel : NSObject |
| 29 @end |
| 30 |
| 31 @interface CBPeripheral : NSObject |
| 32 @end |
| 33 |
| 34 @interface CBCentralManager : NSObject |
| 35 @end |
| 36 |
| 37 @interface CBUUID : NSObject |
| 38 @end |
| 39 |
| 40 #else |
| 41 |
| 42 @class CWChannel; |
| 43 @class CBPeripheral; |
| 44 @class CBCentralManager; |
| 45 @class CBUUID; |
| 46 |
| 47 #endif // MAC_OS_X_VERSION_10_7 |
| 48 |
| 49 #if !defined(MAC_OS_X_VERSION_10_8) || \ |
| 50 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8 |
| 51 |
| 52 @interface NSUUID : NSObject |
| 53 @end |
| 54 |
| 55 #else |
| 56 |
| 57 @class NSUUID; |
| 58 |
| 59 #endif // MAC_OS_X_VERSION_10_8 |
| 60 |
| 61 #if !defined(MAC_OS_X_VERSION_10_9) || \ |
| 62 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9 |
| 63 |
| 64 // NSProgress is public API in 10.9, but a version of it exists and is usable |
| 65 // in 10.8. |
| 66 @interface NSProgress : NSObject |
| 67 @end |
| 68 |
| 69 @interface NSAppearance : NSObject |
| 70 @end |
| 71 |
| 72 #else |
| 73 |
| 74 @class NSProgress; |
| 75 @class NSAppearance; |
| 76 |
| 77 #endif // MAC_OS_X_VERSION_10_9 |
| 78 |
| 79 #if !defined(MAC_OS_X_VERSION_10_10) || \ |
| 80 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10 |
| 81 |
| 82 @interface NSUserActivity : NSObject |
| 83 @end |
| 84 |
| 85 #else |
| 86 |
| 87 @class NSUserActivity; |
| 88 |
| 89 #endif // MAC_OS_X_VERSION_10_10 |
| 90 |
| 91 // ---------------------------------------------------------------------------- |
| 92 // Define typedefs, enums, and protocols not available in the version of the |
| 93 // OSX SDK being compiled against. |
| 94 // ---------------------------------------------------------------------------- |
| 95 |
| 21 #if !defined(MAC_OS_X_VERSION_10_7) || \ | 96 #if !defined(MAC_OS_X_VERSION_10_7) || \ |
| 22 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 | 97 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 |
| 23 | 98 |
| 24 enum { | 99 enum { |
| 25 NSEventPhaseNone = 0, // event not associated with a phase. | 100 NSEventPhaseNone = 0, // event not associated with a phase. |
| 26 NSEventPhaseBegan = 0x1 << 0, | 101 NSEventPhaseBegan = 0x1 << 0, |
| 27 NSEventPhaseStationary = 0x1 << 1, | 102 NSEventPhaseStationary = 0x1 << 1, |
| 28 NSEventPhaseChanged = 0x1 << 2, | 103 NSEventPhaseChanged = 0x1 << 2, |
| 29 NSEventPhaseEnded = 0x1 << 3, | 104 NSEventPhaseEnded = 0x1 << 3, |
| 30 NSEventPhaseCancelled = 0x1 << 4 | 105 NSEventPhaseCancelled = 0x1 << 4 |
| 31 }; | 106 }; |
| 32 typedef NSUInteger NSEventPhase; | 107 typedef NSUInteger NSEventPhase; |
| 33 | 108 |
| 34 enum { | 109 enum { |
| 35 NSFullScreenWindowMask = 1 << 14, | 110 NSFullScreenWindowMask = 1 << 14, |
| 36 }; | 111 }; |
| 37 | 112 |
| 38 enum { | 113 enum { |
| 39 NSApplicationPresentationFullScreen = 1 << 10, | 114 NSApplicationPresentationFullScreen = 1 << 10, |
| 40 }; | 115 }; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 58 NSWindowAnimationBehaviorAlertPanel = 5 | 133 NSWindowAnimationBehaviorAlertPanel = 5 |
| 59 }; | 134 }; |
| 60 typedef NSInteger NSWindowAnimationBehavior; | 135 typedef NSInteger NSWindowAnimationBehavior; |
| 61 | 136 |
| 62 enum { | 137 enum { |
| 63 NSWindowDocumentVersionsButton = 6, | 138 NSWindowDocumentVersionsButton = 6, |
| 64 NSWindowFullScreenButton, | 139 NSWindowFullScreenButton, |
| 65 }; | 140 }; |
| 66 typedef NSUInteger NSWindowButton; | 141 typedef NSUInteger NSWindowButton; |
| 67 | 142 |
| 143 enum CWChannelBand { |
| 144 kCWChannelBandUnknown = 0, |
| 145 kCWChannelBand2GHz = 1, |
| 146 kCWChannelBand5GHz = 2, |
| 147 }; |
| 148 |
| 149 enum { |
| 150 kCWSecurityNone = 0, |
| 151 kCWSecurityWEP = 1, |
| 152 kCWSecurityWPAPersonal = 2, |
| 153 kCWSecurityWPAPersonalMixed = 3, |
| 154 kCWSecurityWPA2Personal = 4, |
| 155 kCWSecurityPersonal = 5, |
| 156 kCWSecurityDynamicWEP = 6, |
| 157 kCWSecurityWPAEnterprise = 7, |
| 158 kCWSecurityWPAEnterpriseMixed = 8, |
| 159 kCWSecurityWPA2Enterprise = 9, |
| 160 kCWSecurityEnterprise = 10, |
| 161 kCWSecurityUnknown = NSIntegerMax, |
| 162 }; |
| 163 |
| 164 typedef NSInteger CWSecurity; |
| 165 |
| 166 enum { |
| 167 kBluetoothFeatureLESupportedController = (1 << 6L), |
| 168 }; |
| 169 |
| 170 @protocol IOBluetoothDeviceInquiryDelegate |
| 171 - (void)deviceInquiryStarted:(IOBluetoothDeviceInquiry*)sender; |
| 172 - (void)deviceInquiryDeviceFound:(IOBluetoothDeviceInquiry*)sender |
| 173 device:(IOBluetoothDevice*)device; |
| 174 - (void)deviceInquiryComplete:(IOBluetoothDeviceInquiry*)sender |
| 175 error:(IOReturn)error |
| 176 aborted:(BOOL)aborted; |
| 177 @end |
| 178 |
| 179 @protocol NSWindowDelegateFullScreenAdditions |
| 180 - (void)windowDidFailToEnterFullScreen:(NSWindow*)window; |
| 181 - (void)windowDidFailToExitFullScreen:(NSWindow*)window; |
| 182 @end |
| 183 |
| 184 enum { |
| 185 CBPeripheralStateDisconnected = 0, |
| 186 CBPeripheralStateConnecting, |
| 187 CBPeripheralStateConnected, |
| 188 }; |
| 189 typedef NSInteger CBPeripheralState; |
| 190 |
| 191 enum { |
| 192 CBCentralManagerStateUnknown = 0, |
| 193 CBCentralManagerStateResetting, |
| 194 CBCentralManagerStateUnsupported, |
| 195 CBCentralManagerStateUnauthorized, |
| 196 CBCentralManagerStatePoweredOff, |
| 197 CBCentralManagerStatePoweredOn, |
| 198 }; |
| 199 typedef NSInteger CBCentralManagerState; |
| 200 |
| 201 @protocol CBCentralManagerDelegate; |
| 202 |
| 203 @protocol CBCentralManagerDelegate<NSObject> |
| 204 - (void)centralManagerDidUpdateState:(CBCentralManager*)central; |
| 205 - (void)centralManager:(CBCentralManager*)central |
| 206 didDiscoverPeripheral:(CBPeripheral*)peripheral |
| 207 advertisementData:(NSDictionary*)advertisementData |
| 208 RSSI:(NSNumber*)RSSI; |
| 209 @end |
| 210 |
| 211 #endif // MAC_OS_X_VERSION_10_7 |
| 212 |
| 213 #if !defined(MAC_OS_X_VERSION_10_8) || \ |
| 214 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8 |
| 215 |
| 216 enum { NSEventPhaseMayBegin = 0x1 << 5 }; |
| 217 |
| 218 #endif // MAC_OS_X_VERSION_10_8 |
| 219 |
| 220 #if !defined(MAC_OS_X_VERSION_10_9) || \ |
| 221 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9 |
| 222 |
| 223 enum { |
| 224 NSWindowOcclusionStateVisible = 1UL << 1, |
| 225 }; |
| 226 typedef NSUInteger NSWindowOcclusionState; |
| 227 |
| 228 enum { NSWorkspaceLaunchWithErrorPresentation = 0x00000040 }; |
| 229 |
| 230 #endif // MAC_OS_X_VERSION_10_9 |
| 231 |
| 232 // ---------------------------------------------------------------------------- |
| 233 // Define NSStrings only available in newer versions of the OSX SDK to force |
| 234 // them to be statically linked. |
| 235 // ---------------------------------------------------------------------------- |
| 236 |
| 237 extern "C" { |
| 238 #if !defined(MAC_OS_X_VERSION_10_7) || \ |
| 239 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 |
| 240 BASE_EXPORT extern NSString* const NSWindowWillEnterFullScreenNotification; |
| 241 BASE_EXPORT extern NSString* const NSWindowWillExitFullScreenNotification; |
| 242 BASE_EXPORT extern NSString* const NSWindowDidEnterFullScreenNotification; |
| 243 BASE_EXPORT extern NSString* const NSWindowDidExitFullScreenNotification; |
| 244 BASE_EXPORT extern NSString* const |
| 245 NSWindowDidChangeBackingPropertiesNotification; |
| 246 BASE_EXPORT extern NSString* const CBAdvertisementDataServiceDataKey; |
| 247 #endif // MAC_OS_X_VERSION_10_7 |
| 248 |
| 249 #if !defined(MAC_OS_X_VERSION_10_9) || \ |
| 250 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_9 |
| 251 BASE_EXPORT extern NSString* const NSWindowDidChangeOcclusionStateNotification; |
| 252 BASE_EXPORT extern NSString* const CBAdvertisementDataIsConnectable; |
| 253 #endif // MAC_OS_X_VERSION_10_9 |
| 254 |
| 255 #if !defined(MAC_OS_X_VERSION_10_10) || \ |
| 256 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10 |
| 257 BASE_EXPORT extern NSString* const NSUserActivityTypeBrowsingWeb; |
| 258 BASE_EXPORT extern NSString* const NSAppearanceNameVibrantDark; |
| 259 #endif // MAC_OS_X_VERSION_10_10 |
| 260 } // extern "C" |
| 261 |
| 262 // ---------------------------------------------------------------------------- |
| 263 // If compiling against an older version of the OSX SDK, declare functions that |
| 264 // are available in newer versions of the OSX SDK. If compiling against a newer |
| 265 // version of the OSX SDK, redeclare those same functions to suppress |
| 266 // -Wpartial-availability warnings. |
| 267 // ---------------------------------------------------------------------------- |
| 268 |
| 269 // Once Chrome no longer supports OSX 10.6, everything within this preprocessor |
| 270 // block can be removed. |
| 271 #if !defined(MAC_OS_X_VERSION_10_7) || \ |
| 272 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 |
| 273 |
| 68 @interface NSEvent (LionSDK) | 274 @interface NSEvent (LionSDK) |
| 69 + (BOOL)isSwipeTrackingFromScrollEventsEnabled; | 275 + (BOOL)isSwipeTrackingFromScrollEventsEnabled; |
| 70 | |
| 71 - (NSEventPhase)momentumPhase; | 276 - (NSEventPhase)momentumPhase; |
| 72 - (NSEventPhase)phase; | 277 - (NSEventPhase)phase; |
| 73 - (BOOL)hasPreciseScrollingDeltas; | 278 - (BOOL)hasPreciseScrollingDeltas; |
| 74 - (CGFloat)scrollingDeltaX; | 279 - (CGFloat)scrollingDeltaX; |
| 75 - (CGFloat)scrollingDeltaY; | 280 - (CGFloat)scrollingDeltaY; |
| 76 - (void)trackSwipeEventWithOptions:(NSEventSwipeTrackingOptions)options | 281 - (void)trackSwipeEventWithOptions:(NSEventSwipeTrackingOptions)options |
| 77 dampenAmountThresholdMin:(CGFloat)minDampenThreshold | 282 dampenAmountThresholdMin:(CGFloat)minDampenThreshold |
| 78 max:(CGFloat)maxDampenThreshold | 283 max:(CGFloat)maxDampenThreshold |
| 79 usingHandler:(void (^)(CGFloat gestureAmount, | 284 usingHandler:(void (^)(CGFloat gestureAmount, |
| 80 NSEventPhase phase, | 285 NSEventPhase phase, |
| 81 BOOL isComplete, | 286 BOOL isComplete, |
| 82 BOOL *stop))trackingHandler; | 287 BOOL* stop))trackingHandler; |
| 83 | |
| 84 - (BOOL)isDirectionInvertedFromDevice; | 288 - (BOOL)isDirectionInvertedFromDevice; |
| 85 | |
| 86 @end | 289 @end |
| 87 | 290 |
| 88 @interface NSApplication (LionSDK) | 291 @interface NSApplication (LionSDK) |
| 89 - (void)disableRelaunchOnLogin; | 292 - (void)disableRelaunchOnLogin; |
| 90 @end | 293 @end |
| 91 | 294 |
| 92 @interface CALayer (LionSDK) | 295 @interface CALayer (LionSDK) |
| 93 - (CGFloat)contentsScale; | 296 - (CGFloat)contentsScale; |
| 94 - (void)setContentsScale:(CGFloat)contentsScale; | 297 - (void)setContentsScale:(CGFloat)contentsScale; |
| 95 @end | 298 @end |
| (...skipping 10 matching lines...) Expand all Loading... |
| 106 - (void)toggleFullScreen:(id)sender; | 309 - (void)toggleFullScreen:(id)sender; |
| 107 - (void)setRestorable:(BOOL)flag; | 310 - (void)setRestorable:(BOOL)flag; |
| 108 - (NSRect)convertRectFromScreen:(NSRect)aRect; | 311 - (NSRect)convertRectFromScreen:(NSRect)aRect; |
| 109 @end | 312 @end |
| 110 | 313 |
| 111 @interface NSCursor (LionSDKDeclarations) | 314 @interface NSCursor (LionSDKDeclarations) |
| 112 + (NSCursor*)IBeamCursorForVerticalLayout; | 315 + (NSCursor*)IBeamCursorForVerticalLayout; |
| 113 @end | 316 @end |
| 114 | 317 |
| 115 @interface NSAnimationContext (LionSDK) | 318 @interface NSAnimationContext (LionSDK) |
| 116 + (void)runAnimationGroup:(void (^)(NSAnimationContext *context))changes | 319 + (void)runAnimationGroup:(void (^)(NSAnimationContext* context))changes |
| 117 completionHandler:(void (^)(void))completionHandler; | 320 completionHandler:(void (^)(void))completionHandler; |
| 118 @property(copy) void(^completionHandler)(void); | 321 @property(copy) void (^completionHandler)(void); |
| 119 @end | 322 @end |
| 120 | 323 |
| 121 @interface NSView (LionSDK) | 324 @interface NSView (LionSDK) |
| 122 - (NSSize)convertSizeFromBacking:(NSSize)size; | 325 - (NSSize)convertSizeFromBacking:(NSSize)size; |
| 123 - (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag; | 326 - (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag; |
| 124 @end | 327 @end |
| 125 | 328 |
| 126 @interface NSObject (ICCameraDeviceDelegateLionSDK) | 329 @interface NSObject (ICCameraDeviceDelegateLionSDK) |
| 127 - (void)deviceDidBecomeReadyWithCompleteContentCatalog:(ICDevice*)device; | 330 - (void)deviceDidBecomeReadyWithCompleteContentCatalog:(ICDevice*)device; |
| 128 - (void)didDownloadFile:(ICCameraFile*)file | 331 - (void)didDownloadFile:(ICCameraFile*)file |
| 129 error:(NSError*)error | 332 error:(NSError*)error |
| 130 options:(NSDictionary*)options | 333 options:(NSDictionary*)options |
| 131 contextInfo:(void*)contextInfo; | 334 contextInfo:(void*)contextInfo; |
| 132 @end | 335 @end |
| 133 | 336 |
| 134 @interface NSScroller (LionSDK) | 337 @interface NSScroller (LionSDK) |
| 135 + (NSInteger)preferredScrollerStyle; | 338 + (NSInteger)preferredScrollerStyle; |
| 136 @end | 339 @end |
| 137 | 340 |
| 138 @interface CWInterface (LionSDK) | 341 @interface CWInterface (LionSDK) |
| 139 - (BOOL)associateToNetwork:(CWNetwork*)network | 342 - (BOOL)associateToNetwork:(CWNetwork*)network |
| 140 password:(NSString*)password | 343 password:(NSString*)password |
| 141 error:(NSError**)error; | 344 error:(NSError**)error; |
| 142 - (NSSet*)scanForNetworksWithName:(NSString*)networkName | 345 - (NSSet*)scanForNetworksWithName:(NSString*)networkName error:(NSError**)error; |
| 143 error:(NSError**)error; | |
| 144 @end | 346 @end |
| 145 | 347 |
| 146 enum CWChannelBand { | 348 @interface CWChannel (LionSDK) |
| 147 kCWChannelBandUnknown = 0, | |
| 148 kCWChannelBand2GHz = 1, | |
| 149 kCWChannelBand5GHz = 2, | |
| 150 }; | |
| 151 | |
| 152 @interface CWChannel : NSObject | |
| 153 @property(readonly) CWChannelBand channelBand; | 349 @property(readonly) CWChannelBand channelBand; |
| 154 @end | 350 @end |
| 155 | 351 |
| 156 enum { | |
| 157 kCWSecurityNone = 0, | |
| 158 kCWSecurityWEP = 1, | |
| 159 kCWSecurityWPAPersonal = 2, | |
| 160 kCWSecurityWPAPersonalMixed = 3, | |
| 161 kCWSecurityWPA2Personal = 4, | |
| 162 kCWSecurityPersonal = 5, | |
| 163 kCWSecurityDynamicWEP = 6, | |
| 164 kCWSecurityWPAEnterprise = 7, | |
| 165 kCWSecurityWPAEnterpriseMixed = 8, | |
| 166 kCWSecurityWPA2Enterprise = 9, | |
| 167 kCWSecurityEnterprise = 10, | |
| 168 kCWSecurityUnknown = NSIntegerMax, | |
| 169 }; | |
| 170 | |
| 171 typedef NSInteger CWSecurity; | |
| 172 | |
| 173 @interface CWNetwork (LionSDK) | 352 @interface CWNetwork (LionSDK) |
| 174 @property(readonly) CWChannel* wlanChannel; | 353 @property(readonly) CWChannel* wlanChannel; |
| 175 @property(readonly) NSInteger rssiValue; | 354 @property(readonly) NSInteger rssiValue; |
| 176 - (BOOL)supportsSecurity:(CWSecurity)security; | 355 - (BOOL)supportsSecurity:(CWSecurity)security; |
| 177 @end | 356 @end |
| 178 | 357 |
| 179 @interface IOBluetoothHostController (LionSDK) | 358 @interface IOBluetoothHostController (LionSDK) |
| 180 - (NSString*)nameAsString; | 359 - (NSString*)nameAsString; |
| 181 - (BluetoothHCIPowerState)powerState; | 360 - (BluetoothHCIPowerState)powerState; |
| 182 @end | 361 @end |
| 183 | 362 |
| 184 enum { | |
| 185 kBluetoothFeatureLESupportedController = (1 << 6L), | |
| 186 }; | |
| 187 | |
| 188 @protocol IOBluetoothDeviceInquiryDelegate | |
| 189 - (void)deviceInquiryStarted:(IOBluetoothDeviceInquiry*)sender; | |
| 190 - (void)deviceInquiryDeviceFound:(IOBluetoothDeviceInquiry*)sender | |
| 191 device:(IOBluetoothDevice*)device; | |
| 192 - (void)deviceInquiryComplete:(IOBluetoothDeviceInquiry*)sender | |
| 193 error:(IOReturn)error | |
| 194 aborted:(BOOL)aborted; | |
| 195 @end | |
| 196 | |
| 197 @interface IOBluetoothL2CAPChannel (LionSDK) | 363 @interface IOBluetoothL2CAPChannel (LionSDK) |
| 198 @property(readonly) BluetoothL2CAPMTU outgoingMTU; | 364 @property(readonly) BluetoothL2CAPMTU outgoingMTU; |
| 199 @end | 365 @end |
| 200 | 366 |
| 201 @interface IOBluetoothDevice (LionSDK) | 367 @interface IOBluetoothDevice (LionSDK) |
| 202 - (NSString*)addressString; | 368 - (NSString*)addressString; |
| 203 - (unsigned int)classOfDevice; | 369 - (unsigned int)classOfDevice; |
| 204 - (BluetoothConnectionHandle)connectionHandle; | 370 - (BluetoothConnectionHandle)connectionHandle; |
| 205 - (BluetoothHCIRSSIValue)rawRSSI; | 371 - (BluetoothHCIRSSIValue)rawRSSI; |
| 206 - (NSArray*)services; | 372 - (NSArray*)services; |
| 207 - (IOReturn)performSDPQuery:(id)target uuids:(NSArray*)uuids; | 373 - (IOReturn)performSDPQuery:(id)target uuids:(NSArray*)uuids; |
| 208 @end | 374 @end |
| 209 | 375 |
| 210 BASE_EXPORT extern "C" NSString* const NSWindowWillEnterFullScreenNotification; | 376 @interface CBPeripheral (LionSDK) |
| 211 BASE_EXPORT extern "C" NSString* const NSWindowWillExitFullScreenNotification; | |
| 212 BASE_EXPORT extern "C" NSString* const NSWindowDidEnterFullScreenNotification; | |
| 213 BASE_EXPORT extern "C" NSString* const NSWindowDidExitFullScreenNotification; | |
| 214 BASE_EXPORT extern "C" NSString* const | |
| 215 NSWindowDidChangeBackingPropertiesNotification; | |
| 216 | |
| 217 @protocol NSWindowDelegateFullScreenAdditions | |
| 218 - (void)windowDidFailToEnterFullScreen:(NSWindow*)window; | |
| 219 - (void)windowDidFailToExitFullScreen:(NSWindow*)window; | |
| 220 @end | |
| 221 | |
| 222 BASE_EXPORT extern "C" NSString* const CBAdvertisementDataServiceDataKey; | |
| 223 | |
| 224 enum { | |
| 225 CBPeripheralStateDisconnected = 0, | |
| 226 CBPeripheralStateConnecting, | |
| 227 CBPeripheralStateConnected, | |
| 228 }; | |
| 229 typedef NSInteger CBPeripheralState; | |
| 230 | |
| 231 @interface CBPeripheral : NSObject | |
| 232 @property(readonly, nonatomic) CFUUIDRef UUID; | 377 @property(readonly, nonatomic) CFUUIDRef UUID; |
| 233 @property(retain, readonly) NSString* name; | 378 @property(retain, readonly) NSString* name; |
| 234 @property(readonly) BOOL isConnected; | 379 @property(readonly) BOOL isConnected; |
| 235 @end | 380 @end |
| 236 | 381 |
| 237 enum { | 382 @interface CBCentralManager (LionSDK) |
| 238 CBCentralManagerStateUnknown = 0, | |
| 239 CBCentralManagerStateResetting, | |
| 240 CBCentralManagerStateUnsupported, | |
| 241 CBCentralManagerStateUnauthorized, | |
| 242 CBCentralManagerStatePoweredOff, | |
| 243 CBCentralManagerStatePoweredOn, | |
| 244 }; | |
| 245 typedef NSInteger CBCentralManagerState; | |
| 246 | |
| 247 @protocol CBCentralManagerDelegate; | |
| 248 | |
| 249 @interface CBCentralManager : NSObject | |
| 250 @property(readonly) CBCentralManagerState state; | 383 @property(readonly) CBCentralManagerState state; |
| 251 - (id)initWithDelegate:(id<CBCentralManagerDelegate>)delegate | 384 - (id)initWithDelegate:(id<CBCentralManagerDelegate>)delegate |
| 252 queue:(dispatch_queue_t)queue; | 385 queue:(dispatch_queue_t)queue; |
| 253 - (void)scanForPeripheralsWithServices:(NSArray*)serviceUUIDs | 386 - (void)scanForPeripheralsWithServices:(NSArray*)serviceUUIDs |
| 254 options:(NSDictionary*)options; | 387 options:(NSDictionary*)options; |
| 255 - (void)stopScan; | 388 - (void)stopScan; |
| 256 @end | 389 @end |
| 257 | 390 |
| 258 @protocol CBCentralManagerDelegate<NSObject> | 391 @interface CBUUID (LionSDK) |
| 259 - (void)centralManagerDidUpdateState:(CBCentralManager*)central; | |
| 260 - (void)centralManager:(CBCentralManager*)central | |
| 261 didDiscoverPeripheral:(CBPeripheral*)peripheral | |
| 262 advertisementData:(NSDictionary*)advertisementData | |
| 263 RSSI:(NSNumber*)RSSI; | |
| 264 @end | |
| 265 | |
| 266 @interface CBUUID : NSObject | |
| 267 @property(nonatomic, readonly) NSData* data; | 392 @property(nonatomic, readonly) NSData* data; |
| 268 + (CBUUID*)UUIDWithString:(NSString*)theString; | 393 + (CBUUID*)UUIDWithString:(NSString*)theString; |
| 269 @end | 394 @end |
| 270 | 395 |
| 271 #endif // MAC_OS_X_VERSION_10_7 | 396 #endif // MAC_OS_X_VERSION_10_7 |
| 272 | 397 |
| 398 // Once Chrome no longer supports OSX 10.7, everything within this preprocessor |
| 399 // block can be removed. |
| 273 #if !defined(MAC_OS_X_VERSION_10_8) || \ | 400 #if !defined(MAC_OS_X_VERSION_10_8) || \ |
| 274 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8 | 401 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8 |
| 275 | |
| 276 enum { | |
| 277 NSEventPhaseMayBegin = 0x1 << 5 | |
| 278 }; | |
| 279 | 402 |
| 280 @interface NSColor (MountainLionSDK) | 403 @interface NSColor (MountainLionSDK) |
| 281 - (CGColorRef)CGColor; | 404 - (CGColorRef)CGColor; |
| 282 @end | 405 @end |
| 283 | 406 |
| 284 @interface NSUUID : NSObject | 407 @interface NSUUID (MountainLionSDK) |
| 285 - (NSString*)UUIDString; | 408 - (NSString*)UUIDString; |
| 286 @end | 409 @end |
| 287 | 410 |
| 288 @interface NSControl (MountainLionSDK) | 411 @interface NSControl (MountainLionSDK) |
| 289 @property BOOL allowsExpansionToolTips; | 412 @property BOOL allowsExpansionToolTips; |
| 290 @end | 413 @end |
| 291 | 414 |
| 292 #endif // MAC_OS_X_VERSION_10_8 | 415 #endif // MAC_OS_X_VERSION_10_8 |
| 293 | 416 |
| 417 // Once Chrome no longer supports OSX 10.8, everything within this preprocessor |
| 418 // block can be removed. |
| 419 #if !defined(MAC_OS_X_VERSION_10_9) || \ |
| 420 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_9 |
| 294 | 421 |
| 295 #if !defined(MAC_OS_X_VERSION_10_9) || \ | 422 @interface NSProgress (MavericksSDK) |
| 296 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9 | |
| 297 | |
| 298 // NSProgress is public API in 10.9, but a version of it exists and is usable | |
| 299 // in 10.8. | |
| 300 | |
| 301 @interface NSProgress : NSObject | |
| 302 | 423 |
| 303 - (instancetype)initWithParent:(NSProgress*)parentProgressOrNil | 424 - (instancetype)initWithParent:(NSProgress*)parentProgressOrNil |
| 304 userInfo:(NSDictionary*)userInfoOrNil; | 425 userInfo:(NSDictionary*)userInfoOrNil; |
| 305 @property (copy) NSString* kind; | 426 @property(copy) NSString* kind; |
| 306 | 427 |
| 307 @property int64_t totalUnitCount; | 428 @property int64_t totalUnitCount; |
| 308 @property int64_t completedUnitCount; | 429 @property int64_t completedUnitCount; |
| 309 | 430 |
| 310 @property (getter=isCancellable) BOOL cancellable; | 431 @property(getter=isCancellable) BOOL cancellable; |
| 311 @property (getter=isPausable) BOOL pausable; | 432 @property(getter=isPausable) BOOL pausable; |
| 312 @property (readonly, getter=isCancelled) BOOL cancelled; | 433 @property(readonly, getter=isCancelled) BOOL cancelled; |
| 313 @property (readonly, getter=isPaused) BOOL paused; | 434 @property(readonly, getter=isPaused) BOOL paused; |
| 314 @property (copy) void (^cancellationHandler)(void); | 435 @property(copy) void (^cancellationHandler)(void); |
| 315 @property (copy) void (^pausingHandler)(void); | 436 @property(copy) void (^pausingHandler)(void); |
| 316 - (void)cancel; | 437 - (void)cancel; |
| 317 - (void)pause; | 438 - (void)pause; |
| 318 | 439 |
| 319 - (void)setUserInfoObject:(id)objectOrNil forKey:(NSString*)key; | 440 - (void)setUserInfoObject:(id)objectOrNil forKey:(NSString*)key; |
| 320 - (NSDictionary*)userInfo; | 441 - (NSDictionary*)userInfo; |
| 321 | 442 |
| 322 @property (readonly, getter=isIndeterminate) BOOL indeterminate; | 443 @property(readonly, getter=isIndeterminate) BOOL indeterminate; |
| 323 @property (readonly) double fractionCompleted; | 444 @property(readonly) double fractionCompleted; |
| 324 | 445 |
| 325 - (void)publish; | 446 - (void)publish; |
| 326 - (void)unpublish; | 447 - (void)unpublish; |
| 327 | 448 |
| 328 @end | 449 @end |
| 329 | 450 |
| 330 @interface NSScreen (MavericksSDK) | 451 @interface NSScreen (MavericksSDK) |
| 331 + (BOOL)screensHaveSeparateSpaces; | 452 + (BOOL)screensHaveSeparateSpaces; |
| 332 @end | 453 @end |
| 333 | 454 |
| 334 // NSAppearance is a new class in the 10.9 SDK. New classes cannot be | |
| 335 // forward-declared because they also require an @implementation, which would | |
| 336 // produce conflicting linkage. Instead, just declare the necessary pieces of | |
| 337 // the interface as a protocol, and treat objects of this type as id. | |
| 338 @protocol CrNSAppearance<NSObject> | |
| 339 + (id<NSObject>)appearanceNamed:(NSString*)name; | |
| 340 @end | |
| 341 | |
| 342 @interface NSView (MavericksSDK) | 455 @interface NSView (MavericksSDK) |
| 343 - (void)setCanDrawSubviewsIntoLayer:(BOOL)flag; | 456 - (void)setCanDrawSubviewsIntoLayer:(BOOL)flag; |
| 344 - (id<CrNSAppearance>)effectiveAppearance; | 457 - (NSAppearance*)effectiveAppearance; |
| 345 @end | 458 @end |
| 346 | 459 |
| 347 enum { | |
| 348 NSWindowOcclusionStateVisible = 1UL << 1, | |
| 349 }; | |
| 350 typedef NSUInteger NSWindowOcclusionState; | |
| 351 | |
| 352 @interface NSWindow (MavericksSDK) | 460 @interface NSWindow (MavericksSDK) |
| 353 - (NSWindowOcclusionState)occlusionState; | 461 - (NSWindowOcclusionState)occlusionState; |
| 354 @end | 462 @end |
| 355 | 463 |
| 356 | 464 @interface NSAppearance (MavericksSDK) |
| 357 BASE_EXPORT extern "C" NSString* const | 465 + (id<NSObject>)appearanceNamed:(NSString*)name; |
| 358 NSWindowDidChangeOcclusionStateNotification; | 466 @end |
| 359 | |
| 360 enum { | |
| 361 NSWorkspaceLaunchWithErrorPresentation = 0x00000040 | |
| 362 }; | |
| 363 | 467 |
| 364 @interface CBPeripheral (MavericksSDK) | 468 @interface CBPeripheral (MavericksSDK) |
| 365 @property(readonly, nonatomic) NSUUID* identifier; | 469 @property(readonly, nonatomic) NSUUID* identifier; |
| 366 @end | 470 @end |
| 367 | 471 |
| 368 BASE_EXPORT extern "C" NSString* const CBAdvertisementDataIsConnectable; | |
| 369 | |
| 370 #else // !MAC_OS_X_VERSION_10_9 | |
| 371 | |
| 372 typedef enum { | |
| 373 kCWSecurityModeOpen = 0, | |
| 374 kCWSecurityModeWEP, | |
| 375 kCWSecurityModeWPA_PSK, | |
| 376 kCWSecurityModeWPA2_PSK, | |
| 377 kCWSecurityModeWPA_Enterprise, | |
| 378 kCWSecurityModeWPA2_Enterprise, | |
| 379 kCWSecurityModeWPS, | |
| 380 kCWSecurityModeDynamicWEP | |
| 381 } CWSecurityMode; | |
| 382 | |
| 383 @interface CWNetwork (SnowLeopardSDK) | |
| 384 @property(readonly) NSNumber* rssi; | |
| 385 @property(readonly) NSNumber* securityMode; | |
| 386 @end | |
| 387 | |
| 388 BASE_EXPORT extern "C" NSString* const kCWSSIDDidChangeNotification; | |
| 389 | |
| 390 #endif // MAC_OS_X_VERSION_10_9 | 472 #endif // MAC_OS_X_VERSION_10_9 |
| 391 | 473 |
| 474 // Once Chrome no longer supports OSX 10.9, everything within this preprocessor |
| 475 // block can be removed. |
| 392 #if !defined(MAC_OS_X_VERSION_10_10) || \ | 476 #if !defined(MAC_OS_X_VERSION_10_10) || \ |
| 393 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10 | 477 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10 |
| 394 | 478 |
| 395 @interface NSUserActivity : NSObject | 479 @interface NSUserActivity (YosemiteSDK) |
| 396 | 480 |
| 397 @property (readonly, copy) NSString* activityType; | 481 @property(readonly, copy) NSString* activityType; |
| 398 @property (copy) NSDictionary* userInfo; | 482 @property(copy) NSDictionary* userInfo; |
| 399 @property (copy) NSURL* webpageURL; | 483 @property(copy) NSURL* webpageURL; |
| 400 | 484 |
| 401 - (instancetype)initWithActivityType:(NSString*)activityType; | 485 - (instancetype)initWithActivityType:(NSString*)activityType; |
| 402 - (void)becomeCurrent; | 486 - (void)becomeCurrent; |
| 403 - (void)invalidate; | 487 - (void)invalidate; |
| 404 | 488 |
| 405 @end | 489 @end |
| 406 | 490 |
| 407 BASE_EXPORT extern "C" NSString* const NSUserActivityTypeBrowsingWeb; | |
| 408 | |
| 409 BASE_EXPORT extern "C" NSString* const NSAppearanceNameVibrantDark; | |
| 410 | |
| 411 @interface CBUUID (YosemiteSDK) | 491 @interface CBUUID (YosemiteSDK) |
| 412 - (NSString*)UUIDString; | 492 - (NSString*)UUIDString; |
| 413 @end | 493 @end |
| 414 | 494 |
| 415 #endif // MAC_OS_X_VERSION_10_10 | 495 #endif // MAC_OS_X_VERSION_10_10 |
| 416 | 496 |
| 497 // ---------------------------------------------------------------------------- |
| 498 // Chrome uses -[CWNetwork securityMode] and -[CWNetwork rssi] on OSX 10.6. The |
| 499 // former method relies on the enum CWSecurityMode which was removed in the OSX |
| 500 // 10.9 SDK. In order for Chrome to compile against an OSX 10.9+ SDK, Chrome |
| 501 // must define this enum. Chrome must also declare these methods. |
| 502 // |
| 503 // These declarations and definitions will not be necessary once Chrome no |
| 504 // longer runs on OSX 10.6. |
| 505 // ---------------------------------------------------------------------------- |
| 506 #if defined(MAC_OS_X_VERSION_10_9) && \ |
| 507 MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_6 |
| 508 typedef enum { |
| 509 kCWSecurityModeOpen = 0, |
| 510 kCWSecurityModeWEP, |
| 511 kCWSecurityModeWPA_PSK, |
| 512 kCWSecurityModeWPA2_PSK, |
| 513 kCWSecurityModeWPA_Enterprise, |
| 514 kCWSecurityModeWPA2_Enterprise, |
| 515 kCWSecurityModeWPS, |
| 516 kCWSecurityModeDynamicWEP |
| 517 } CWSecurityMode; |
| 518 |
| 519 @interface CWNetwork (SnowLeopardSDK) |
| 520 @property(readonly) NSNumber* rssi; |
| 521 @property(readonly) NSNumber* securityMode; |
| 522 @end |
| 523 #endif |
| 524 |
| 525 // ---------------------------------------------------------------------------- |
| 526 // The symbol for kCWSSIDDidChangeNotification is available in the |
| 527 // CoreWLAN.framework for OSX versions 10.6 through 10.10. The symbol is not |
| 528 // declared in the OSX 10.9+ SDK, so when compiling against an OSX 10.9+ SDK, |
| 529 // declare the symbol. |
| 530 // ---------------------------------------------------------------------------- |
| 531 #if defined(MAC_OS_X_VERSION_10_9) && \ |
| 532 MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 |
| 533 BASE_EXPORT extern "C" NSString* const kCWSSIDDidChangeNotification; |
| 534 #endif |
| 417 #endif // BASE_MAC_SDK_FORWARD_DECLARATIONS_H_ | 535 #endif // BASE_MAC_SDK_FORWARD_DECLARATIONS_H_ |
| OLD | NEW |