This repository has been archived by the owner on Mar 4, 2021. It is now read-only.
/
foundation.cs
6220 lines (4425 loc) · 182 KB
/
foundation.cs
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//
// This file describes the API that the generator will produce
//
// Authors:
// Geoff Norton
// Miguel de Icaza
//
// Copyright 2009, Novell, Inc.
// Copyright 2010, Novell, Inc.
// Copyright 2011-2012 Xamarin Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//
using MonoMac.ObjCRuntime;
using MonoMac.CoreFoundation;
using MonoMac.Foundation;
using MonoMac.CoreGraphics;
using MonoMac.CoreMedia;
#if MONOMAC
using MonoMac.AppKit;
#else
using MonoMac.CoreLocation;
using MonoMac.UIKit;
#endif
using System;
using System.Drawing;
using System.ComponentModel;
namespace MonoMac.Foundation
{
public delegate int NSComparator (NSObject obj1, NSObject obj2);
public delegate void NSAttributedRangeCallback (NSDictionary attrs, NSRange range, ref bool stop);
public delegate void NSAttributedStringCallback (NSObject value, NSRange range, ref bool stop);
public delegate bool NSEnumerateErrorHandler (NSUrl url, NSError error);
[BaseType (typeof (NSObject))]
public interface NSArray {
[Export ("count")]
uint Count { get; }
[Export ("objectAtIndex:")]
IntPtr ValueAt (uint idx);
[Export ("arrayWithObjects:count:")][Static][Internal]
NSArray FromObjects (IntPtr array, int count);
[Export ("valueForKey:")]
NSObject ValueForKey (NSString key);
[Export ("setValue:forKey:")]
void SetValueForKey (NSObject value, NSString key);
[Export ("writeToFile:atomically:")]
bool WriteToFile (string path, bool useAuxiliaryFile);
[Export ("arrayWithContentsOfFile:")][Static]
NSArray FromFile (string path);
[Export ("sortedArrayUsingComparator:")]
NSArray Sort (NSComparator cmptr);
[Export ("filteredArrayUsingPredicate:")]
NSArray Filter (NSPredicate predicate);
}
[Since (3,2)]
[BaseType (typeof (NSObject))]
public interface NSAttributedString {
[Export ("string")]
string Value { get; }
[Export ("attributesAtIndex:effectiveRange:")]
NSDictionary GetAttributes (int location, out NSRange effectiveRange);
[Export ("length")]
int Length { get; }
// TODO: figure out the type, this deserves to be strongly typed if possble
[Export ("attribute:atIndex:effectiveRange:")]
NSObject GetAttribute (string attribute, int location, out NSRange effectiveRange);
[Export ("attributedSubstringFromRange:"), Internal]
NSAttributedString Substring (NSRange range);
[Export ("attributesAtIndex:longestEffectiveRange:inRange:")]
NSDictionary GetAttributes (int location, out NSRange longestEffectiveRange, NSRange rangeLimit);
[Export ("attribute:atIndex:longestEffectiveRange:inRange:")]
NSObject GetAttribute (string attribute, int location, out NSRange longestEffectiveRange, NSRange rangeLimit);
[Export ("isEqualToAttributedString:")]
bool IsEqual (NSAttributedString other);
[Export ("initWithString:")]
IntPtr Constructor (string str);
[Export ("initWithString:attributes:")]
[EditorBrowsable (EditorBrowsableState.Advanced)]
IntPtr Constructor (string str, NSDictionary attributes);
[Export ("initWithAttributedString:")]
IntPtr Constructor (NSAttributedString other);
[Export ("enumerateAttributesInRange:options:usingBlock:")]
void EnumerateAttributes (NSRange range, NSAttributedStringEnumeration options, NSAttributedRangeCallback callback);
[Export ("enumerateAttribute:inRange:options:usingBlock:")]
void EnumerateAttribute (NSString attributeName, NSRange inRange, NSAttributedStringEnumeration options, NSAttributedStringCallback callback);
#if MONOMAC
[Export("size")]
SizeF Size { get; }
[Field ("NSFontAttributeName", "AppKit")]
NSString FontAttributeName { get; }
[Field ("NSLinkAttributeName", "AppKit")]
NSString LinkAttributeName { get; }
[Field ("NSUnderlineStyleAttributeName", "AppKit")]
NSString UnderlineStyleAttributeName { get; }
[Field ("NSStrikethroughStyleAttributeName", "AppKit")]
NSString StrikethroughStyleAttributeName { get; }
[Field ("NSStrokeWidthAttributeName", "AppKit")]
NSString StrokeWidthAttributeName { get; }
[Field ("NSParagraphStyleAttributeName", "AppKit")]
NSString ParagraphStyleAttributeName { get; }
[Field ("NSForegroundColorAttributeName", "AppKit")]
NSString ForegroundColorAttributeName { get; }
[Field ("NSBackgroundColorAttributeName", "AppKit")]
NSString BackgroundColorAttributeName { get; }
[Field ("NSLigatureAttributeName", "AppKit")]
NSString LigatureAttributeName { get; }
[Field ("NSObliquenessAttributeName", "AppKit")]
NSString ObliquenessAttributeName { get; }
[Field ("NSSuperscriptAttributeName", "AppKit")]
NSString SuperscriptAttributeName { get; }
[Field ("NSAttachmentAttributeName", "AppKit")]
NSString AttachmentAttributeName { get; }
[Field ("NSBaselineOffsetAttributeName", "AppKit")]
NSString BaselineOffsetAttributeName { get; }
[Field ("NSKernAttributeName", "AppKit")]
NSString KernAttributeName { get; }
[Field ("NSStrokeColorAttributeName", "AppKit")]
NSString StrokeColorAttributeName { get; }
[Field ("NSUnderlineColorAttributeName", "AppKit")]
NSString UnderlineColorAttributeName { get; }
[Field ("NSStrikethroughColorAttributeName", "AppKit")]
NSString StrikethroughColorAttributeName { get; }
[Field ("NSShadowAttributeName", "AppKit")]
NSString ShadowAttributeName { get; }
[Field ("NSExpansionAttributeName", "AppKit")]
NSString ExpansionAttributeName { get; }
[Field ("NSCursorAttributeName", "AppKit")]
NSString CursorAttributeName { get; }
[Field ("NSToolTipAttributeName", "AppKit")]
NSString ToolTipAttributeName { get; }
[Field ("NSMarkedClauseSegmentAttributeName", "AppKit")]
NSString MarkedClauseSegmentAttributeName { get; }
[Field ("NSWritingDirectionAttributeName", "AppKit")]
NSString WritingDirectionAttributeName { get; }
[Field ("NSVerticalGlyphFormAttributeName", "AppKit")]
NSString VerticalGlyphFormAttributeName { get; }
[Export ("initWithData:options:documentAttributes:error:")]
IntPtr Constructor (NSData data, NSDictionary options, out NSDictionary docAttributes, out NSError error);
[Export ("initWithDocFormat:documentAttributes:")]
IntPtr Constructor(NSData wordDocFormat, out NSDictionary docAttributes);
[Export ("initWithHTML:baseURL:documentAttributes:")]
IntPtr Constructor (NSData htmlData, NSUrl baseUrl, out NSDictionary docAttributes);
[Export ("drawAtPoint:")]
void DrawString (PointF point);
[Export ("drawInRect:")]
void DrawString (RectangleF rect);
[Export ("drawWithRect:options:")]
void DrawString (RectangleF rect, NSStringDrawingOptions options);
#else
[Since (6,0)]
[Export ("size")]
SizeF Size { get; }
[Since (6,0)]
[Export ("drawAtPoint:")]
void DrawString (PointF point);
[Since (6,0)]
[Export ("drawInRect:")]
void DrawString (RectangleF rect);
[Since (6,0)]
[Export ("drawWithRect:options:context:")]
void DrawString (RectangleF rect, NSStringDrawingOptions options, [NullAllowed] NSStringDrawingContext context);
[Since (6,0)]
[Export ("boundingRectWithSize:options:context:")]
RectangleF GetBoundingRect (SizeF size, NSStringDrawingOptions options, [NullAllowed] NSStringDrawingContext context);
#endif
}
[BaseType (typeof (NSObject),
Delegates=new string [] { "WeakDelegate" },
Events=new Type [] { typeof (NSCacheDelegate)} )]
[Since (4,0)]
public interface NSCache {
[Export ("objectForKey:")]
NSObject ObjectForKey (NSObject key);
[Export ("setObject:forKey:")]
void SetObjectforKey (NSObject obj, NSObject key);
[Export ("setObject:forKey:cost:")]
void SetCost (NSObject obj, NSObject key, uint cost);
[Export ("removeObjectForKey:")]
void RemoveObjectForKey (NSObject key);
[Export ("removeAllObjects")]
void RemoveAllObjects ();
//Detected properties
[Export ("name")]
string Name { get; set; }
[Export ("delegate")]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")]
NSCacheDelegate Delegate { get; set; }
[Export ("totalCostLimit")]
uint TotalCostLimit { get; set; }
[Export ("countLimit")]
uint CountLimit { get; set; }
[Export ("evictsObjectsWithDiscardedContent")]
bool EvictsObjectsWithDiscardedContent { get; set; }
}
[BaseType (typeof (NSObject))]
[Model]
public interface NSCacheDelegate {
[Export ("cache:willEvictObject:"), EventArgs ("NSObject")]
void WillEvictObject (NSCache cache, NSObject obj);
}
[BaseType (typeof (NSObject), Name="NSCachedURLResponse")]
// instance created with 'init' will crash when Dispose is called
[DisableDefaultCtor]
public interface NSCachedUrlResponse {
[Export ("initWithResponse:data:userInfo:storagePolicy:")]
IntPtr Constructor (NSUrlResponse response, NSData data, [NullAllowed] NSDictionary userInfo, NSUrlCacheStoragePolicy storagePolicy);
[Export ("initWithResponse:data:")]
IntPtr Constructor (NSUrlResponse response, NSData data);
[Export ("response")]
NSUrlResponse Response { get; }
[Export ("data")]
NSData Data { get; }
[Export ("userInfo")]
NSDictionary UserInfo { get; }
[Export ("storagePolicy")]
NSUrlCacheStoragePolicy StoragePolicy { get; }
}
[BaseType (typeof (NSObject))]
// 'init' returns NIL
[DisableDefaultCtor]
public interface NSCalendar {
[Export ("initWithCalendarIdentifier:")]
IntPtr Constructor (NSString identifier);
[Export ("calendarIdentifier")]
string Identifier { get; }
[Export ("currentCalendar")] [Static]
NSCalendar CurrentCalendar { get; }
[Export ("locale")]
NSLocale Locale { get; set; }
[Export ("timeZone")]
NSTimeZone TimeZone { get; set; }
[Export ("firstWeekday")]
uint FirstWeekDay { get; set; }
[Export ("minimumDaysInFirstWeek")]
uint MinimumDaysInFirstWeek { get; set; }
//- (NSRange)minimumRangeOfUnit:(NSCalendarUnit)unit;
//- (NSRange)maximumRangeOfUnit:(NSCalendarUnit)unit;
//- (NSRange)rangeOfUnit:(NSCalendarUnit)smaller inUnit:(NSCalendarUnit)larger forDate:(NSDate *)date;
//- (NSUInteger)ordinalityOfUnit:(NSCalendarUnit)smaller inUnit:(NSCalendarUnit)larger forDate:(NSDate *)date;
//- (BOOL)rangeOfUnit:(NSCalendarUnit)unit startDate:(NSDate **)datep interval:(NSTimeInterval *)tip forDate:(NSDate *)date AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
//- (NSDate *)dateFromComponents:(NSDateComponents *)comps;
//- (NSDateComponents *)components:(NSUInteger)unitFlags fromDate:(NSDate *)date;
//- (NSDate *)dateByAddingComponents:(NSDateComponents *)comps toDate:(NSDate *)date options:(NSUInteger)opts;
//- (NSDateComponents *)components:(NSUInteger)unitFlags fromDate:(NSDate *)startingDate toDate:(NSDate *)resultDate options:(NSUInteger)opts;
[Field ("NSGregorianCalendar"), Internal]
NSString NSGregorianCalendar { get; }
[Field ("NSBuddhistCalendar"), Internal]
NSString NSBuddhistCalendar { get; }
[Field ("NSChineseCalendar"), Internal]
NSString NSChineseCalendar { get; }
[Field ("NSHebrewCalendar"), Internal]
NSString NSHebrewCalendar { get; }
[Field ("NSIslamicCalendar"), Internal]
NSString NSIslamicCalendar { get; }
[Field ("NSIslamicCivilCalendar"), Internal]
NSString NSIslamicCivilCalendar { get; }
[Field ("NSJapaneseCalendar"), Internal]
NSString NSJapaneseCalendar { get; }
[Field ("NSRepublicOfChinaCalendar"), Internal]
NSString NSRepublicOfChinaCalendar { get; }
[Field ("NSPersianCalendar"), Internal]
NSString NSPersianCalendar { get; }
[Field ("NSIndianCalendar"), Internal]
NSString NSIndianCalendar { get; }
[Field ("NSISO8601Calendar"), Internal]
NSString NSISO8601Calendar { get; }
}
[Since (3,2)]
[BaseType (typeof (NSObject))]
public interface NSCharacterSet {
[Static, Export ("alphanumericCharacterSet")]
NSCharacterSet Alphanumerics {get;}
[Static, Export ("capitalizedLetterCharacterSet")]
NSCharacterSet Capitalized {get;}
// TODO/FIXME: constructor?
[Static, Export ("characterSetWithBitmapRepresentation:")]
NSCharacterSet FromBitmap (NSData data);
// TODO/FIXME: constructor?
[Static, Export ("characterSetWithCharactersInString:")]
NSCharacterSet FromString (string aString);
[Static, Export ("characterSetWithContentsOfFile:")]
NSCharacterSet FromFile (string path);
[Static, Export ("characterSetWithRange:")]
NSCharacterSet FromRange (NSRange aRange);
[Static, Export ("controlCharacterSet")]
NSCharacterSet Controls {get;}
[Static, Export ("decimalDigitCharacterSet")]
NSCharacterSet DecimalDigits {get;}
[Static, Export ("decomposableCharacterSet")]
NSCharacterSet Decomposables {get;}
[Static, Export ("illegalCharacterSet")]
NSCharacterSet Illegals {get;}
[Static, Export ("letterCharacterSet")]
NSCharacterSet Letters {get;}
[Static, Export ("lowercaseLetterCharacterSet")]
NSCharacterSet LowercaseLetters {get;}
[Static, Export ("newlineCharacterSet")]
NSCharacterSet Newlines {get;}
[Static, Export ("nonBaseCharacterSet")]
NSCharacterSet Marks {get;}
[Static, Export ("punctuationCharacterSet")]
NSCharacterSet Punctuation {get;}
[Static, Export ("symbolCharacterSet")]
NSCharacterSet Symbols {get;}
[Static, Export ("uppercaseLetterCharacterSet")]
NSCharacterSet UppercaseLetters {get;}
[Static, Export ("whitespaceAndNewlineCharacterSet")]
NSCharacterSet WhitespaceAndNewlines {get;}
[Static, Export ("whitespaceCharacterSet")]
NSCharacterSet Whitespaces {get;}
[Export ("bitmapRepresentation")]
NSData GetBitmapRepresentation ();
[Export ("characterIsMember:")]
bool Contains (char aCharacter);
[Export ("hasMemberInPlane:")]
bool HasMemberInPlane (byte thePlane);
[Export ("invertedSet")]
NSCharacterSet InvertedSet {get;}
[Export ("isSupersetOfSet:")]
bool IsSupersetOf (NSCharacterSet theOtherSet);
[Export ("longCharacterIsMember:")]
bool Contains (uint theLongChar);
}
[BaseType (typeof (NSObject))]
public interface NSCoder {
//
// Encoding and decoding
//
[Export ("encodeObject:")]
void Encode (NSObject obj);
[Export ("encodeRootObject:")]
void EncodeRoot (NSObject obj);
[Export ("decodeObject")]
NSObject DecodeObject ();
//
// Encoding and decoding with keys
//
[Export ("encodeConditionalObject:forKey:")]
void EncodeConditionalObject (NSObject val, string key);
[Export ("encodeObject:forKey:")]
void Encode (NSObject val, string key);
[Export ("encodeBool:forKey:")]
void Encode (bool val, string key);
[Export ("encodeDouble:forKey:")]
void Encode (double val, string key);
[Export ("encodeFloat:forKey:")]
void Encode (float val, string key);
[Export ("encodeInt32:forKey:")]
void Encode (int val, string key);
[Export ("encodeInt64:forKey:")]
void Encode (long val, string key);
[Export ("encodeBytes:length:forKey:")]
void EncodeBlock (IntPtr bytes, int length, string key);
[Export ("containsValueForKey:")]
bool ContainsKey (string key);
[Export ("decodeBoolForKey:")]
bool DecodeBool (string key);
[Export ("decodeDoubleForKey:")]
double DecodeDouble (string key);
[Export ("decodeFloatForKey:")]
float DecodeFloat (string key);
[Export ("decodeInt32ForKey:")]
int DecodeInt (string key);
[Export ("decodeInt64ForKey:")]
long DecodeLong (string key);
[Export ("decodeObjectForKey:")]
NSObject DecodeObject (string key);
[Internal, Export ("decodeBytesForKey:returnedLength:")]
IntPtr DecodeBytes (string key, IntPtr length_ptr);
[Since (6,0)]
[Export ("allowedClasses")]
NSSet AllowedClasses { get; }
[Since (6,0)]
[Export ("requiresSecureCoding")]
bool RequiresSecureCoding ();
}
[BaseType (typeof (NSPredicate))]
public interface NSComparisonPredicate {
[Static, Export ("predicateWithLeftExpression:rightExpression:modifier:type:options:")]
NSPredicate Create (NSExpression leftExpression, NSExpression rightExpression, NSComparisonPredicateModifier comparisonModifier, NSPredicateOperatorType operatorType, NSComparisonPredicateOptions comparisonOptions);
[Static, Export ("predicateWithLeftExpression:rightExpression:customSelector:")]
NSPredicate FromSelector (NSExpression leftExpression, NSExpression rightExpression, Selector selector);
[Export ("initWithLeftExpression:rightExpression:modifier:type:options:")]
IntPtr Constructor (NSExpression leftExpression, NSExpression rightExpression, NSComparisonPredicateModifier comparisonModifier, NSPredicateOperatorType operatorType, NSComparisonPredicateOptions comparisonOptions);
[Export ("initWithLeftExpression:rightExpression:customSelector:")]
IntPtr Constructor (NSExpression leftExpression, NSExpression rightExpression, Selector selector);
[Export ("predicateOperatorType")]
NSPredicateOperatorType PredicateOperatorType { get; }
[Export ("comparisonPredicateModifier")]
NSComparisonPredicateModifier ComparisonPredicateModifier { get; }
[Export ("leftExpression")]
NSExpression LeftExpression { get; }
[Export ("rightExpression")]
NSExpression RightExpression { get; }
[Export ("customSelector")]
Selector CustomSelector { get; }
[Export ("options")]
NSComparisonPredicateOptions Options { get; }
}
[BaseType (typeof (NSPredicate))]
[DisableDefaultCtor] // An uncaught exception was raised: Can't have a NOT predicate with no subpredicate.
public interface NSCompoundPredicate {
[Export ("initWithType:subpredicates:")]
IntPtr Constructor (NSCompoundPredicateType type, NSPredicate[] subpredicates);
[Export ("compoundPredicateType")]
NSCompoundPredicateType Type { get; }
[Export ("subpredicates")]
NSPredicate[] Subpredicates { get; }
[Static]
[Export ("andPredicateWithSubpredicates:")]
NSPredicate CreateAndPredicate (NSPredicate[] subpredicates);
[Static]
[Export ("orPredicateWithSubpredicates:")]
NSPredicate CreateOrPredicate (NSPredicate [] subpredicates);
[Static]
[Export ("notPredicateWithSubpredicate:")]
NSPredicate CreateNotPredicate (NSPredicate predicate);
}
[BaseType (typeof (NSObject))]
public interface NSData {
[Export ("dataWithContentsOfURL:")]
[Static]
NSData FromUrl (NSUrl url);
[Export ("dataWithContentsOfURL:options:error:")]
[Static]
NSData FromUrl (NSUrl url, NSDataReadingOptions mask, out NSError error);
[Export ("dataWithContentsOfFile:")][Static]
NSData FromFile (string path);
[Export ("dataWithContentsOfFile:options:error:")]
[Static]
NSData FromFile (string path, NSDataReadingOptions mask, out NSError error);
[Export ("dataWithData:")]
[Static]
NSData FromData (NSData source);
[Export ("dataWithBytes:length:"), Static]
NSData FromBytes (IntPtr bytes, uint size);
[Export ("bytes")]
IntPtr Bytes { get; }
[Export ("length")]
uint Length { get; [NotImplemented] set; }
[Export ("writeToFile:options:error:")]
bool _Save (string file, int options, IntPtr addr);
[Export ("writeToURL:options:error:")]
bool _Save (NSUrl url, int options, IntPtr addr);
[Export ("rangeOfData:options:range:")]
[Since (4,0)]
NSRange Find (NSData dataToFind, NSDataSearchOptions searchOptions, NSRange searchRange);
}
[BaseType (typeof (NSObject))]
public interface NSDateComponents {
[Since (4,0)]
[Export ("timeZone")]
NSTimeZone TimeZone { get; set; }
[Export ("calendar")]
[Since (4,0)]
NSCalendar Calendar { get; set; }
[Export ("quarter")]
[Since (4,0)]
int Quarter { get; set; }
[Export ("date")]
[Since (4,0)]
NSDate Date { get; }
//Detected properties
[Export ("era")]
int Era { get; set; }
[Export ("year")]
int Year { get; set; }
[Export ("month")]
int Month { get; set; }
[Export ("day")]
int Day { get; set; }
[Export ("hour")]
int Hour { get; set; }
[Export ("minute")]
int Minute { get; set; }
[Export ("second")]
int Second { get; set; }
[Export ("week")]
int Week { get; set; }
[Export ("weekday")]
int Weekday { get; set; }
[Export ("weekdayOrdinal")]
int WeekdayOrdinal { get; set; }
[Since (5,0)]
[Export ("weekOfMonth")]
int WeekOfMonth { get; set; }
[Since (5,0)]
[Export ("weekOfYear")]
int WeekOfYear { get; set; }
[Since (5,0)]
[Export ("yearForWeekOfYear")]
int YearForWeekOfYear { get; set; }
[Since (6,0)]
[Export ("leapMonth")]
bool IsLeapMonth { [Bind ("isLeapMonth")] get; set; }
}
[Since (6,0)]
[BaseType (typeof (NSFormatter))]
interface NSByteCountFormatter {
[Export ("allowsNonnumericFormatting")]
bool AllowsNonnumericFormatting { get; set; }
[Export ("includesUnit")]
bool IncludesUnit { get; set; }
[Export ("includesCount")]
bool IncludesCount { get; set; }
[Export ("includesActualByteCount")]
bool IncludesActualByteCount { get; set; }
[Export ("adaptive")]
bool Adaptive { [Bind ("isAdaptive")] get; set; }
[Export ("zeroPadsFractionDigits")]
bool ZeroPadsFractionDigits { get; set; }
[Static]
[Export ("stringFromByteCount:countStyle:")]
string Format (long byteCount, NSByteCountFormatterCountStyle countStyle);
[Export ("stringFromByteCount:")]
string Format (long byteCount);
[Export ("allowedUnits")]
NSByteCountFormatterUnits AllowedUnits { get; set; }
[Export ("countStyle")]
NSByteCountFormatterCountStyle CountStyle { get; set; }
}
[BaseType (typeof (NSFormatter))]
public interface NSDateFormatter {
[Export ("stringFromDate:")]
string ToString (NSDate date);
[Export ("dateFromString:")]
NSDate Parse (string date);
[Export ("dateFormat")]
string DateFormat { get; set; }
[Export ("dateStyle")]
NSDateFormatterStyle DateStyle { get; set; }
[Export ("timeStyle")]
NSDateFormatterStyle TimeStyle { get; set; }
[Export ("locale")]
NSLocale Locale { get; set; }
[Export ("generatesCalendarDates")]
bool GeneratesCalendarDates { get; set; }
[Export ("formatterBehavior")]
NSDateFormatterBehavior Behavior { get; set; }
[Export ("defaultFormatterBehavior"), Static]
NSDateFormatterBehavior DefaultBehavior { get; set; }
[Export ("timeZone")]
NSTimeZone TimeZone { get; set; }
[Export ("calendar")]
NSCalendar Calendar { get; set; }
// not exposed as a property in documentation
[Export ("isLenient")]
bool IsLenient { get; [Bind ("setLenient:")] set; }
[Export ("twoDigitStartDate")]
NSDate TwoDigitStartDate { get; set; }
[Export ("defaultDate")]
NSDate DefaultDate { get; set; }
[Export ("eraSymbols")]
string [] EraSymbols { get; set; }
[Export ("monthSymbols")]
string [] MonthSymbols { get; set; }
[Export ("shortMonthSymbols")]
string [] ShortMonthSymbols { get; set; }
[Export ("weekdaySymbols")]
string [] WeekdaySymbols { get; set; }
[Export ("shortWeekdaySymbols")]
string [] ShortWeekdaySymbols { get; set; }
[Export ("AMSymbol")]
string AMSymbol { get; set; }
[Export ("PMSymbol")]
string PMSymbol { get; set; }
[Export ("longEraSymbols")]
string [] LongEraSymbols { get; set; }
[Export ("veryShortMonthSymbols")]
string [] VeryShortMonthSymbols { get; set; }
[Export ("standaloneMonthSymbols")]
string [] StandaloneMonthSymbols { get; set; }
[Export ("shortStandaloneMonthSymbols")]
string [] ShortStandaloneMonthSymbols { get; set; }
[Export ("veryShortStandaloneMonthSymbols")]
string [] VeryShortStandaloneMonthSymbols { get; set; }
[Export ("veryShortWeekdaySymbols")]
string [] VeryShortWeekdaySymbols { get; set; }
[Export ("standaloneWeekdaySymbols")]
string [] StandaloneWeekdaySymbols { get; set; }
[Export ("shortStandaloneWeekdaySymbols")]
string [] ShortStandaloneWeekdaySymbols { get; set; }
[Export ("veryShortStandaloneWeekdaySymbols")]
string [] VeryShortStandaloneWeekdaySymbols { get; set; }
[Export ("quarterSymbols")]
string [] QuarterSymbols { get; set; }
[Export ("shortQuarterSymbols")]
string [] ShortQuarterSymbols { get; set; }
[Export ("standaloneQuarterSymbols")]
string [] StandaloneQuarterSymbols { get; set; }
[Export ("shortStandaloneQuarterSymbols")]
string [] ShortStandaloneQuarterSymbols { get; set; }
[Export ("gregorianStartDate")]
NSDate GregorianStartDate { get; set; }
}
//@interface NSFormatter : NSObject <NSCopying, NSCoding>
[BaseType (typeof (NSObject))]
public interface NSFormatter {
[Export ("stringForObjectValue:")]
string StringFor (NSObject value);
// - (NSAttributedString *)attributedStringForObjectValue:(id)obj withDefaultAttributes:(NSDictionary *)attrs;
[Export ("editingStringForObjectValue:")]
string EditingStringFor (NSObject value);
}
[BaseType (typeof (NSObject))]
[Model]
public interface NSKeyedArchiverDelegate {
[Export ("archiver:didEncodeObject:"), EventArgs ("NSObject")]
void EncodedObject (NSKeyedArchiver archiver, NSObject obj);
[Export ("archiverDidFinish:")]
void Finished (NSKeyedArchiver archiver);
[Export ("archiver:willEncodeObject:"), DelegateName ("NSEncodeHook"), DefaultValue (null)]
NSObject WillEncode (NSKeyedArchiver archiver, NSObject obj);
[Export ("archiverWillFinish:")]
void Finishing (NSKeyedArchiver archiver);
[Export ("archiver:willReplaceObject:withObject:"), EventArgs ("NSArchiveReplace")]
void ReplacingObject (NSKeyedArchiver archiver, NSObject oldObject, NSObject newObject);
}
[BaseType (typeof (NSObject))]
[Model]
public interface NSKeyedUnarchiverDelegate {
[Export ("unarchiver:didDecodeObject:"), DelegateName ("NSDecoderCallback"), DefaultValue (null)]
NSObject DecodedObject (NSKeyedUnarchiver unarchiver, NSObject obj);
[Export ("unarchiverDidFinish:")]
void Finished (NSKeyedUnarchiver unarchiver);
[Export ("unarchiver:cannotDecodeObjectOfClassName:originalClasses:"), DelegateName ("NSDecoderHandler"), DefaultValue (null)]
Class CannotDecodeClass (NSKeyedUnarchiver unarchiver, string klass, string [] classes);
[Export ("unarchiverWillFinish:")]
void Finishing (NSKeyedUnarchiver unarchiver);
[Export ("unarchiver:willReplaceObject:withObject:"), EventArgs ("NSArchiveReplace")]
void ReplacingObject (NSKeyedUnarchiver unarchiver, NSObject oldObject, NSObject newObject);
}
[BaseType (typeof (NSCoder),
Delegates=new string [] {"WeakDelegate"},
Events=new Type [] { typeof (NSKeyedArchiverDelegate) })]
// Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[NSKeyedArchiver init]: cannot use -init for initialization
[DisableDefaultCtor]
public interface NSKeyedArchiver {
[Export ("initForWritingWithMutableData:")]
IntPtr Constructor (NSMutableData data);
[Export ("archivedDataWithRootObject:")]
[Static]
NSData ArchivedDataWithRootObject (NSObject root);
[Export ("archiveRootObject:toFile:")]
[Static]
bool ArchiveRootObjectToFile (NSObject root, string file);
[Export ("finishEncoding")]
void FinishEncoding ();
[Export ("outputFormat")]
NSPropertyListFormat PropertyListFormat { get; set; }
[Wrap ("WeakDelegate")]
NSKeyedArchiverDelegate Delegate { get; set; }
[Export ("delegate", ArgumentSemantic.Assign)][NullAllowed]
NSObject WeakDelegate { get; set; }
[Export ("setClassName:forClass:")]
void SetClassName (string name, Class kls);
[Export ("classNameForClass:")]
string GetClassName (Class kls);
}
[BaseType (typeof (NSCoder),
Delegates=new string [] {"WeakDelegate"},
Events=new Type [] { typeof (NSKeyedUnarchiverDelegate) })]
// Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[NSKeyedUnarchiver init]: cannot use -init for initialization
[DisableDefaultCtor]
public interface NSKeyedUnarchiver {
[Export ("initForReadingWithData:")]
[MarshalNativeExceptions]
IntPtr Constructor (NSData data);
[Static, Export ("unarchiveObjectWithData:")]
[MarshalNativeExceptions]
NSObject UnarchiveObject (NSData data);
[Static, Export ("unarchiveObjectWithFile:")]
[MarshalNativeExceptions]
NSObject UnarchiveFile (string file);
[Export ("finishDecoding")]
void FinishDecoding ();
[Wrap ("WeakDelegate")]
NSKeyedUnarchiverDelegate Delegate { get; set; }
[Export ("delegate", ArgumentSemantic.Assign)][NullAllowed]
NSObject WeakDelegate { get; set; }
[Export ("setClass:forClassName:")]
void SetClass (Class kls, string codedName);
[Export ("classForClassName:")]
Class GetClass (string codedName);
}
[BaseType (typeof (NSObject), Delegates=new string [] { "Delegate" }, Events=new Type [] { typeof (NSMetadataQueryDelegate)})]
public interface NSMetadataQuery {
[Export ("startQuery")]
bool StartQuery ();
[Export ("stopQuery")]
void StopQuery ();
[Export ("isStarted")]
bool IsStarted { get; }
[Export ("isGathering")]
bool IsGathering { get; }
[Export ("isStopped")]
bool IsStopped { get; }
[Export ("disableUpdates")]
void DisableUpdates ();
[Export ("enableUpdates")]
void EnableUpdates ();
[Export ("resultCount")]
int ResultCount { get; }