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 #ifndef BASE_COCOA_PROTOCOLS_MAC_H_
6 #define BASE_COCOA_PROTOCOLS_MAC_H_
9 #import <Cocoa/Cocoa.h>
11 // GTM also maintinas a list of empty protocols, but only the ones the library
12 // requires. Augment that below.
13 #import "third_party/GTM/GTMDefines.h"
15 // The Mac OS X 10.6 SDK introduced new protocols used for delegates. These
16 // protocol defintions were not present in earlier releases of the Mac OS X
17 // SDK. In order to support building against the new SDK, which requires
18 // delegates to conform to these protocols, and earlier SDKs, which do not
19 // define these protocols at all, this file will provide empty protocol
20 // definitions when used with earlier SDK versions.
22 #define DEFINE_EMPTY_PROTOCOL(p) \
26 #if !defined(MAC_OS_X_VERSION_10_6) || \
27 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
29 DEFINE_EMPTY_PROTOCOL(NSAlertDelegate
)
30 DEFINE_EMPTY_PROTOCOL(NSApplicationDelegate
)
31 DEFINE_EMPTY_PROTOCOL(NSControlTextEditingDelegate
)
32 DEFINE_EMPTY_PROTOCOL(NSMatrixDelegate
)
33 DEFINE_EMPTY_PROTOCOL(NSMenuDelegate
)
34 DEFINE_EMPTY_PROTOCOL(NSOpenSavePanelDelegate
)
35 DEFINE_EMPTY_PROTOCOL(NSOutlineViewDataSource
)
36 DEFINE_EMPTY_PROTOCOL(NSOutlineViewDelegate
)
37 DEFINE_EMPTY_PROTOCOL(NSSpeechSynthesizerDelegate
)
38 DEFINE_EMPTY_PROTOCOL(NSSplitViewDelegate
)
39 DEFINE_EMPTY_PROTOCOL(NSTableViewDataSource
)
40 DEFINE_EMPTY_PROTOCOL(NSTableViewDelegate
)
41 DEFINE_EMPTY_PROTOCOL(NSTextFieldDelegate
)
42 DEFINE_EMPTY_PROTOCOL(NSTextViewDelegate
)
43 DEFINE_EMPTY_PROTOCOL(NSWindowDelegate
)
45 #endif // MAC_OS_X_VERSION_10_6
47 #if !defined(MAC_OS_X_VERSION_10_8) || \
48 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8
50 DEFINE_EMPTY_PROTOCOL(NSUserNotificationCenterDelegate
)
52 #endif // MAC_OS_X_VERSION_10_6
54 #undef DEFINE_EMPTY_PROTOCOL
56 #endif // BASE_COCOA_PROTOCOLS_MAC_H_