1{ Parsed from AppKit.framework NSToolbar.h }
2
3
4{$ifdef TYPES}
5type
6  NSToolbarPtr = ^NSToolbar;
7  NSToolbarDelegateProtocolPtr = ^NSToolbarDelegateProtocol;
8{$endif}
9
10{$ifdef TYPES}
11type
12  NSToolbarDisplayMode = NSUInteger;
13  NSToolbarDisplayModePtr = ^NSToolbarDisplayMode;
14
15const
16  NSToolbarDisplayModeDefault = 0;
17  NSToolbarDisplayModeIconAndLabel = 1;
18  NSToolbarDisplayModeIconOnly = 2;
19  NSToolbarDisplayModeLabelOnly = 3;
20
21type
22  NSToolbarSizeMode = NSUInteger;
23  NSToolbarSizeModePtr = ^NSToolbarSizeMode;
24
25const
26  NSToolbarSizeModeDefault = 0;
27  NSToolbarSizeModeRegular = 1;
28  NSToolbarSizeModeSmall = 2;
29{$endif}
30
31{$ifdef CLASSES}
32
33type
34  NSToolbar = objcclass external (NSObject)
35  private
36    _toolbarIdentifier: NSString;
37    _currentItems: NSMutableArray;
38    _currentItemIdentifiers: NSMutableArray;
39    _fullScreenAccessoryView: NSView;
40    _res2: id;
41    _selectedItemIdentifier: NSString;
42    _metrics: pointer;
43    _delegate: id;
44    _logicalWindow: NSWindow;
45    _configPalette: id;
46    _toolbarView: id;
47    _syncPostEnabledCount: NSInteger;
48    _tbFlags: bitpacked record
49      case byte of
50        0: (_anonBitField__tbFlags0: cuint);
51        1: (
52          allowsUserCustomization: 0..1;
53          autosavesUsingIdentifier: 0..1;
54          initialConfigurationDone: 0..1;
55          doesNotAttachToMenuBar: 0..1;
56          delegateDefaultItemIdentifiers: 0..1;
57          delegateAllowedItemIdentifiers: 0..1;
58          delegateItemWithItemIdentifier: 0..1;
59          delegateNotificationsEnabled: 0..1;
60          prefersToBeShown: 0..1;
61          loadItemsImmediately: 0..1;
62          currentItemsContainsPlaceholder: 0..1;
63          customizationPanelIsRunning: 0..1;
64          usesCustomSheetWidth: 0..1;
65          clickAndDragPerformsCustomization: 0..1;
66          showsNoContextMenu: 0..1;
67          currentlyLoadingPlaceholders: 0..1;
68          delegateItemWithItemIdentifier2: 0..1;
69          inGlobalWindow: 0..1;
70          hasOwnedFullscreenViewController: 0..1;
71          usesServicesItems: 0..1;
72          usingFSMetrics: 0..1;
73          keyboardLoopNeedsUpdating: 0..1;
74          showHideDuringConfigurationChangeDisabled: 0..1;
75          displayMode: 0..((1 shl 2)-1);
76          sizeMode: 0..((1 shl 2)-1);
77          doNotShowBaselineSeparator: 0..1;
78          hideWithoutResizingWindowHint: 0..1;
79          autovalidatesItemsDisabled: 0..1;
80          inAutovalidation: 0..1;
81          loadedMetrics: 0..1;
82        );
83      end;
84    _customizationSheetWidth: NSInteger;
85    _tbReserved: id;
86  public
87    function initWithIdentifier (identifier: NSString): instancetype; message 'initWithIdentifier:'; { NS_DESIGNATED_INITIALIZER }
88    procedure insertItemWithItemIdentifier_atIndex (itemIdentifier: NSString; index: NSInteger); message 'insertItemWithItemIdentifier:atIndex:';
89    procedure removeItemAtIndex (index: NSInteger); message 'removeItemAtIndex:';
90    procedure setDelegate(newValue: NSToolbarDelegateProtocol); message 'setDelegate:';
91    function delegate: NSToolbarDelegateProtocol; message 'delegate';
92    procedure setVisible(newValue: ObjCBOOL); message 'setVisible:';
93    function isVisible: ObjCBOOL; message 'isVisible';
94    procedure runCustomizationPalette (sender: id); message 'runCustomizationPalette:';
95    function customizationPaletteIsRunning: ObjCBOOL; message 'customizationPaletteIsRunning';
96    procedure setDisplayMode(newValue: NSToolbarDisplayMode); message 'setDisplayMode:';
97    function displayMode: NSToolbarDisplayMode; message 'displayMode';
98    procedure setSelectedItemIdentifier(newValue: NSString); message 'setSelectedItemIdentifier:';
99    function selectedItemIdentifier: NSString; message 'selectedItemIdentifier';
100    procedure setSizeMode(newValue: NSToolbarSizeMode); message 'setSizeMode:';
101    function sizeMode: NSToolbarSizeMode; message 'sizeMode';
102    procedure setShowsBaselineSeparator(newValue: ObjCBOOL); message 'setShowsBaselineSeparator:';
103    function showsBaselineSeparator: ObjCBOOL; message 'showsBaselineSeparator';
104    procedure setAllowsUserCustomization(newValue: ObjCBOOL); message 'setAllowsUserCustomization:';
105    function allowsUserCustomization: ObjCBOOL; message 'allowsUserCustomization';
106    function identifier: NSString; message 'identifier';
107    function items: NSArray; message 'items';
108    function visibleItems: NSArray; message 'visibleItems';
109    procedure setAutosavesConfiguration(newValue: ObjCBOOL); message 'setAutosavesConfiguration:';
110    function autosavesConfiguration: ObjCBOOL; message 'autosavesConfiguration';
111    procedure setConfigurationFromDictionary (configDict: NSDictionary); message 'setConfigurationFromDictionary:';
112    function configurationDictionary: NSDictionary; message 'configurationDictionary';
113    procedure validateVisibleItems; message 'validateVisibleItems';
114    procedure setAllowsExtensionItems(newValue: ObjCBOOL); message 'setAllowsExtensionItems:';
115    function allowsExtensionItems: ObjCBOOL; message 'allowsExtensionItems';
116  end;
117{$endif}
118
119{$ifdef PROTOCOLS}
120
121type
122  NSToolbarDelegateProtocol = objcprotocol external name 'NSToolbarDelegate' (NSObjectProtocol)
123  optional
124    function toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar (toolbar: NSToolbar; itemIdentifier: NSString; flag: ObjCBOOL): NSToolbarItem; message 'toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar:';
125    function toolbarDefaultItemIdentifiers (toolbar: NSToolbar): NSArray; message 'toolbarDefaultItemIdentifiers:';
126    function toolbarAllowedItemIdentifiers (toolbar: NSToolbar): NSArray; message 'toolbarAllowedItemIdentifiers:';
127  optional
128    function toolbarSelectableItemIdentifiers (toolbar: NSToolbar): NSArray; message 'toolbarSelectableItemIdentifiers:';
129    procedure toolbarWillAddItem (notification: NSNotification); message 'toolbarWillAddItem:';
130    procedure toolbarDidRemoveItem (notification: NSNotification); message 'toolbarDidRemoveItem:';
131  end;
132{$endif}
133
134{$ifdef EXTERNAL_SYMBOLS}
135var
136  NSToolbarWillAddItemNotification: NSString; cvar; external;
137  NSToolbarDidRemoveItemNotification: NSString; cvar; external;
138{$endif}
139
140{$ifdef CLASSES}
141
142type
143  NSToolbar_NSDeprecated = objccategory external name 'NSDeprecated' (NSToolbar)
144    procedure setFullScreenAccessoryView(newValue: NSView); message 'setFullScreenAccessoryView:';
145    function fullScreenAccessoryView: NSView; message 'fullScreenAccessoryView';
146    procedure setFullScreenAccessoryViewMinHeight(newValue: CGFloat); message 'setFullScreenAccessoryViewMinHeight:';
147    function fullScreenAccessoryViewMinHeight: CGFloat; message 'fullScreenAccessoryViewMinHeight';
148    procedure setFullScreenAccessoryViewMaxHeight(newValue: CGFloat); message 'setFullScreenAccessoryViewMaxHeight:';
149    function fullScreenAccessoryViewMaxHeight: CGFloat; message 'fullScreenAccessoryViewMaxHeight';
150  end;
151{$endif}
152
153