summaryrefslogtreecommitdiff
path: root/packages/cocoaint/src/appkit/NSFontManager.inc
blob: 9e47ff6a3107f3c09b0395ee0fb93f7a77955b3d (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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
{ Parsed from Appkit.framework NSFontManager.h }
{ Version: 2.1.4 - Sun Jan 2 15:08:19 CET 2011 }


{$ifdef TYPES}
{$ifndef NSFONTMANAGER_PAS_T}
{$define NSFONTMANAGER_PAS_T}

{ Types }
type
  NSFontTraitMask = NSUInteger;
  NSFontTraitMaskPtr = ^NSFontTraitMask;
  NSFontAction = NSUInteger;
  NSFontActionPtr = ^NSFontAction;

{ Constants }

const
  NSItalicFontMask = $00000001;
  NSBoldFontMask = $00000002;
  NSUnboldFontMask = $00000004;
  NSNonStandardCharacterSetFontMask = $00000008;
  NSNarrowFontMask = $00000010;
  NSExpandedFontMask = $00000020;
  NSCondensedFontMask = $00000040;
  NSSmallCapsFontMask = $00000080;
  NSPosterFontMask = $00000100;
  NSCompressedFontMask = $00000200;
  NSFixedPitchFontMask = $00000400;
  NSUnitalicFontMask = $01000000;

const
  NSFontCollectionApplicationOnlyMask = 1 shl 0;

const
  NSNoFontChangeAction = 0;
  NSViaPanelFontAction = 1;
  NSAddTraitFontAction = 2;
  NSSizeUpFontAction = 3;
  NSSizeDownFontAction = 4;
  NSHeavierFontAction = 5;
  NSLighterFontAction = 6;
  NSRemoveTraitFontAction = 7;

{$endif}
{$endif}

{$ifdef RECORDS}
{$ifndef NSFONTMANAGER_PAS_R}
{$define NSFONTMANAGER_PAS_R}

{$endif}
{$endif}

{$ifdef FUNCTIONS}
{$ifndef NSFONTMANAGER_PAS_F}
{$define NSFONTMANAGER_PAS_F}

{$endif}
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
{$ifndef NSFONTMANAGER_PAS_S}
{$define NSFONTMANAGER_PAS_S}

{$endif}
{$endif}

{$ifdef FORWARD}
  NSFontManager = objcclass;
  NSFontManagerPointer = ^NSFontManager;
  NSFontManagerPtr = NSFontManagerPointer;

{$endif}

{$ifdef CLASSES}
{$ifndef NSFONTMANAGER_PAS_C}
{$define NSFONTMANAGER_PAS_C}

{ NSFontManager }
  NSFontManager = objcclass external (NSObject)
  private
    _panel: NSFontPanel;
    _fmReserved1: cuint;
    _action: SEL;
    _actionOrigin: id;
    _target: id;
    _selFont: NSFont;
    __fmFlags: bitpacked record
      case byte of
       0: (_anonbitfield_NSFontManager0: cuint);
       1: (
        multipleFont: 0..1;
        disabled: 0..1;
        senderTagMode: 0..((1 shl 2)-1);
        _RESERVED: 0..((1 shl 12)-1);
      );
      end;
    _fmReserved3: cushort;
    _delegate: id;
    _collections: id;
    _hiddenCollections: id;
    _fmReserved4: NSUInteger;
    
  public
    class procedure setFontPanelFactory(factoryId: Pobjc_class); message 'setFontPanelFactory:';
    class procedure setFontManagerFactory(factoryId: Pobjc_class); message 'setFontManagerFactory:';
    class function sharedFontManager: NSFontManager; message 'sharedFontManager';
    function isMultiple: Boolean; message 'isMultiple';
    function selectedFont: NSFont; message 'selectedFont';
    procedure setSelectedFont_isMultiple(fontObj: NSFont; flag: Boolean); message 'setSelectedFont:isMultiple:';
    procedure setFontMenu(newMenu: NSMenu); message 'setFontMenu:';
    function fontMenu(create_: Boolean): NSMenu; message 'fontMenu:';
    function fontPanel(create_: Boolean): NSFontPanel; message 'fontPanel:';
    function fontWithFamily_traits_weight_size(family: NSString; traits: NSFontTraitMask; weight: NSInteger; size: CGFloat): NSFont; message 'fontWithFamily:traits:weight:size:';
    function traitsOfFont(fontObj: NSFont): NSFontTraitMask; message 'traitsOfFont:';
    function weightOfFont(fontObj: NSFont): NSInteger; message 'weightOfFont:';
    function availableFonts: NSArray; message 'availableFonts';
    function availableFontFamilies: NSArray; message 'availableFontFamilies';
    function availableMembersOfFontFamily(fam: NSString): NSArray; message 'availableMembersOfFontFamily:';
    function convertFont(fontObj: NSFont): NSFont; message 'convertFont:';
    function convertFont_toSize(fontObj: NSFont; size: CGFloat): NSFont; message 'convertFont:toSize:';
    function convertFont_toFace(fontObj: NSFont; typeface: NSString): NSFont; message 'convertFont:toFace:';
    function convertFont_toFamily(fontObj: NSFont; family: NSString): NSFont; message 'convertFont:toFamily:';
    function convertFont_toHaveTrait(fontObj: NSFont; trait: NSFontTraitMask): NSFont; message 'convertFont:toHaveTrait:';
    function convertFont_toNotHaveTrait(fontObj: NSFont; trait: NSFontTraitMask): NSFont; message 'convertFont:toNotHaveTrait:';
    function convertWeight_ofFont(upFlag: Boolean; fontObj: NSFont): NSFont; message 'convertWeight:ofFont:';
    function isEnabled: Boolean; message 'isEnabled';
    procedure setEnabled(flag: Boolean); message 'setEnabled:';
    function action: SEL; message 'action';
    procedure setAction(aSelector: SEL); message 'setAction:';
    function sendAction: Boolean; message 'sendAction';
    procedure setDelegate(anObject: id); message 'setDelegate:';
    function delegate: id; message 'delegate';
    function localizedNameForFamily_face(family: NSString; faceKey: NSString): NSString; message 'localizedNameForFamily:face:';
    procedure setSelectedAttributes_isMultiple(attributes: NSDictionary; flag: Boolean); message 'setSelectedAttributes:isMultiple:';
    function convertAttributes(attributes: NSDictionary): NSDictionary; message 'convertAttributes:';
    function availableFontNamesMatchingFontDescriptor(descriptor: NSFontDescriptor): NSArray; message 'availableFontNamesMatchingFontDescriptor:';
    function collectionNames: NSArray; message 'collectionNames';
    function fontDescriptorsInCollection(collectionNames_: NSString): NSArray; message 'fontDescriptorsInCollection:';
    function addCollection_options(collectionName: NSString; collectionOptions: NSInteger): Boolean; message 'addCollection:options:';
    function removeCollection(collectionName: NSString): Boolean; message 'removeCollection:';
    procedure addFontDescriptors_toCollection(descriptors: NSArray; collectionName: NSString); message 'addFontDescriptors:toCollection:';
    procedure removeFontDescriptor_fromCollection(descriptor: NSFontDescriptor; collection: NSString); message 'removeFontDescriptor:fromCollection:';
    function currentFontAction: NSFontAction; message 'currentFontAction';
    function convertFontTraits(traits: NSFontTraitMask): NSFontTraitMask; message 'convertFontTraits:';
    procedure setTarget(aTarget: id); message 'setTarget:';
    function target: id; message 'target';
  end;

{ NSFontManagerMenuActionMethodsCategory }
  NSFontManagerMenuActionMethodsCategory = objccategory external (NSFontManager)
    function fontNamed_hasTraits(fName: NSString; someTraits: NSFontTraitMask): Boolean; message 'fontNamed:hasTraits:';
    function availableFontNamesWithTraits(someTraits: NSFontTraitMask): NSArray; message 'availableFontNamesWithTraits:';
    procedure addFontTrait(sender: id); message 'addFontTrait:';
    procedure removeFontTrait(sender: id); message 'removeFontTrait:';
    procedure modifyFontViaPanel(sender: id); message 'modifyFontViaPanel:';
    procedure modifyFont(sender: id); message 'modifyFont:';
    procedure orderFrontFontPanel(sender: id); message 'orderFrontFontPanel:';
    procedure orderFrontStylesPanel(sender: id); message 'orderFrontStylesPanel:';
  end;

{ NSFontManagerDelegateCategory }
  NSFontManagerDelegateCategory = objccategory external (NSObject)
    function fontManager_willIncludeFont(sender: id; fontName: NSString): Boolean; message 'fontManager:willIncludeFont:';
  end;

{ NSFontManagerResponderMethodCategory }
  NSFontManagerResponderMethodCategory = objccategory external (NSObject)
    procedure changeFont(sender: id); message 'changeFont:';
  end;

{$endif}
{$endif}