summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/cocoaint/src/foundation/NSLocale.inc
blob: f8e4412c992facccc8e8b3b83d557db1680bcb2f (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
{ Parsed from Foundation.framework NSLocale.h }

{$ifdef TYPES}
{$ifndef NSLOCALE_PAS_T}
{$define NSLOCALE_PAS_T}

{ Constants }

const
  NSLocaleLanguageDirectionUnknown = kCFLocaleLanguageDirectionUnknown;
  NSLocaleLanguageDirectionLeftToRight = kCFLocaleLanguageDirectionLeftToRight;
  NSLocaleLanguageDirectionRightToLeft = kCFLocaleLanguageDirectionRightToLeft;
  NSLocaleLanguageDirectionTopToBottom = kCFLocaleLanguageDirectionTopToBottom;
  NSLocaleLanguageDirectionBottomToTop = kCFLocaleLanguageDirectionBottomToTop;

{ Types }
type
  NSLocaleLanguageDirection = NSUInteger;
  NSLocaleLanguageDirectionPtr = ^NSLocaleLanguageDirection;

{$endif}
{$endif}

{$ifdef RECORDS}
{$ifndef NSLOCALE_PAS_R}
{$define NSLOCALE_PAS_R}

{$endif}
{$endif}

{$ifdef FUNCTIONS}
{$ifndef NSLOCALE_PAS_F}
{$define NSLOCALE_PAS_F}

{$endif}
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
{$ifndef NSLOCALE_PAS_S}
{$define NSLOCALE_PAS_S}

{ External string constants }
var
  NSCurrentLocaleDidChangeNotification: NSString; cvar; external;
  NSLocaleIdentifier: NSString; cvar; external;
  NSLocaleLanguageCode: NSString; cvar; external;
  NSLocaleCountryCode: NSString; cvar; external;
  NSLocaleScriptCode: NSString; cvar; external;
  NSLocaleVariantCode: NSString; cvar; external;
  NSLocaleExemplarCharacterSet: NSString; cvar; external;
  NSLocaleCalendar: NSString; cvar; external;
  NSLocaleCollationIdentifier: NSString; cvar; external;
  NSLocaleUsesMetricSystem: NSString; cvar; external;
  NSLocaleMeasurementSystem: NSString; cvar; external;
  NSLocaleDecimalSeparator: NSString; cvar; external;
  NSLocaleGroupingSeparator: NSString; cvar; external;
  NSLocaleCurrencySymbol: NSString; cvar; external;
  NSLocaleCurrencyCode: NSString; cvar; external;
  NSLocaleCollatorIdentifier: NSString; cvar; external;
  NSLocaleQuotationBeginDelimiterKey: NSString; cvar; external;
  NSLocaleQuotationEndDelimiterKey: NSString; cvar; external;
  NSLocaleAlternateQuotationBeginDelimiterKey: NSString; cvar; external;
  NSLocaleAlternateQuotationEndDelimiterKey: NSString; cvar; external;
  NSGregorianCalendar: NSString; cvar; external;
  NSBuddhistCalendar: NSString; cvar; external;
  NSChineseCalendar: NSString; cvar; external;
  NSHebrewCalendar: NSString; cvar; external;
  NSIslamicCalendar: NSString; cvar; external;
  NSIslamicCivilCalendar: NSString; cvar; external;
  NSJapaneseCalendar: NSString; cvar; external;
  NSRepublicOfChinaCalendar: NSString; cvar; external;
  NSPersianCalendar: NSString; cvar; external;
  NSIndianCalendar: NSString; cvar; external;
  NSISO8601Calendar: NSString; cvar; external;

{$endif}
{$endif}

{$ifdef FORWARD}
  NSLocale = objcclass;
  NSLocalePointer = ^NSLocale;
  NSLocalePtr = NSLocalePointer;

{$endif}

{$ifdef CLASSES}
{$ifndef NSLOCALE_PAS_C}
{$define NSLOCALE_PAS_C}

{ NSLocale }
  NSLocale = objcclass external (NSObject, NSCopyingProtocol, NSCodingProtocol)
    
  public
    function objectForKey(key: id): id; message 'objectForKey:';
    function displayNameForKey_value(key: id; value: id): NSString; message 'displayNameForKey:value:';

    { Adopted Protocols }
    function copyWithZone(zone_: NSZonePtr): id;
    procedure encodeWithCoder(aCoder: NSCoder);
    function initWithCoder(aDecoder: NSCoder): id;
  end;

{ NSExtendedLocaleCategory }
  NSExtendedLocaleCategory = objccategory external (NSLocale)
    function localeIdentifier: NSString; message 'localeIdentifier';
  end;

{ NSLocaleCreationCategory }
  NSLocaleCreationCategory = objccategory external (NSLocale)
    class function systemLocale: id; message 'systemLocale';
    class function currentLocale: id; message 'currentLocale';
    class function autoupdatingCurrentLocale: id; message 'autoupdatingCurrentLocale';
    function initWithLocaleIdentifier(string_: NSString): id; message 'initWithLocaleIdentifier:';
  end;

{ NSLocaleGeneralInfoCategory }
  NSLocaleGeneralInfoCategory = objccategory external (NSLocale)
    class function availableLocaleIdentifiers: NSArray; message 'availableLocaleIdentifiers';
    class function ISOLanguageCodes: NSArray; message 'ISOLanguageCodes';
    class function ISOCountryCodes: NSArray; message 'ISOCountryCodes';
    class function ISOCurrencyCodes: NSArray; message 'ISOCurrencyCodes';
    class function commonISOCurrencyCodes: NSArray; message 'commonISOCurrencyCodes';
    class function preferredLanguages: NSArray; message 'preferredLanguages';
    class function componentsFromLocaleIdentifier(string_: NSString): NSDictionary; message 'componentsFromLocaleIdentifier:';
    class function localeIdentifierFromComponents(dict: NSDictionary): NSString; message 'localeIdentifierFromComponents:';
    class function canonicalLocaleIdentifierFromString(string_: NSString): NSString; message 'canonicalLocaleIdentifierFromString:';
    class function canonicalLanguageIdentifierFromString(string_: NSString): NSString; message 'canonicalLanguageIdentifierFromString:';
    class function localeIdentifierFromWindowsLocaleCode(lcid: cuint32): NSString; message 'localeIdentifierFromWindowsLocaleCode:';
    class function windowsLocaleCodeFromLocaleIdentifier(localeIdentifier_: NSString): cuint32; message 'windowsLocaleCodeFromLocaleIdentifier:';
    class function characterDirectionForLanguage(isoLangCode: NSString): NSLocaleLanguageDirection; message 'characterDirectionForLanguage:';
    class function lineDirectionForLanguage(isoLangCode: NSString): NSLocaleLanguageDirection; message 'lineDirectionForLanguage:';
  end;

{$endif}
{$endif}