1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 #ifndef nsTouchBarNativeAPIDefines_h
6 #define nsTouchBarNativeAPIDefines_h
7 
8 #import <Cocoa/Cocoa.h>
9 
10 #if !defined(MAC_OS_X_VERSION_10_12_2) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12_2
11 @interface NSApplication (TouchBarMenu)
12 - (IBAction)toggleTouchBarCustomizationPalette:(id)sender;
13 @end
14 
15 typedef NSString* NSTouchBarItemIdentifier;
16 __attribute__((weak_import)) @interface NSTouchBarItem : NSObject
17 @property(readonly) NSView* view;
18 @property(readonly) NSString* customizationLabel;
19 - (instancetype)initWithIdentifier:(NSTouchBarItemIdentifier)aIdentifier;
20 @end
21 
22 @protocol NSSharingServicePickerTouchBarItemDelegate
23 @end
24 
25 __attribute__((weak_import)) @interface NSSharingServicePickerTouchBarItem : NSTouchBarItem
26 @property(strong) id<NSSharingServicePickerTouchBarItemDelegate> delegate;
27 @property(strong) NSImage* buttonImage;
28 @end
29 
30 __attribute__((weak_import)) @interface NSCustomTouchBarItem : NSTouchBarItem
31 @property(strong) NSView* view;
32 @property(strong) NSString* customizationLabel;
33 @end
34 
35 @protocol NSTouchBarDelegate
36 @end
37 
38 typedef NSString* NSTouchBarCustomizationIdentifier;
39 __attribute__((weak_import)) @interface NSTouchBar : NSObject
40 @property(strong) NSArray<NSTouchBarItemIdentifier>* defaultItemIdentifiers;
41 @property(strong) id<NSTouchBarDelegate> delegate;
42 @property(strong) NSTouchBarCustomizationIdentifier customizationIdentifier;
43 @property(strong) NSArray<NSTouchBarItemIdentifier>* customizationAllowedItemIdentifiers;
44 - (NSTouchBarItem*)itemForIdentifier:(NSTouchBarItemIdentifier)aIdentifier;
45 @end
46 
47 __attribute__((weak_import)) @interface NSPopoverTouchBarItem : NSTouchBarItem
48 @property(strong) NSString* customizationLabel;
49 @property(strong) NSView* collapsedRepresentation;
50 @property(strong) NSImage* collapsedRepresentationImage;
51 @property(strong) NSString* collapsedRepresentationLabel;
52 @property(strong) NSTouchBar* popoverTouchBar;
53 @property BOOL showsCloseButton;
54 - (void)showPopover:(id)sender;
55 - (void)dismissPopover:(id)sender;
56 @end
57 
58 @interface NSButton (TouchBarButton)
59 @property(strong) NSColor* bezelColor;
60 @end
61 #endif  // !defined(MAC_OS_X_VERSION_10_12_2)
62 #endif  // nsTouchBarNativeAPIDefines_h
63