Added unit test for DevTools' ephemeral port support.
[chromium-blink-merge.git] / base / mac / sdk_forward_declarations.h
blob1148e3673f002eaf5482a6135a41b8819ab80032
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/objc/IOBluetoothDevice.h>
18 #import <IOBluetooth/objc/IOBluetoothDeviceInquiry.h>
19 #import <IOBluetooth/objc/IOBluetoothHostController.h>
21 #if !defined(MAC_OS_X_VERSION_10_7) || \
22 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
24 enum {
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;
34 enum {
35 NSFullScreenWindowMask = 1 << 14,
38 enum {
39 NSApplicationPresentationFullScreen = 1 << 10,
42 enum {
43 NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7,
44 NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8,
47 enum {
48 NSEventSwipeTrackingLockDirection = 0x1 << 0,
49 NSEventSwipeTrackingClampGestureAmount = 0x1 << 1,
51 typedef NSUInteger NSEventSwipeTrackingOptions;
53 enum {
54 NSWindowAnimationBehaviorDefault = 0,
55 NSWindowAnimationBehaviorNone = 2,
56 NSWindowAnimationBehaviorDocumentWindow = 3,
57 NSWindowAnimationBehaviorUtilityWindow = 4,
58 NSWindowAnimationBehaviorAlertPanel = 5
60 typedef NSInteger NSWindowAnimationBehavior;
62 enum {
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,
79 NSEventPhase phase,
80 BOOL isComplete,
81 BOOL *stop))trackingHandler;
83 - (BOOL)isDirectionInvertedFromDevice;
85 @end
87 @interface NSApplication (LionSDK)
88 - (void)disableRelaunchOnLogin;
89 @end
91 @interface CALayer (LionSDK)
92 - (CGFloat)contentsScale;
93 - (void)setContentsScale:(CGFloat)contentsScale;
94 @end
96 @interface NSScreen (LionSDK)
97 - (CGFloat)backingScaleFactor;
98 - (NSRect)convertRectToBacking:(NSRect)aRect;
99 @end
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;
107 @end
109 @interface NSCursor (LionSDKDeclarations)
110 + (NSCursor*)IBeamCursorForVerticalLayout;
111 @end
113 @interface NSAnimationContext (LionSDK)
114 + (void)runAnimationGroup:(void (^)(NSAnimationContext *context))changes
115 completionHandler:(void (^)(void))completionHandler;
116 @end
118 @interface NSView (LionSDK)
119 - (NSSize)convertSizeFromBacking:(NSSize)size;
120 - (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag;
121 @end
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
131 @interface NSScroller (LionSDK)
132 + (NSInteger)preferredScrollerStyle;
133 @end
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
143 enum CWChannelBand {
144 kCWChannelBandUnknown = 0,
145 kCWChannelBand2GHz = 1,
146 kCWChannelBand5GHz = 2,
149 @interface CWChannel : NSObject
150 @property(readonly) CWChannelBand channelBand;
151 @end
153 @interface CWNetwork (LionSDK)
154 @property(readonly) CWChannel* wlanChannel;
155 @end
157 @interface IOBluetoothHostController (LionSDK)
158 - (NSString*)nameAsString;
159 - (BluetoothHCIPowerState)powerState;
160 @end
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
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
180 #endif // MAC_OS_X_VERSION_10_7
183 #if !defined(MAC_OS_X_VERSION_10_8) || \
184 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8
186 enum {
187 NSEventPhaseMayBegin = 0x1 << 5
190 #endif // MAC_OS_X_VERSION_10_8
193 #if !defined(MAC_OS_X_VERSION_10_9) || \
194 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
196 // NSProgress is public API in 10.9, but a version of it exists and is usable
197 // in 10.8.
199 @interface NSProgress : NSObject
201 - (instancetype)initWithParent:(NSProgress*)parentProgressOrNil
202 userInfo:(NSDictionary*)userInfoOrNil;
203 @property (copy) NSString* kind;
205 @property int64_t totalUnitCount;
206 @property int64_t completedUnitCount;
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;
217 - (void)setUserInfoObject:(id)objectOrNil forKey:(NSString*)key;
218 - (NSDictionary*)userInfo;
220 @property (readonly, getter=isIndeterminate) BOOL indeterminate;
221 @property (readonly) double fractionCompleted;
223 - (void)publish;
224 - (void)unpublish;
226 @end
228 @interface NSView (MavericksSDK)
229 - (void)setCanDrawSubviewsIntoLayer:(BOOL)flag;
230 @end
232 enum {
233 NSWindowOcclusionStateVisible = 1UL << 1,
235 typedef NSUInteger NSWindowOcclusionState;
237 @interface NSWindow (MavericksSDK)
238 - (NSWindowOcclusionState)occlusionState;
239 @end
241 #endif // MAC_OS_X_VERSION_10_9
243 #endif // BASE_MAC_SDK_FORWARD_DECLARATIONS_H_