PageRenderTime 56ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 1ms

/src/foundation.cs

https://github.com/kjpou1/maccore
C# | 6779 lines | 4627 code | 1959 blank | 193 comment | 1 complexity | fd86bd4a55207ac9882d09cd1d103e34 MD5 | raw file
Possible License(s): Apache-2.0

Large files files are truncated, but you can click here to view the full file

  1. //
  2. // This file describes the API that the generator will produce
  3. //
  4. // Authors:
  5. // Geoff Norton
  6. // Miguel de Icaza
  7. // Aaron Bockover
  8. //
  9. // Copyright 2009, Novell, Inc.
  10. // Copyright 2010, Novell, Inc.
  11. // Copyright 2011-2013 Xamarin Inc.
  12. //
  13. // Permission is hereby granted, free of charge, to any person obtaining
  14. // a copy of this software and associated documentation files (the
  15. // "Software"), to deal in the Software without restriction, including
  16. // without limitation the rights to use, copy, modify, merge, publish,
  17. // distribute, sublicense, and/or sell copies of the Software, and to
  18. // permit persons to whom the Software is furnished to do so, subject to
  19. // the following conditions:
  20. //
  21. // The above copyright notice and this permission notice shall be
  22. // included in all copies or substantial portions of the Software.
  23. //
  24. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  25. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  26. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  27. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  28. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  29. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  30. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  31. //
  32. //
  33. using MonoMac.ObjCRuntime;
  34. using MonoMac.CoreFoundation;
  35. using MonoMac.Foundation;
  36. using MonoMac.CoreGraphics;
  37. using MonoMac.CoreMedia;
  38. #if MONOMAC
  39. using MonoMac.AppKit;
  40. #else
  41. using MonoMac.CoreLocation;
  42. using MonoMac.UIKit;
  43. #endif
  44. using System;
  45. using System.Drawing;
  46. using System.ComponentModel;
  47. namespace MonoMac.Foundation
  48. {
  49. public delegate int NSComparator (NSObject obj1, NSObject obj2);
  50. public delegate void NSAttributedRangeCallback (NSDictionary attrs, NSRange range, ref bool stop);
  51. public delegate void NSAttributedStringCallback (NSObject value, NSRange range, ref bool stop);
  52. public delegate bool NSEnumerateErrorHandler (NSUrl url, NSError error);
  53. [BaseType (typeof (NSObject))]
  54. public interface NSArray {
  55. [Export ("count")]
  56. uint Count { get; }
  57. [Export ("objectAtIndex:")]
  58. IntPtr ValueAt (uint idx);
  59. [Export ("arrayWithObjects:count:")][Static][Internal]
  60. NSArray FromObjects (IntPtr array, int count);
  61. [Export ("valueForKey:")]
  62. [MarshalNativeExceptions]
  63. NSObject ValueForKey (NSString key);
  64. [Export ("setValue:forKey:")]
  65. void SetValueForKey (NSObject value, NSString key);
  66. [Export ("writeToFile:atomically:")]
  67. bool WriteToFile (string path, bool useAuxiliaryFile);
  68. [Export ("arrayWithContentsOfFile:")][Static]
  69. NSArray FromFile (string path);
  70. [Export ("sortedArrayUsingComparator:")]
  71. NSArray Sort (NSComparator cmptr);
  72. [Export ("filteredArrayUsingPredicate:")]
  73. NSArray Filter (NSPredicate predicate);
  74. }
  75. [Since (3,2)]
  76. [BaseType (typeof (NSObject))]
  77. public partial interface NSAttributedString {
  78. [Export ("string")]
  79. string Value { get; }
  80. [Export ("attributesAtIndex:effectiveRange:")]
  81. NSDictionary GetAttributes (int location, out NSRange effectiveRange);
  82. [Export ("length")]
  83. int Length { get; }
  84. // TODO: figure out the type, this deserves to be strongly typed if possble
  85. [Export ("attribute:atIndex:effectiveRange:")]
  86. NSObject GetAttribute (string attribute, int location, out NSRange effectiveRange);
  87. [Export ("attributedSubstringFromRange:"), Internal]
  88. NSAttributedString Substring (NSRange range);
  89. [Export ("attributesAtIndex:longestEffectiveRange:inRange:")]
  90. NSDictionary GetAttributes (int location, out NSRange longestEffectiveRange, NSRange rangeLimit);
  91. [Export ("attribute:atIndex:longestEffectiveRange:inRange:")]
  92. NSObject GetAttribute (string attribute, int location, out NSRange longestEffectiveRange, NSRange rangeLimit);
  93. [Export ("isEqualToAttributedString:")]
  94. bool IsEqual (NSAttributedString other);
  95. [Export ("initWithString:")]
  96. IntPtr Constructor (string str);
  97. [Export ("initWithString:attributes:")]
  98. [EditorBrowsable (EditorBrowsableState.Advanced)]
  99. IntPtr Constructor (string str, NSDictionary attributes);
  100. [Export ("initWithAttributedString:")]
  101. IntPtr Constructor (NSAttributedString other);
  102. [Export ("enumerateAttributesInRange:options:usingBlock:")]
  103. void EnumerateAttributes (NSRange range, NSAttributedStringEnumeration options, NSAttributedRangeCallback callback);
  104. [Export ("enumerateAttribute:inRange:options:usingBlock:")]
  105. void EnumerateAttribute (NSString attributeName, NSRange inRange, NSAttributedStringEnumeration options, NSAttributedStringCallback callback);
  106. #if MONOMAC
  107. [Export("size")]
  108. SizeF Size { get; }
  109. [Field ("NSFontAttributeName", "AppKit")]
  110. NSString FontAttributeName { get; }
  111. [Field ("NSLinkAttributeName", "AppKit")]
  112. NSString LinkAttributeName { get; }
  113. [Field ("NSUnderlineStyleAttributeName", "AppKit")]
  114. NSString UnderlineStyleAttributeName { get; }
  115. [Field ("NSStrikethroughStyleAttributeName", "AppKit")]
  116. NSString StrikethroughStyleAttributeName { get; }
  117. [Field ("NSStrokeWidthAttributeName", "AppKit")]
  118. NSString StrokeWidthAttributeName { get; }
  119. [Field ("NSParagraphStyleAttributeName", "AppKit")]
  120. NSString ParagraphStyleAttributeName { get; }
  121. [Field ("NSForegroundColorAttributeName", "AppKit")]
  122. NSString ForegroundColorAttributeName { get; }
  123. [Field ("NSBackgroundColorAttributeName", "AppKit")]
  124. NSString BackgroundColorAttributeName { get; }
  125. [Field ("NSLigatureAttributeName", "AppKit")]
  126. NSString LigatureAttributeName { get; }
  127. [Field ("NSObliquenessAttributeName", "AppKit")]
  128. NSString ObliquenessAttributeName { get; }
  129. [Field ("NSSuperscriptAttributeName", "AppKit")]
  130. NSString SuperscriptAttributeName { get; }
  131. [Field ("NSAttachmentAttributeName", "AppKit")]
  132. NSString AttachmentAttributeName { get; }
  133. [Field ("NSBaselineOffsetAttributeName", "AppKit")]
  134. NSString BaselineOffsetAttributeName { get; }
  135. [Field ("NSKernAttributeName", "AppKit")]
  136. NSString KernAttributeName { get; }
  137. [Field ("NSStrokeColorAttributeName", "AppKit")]
  138. NSString StrokeColorAttributeName { get; }
  139. [Field ("NSUnderlineColorAttributeName", "AppKit")]
  140. NSString UnderlineColorAttributeName { get; }
  141. [Field ("NSStrikethroughColorAttributeName", "AppKit")]
  142. NSString StrikethroughColorAttributeName { get; }
  143. [Field ("NSShadowAttributeName", "AppKit")]
  144. NSString ShadowAttributeName { get; }
  145. [Field ("NSExpansionAttributeName", "AppKit")]
  146. NSString ExpansionAttributeName { get; }
  147. [Field ("NSCursorAttributeName", "AppKit")]
  148. NSString CursorAttributeName { get; }
  149. [Field ("NSToolTipAttributeName", "AppKit")]
  150. NSString ToolTipAttributeName { get; }
  151. [Field ("NSMarkedClauseSegmentAttributeName", "AppKit")]
  152. NSString MarkedClauseSegmentAttributeName { get; }
  153. [Field ("NSWritingDirectionAttributeName", "AppKit")]
  154. NSString WritingDirectionAttributeName { get; }
  155. [Field ("NSVerticalGlyphFormAttributeName", "AppKit")]
  156. NSString VerticalGlyphFormAttributeName { get; }
  157. [Export ("initWithData:options:documentAttributes:error:")]
  158. IntPtr Constructor (NSData data, NSDictionary options, out NSDictionary docAttributes, out NSError error);
  159. [Export ("initWithDocFormat:documentAttributes:")]
  160. IntPtr Constructor(NSData wordDocFormat, out NSDictionary docAttributes);
  161. [Export ("initWithHTML:baseURL:documentAttributes:")]
  162. IntPtr Constructor (NSData htmlData, NSUrl baseUrl, out NSDictionary docAttributes);
  163. [Export ("drawAtPoint:")]
  164. void DrawString (PointF point);
  165. [Export ("drawInRect:")]
  166. void DrawString (RectangleF rect);
  167. [Export ("drawWithRect:options:")]
  168. void DrawString (RectangleF rect, NSStringDrawingOptions options);
  169. #else
  170. [Since (6,0)]
  171. [Export ("size")]
  172. SizeF Size { get; }
  173. [Since (6,0)]
  174. [Export ("drawAtPoint:")]
  175. void DrawString (PointF point);
  176. [Since (6,0)]
  177. [Export ("drawInRect:")]
  178. void DrawString (RectangleF rect);
  179. [Since (6,0)]
  180. [Export ("drawWithRect:options:context:")]
  181. void DrawString (RectangleF rect, NSStringDrawingOptions options, [NullAllowed] NSStringDrawingContext context);
  182. [Since (6,0)]
  183. [Export ("boundingRectWithSize:options:context:")]
  184. RectangleF GetBoundingRect (SizeF size, NSStringDrawingOptions options, [NullAllowed] NSStringDrawingContext context);
  185. #endif
  186. }
  187. [BaseType (typeof (NSObject),
  188. Delegates=new string [] { "WeakDelegate" },
  189. Events=new Type [] { typeof (NSCacheDelegate)} )]
  190. [Since (4,0)]
  191. public interface NSCache {
  192. [Export ("objectForKey:")]
  193. NSObject ObjectForKey (NSObject key);
  194. [Export ("setObject:forKey:")]
  195. void SetObjectforKey (NSObject obj, NSObject key);
  196. [Export ("setObject:forKey:cost:")]
  197. void SetCost (NSObject obj, NSObject key, uint cost);
  198. [Export ("removeObjectForKey:")]
  199. void RemoveObjectForKey (NSObject key);
  200. [Export ("removeAllObjects")]
  201. void RemoveAllObjects ();
  202. //Detected properties
  203. [Export ("name")]
  204. string Name { get; set; }
  205. [Export ("delegate")]
  206. NSObject WeakDelegate { get; set; }
  207. [Wrap ("WeakDelegate")]
  208. NSCacheDelegate Delegate { get; set; }
  209. [Export ("totalCostLimit")]
  210. uint TotalCostLimit { get; set; }
  211. [Export ("countLimit")]
  212. uint CountLimit { get; set; }
  213. [Export ("evictsObjectsWithDiscardedContent")]
  214. bool EvictsObjectsWithDiscardedContent { get; set; }
  215. }
  216. [BaseType (typeof (NSObject))]
  217. [Model]
  218. [Protocol]
  219. public interface NSCacheDelegate {
  220. [Export ("cache:willEvictObject:"), EventArgs ("NSObject")]
  221. void WillEvictObject (NSCache cache, NSObject obj);
  222. }
  223. [BaseType (typeof (NSObject), Name="NSCachedURLResponse")]
  224. // instance created with 'init' will crash when Dispose is called
  225. [DisableDefaultCtor]
  226. public interface NSCachedUrlResponse {
  227. [Export ("initWithResponse:data:userInfo:storagePolicy:")]
  228. IntPtr Constructor (NSUrlResponse response, NSData data, [NullAllowed] NSDictionary userInfo, NSUrlCacheStoragePolicy storagePolicy);
  229. [Export ("initWithResponse:data:")]
  230. IntPtr Constructor (NSUrlResponse response, NSData data);
  231. [Export ("response")]
  232. NSUrlResponse Response { get; }
  233. [Export ("data")]
  234. NSData Data { get; }
  235. [Export ("userInfo")]
  236. NSDictionary UserInfo { get; }
  237. [Export ("storagePolicy")]
  238. NSUrlCacheStoragePolicy StoragePolicy { get; }
  239. }
  240. [BaseType (typeof (NSObject))]
  241. // 'init' returns NIL
  242. [DisableDefaultCtor]
  243. public interface NSCalendar {
  244. [Export ("initWithCalendarIdentifier:")]
  245. IntPtr Constructor (NSString identifier);
  246. [Export ("calendarIdentifier")]
  247. string Identifier { get; }
  248. [Export ("currentCalendar")] [Static]
  249. NSCalendar CurrentCalendar { get; }
  250. [Export ("locale")]
  251. NSLocale Locale { get; set; }
  252. [Export ("timeZone")]
  253. NSTimeZone TimeZone { get; set; }
  254. [Export ("firstWeekday")]
  255. uint FirstWeekDay { get; set; }
  256. [Export ("minimumDaysInFirstWeek")]
  257. uint MinimumDaysInFirstWeek { get; set; }
  258. //- (NSRange)minimumRangeOfUnit:(NSCalendarUnit)unit;
  259. //- (NSRange)maximumRangeOfUnit:(NSCalendarUnit)unit;
  260. //- (NSRange)rangeOfUnit:(NSCalendarUnit)smaller inUnit:(NSCalendarUnit)larger forDate:(NSDate *)date;
  261. //- (NSUInteger)ordinalityOfUnit:(NSCalendarUnit)smaller inUnit:(NSCalendarUnit)larger forDate:(NSDate *)date;
  262. //- (BOOL)rangeOfUnit:(NSCalendarUnit)unit startDate:(NSDate **)datep interval:(NSTimeInterval *)tip forDate:(NSDate *)date AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
  263. [Export ("components:fromDate:")]
  264. NSDateComponents Components (NSCalendarUnit unitFlags, NSDate fromDate);
  265. [Export ("components:fromDate:toDate:options:")]
  266. NSDateComponents Components (NSCalendarUnit unitFlags, NSDate fromDate, NSDate toDate, NSDateComponentsWrappingBehavior opts);
  267. [Export ("dateByAddingComponents:toDate:options:")]
  268. NSDate DateByAddingComponents (NSDateComponents comps, NSDate date, NSDateComponentsWrappingBehavior opts);
  269. [Export ("dateFromComponents:")]
  270. NSDate DateFromComponents (NSDateComponents comps);
  271. [Field ("NSGregorianCalendar"), Internal]
  272. NSString NSGregorianCalendar { get; }
  273. [Field ("NSBuddhistCalendar"), Internal]
  274. NSString NSBuddhistCalendar { get; }
  275. [Field ("NSChineseCalendar"), Internal]
  276. NSString NSChineseCalendar { get; }
  277. [Field ("NSHebrewCalendar"), Internal]
  278. NSString NSHebrewCalendar { get; }
  279. [Field ("NSIslamicCalendar"), Internal]
  280. NSString NSIslamicCalendar { get; }
  281. [Field ("NSIslamicCivilCalendar"), Internal]
  282. NSString NSIslamicCivilCalendar { get; }
  283. [Field ("NSJapaneseCalendar"), Internal]
  284. NSString NSJapaneseCalendar { get; }
  285. [Field ("NSRepublicOfChinaCalendar"), Internal]
  286. NSString NSRepublicOfChinaCalendar { get; }
  287. [Field ("NSPersianCalendar"), Internal]
  288. NSString NSPersianCalendar { get; }
  289. [Field ("NSIndianCalendar"), Internal]
  290. NSString NSIndianCalendar { get; }
  291. [Field ("NSISO8601Calendar"), Internal]
  292. NSString NSISO8601Calendar { get; }
  293. }
  294. [Since (3,2)]
  295. [BaseType (typeof (NSObject))]
  296. public interface NSCharacterSet {
  297. [Static, Export ("alphanumericCharacterSet")]
  298. NSCharacterSet Alphanumerics {get;}
  299. [Static, Export ("capitalizedLetterCharacterSet")]
  300. NSCharacterSet Capitalized {get;}
  301. // TODO/FIXME: constructor?
  302. [Static, Export ("characterSetWithBitmapRepresentation:")]
  303. NSCharacterSet FromBitmap (NSData data);
  304. // TODO/FIXME: constructor?
  305. [Static, Export ("characterSetWithCharactersInString:")]
  306. NSCharacterSet FromString (string aString);
  307. [Static, Export ("characterSetWithContentsOfFile:")]
  308. NSCharacterSet FromFile (string path);
  309. [Static, Export ("characterSetWithRange:")]
  310. NSCharacterSet FromRange (NSRange aRange);
  311. [Static, Export ("controlCharacterSet")]
  312. NSCharacterSet Controls {get;}
  313. [Static, Export ("decimalDigitCharacterSet")]
  314. NSCharacterSet DecimalDigits {get;}
  315. [Static, Export ("decomposableCharacterSet")]
  316. NSCharacterSet Decomposables {get;}
  317. [Static, Export ("illegalCharacterSet")]
  318. NSCharacterSet Illegals {get;}
  319. [Static, Export ("letterCharacterSet")]
  320. NSCharacterSet Letters {get;}
  321. [Static, Export ("lowercaseLetterCharacterSet")]
  322. NSCharacterSet LowercaseLetters {get;}
  323. [Static, Export ("newlineCharacterSet")]
  324. NSCharacterSet Newlines {get;}
  325. [Static, Export ("nonBaseCharacterSet")]
  326. NSCharacterSet Marks {get;}
  327. [Static, Export ("punctuationCharacterSet")]
  328. NSCharacterSet Punctuation {get;}
  329. [Static, Export ("symbolCharacterSet")]
  330. NSCharacterSet Symbols {get;}
  331. [Static, Export ("uppercaseLetterCharacterSet")]
  332. NSCharacterSet UppercaseLetters {get;}
  333. [Static, Export ("whitespaceAndNewlineCharacterSet")]
  334. NSCharacterSet WhitespaceAndNewlines {get;}
  335. [Static, Export ("whitespaceCharacterSet")]
  336. NSCharacterSet Whitespaces {get;}
  337. [Export ("bitmapRepresentation")]
  338. NSData GetBitmapRepresentation ();
  339. [Export ("characterIsMember:")]
  340. bool Contains (char aCharacter);
  341. [Export ("hasMemberInPlane:")]
  342. bool HasMemberInPlane (byte thePlane);
  343. [Export ("invertedSet")]
  344. NSCharacterSet InvertedSet {get;}
  345. [Export ("isSupersetOfSet:")]
  346. bool IsSupersetOf (NSCharacterSet theOtherSet);
  347. [Export ("longCharacterIsMember:")]
  348. bool Contains (uint theLongChar);
  349. }
  350. [BaseType (typeof (NSObject))]
  351. public interface NSCoder {
  352. //
  353. // Encoding and decoding
  354. //
  355. [Export ("encodeObject:")]
  356. void Encode (NSObject obj);
  357. [Export ("encodeRootObject:")]
  358. void EncodeRoot (NSObject obj);
  359. [Export ("decodeObject")]
  360. NSObject DecodeObject ();
  361. //
  362. // Encoding and decoding with keys
  363. //
  364. [Export ("encodeConditionalObject:forKey:")]
  365. void EncodeConditionalObject (NSObject val, string key);
  366. [Export ("encodeObject:forKey:")]
  367. void Encode (NSObject val, string key);
  368. [Export ("encodeBool:forKey:")]
  369. void Encode (bool val, string key);
  370. [Export ("encodeDouble:forKey:")]
  371. void Encode (double val, string key);
  372. [Export ("encodeFloat:forKey:")]
  373. void Encode (float val, string key);
  374. [Export ("encodeInt32:forKey:")]
  375. void Encode (int val, string key);
  376. [Export ("encodeInt64:forKey:")]
  377. void Encode (long val, string key);
  378. [Export ("encodeBytes:length:forKey:")]
  379. void EncodeBlock (IntPtr bytes, int length, string key);
  380. [Export ("containsValueForKey:")]
  381. bool ContainsKey (string key);
  382. [Export ("decodeBoolForKey:")]
  383. bool DecodeBool (string key);
  384. [Export ("decodeDoubleForKey:")]
  385. double DecodeDouble (string key);
  386. [Export ("decodeFloatForKey:")]
  387. float DecodeFloat (string key);
  388. [Export ("decodeInt32ForKey:")]
  389. int DecodeInt (string key);
  390. [Export ("decodeInt64ForKey:")]
  391. long DecodeLong (string key);
  392. [Export ("decodeObjectForKey:")]
  393. NSObject DecodeObject (string key);
  394. [Internal, Export ("decodeBytesForKey:returnedLength:")]
  395. IntPtr DecodeBytes (string key, IntPtr length_ptr);
  396. [Since (6,0)]
  397. [Export ("allowedClasses")]
  398. NSSet AllowedClasses { get; }
  399. [Since (6,0)]
  400. [Export ("requiresSecureCoding")]
  401. bool RequiresSecureCoding ();
  402. }
  403. [BaseType (typeof (NSPredicate))]
  404. public interface NSComparisonPredicate {
  405. [Static, Export ("predicateWithLeftExpression:rightExpression:modifier:type:options:")]
  406. NSPredicate Create (NSExpression leftExpression, NSExpression rightExpression, NSComparisonPredicateModifier comparisonModifier, NSPredicateOperatorType operatorType, NSComparisonPredicateOptions comparisonOptions);
  407. [Static, Export ("predicateWithLeftExpression:rightExpression:customSelector:")]
  408. NSPredicate FromSelector (NSExpression leftExpression, NSExpression rightExpression, Selector selector);
  409. [Export ("initWithLeftExpression:rightExpression:modifier:type:options:")]
  410. IntPtr Constructor (NSExpression leftExpression, NSExpression rightExpression, NSComparisonPredicateModifier comparisonModifier, NSPredicateOperatorType operatorType, NSComparisonPredicateOptions comparisonOptions);
  411. [Export ("initWithLeftExpression:rightExpression:customSelector:")]
  412. IntPtr Constructor (NSExpression leftExpression, NSExpression rightExpression, Selector selector);
  413. [Export ("predicateOperatorType")]
  414. NSPredicateOperatorType PredicateOperatorType { get; }
  415. [Export ("comparisonPredicateModifier")]
  416. NSComparisonPredicateModifier ComparisonPredicateModifier { get; }
  417. [Export ("leftExpression")]
  418. NSExpression LeftExpression { get; }
  419. [Export ("rightExpression")]
  420. NSExpression RightExpression { get; }
  421. [Export ("customSelector")]
  422. Selector CustomSelector { get; }
  423. [Export ("options")]
  424. NSComparisonPredicateOptions Options { get; }
  425. }
  426. [BaseType (typeof (NSPredicate))]
  427. [DisableDefaultCtor] // An uncaught exception was raised: Can't have a NOT predicate with no subpredicate.
  428. public interface NSCompoundPredicate {
  429. [Export ("initWithType:subpredicates:")]
  430. IntPtr Constructor (NSCompoundPredicateType type, NSPredicate[] subpredicates);
  431. [Export ("compoundPredicateType")]
  432. NSCompoundPredicateType Type { get; }
  433. [Export ("subpredicates")]
  434. NSPredicate[] Subpredicates { get; }
  435. [Static]
  436. [Export ("andPredicateWithSubpredicates:")]
  437. NSPredicate CreateAndPredicate (NSPredicate[] subpredicates);
  438. [Static]
  439. [Export ("orPredicateWithSubpredicates:")]
  440. NSPredicate CreateOrPredicate (NSPredicate [] subpredicates);
  441. [Static]
  442. [Export ("notPredicateWithSubpredicate:")]
  443. NSPredicate CreateNotPredicate (NSPredicate predicate);
  444. }
  445. [BaseType (typeof (NSObject))]
  446. public interface NSData {
  447. [Export ("dataWithContentsOfURL:")]
  448. [Static]
  449. NSData FromUrl (NSUrl url);
  450. [Export ("dataWithContentsOfURL:options:error:")]
  451. [Static]
  452. NSData FromUrl (NSUrl url, NSDataReadingOptions mask, out NSError error);
  453. [Export ("dataWithContentsOfFile:")][Static]
  454. NSData FromFile (string path);
  455. [Export ("dataWithContentsOfFile:options:error:")]
  456. [Static]
  457. NSData FromFile (string path, NSDataReadingOptions mask, out NSError error);
  458. [Export ("dataWithData:")]
  459. [Static]
  460. NSData FromData (NSData source);
  461. [Export ("dataWithBytes:length:"), Static]
  462. NSData FromBytes (IntPtr bytes, uint size);
  463. [Export ("bytes")]
  464. IntPtr Bytes { get; }
  465. [Export ("length")]
  466. uint Length { get; [NotImplemented] set; }
  467. [Export ("writeToFile:options:error:")]
  468. bool _Save (string file, int options, IntPtr addr);
  469. [Export ("writeToURL:options:error:")]
  470. bool _Save (NSUrl url, int options, IntPtr addr);
  471. [Export ("rangeOfData:options:range:")]
  472. [Since (4,0)]
  473. NSRange Find (NSData dataToFind, NSDataSearchOptions searchOptions, NSRange searchRange);
  474. }
  475. [BaseType (typeof (NSObject))]
  476. public interface NSDateComponents {
  477. [Since (4,0)]
  478. [Export ("timeZone")]
  479. NSTimeZone TimeZone { get; set; }
  480. [Export ("calendar")]
  481. [Since (4,0)]
  482. NSCalendar Calendar { get; set; }
  483. [Export ("quarter")]
  484. [Since (4,0)]
  485. int Quarter { get; set; }
  486. [Export ("date")]
  487. [Since (4,0)]
  488. NSDate Date { get; }
  489. //Detected properties
  490. [Export ("era")]
  491. int Era { get; set; }
  492. [Export ("year")]
  493. int Year { get; set; }
  494. [Export ("month")]
  495. int Month { get; set; }
  496. [Export ("day")]
  497. int Day { get; set; }
  498. [Export ("hour")]
  499. int Hour { get; set; }
  500. [Export ("minute")]
  501. int Minute { get; set; }
  502. [Export ("second")]
  503. int Second { get; set; }
  504. [Export ("week")]
  505. int Week { get; set; }
  506. [Export ("weekday")]
  507. int Weekday { get; set; }
  508. [Export ("weekdayOrdinal")]
  509. int WeekdayOrdinal { get; set; }
  510. [Since (5,0)]
  511. [Export ("weekOfMonth")]
  512. int WeekOfMonth { get; set; }
  513. [Since (5,0)]
  514. [Export ("weekOfYear")]
  515. int WeekOfYear { get; set; }
  516. [Since (5,0)]
  517. [Export ("yearForWeekOfYear")]
  518. int YearForWeekOfYear { get; set; }
  519. [Since (6,0)]
  520. [Export ("leapMonth")]
  521. bool IsLeapMonth { [Bind ("isLeapMonth")] get; set; }
  522. }
  523. [Since (6,0)]
  524. [BaseType (typeof (NSFormatter))]
  525. interface NSByteCountFormatter {
  526. [Export ("allowsNonnumericFormatting")]
  527. bool AllowsNonnumericFormatting { get; set; }
  528. [Export ("includesUnit")]
  529. bool IncludesUnit { get; set; }
  530. [Export ("includesCount")]
  531. bool IncludesCount { get; set; }
  532. [Export ("includesActualByteCount")]
  533. bool IncludesActualByteCount { get; set; }
  534. [Export ("adaptive")]
  535. bool Adaptive { [Bind ("isAdaptive")] get; set; }
  536. [Export ("zeroPadsFractionDigits")]
  537. bool ZeroPadsFractionDigits { get; set; }
  538. [Static]
  539. [Export ("stringFromByteCount:countStyle:")]
  540. string Format (long byteCount, NSByteCountFormatterCountStyle countStyle);
  541. [Export ("stringFromByteCount:")]
  542. string Format (long byteCount);
  543. [Export ("allowedUnits")]
  544. NSByteCountFormatterUnits AllowedUnits { get; set; }
  545. [Export ("countStyle")]
  546. NSByteCountFormatterCountStyle CountStyle { get; set; }
  547. }
  548. [BaseType (typeof (NSFormatter))]
  549. public interface NSDateFormatter {
  550. [Export ("stringFromDate:")]
  551. string ToString (NSDate date);
  552. [Export ("dateFromString:")]
  553. NSDate Parse (string date);
  554. [Export ("dateFormat")]
  555. string DateFormat { get; set; }
  556. [Export ("dateStyle")]
  557. NSDateFormatterStyle DateStyle { get; set; }
  558. [Export ("timeStyle")]
  559. NSDateFormatterStyle TimeStyle { get; set; }
  560. [Export ("locale")]
  561. NSLocale Locale { get; set; }
  562. [Export ("generatesCalendarDates")]
  563. bool GeneratesCalendarDates { get; set; }
  564. [Export ("formatterBehavior")]
  565. NSDateFormatterBehavior Behavior { get; set; }
  566. [Export ("defaultFormatterBehavior"), Static]
  567. NSDateFormatterBehavior DefaultBehavior { get; set; }
  568. [Export ("timeZone")]
  569. NSTimeZone TimeZone { get; set; }
  570. [Export ("calendar")]
  571. NSCalendar Calendar { get; set; }
  572. // not exposed as a property in documentation
  573. [Export ("isLenient")]
  574. bool IsLenient { get; [Bind ("setLenient:")] set; }
  575. [Export ("twoDigitStartDate")]
  576. NSDate TwoDigitStartDate { get; set; }
  577. [Export ("defaultDate")]
  578. NSDate DefaultDate { get; set; }
  579. [Export ("eraSymbols")]
  580. string [] EraSymbols { get; set; }
  581. [Export ("monthSymbols")]
  582. string [] MonthSymbols { get; set; }
  583. [Export ("shortMonthSymbols")]
  584. string [] ShortMonthSymbols { get; set; }
  585. [Export ("weekdaySymbols")]
  586. string [] WeekdaySymbols { get; set; }
  587. [Export ("shortWeekdaySymbols")]
  588. string [] ShortWeekdaySymbols { get; set; }
  589. [Export ("AMSymbol")]
  590. string AMSymbol { get; set; }
  591. [Export ("PMSymbol")]
  592. string PMSymbol { get; set; }
  593. [Export ("longEraSymbols")]
  594. string [] LongEraSymbols { get; set; }
  595. [Export ("veryShortMonthSymbols")]
  596. string [] VeryShortMonthSymbols { get; set; }
  597. [Export ("standaloneMonthSymbols")]
  598. string [] StandaloneMonthSymbols { get; set; }
  599. [Export ("shortStandaloneMonthSymbols")]
  600. string [] ShortStandaloneMonthSymbols { get; set; }
  601. [Export ("veryShortStandaloneMonthSymbols")]
  602. string [] VeryShortStandaloneMonthSymbols { get; set; }
  603. [Export ("veryShortWeekdaySymbols")]
  604. string [] VeryShortWeekdaySymbols { get; set; }
  605. [Export ("standaloneWeekdaySymbols")]
  606. string [] StandaloneWeekdaySymbols { get; set; }
  607. [Export ("shortStandaloneWeekdaySymbols")]
  608. string [] ShortStandaloneWeekdaySymbols { get; set; }
  609. [Export ("veryShortStandaloneWeekdaySymbols")]
  610. string [] VeryShortStandaloneWeekdaySymbols { get; set; }
  611. [Export ("quarterSymbols")]
  612. string [] QuarterSymbols { get; set; }
  613. [Export ("shortQuarterSymbols")]
  614. string [] ShortQuarterSymbols { get; set; }
  615. [Export ("standaloneQuarterSymbols")]
  616. string [] StandaloneQuarterSymbols { get; set; }
  617. [Export ("shortStandaloneQuarterSymbols")]
  618. string [] ShortStandaloneQuarterSymbols { get; set; }
  619. [Export ("gregorianStartDate")]
  620. NSDate GregorianStartDate { get; set; }
  621. }
  622. public delegate void NSFileHandleUpdateHandler (NSFileHandle handle);
  623. public interface NSFileHandleReadEventArgs {
  624. [Export ("NSFileHandleNotificationDataItem")]
  625. NSData AvailableData { get; }
  626. [Export ("NSFileHandleError", ArgumentSemantic.Assign)]
  627. int UnixErrorCode { get; }
  628. }
  629. public interface NSFileHandleConnectionAcceptedEventArgs {
  630. [Export ("NSFileHandleNotificationFileHandleItem")]
  631. NSFileHandle NearSocketConnection { get; }
  632. [Export ("NSFileHandleError", ArgumentSemantic.Assign)]
  633. int UnixErrorCode { get; }
  634. }
  635. [BaseType (typeof (NSObject))]
  636. [DisableDefaultCtor] // return invalid handle
  637. public interface NSFileHandle
  638. {
  639. [Export ("availableData")]
  640. NSData AvailableData ();
  641. [Export ("readDataToEndOfFile")]
  642. NSData ReadDataToEndOfFile ();
  643. [Export ("readDataOfLength:")]
  644. NSData ReadDataOfLength (uint length);
  645. [Export ("writeData:")]
  646. void WriteData (NSData data);
  647. [Export ("offsetInFile")]
  648. ulong OffsetInFile ();
  649. [Export ("seekToEndOfFile")]
  650. ulong SeekToEndOfFile ();
  651. [Export ("seekToFileOffset:")]
  652. void SeekToFileOffset (ulong offset);
  653. [Export ("truncateFileAtOffset:")]
  654. void TruncateFileAtOffset (ulong offset);
  655. [Export ("synchronizeFile")]
  656. void SynchronizeFile ();
  657. [Export ("closeFile")]
  658. void CloseFile ();
  659. [Static]
  660. [Export ("fileHandleWithStandardInput")]
  661. NSFileHandle FromStandardInput ();
  662. [Static]
  663. [Export ("fileHandleWithStandardOutput")]
  664. NSFileHandle FromStandardOutput ();
  665. [Static]
  666. [Export ("fileHandleWithStandardError")]
  667. NSFileHandle FromStandardError ();
  668. [Static]
  669. [Export ("fileHandleWithNullDevice")]
  670. NSFileHandle FromNullDevice ();
  671. [Static]
  672. [Export ("fileHandleForReadingAtPath:")]
  673. NSFileHandle OpenRead (string path);
  674. [Static]
  675. [Export ("fileHandleForWritingAtPath:")]
  676. NSFileHandle OpenWrite (string path);
  677. [Static]
  678. [Export ("fileHandleForUpdatingAtPath:")]
  679. NSFileHandle OpenUpdate (string path);
  680. [Static]
  681. [Export ("fileHandleForReadingFromURL:error:")]
  682. NSFileHandle OpenReadUrl (NSUrl url, out NSError error);
  683. [Static]
  684. [Export ("fileHandleForWritingToURL:error:")]
  685. NSFileHandle OpenWriteUrl (NSUrl url, out NSError error);
  686. [Static]
  687. [Export ("fileHandleForUpdatingURL:error:")]
  688. NSFileHandle OpenUpdateUrl (NSUrl url, out NSError error);
  689. [Export ("readInBackgroundAndNotifyForModes:")]
  690. void ReadInBackground (NSString [] notifyRunLoopModes);
  691. [Export ("readInBackgroundAndNotify")]
  692. void ReadInBackground ();
  693. [Export ("readToEndOfFileInBackgroundAndNotifyForModes:")]
  694. void ReadToEndOfFileInBackground (NSString [] notifyRunLoopModes);
  695. [Export ("readToEndOfFileInBackgroundAndNotify")]
  696. void ReadToEndOfFileInBackground ();
  697. [Export ("acceptConnectionInBackgroundAndNotifyForModes:")]
  698. void AcceptConnectionInBackground (NSString [] notifyRunLoopModes);
  699. [Export ("acceptConnectionInBackgroundAndNotify")]
  700. void AcceptConnectionInBackground ();
  701. [Export ("waitForDataInBackgroundAndNotifyForModes:")]
  702. void WaitForDataInBackground (NSString [] notifyRunLoopModes);
  703. [Export ("waitForDataInBackgroundAndNotify")]
  704. void WaitForDataInBackground ();
  705. [Export ("initWithFileDescriptor:closeOnDealloc:")]
  706. IntPtr Constructor (int fd, bool closeOnDealloc);
  707. [Export ("initWithFileDescriptor:")]
  708. IntPtr Constructor (int fd);
  709. [Export ("fileDescriptor")]
  710. int FileDescriptor { get; }
  711. [Export ("setReadabilityHandler:")]
  712. void SetReadabilityHandler ([NullAllowed] NSFileHandleUpdateHandler readCallback);
  713. [Export ("setWriteabilityHandler:")]
  714. void SetWriteabilityHandle ([NullAllowed] NSFileHandleUpdateHandler writeCallback);
  715. [Field ("NSFileHandleOperationException")]
  716. NSString OperationException { get; }
  717. [Field ("NSFileHandleReadCompletionNotification")]
  718. [Notification (typeof (NSFileHandleReadEventArgs))]
  719. NSString ReadCompletionNotification { get; }
  720. [Field ("NSFileHandleReadToEndOfFileCompletionNotification")]
  721. [Notification (typeof (NSFileHandleReadEventArgs))]
  722. NSString ReadToEndOfFileCompletionNotification { get; }
  723. [Field ("NSFileHandleConnectionAcceptedNotification")]
  724. [Notification (typeof (NSFileHandleConnectionAcceptedEventArgs))]
  725. NSString ConnectionAcceptedNotification { get; }
  726. [Field ("NSFileHandleDataAvailableNotification")]
  727. [Notification]
  728. NSString DataAvailableNotification { get; }
  729. }
  730. [BaseType (typeof (NSObject))]
  731. public interface NSPipe {
  732. [Export ("fileHandleForReading")]
  733. NSFileHandle ReadHandle { get; }
  734. [Export ("fileHandleForWriting")]
  735. NSFileHandle WriteHandle { get; }
  736. [Static]
  737. [Export ("pipe")]
  738. NSPipe Create ();
  739. }
  740. //@interface NSFormatter : NSObject <NSCopying, NSCoding>
  741. [BaseType (typeof (NSObject))]
  742. public interface NSFormatter {
  743. [Export ("stringForObjectValue:")]
  744. string StringFor (NSObject value);
  745. // - (NSAttributedString *)attributedStringForObjectValue:(id)obj withDefaultAttributes:(NSDictionary *)attrs;
  746. [Export ("editingStringForObjectValue:")]
  747. string EditingStringFor (NSObject value);
  748. }
  749. [BaseType (typeof (NSObject))]
  750. [Model]
  751. [Protocol]
  752. public interface NSKeyedArchiverDelegate {
  753. [Export ("archiver:didEncodeObject:"), EventArgs ("NSObject")]
  754. void EncodedObject (NSKeyedArchiver archiver, NSObject obj);
  755. [Export ("archiverDidFinish:")]
  756. void Finished (NSKeyedArchiver archiver);
  757. [Export ("archiver:willEncodeObject:"), DelegateName ("NSEncodeHook"), DefaultValue (null)]
  758. NSObject WillEncode (NSKeyedArchiver archiver, NSObject obj);
  759. [Export ("archiverWillFinish:")]
  760. void Finishing (NSKeyedArchiver archiver);
  761. [Export ("archiver:willReplaceObject:withObject:"), EventArgs ("NSArchiveReplace")]
  762. void ReplacingObject (NSKeyedArchiver archiver, NSObject oldObject, NSObject newObject);
  763. }
  764. [BaseType (typeof (NSObject))]
  765. [Model]
  766. [Protocol]
  767. public interface NSKeyedUnarchiverDelegate {
  768. [Export ("unarchiver:didDecodeObject:"), DelegateName ("NSDecoderCallback"), DefaultValue (null)]
  769. NSObject DecodedObject (NSKeyedUnarchiver unarchiver, NSObject obj);
  770. [Export ("unarchiverDidFinish:")]
  771. void Finished (NSKeyedUnarchiver unarchiver);
  772. [Export ("unarchiver:cannotDecodeObjectOfClassName:originalClasses:"), DelegateName ("NSDecoderHandler"), DefaultValue (null)]
  773. Class CannotDecodeClass (NSKeyedUnarchiver unarchiver, string klass, string [] classes);
  774. [Export ("unarchiverWillFinish:")]
  775. void Finishing (NSKeyedUnarchiver unarchiver);
  776. [Export ("unarchiver:willReplaceObject:withObject:"), EventArgs ("NSArchiveReplace")]
  777. void ReplacingObject (NSKeyedUnarchiver unarchiver, NSObject oldObject, NSObject newObject);
  778. }
  779. [BaseType (typeof (NSCoder),
  780. Delegates=new string [] {"WeakDelegate"},
  781. Events=new Type [] { typeof (NSKeyedArchiverDelegate) })]
  782. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[NSKeyedArchiver init]: cannot use -init for initialization
  783. [DisableDefaultCtor]
  784. public interface NSKeyedArchiver {
  785. [Export ("initForWritingWithMutableData:")]
  786. IntPtr Constructor (NSMutableData data);
  787. [Export ("archivedDataWithRootObject:")]
  788. [Static]
  789. NSData ArchivedDataWithRootObject (NSObject root);
  790. [Export ("archiveRootObject:toFile:")]
  791. [Static]
  792. bool ArchiveRootObjectToFile (NSObject root, string file);
  793. [Export ("finishEncoding")]
  794. void FinishEncoding ();
  795. [Export ("outputFormat")]
  796. NSPropertyListFormat PropertyListFormat { get; set; }
  797. [Wrap ("WeakDelegate")]
  798. NSKeyedArchiverDelegate Delegate { get; set; }
  799. [Export ("delegate", ArgumentSemantic.Assign)][NullAllowed]
  800. NSObject WeakDelegate { get; set; }
  801. [Export ("setClassName:forClass:")]
  802. void SetClassName (string name, Class kls);
  803. [Export ("classNameForClass:")]
  804. string GetClassName (Class kls);
  805. }
  806. [BaseType (typeof (NSCoder),
  807. Delegates=new string [] {"WeakDelegate"},
  808. Events=new Type [] { typeof (NSKeyedUnarchiverDelegate) })]
  809. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[NSKeyedUnarchiver init]: cannot use -init for initialization
  810. [DisableDefaultCtor]
  811. public interface NSKeyedUnarchiver {
  812. [Export ("initForReadingWithData:")]
  813. [MarshalNativeExceptions]
  814. IntPtr Constructor (NSData data);
  815. [Static, Export ("unarchiveObjectWithData:")]
  816. [MarshalNativeExceptions]
  817. NSObject UnarchiveObject (NSData data);
  818. [Static, Export ("unarchiveObjectWithFile:")]
  819. [MarshalNativeExceptions]
  820. NSObject UnarchiveFile (string file);
  821. [Export ("finishDecoding")]
  822. void FinishDecoding ();
  823. [Wrap ("WeakDelegate")]
  824. NSKeyedUnarchiverDelegate Delegate { get; set; }
  825. [Export ("delegate", ArgumentSemantic.Assign)][NullAllowed]
  826. NSObject WeakDelegate { get; set; }
  827. [Export ("setClass:forClassName:")]
  828. void SetClass (Class kls, string codedName);
  829. [Export ("classForClassName:")]
  830. Class GetClass (string codedName);
  831. }
  832. [BaseType (typeof (NSObject), Delegates=new string [] { "Delegate" }, Events=new Type [] { typeof (NSMetadataQueryDelegate)})]
  833. public interface NSMetadataQuery {
  834. [Export ("startQuery")]
  835. bool StartQuery ();
  836. [Export ("stopQuery")]
  837. void StopQuery ();
  838. [Export ("isStarted")]
  839. bool IsStarted { get; }
  840. [Export ("isGathering")]
  841. bool IsGathering { get; }
  842. [Export ("isStopped")]
  843. bool IsStopped { get; }
  844. [Export ("disableUpdates")]
  845. void DisableUpdates ();
  846. [Export ("enableUpdates")]
  847. void EnableUpdates ();
  848. [Export ("resultCount")]
  849. int ResultCount { get; }
  850. [Export ("resultAtIndex:")]
  851. NSObject ResultAtIndex (int idx);
  852. [Export ("results")]
  853. NSMetadataItem[] Results { get; }
  854. [Export ("indexOfResult:")]
  855. int IndexOfResult (NSObject result);
  856. [Export ("valueLists")]
  857. NSDictionary ValueLists { get; }
  858. [Export ("groupedResults")]
  859. NSObject [] GroupedResults { get; }
  860. [Export ("valueOfAttribute:forResultAtIndex:")]
  861. NSObject ValueOfAttribute (string attribyteName, int atIndex);
  862. [Export ("delegate", ArgumentSemantic.Assign), NullAllowed]
  863. NSMetadataQueryDelegate WeakDelegate { get; set; }
  864. [Wrap ("WeakDelegate")]
  865. NSMetadataQueryDelegate Delegate { get; set; }
  866. [Export ("predicate")]
  867. NSPredicate Predicate { get; set; }
  868. [Export ("sortDescriptors")]
  869. NSSortDescriptor[] SortDescriptors { get; set; }
  870. [Export ("valueListAttributes")]
  871. NSObject[] ValueListAttributes { get; set; }
  872. [Export ("groupingAttributes")]
  873. NSArray GroupingAttributes { get; set; }
  874. [Export ("notificationBatchingInterval")]
  875. double NotificationBatchingInterval { get; set; }
  876. [Export ("searchScopes")]
  877. NSObject [] SearchScopes { get; set; }
  878. // There is no info associated with these notifications
  879. [Field ("NSMetadataQueryDidStartGatheringNotification")]
  880. [Notification]
  881. NSString DidStartGatheringNotification { get; }
  882. [Field ("NSMetadataQueryGatheringProgressNotification")]
  883. [Notification]
  884. NSString GatheringProgressNotification { get; }
  885. [Field ("NSMetadataQueryDidFinishGatheringNotification")]
  886. [Notification]
  887. NSString DidFinishGatheringNotification { get; }
  888. [Field ("NSMetadataQueryDidUpdateNotification")]
  889. [Notification]
  890. NSString DidUpdateNotification { get; }
  891. [Field ("NSMetadataQueryResultContentRelevanceAttribute")]
  892. NSString ResultContentRelevanceAttribute { get; }
  893. // Scope constants for defined search locations
  894. #if MONOMAC
  895. [Field ("NSMetadataQueryUserHomeScope")]
  896. NSString UserHomeScope { get; }
  897. [Field ("NSMetadataQueryLocalComputerScope")]
  898. NSString LocalComputerScope { get; }
  899. [Field ("NSMetadataQueryNetworkScope")]
  900. NSString QueryNetworkScope { get; }
  901. [Field ("NSMetadataQueryLocalDocumentsScope")]
  902. NSString QueryLocalDocumentsScope { get; }
  903. #endif
  904. [Field ("NSMetadataQueryUbiquitousDocumentsScope")]
  905. NSString QueryUbiquitousDocumentsScope { get; }
  906. [Field ("NSMetadataQueryUbiquitousDataScope")]
  907. NSString QueryUbiquitousDataScope { get; }
  908. [Field ("NSMetadataItemFSNameKey")]
  909. NSString ItemFSNameKey { get; }
  910. [Field ("NSMetadataItemDisplayNameKey")]
  911. NSString ItemDisplayNameKey { get; }
  912. [Field ("NSMetadataItemURLKey")]
  913. NSString ItemURLKey { get; }
  914. [Field ("NSMetadataItemPathKey")]
  915. NSString ItemPathKey { get; }
  916. [Field ("NSMetadataItemFSSizeKey")]
  917. NSString ItemFSSizeKey { get; }
  918. [Field ("NSMetadataItemFSCreationDateKey")]
  919. NSString ItemFSCreationDateKey { get; }
  920. [Field ("NSMetadataItemFSContentChangeDateKey")]
  921. NSString ItemFSContentChangeDateKey { get; }
  922. [Field ("NSMetadataItemIsUbiquitousKey")]
  923. NSString ItemIsUbiquitousKey { get; }
  924. [Field ("NSMetadataUbiquitousItemHasUnresolvedConflictsKey")]
  925. NSString UbiquitousItemHasUnresolvedConflictsKey { get; }
  926. [Field ("NSMetadataUbiquitousItemIsDownloadedKey")]
  927. NSString UbiquitousItemIsDownloadedKey { get; }
  928. [Field ("NSMetadataUbiquitousItemIsDownloadingKey")]
  929. NSString UbiquitousItemIsDownloadingKey { get; }
  930. [Field ("NSMetadataUbiquitousItemIsUploadedKey")]
  931. NSString UbiquitousItemIsUploadedKey { get; }
  932. [Field ("NSMetadataUbiquitousItemIsUploadingKey")]
  933. NSString UbiquitousItemIsUploadingKey { get; }
  934. [Field ("NSMetadataUbiquitousItemPercentDownloadedKey")]
  935. NSString UbiquitousItemPercentDownloadedKey { get; }
  936. [Field ("NSMetadataUbiquitousItemPercentUploadedKey")]
  937. NSString UbiquitousItemPercentUploadedKey { get; }
  938. }
  939. [BaseType (typeof (NSObject))]
  940. [Model]
  941. [Protocol]
  942. public interface NSMetadataQueryDelegate {
  943. [Export ("metadataQuery:replacementObjectForResultObject:"), DelegateName ("NSMetadataQueryObject"), DefaultValue(null)]
  944. NSObject ReplacementObjectForResultObject (NSMetadataQuery query, NSMetadataItem result);
  945. [Export ("metadataQuery:replacementValueForAttribute:value:"), DelegateName ("NSMetadataQueryValue"), DefaultValue(null)]
  946. NSObject ReplacementValueForAttributevalue (NSMetadataQuery query, string attributeName, NSObject value);
  947. }
  948. [BaseType (typeof (NSObject))]
  949. public interface NSMetadataItem {
  950. [Export ("valueForAttribute:")]
  951. NSObject ValueForAttribute (string key);
  952. [Export ("valuesForAttributes:")]
  953. NSDictionary ValuesForAttributes (NSArray keys);
  954. [Export ("attributes")]
  955. NSObject [] Attributes { get; }
  956. }
  957. [BaseType (typeof (NSObject))]
  958. public interface NSMetadataQueryAttributeValueTuple {
  959. [Export ("attribute")]
  960. string Attribute { get; }
  961. [Export ("value")]
  962. NSObject Value { get; }
  963. [Export ("count")]
  964. int Count { get; }
  965. }
  966. [BaseType (typeof (NSObject))]
  967. public interface NSMetadataQueryResultGroup {
  968. [Export ("attribute")]
  969. string Attribute { get; }
  970. [Export ("value")]
  971. NSObject Value { get; }
  972. [Export ("subgroups")]
  973. NSObject [] Subgroups { get; }
  974. [Export ("resultCount")]
  975. int ResultCount { get; }
  976. [Export ("resultAtIndex:")]
  977. NSObject ResultAtIndex (uint idx);
  978. [Export ("results")]
  979. NSObject [] Results { get; }
  980. }
  981. // This API is only supported because a bunch of third-party
  982. // APIs are so poorly designed that they expose NSMutableArray
  983. // as a public property.
  984. [Obsolete ("You really should avoid using NSMutableArray in MonoTouch/MonoMac, this is usually used by poorly designed public APIs")]
  985. [BaseType (typeof (NSArray))]
  986. public interface NSMutableArray {
  987. [Export ("initWithCapacity:")]
  988. IntPtr Constructor (int capacity);
  989. [Export ("addObject:")]
  990. void Add (NSObject obj);
  991. [Export ("insertObject:atIndex:")]
  992. void Insert (NSObject obj, int index);
  993. [Export ("removeLastObject")]
  994. void RemoveLastObject ();
  995. [Export ("removeObjectAtIndex:")]
  996. void RemoveObject (int index);
  997. [Export ("replaceObjectAtIndex:withObject:")]
  998. void ReplaceObject (int index, NSObject withObject);
  999. [Export ("removeAllObjects")]
  1000. void RemoveAllObjects ();
  1001. [Export ("addObjectsFromArray:")]
  1002. void AddObjects (NSObject [] source);
  1003. [Export ("insertObjects:atIndexes:")]
  1004. void InsertObjects (NSObject [] objects, NSIndexSet atIndexes);
  1005. [Export ("removeObjectsAtIndexes:")]
  1006. void RemoveObjectsAtIndexes (NSIndexSet indexSet);
  1007. }
  1008. [Since (3,2)]
  1009. [BaseType (typeof (NSAttributedString))]
  1010. public interface NSMutableAttributedString {
  1011. [Export ("initWithString:")]
  1012. IntPtr Constructor (string str);
  1013. [Export ("initWithString:attributes:")]
  1014. IntPtr Constructor (string str, NSDictionary attributes);
  1015. [Export ("initWithAttributedString:")]
  1016. IntPtr Constructor (NSAttributedString other);
  1017. [Export ("replaceCharactersInRange:withString:")]
  1018. void Replace (NSRange range, string newValue);
  1019. [Export ("setAttributes:range:")]
  1020. void SetAttributes (NSDictionary attrs, NSRange range);
  1021. [Export ("addAttribute:value:range:")]
  1022. void AddAttribute (NSString attributeName, NSObject value, NSRange range);
  1023. [Export ("addAttributes:range:")]
  1024. void AddAttributes (NSDictionary attrs, NSRange range);
  1025. [Export ("removeAttribute:range:")]
  1026. void RemoveAttribute (string name, NSRange range);
  1027. [Export ("replaceCharactersInRange:withAttributedString:")]
  1028. void Replace (NSRange range, NSAttributedString value);
  1029. [Export ("insertAttributedString:atIndex:")]
  1030. void Insert (NSAttributedString attrString, int location);
  1031. [Export ("appendAttributedString:")]
  1032. void Append (NSAttributedString attrString);
  1033. [Export ("deleteCharactersInRange:")]
  1034. void DeleteRange (NSRange range);
  1035. [Export ("setAttributedString:")]
  1036. void SetString (NSAttributedString attrString);
  1037. [Export ("beginEditing")]
  1038. void BeginEditing ();
  1039. [Export ("endEditing")]
  1040. void EndEditing ();
  1041. }
  1042. [BaseType (typeof (NSData))]
  1043. public interface NSMutableData {
  1044. [Static, Export ("dataWithCapacity:")] [Autorelease]
  1045. NSMutableData FromCapacity (int capacity);
  1046. [Static, Export ("dataWithLength:")] [Autorelease]
  1047. NSMutableData FromLength (int length);
  1048. [Static, Export ("data")] [Autorelease]
  1049. NSMutableData Create ();
  1050. [Export ("setLength:")]
  1051. void SetLength (uint len);
  1052. [Export ("mutableBytes")]
  1053. IntPtr MutableBytes { get; }
  1054. [Export ("initWithCapacity:")]
  1055. IntPtr Constructor (uint len);
  1056. [Export ("appendData:")]
  1057. void AppendData (NSData other);
  1058. [Export ("appendBytes:length:")]
  1059. void AppendBytes (IntPtr bytes, uint len);
  1060. [Export ("setData:")]
  1061. void SetData (NSData data);
  1062. [Export ("length")]
  1063. [Override]
  1064. uint Length { get; set; }
  1065. }
  1066. [BaseType (typeof (NSObject))]
  1067. public interface NSDate {
  1068. [Export ("timeIntervalSinceReferenceDate")]
  1069. double SecondsSinceReferenceDate { get; }
  1070. [Export ("dateWithTimeIntervalSinceReferenceDate:")]
  1071. [Static]
  1072. NSDate FromTimeIntervalSinceReferenceDate (double secs);
  1073. [Static, Export ("dateWithTimeIntervalSince1970:")]
  1074. NSDate FromTimeIntervalSince1970 (double secs);
  1075. [Export ("date")]
  1076. [Static]
  1077. NSDate Now { get; }
  1078. [Export ("distantPast")]
  1079. [Static]
  1080. NSDate DistantPast { get; }
  1081. [Export ("distantFuture")]
  1082. [Static]
  1083. NSDate DistantFuture { get; }
  1084. [Export ("dateByAddingTimeInterval:")]
  1085. NSDate AddSeconds (double seconds);
  1086. [Export ("dateWithTimeIntervalSinceNow:")]
  1087. [Static]
  1088. NSDate FromTimeIntervalSinceNow (double secs);
  1089. }
  1090. [BaseType (typeof (NSObject))]
  1091. public interface NSDictionary {
  1092. [Export ("dictionaryWithContentsOfFile:")]
  1093. [Static]
  1094. NSDictionary FromFile (string path);
  1095. [Export ("dictionaryWithContentsOfURL:")]
  1096. [Static]
  1097. NSDictionary FromUrl (NSUrl url);
  1098. [Export ("dictionaryWithObject:forKey:")]
  1099. [Static]
  1100. NSDictionary FromObjectAndKey (NSObject obj, NSObject key);
  1101. [Export ("dictionaryWithDictionary:")]
  1102. [Static]
  1103. NSDictionary FromDictionary (NSDictionary source);
  1104. [Export ("dictionaryWithObjects:forKeys:count:")]
  1105. [Static, Internal]
  1106. NSDictionary FromObjectsAndKeysInternal ([NullAllowed] NSArray objects, [NullAllowed] NSArray keys, int count);
  1107. [Export ("dictionaryWithObjects:forKeys:")]
  1108. [Static, Internal]
  1109. NSDictionary FromObjectsAndKeysInternal ([NullAllowed] NSArray objects, [NullAllowed] NSArray keys);
  1110. [Export ("initWithDictionary:")]
  1111. IntPtr Constructor (NSDictionary other);
  1112. [Export ("initWithContentsOfFile:")]
  1113. IntPtr Constructor (string fileName);
  1114. [Export ("initWithObjects:forKeys:"), Internal]
  1115. IntPtr Constructor (NSArray objects, NSArray keys);
  1116. [Export ("initWithContentsOfURL:")]
  1117. IntPtr Constructor (NSUrl url);
  1118. [Export ("count")]
  1119. uint Count { get; }
  1120. [Export ("objectForKey:")]
  1121. NSObject ObjectForKey (NSObject key);
  1122. [Export ("allKeys")][Autorelease]
  1123. NSObject [] Keys { get; }
  1124. [Export ("allKeysForObject:")][Autorelease]
  1125. NSObject [] KeysForObject (NSObject obj);
  1126. [Export ("allValues")][Autorelease]
  1127. NSObject [] Values { get; }
  1128. [Export ("descriptionInStringsFileFormat")]
  1129. string DescriptionInStringsFileFormat { get; }
  1130. [Export ("isEqualToDictionary:")]
  1131. bool IsEqualToDictionary (NSDictionary other);
  1132. [Export ("objectEnumerator")]
  1133. NSEnumerator ObjectEnumerator { get; }
  1134. [Export ("objectsForKeys:notFoundMarker:")][Autorelease]
  1135. NSObject [] ObjectsForKeys (NSArray keys, NSObject marker);
  1136. [Export ("writeToFile:atomically:")]
  1137. bool WriteToFile (string path, bool useAuxiliaryFile);
  1138. [Export ("writeToURL:atomically:")]
  1139. bool WriteToUrl (NSUrl url, bool atomically);
  1140. [Since (6,0)]
  1141. [Static]
  1142. [Export ("sharedKeySetForKeys:")]
  1143. NSObject GetSharedKeySetForKeys (NSObject [] keys);
  1144. }
  1145. [BaseType (typeof (NSObject))]
  1146. public interface NSEnumerator {
  1147. [Export ("nextObject")]
  1148. NSObject NextObject ();
  1149. }
  1150. [BaseType (typeof (NSObject))]
  1151. [DisableDefaultCtor]
  1152. public interface NSError {
  1153. [Static, Export ("errorWithDomain:code:userInfo:")]
  1154. NSError FromDomain (NSString domain, int code, [NullAllowed] NSDictionary userInfo);
  1155. [Export ("initWithDomain:code:userInfo:")]
  1156. IntPtr Constructor (NSString domain, int code, [NullAllowed] NSDictionary userInfo);
  1157. [Export ("domain")]
  1158. string Domain { get; }
  1159. [Export ("code")]
  1160. int Code { get; }
  1161. [Export ("userInfo")]
  1162. NSDictionary UserInfo { get; }
  1163. [Export ("localizedDescription")]
  1164. string LocalizedDescription { get; }
  1165. [Field ("NSCocoaErrorDomain")]
  1166. NSString CocoaErrorDomain { get;}
  1167. [Field ("NSPOSIXErrorDomain")]
  1168. NSString PosixErrorDomain { get; }
  1169. [Field ("NSOSStatusErrorDomain")]
  1170. NSString OsStatusErrorDomain { get; }
  1171. [Field ("NSMachErrorDomain")]
  1172. NSString MachErrorDomain { get; }
  1173. [Field ("NSUnderlyingErrorKey")]
  1174. NSString UnderlyingErrorKey { get; }
  1175. [Field ("NSLocalizedDescriptionKey")]
  1176. NSString LocalizedDescriptionKey { get; }
  1177. [Field ("NSLocalizedFailureReasonErrorKey")]
  1178. NSString LocalizedFailureReasonErrorKey { get; }
  1179. [Field ("NSLocalizedRecoverySuggestionErrorKey")]
  1180. NSString LocalizedRecoverySuggestionErrorKey { get; }
  1181. [Field ("NSLocalizedRecoveryOptionsErrorKey")]
  1182. NSString LocalizedRecoveryOptionsErrorKey { get; }
  1183. [Field ("NSRecoveryAttempterErrorKey")]
  1184. NSString RecoveryAttempterErrorKey { get; }
  1185. [Field ("NSHelpAnchorErrorKey")]
  1186. NSString HelpAnchorErrorKey { get; }
  1187. [Field ("NSStringEncodingErrorKey")]
  1188. NSString StringEncodingErrorKey { get; }
  1189. [Field ("NSURLErrorKey")]
  1190. NSString UrlErrorKey { get; }
  1191. [Field ("NSFilePathErrorKey")]
  1192. NSString FilePathErrorKey { get; }
  1193. }
  1194. [BaseType (typeof (NSObject))]
  1195. // 'init' returns NIL
  1196. [DisableDefaultCtor]
  1197. public interface NSException {
  1198. [Export ("initWithName:reason:userInfo:")]
  1199. IntPtr Constructor (string name, string reason, [NullAllowed] NSDictionary userInfo);
  1200. [Export ("name")]
  1201. string Name { get; }
  1202. [Export ("reason")]
  1203. string Reason { get; }
  1204. [Export ("userInfo")]
  1205. NSObject UserInfo { get; }
  1206. [Export ("callStackReturnAddresses")]
  1207. NSNumber[] CallStackReturnAddresses { get; }
  1208. }
  1209. public delegate void NSExpressionHandler (NSObject evaluatedObject, NSExpression [] expressions, NSMutableDictionary context);
  1210. [BaseType (typeof (NSObject))]
  1211. // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -predicateFormat cannot be sent to an abstract object of class NSExpression: Create a concrete instance!
  1212. [DisableDefaultCtor]
  1213. public interface NSExpression {
  1214. [Static, Export ("expressionForConstantValue:")]
  1215. NSExpression FromConstant (NSObject obj);
  1216. [Static, Export ("expressionForEvaluatedObject")]
  1217. NSExpression ExpressionForEvaluatedObject { get; }
  1218. [Static, Export ("expressionForVariable:")]
  1219. NSExpression FromVariable (string string1);
  1220. [Static, Export ("expressionForKeyPath:")]
  1221. NSExpression FromKeyPath (string keyPath);
  1222. [Static, Export ("expressionForFunction:arguments:")]
  1223. NSExpression FromFunction (string name, NSExpression[] parameters);
  1224. [Static, Export ("expressionWithFormat:argumentArray:")]
  1225. NSExpression FromFormat (string format, NSExpression [] parameters);
  1226. //+ (NSExpression *)expressionForAggregate:(NSArray *)subexpressions;
  1227. [Static, Export ("expressionForAggregate:")]
  1228. NSExpression FromAggregate

Large files files are truncated, but you can click here to view the full file