• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2009 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.
4 
5 #ifndef BASE_COCOA_PROTOCOLS_MAC_H_
6 #define BASE_COCOA_PROTOCOLS_MAC_H_
7 #pragma once
8 
9 #import <Cocoa/Cocoa.h>
10 
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"
14 
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.
21 
22 #if !defined(MAC_OS_X_VERSION_10_6) || \
23     MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
24 
25 #define DEFINE_EMPTY_PROTOCOL(p) \
26 @protocol p \
27 @end
28 
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(NSTableViewDataSource)
38 DEFINE_EMPTY_PROTOCOL(NSTableViewDelegate)
39 DEFINE_EMPTY_PROTOCOL(NSTextFieldDelegate)
40 DEFINE_EMPTY_PROTOCOL(NSTextViewDelegate)
41 DEFINE_EMPTY_PROTOCOL(NSWindowDelegate)
42 
43 #undef DEFINE_EMPTY_PROTOCOL
44 
45 #endif
46 
47 #endif  // BASE_COCOA_PROTOCOLS_MAC_H_
48