summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/cocoaint/src/appkit/NSToolbarItem.inc
blob: 5a4cc047a3ef20d73334088f94504208f215dd9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
{ Parsed from Appkit.framework NSToolbarItem.h }

{$ifdef TYPES}
{$ifndef NSTOOLBARITEM_PAS_T}
{$define NSTOOLBARITEM_PAS_T}

{ Constants }

const
  NSToolbarItemVisibilityPriorityStandard = 0;
  NSToolbarItemVisibilityPriorityLow = -1000;
  NSToolbarItemVisibilityPriorityHigh = 1000;
  NSToolbarItemVisibilityPriorityUser = 2000;

{$endif}
{$endif}

{$ifdef RECORDS}
{$ifndef NSTOOLBARITEM_PAS_R}
{$define NSTOOLBARITEM_PAS_R}

{$endif}
{$endif}

{$ifdef FUNCTIONS}
{$ifndef NSTOOLBARITEM_PAS_F}
{$define NSTOOLBARITEM_PAS_F}

{$endif}
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
{$ifndef NSTOOLBARITEM_PAS_S}
{$define NSTOOLBARITEM_PAS_S}

{ External string constants }
var
  NSToolbarSeparatorItemIdentifier: NSString; cvar; external;
  NSToolbarSpaceItemIdentifier: NSString; cvar; external;
  NSToolbarFlexibleSpaceItemIdentifier: NSString; cvar; external;
  NSToolbarShowColorsItemIdentifier: NSString; cvar; external;
  NSToolbarShowFontsItemIdentifier: NSString; cvar; external;
  NSToolbarCustomizeToolbarItemIdentifier: NSString; cvar; external;
  NSToolbarPrintItemIdentifier: NSString; cvar; external;

{$endif}
{$endif}

{$ifdef FORWARD}
  NSToolbarItem = objcclass;
  NSToolbarItemPointer = ^NSToolbarItem;
  NSToolbarItemPtr = NSToolbarItemPointer;

{$endif}

{$ifdef CLASSES}
{$ifndef NSTOOLBARITEM_PAS_C}
{$define NSTOOLBARITEM_PAS_C}

{ NSToolbarItem }
  NSToolbarItem = objcclass external (NSObject, NSCopyingProtocol, NSValidatedUserInterfaceItemProtocol)
  private
    _toolbar: NSToolbar;
    _image: NSImage;
    _itemIdentifier: NSString;
    _label: NSString;
    _labelAlignment: NSTextAlignment;
    _paletteLabel: NSString;
    _toolTip: NSString;
    _menuItemRep: NSMenuItem;
    _tag: NSInteger;
    __tbiFlags: record
      case byte of
       0: (_anonbitfield_NSToolbarItem0: cuint);
       1: (data: bitpacked record
        viewRespondsToIsEnabled: 0..1;
        viewRespondsToSetEnabled: 0..1;
        viewRespondsToTag: 0..1;
        viewRespondsToSetTag: 0..1;
        viewRespondsToAction: 0..1;
        viewRespondsToSetAction: 0..1;
        viewRespondsToTarget: 0..1;
        viewRespondsToSetTarget: 0..1;
        viewRespondsToImage: 0..1;
        viewRespondsToSetImage: 0..1;
        _isEnabled: 0..1;
        isUserRemovable: 0..1;
        menuHasBeenSet: 0..1;
        menuRepIsDefault: 0..1;
        viewHasBeenLoaded: 0..1;
        drawingForDragImage: 0..1;
        isCustomItemType: 0..1;
        hasValidatedAutoModeConfiguration: 0..1;
        useAutoModeConfiguration: 0..1;
        RESERVED2: 0..1;
        autovalidationDisabled: 0..1;
        tagHasBeenSet: 0..1;
        sizeHasBeenSet: 0..1;
        stateWasDisabledBeforeSheet: 0..1;
        RESERVED: 0..((1 shl 8)-1);
       end;
      );
      end;
    _tbiReserved: id;
    _itemViewer: id;
    _view: NSView;
    _minSize: NSSize;
    _maxSize: NSSize;
    {$ifdef cpu64}
    _toolbarItemReserved: id;
    {$endif}
    
  public
    function initWithItemIdentifier(itemIdentifier_: NSString): id; message 'initWithItemIdentifier:';
    function itemIdentifier: NSString; message 'itemIdentifier';
    function toolbar: NSToolbar; message 'toolbar';
    procedure setLabel(label__: NSString); message 'setLabel:';
    function label_: NSString; message 'label';
    procedure setPaletteLabel(paletteLabel_: NSString); message 'setPaletteLabel:';
    function paletteLabel: NSString; message 'paletteLabel';
    procedure setToolTip(toolTip_: NSString); message 'setToolTip:';
    function toolTip: NSString; message 'toolTip';
    procedure setMenuFormRepresentation(menuItem: NSMenuItem); message 'setMenuFormRepresentation:';
    function menuFormRepresentation: NSMenuItem; message 'menuFormRepresentation';
    procedure setTag(tag_: NSInteger); message 'setTag:';
    function tag: NSInteger; message 'tag';
    procedure setTarget(target_: id); message 'setTarget:';
    function target: id; message 'target';
    procedure setAction(action_: SEL); message 'setAction:';
    function action: SEL; message 'action';
    procedure setEnabled(enabled: Boolean); message 'setEnabled:';
    function isEnabled: Boolean; message 'isEnabled';
    procedure setImage(image_: NSImage); message 'setImage:';
    function image: NSImage; message 'image';
    procedure setView(view_: NSView); message 'setView:';
    function view: NSView; message 'view';
    procedure setMinSize(size: NSSize); message 'setMinSize:';
    function minSize: NSSize; message 'minSize';
    procedure setMaxSize(size: NSSize); message 'setMaxSize:';
    function maxSize: NSSize; message 'maxSize';
    procedure setVisibilityPriority(visibilityPriority_: NSInteger); message 'setVisibilityPriority:';
    function visibilityPriority: NSInteger; message 'visibilityPriority';
    procedure validate; message 'validate';
    procedure setAutovalidates(resistance: Boolean); message 'setAutovalidates:';
    function autovalidates: Boolean; message 'autovalidates';
    function allowsDuplicatesInToolbar: Boolean; message 'allowsDuplicatesInToolbar';

    { Adopted Protocols }
    function copyWithZone(zone_: NSZonePtr): id;
  end;

{ NSToolbarItemValidationCategory }
  NSToolbarItemValidationCategory = objccategory external (NSObject)
    function validateToolbarItem(theItem: NSToolbarItem): Boolean; message 'validateToolbarItem:';
  end;

{$endif}
{$endif}